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
00043
00044
00045 COMMAND_ENABLEREQPARAMS = 0x10,
00046 COMMAND_PARAMASTARGET = 0x20,
00047
00048 SESSION_MUSTBECONNECTED = 0x40,
00049 SESSION_MUSTBELONG = 0x80,
00050 SESSION_MUSTHAS = 0x100,
00051
00052
00053 SESSION_MUSTHASPRIVATE = 0x200,
00054 COMMAND_TARGET_VALID_UID = 0x400
00055
00056
00057
00058 } command_flags_t;
00059
00060 typedef COMMAND(command_func_t);
00061
00062 typedef struct command {
00063 struct command *next;
00064
00065
00066 const char *name;
00067 plugin_t *plugin;
00068
00069
00070 char **params;
00071 command_func_t *function;
00072 command_flags_t flags;
00073 char **possibilities;
00074 } command_t;
00075
00076 #ifndef EKG2_WIN32_NOFUNCTION
00077 extern command_t *commands;
00078
00079 command_t *command_add(plugin_t *plugin, const char *name, char *params, command_func_t function, command_flags_t flags, char *possibilities);
00080 int command_remove(plugin_t *plugin, const char *name);
00081 command_t *command_find (const char *name);
00082 void command_init();
00083 void commands_remove(command_t *c);
00084 command_t *commands_removei(command_t *c);
00085 void commands_destroy();
00086 int command_exec(const char *target, session_t *session, const char *line, int quiet);
00087 int command_exec_params(const char *target, session_t *session, int quiet, const char *command, ...);
00088 int command_exec_format(const char *target, session_t *session, int quiet, const char *format, ...);
00089
00090 COMMAND(cmd_add);
00091 COMMAND(cmd_alias_exec);
00092 COMMAND(cmd_exec);
00093 COMMAND(cmd_list);
00094 COMMAND(cmd_dcc);
00095 COMMAND(cmd_bind);
00096 COMMAND(session_command);
00097 COMMAND(cmd_on);
00098 COMMAND(cmd_metacontact);
00099 COMMAND(cmd_streams);
00100 COMMAND(cmd_script);
00101 #endif
00102
00103
00104
00105 #define SEND_NICKS_MAX 100
00106
00107 extern char *send_nicks[SEND_NICKS_MAX];
00108 extern int send_nicks_count, send_nicks_index;
00109
00110 #ifndef EKG2_WIN32_NOFUNCTION
00111 void tabnick_add(const char *nick);
00112 void tabnick_remove(const char *nick);
00113
00114
00115 int match_arg(const char *arg, char shortopt, const char *longopt, int longoptlen);
00116
00117
00118 extern char *last_search_first_name;
00119 extern char *last_search_last_name;
00120 extern char *last_search_nickname;
00121 extern char *last_search_uid;
00122 #endif
00123
00124 #ifdef __cplusplus
00125 }
00126 #endif
00127
00128 #endif
00129
00130
00131
00132
00133
00134
00135
00136
00137