Idź do dokumentacji tego pliku.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __EKG_COMMANDS_H
00022 #define __EKG_COMMANDS_H
00023
00024 #include "dynstuff.h"
00025 #include "plugins.h"
00026 #include "themes.h"
00027 #include "sessions.h"
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033 #define printq(x...) do { if (!quiet) { print(x); } } while(0)
00034
00035 #define COMMAND(x) int x(const char *name, const char **params, session_t *session, const char *target, int quiet)
00036
00037 typedef enum {
00038
00039 COMMAND_ISALIAS = 0x01,
00040 COMMAND_ISSCRIPT = 0x02,
00041 COMMAND_WITH_RESOURCE = 0x04,
00042 COMMAND_PASS_UNCHANGED = 0x08,
00043
00044
00045
00046 COMMAND_ENABLEREQPARAMS = 0x10,
00047 COMMAND_PARAMASTARGET = 0x20,
00048
00049 SESSION_MUSTBECONNECTED = 0x40,
00050 SESSION_MUSTBELONG = 0x80,
00051 SESSION_MUSTHAS = 0x100,
00052
00053
00054 SESSION_MUSTHASPRIVATE = 0x200,
00055 COMMAND_TARGET_VALID_UID = 0x400
00056
00057
00058
00059 } command_flags_t;
00060
00061 typedef COMMAND(command_func_t);
00062
00063 typedef struct command {
00064 struct command *next;
00065
00066
00067 const char *name;
00068 plugin_t *plugin;
00069
00070
00071 char **params;
00072 command_func_t *function;
00073 command_flags_t flags;
00074 char **possibilities;
00075 } command_t;
00076
00077 #ifndef EKG2_WIN32_NOFUNCTION
00078 extern command_t *commands;
00079
00080 command_t *command_add(plugin_t *plugin, const char *name, char *params, command_func_t function, command_flags_t flags, char *possibilities);
00081 int command_remove(plugin_t *plugin, const char *name);
00082 command_t *command_find (const char *name);
00083 void command_init();
00084 void commands_remove(command_t *c);
00085 command_t *commands_removei(command_t *c);
00086 void commands_destroy();
00087 int command_exec(const char *target, session_t *session, const char *line, int quiet);
00088 int command_exec_params(const char *target, session_t *session, int quiet, const char *command, ...);
00089 int command_exec_format(const char *target, session_t *session, int quiet, const char *format, ...);
00090
00091 COMMAND(cmd_add);
00092 COMMAND(cmd_alias_exec);
00093 COMMAND(cmd_exec);
00094 COMMAND(cmd_list);
00095 COMMAND(cmd_dcc);
00096 COMMAND(cmd_bind);
00097 COMMAND(session_command);
00098 COMMAND(cmd_on);
00099 COMMAND(cmd_metacontact);
00100 COMMAND(cmd_streams);
00101 COMMAND(cmd_script);
00102 #endif
00103
00104
00105
00106 #define SEND_NICKS_MAX 100
00107
00108 extern char *send_nicks[SEND_NICKS_MAX];
00109 extern int send_nicks_count, send_nicks_index;
00110
00111 #ifndef EKG2_WIN32_NOFUNCTION
00112 void tabnick_add(const char *nick);
00113 void tabnick_remove(const char *nick);
00114
00115
00116 int match_arg(const char *arg, char shortopt, const char *longopt, int longoptlen);
00117
00118
00119 extern char *last_search_first_name;
00120 extern char *last_search_last_name;
00121 extern char *last_search_nickname;
00122 extern char *last_search_uid;
00123 #endif
00124
00125 #ifdef __cplusplus
00126 }
00127 #endif
00128
00129 #endif
00130
00131
00132
00133
00134
00135
00136
00137
00138