1 /* You can distribute this header with your plugins for easy compilation */
7 #define XCHAT_IFACE_MAJOR 1
8 #define XCHAT_IFACE_MINOR 9
9 #define XCHAT_IFACE_MICRO 11
10 #define XCHAT_IFACE_VERSION ((XCHAT_IFACE_MAJOR * 10000) + \
11 (XCHAT_IFACE_MINOR * 100) + \
14 #define XCHAT_PRI_HIGHEST 127
15 #define XCHAT_PRI_HIGH 64
16 #define XCHAT_PRI_NORM 0
17 #define XCHAT_PRI_LOW (-64)
18 #define XCHAT_PRI_LOWEST (-128)
20 #define XCHAT_FD_READ 1
21 #define XCHAT_FD_WRITE 2
22 #define XCHAT_FD_EXCEPTION 4
23 #define XCHAT_FD_NOTSOCKET 8
25 #define XCHAT_EAT_NONE 0 /* pass it on through! */
26 #define XCHAT_EAT_XCHAT 1 /* don't let xchat see this event */
27 #define XCHAT_EAT_PLUGIN 2 /* don't let other plugins see this event */
28 #define XCHAT_EAT_ALL (XCHAT_EAT_XCHAT|XCHAT_EAT_PLUGIN) /* don't let anything see this event */
34 typedef struct _xchat_plugin xchat_plugin
;
35 typedef struct _xchat_list xchat_list
;
36 typedef struct _xchat_hook xchat_hook
;
38 typedef struct _xchat_context xchat_context
;
44 /* these are only used on win32 */
45 xchat_hook
*(*xchat_hook_command
) (xchat_plugin
*ph
,
48 int (*callback
) (char *word
[], char *word_eol
[], void *user_data
),
49 const char *help_text
,
51 xchat_hook
*(*xchat_hook_server
) (xchat_plugin
*ph
,
54 int (*callback
) (char *word
[], char *word_eol
[], void *user_data
),
56 xchat_hook
*(*xchat_hook_print
) (xchat_plugin
*ph
,
59 int (*callback
) (char *word
[], void *user_data
),
61 xchat_hook
*(*xchat_hook_timer
) (xchat_plugin
*ph
,
63 int (*callback
) (void *user_data
),
65 xchat_hook
*(*xchat_hook_fd
) (xchat_plugin
*ph
,
68 int (*callback
) (int fd
, int flags
, void *user_data
),
70 void *(*xchat_unhook
) (xchat_plugin
*ph
,
72 void (*xchat_print
) (xchat_plugin
*ph
,
74 void (*xchat_printf
) (xchat_plugin
*ph
,
75 const char *format
, ...);
76 void (*xchat_command
) (xchat_plugin
*ph
,
78 void (*xchat_commandf
) (xchat_plugin
*ph
,
79 const char *format
, ...);
80 int (*xchat_nickcmp
) (xchat_plugin
*ph
,
83 int (*xchat_set_context
) (xchat_plugin
*ph
,
85 xchat_context
*(*xchat_find_context
) (xchat_plugin
*ph
,
88 xchat_context
*(*xchat_get_context
) (xchat_plugin
*ph
);
89 const char *(*xchat_get_info
) (xchat_plugin
*ph
,
91 int (*xchat_get_prefs
) (xchat_plugin
*ph
,
95 xchat_list
* (*xchat_list_get
) (xchat_plugin
*ph
,
97 void (*xchat_list_free
) (xchat_plugin
*ph
,
99 const char * const * (*xchat_list_fields
) (xchat_plugin
*ph
,
101 int (*xchat_list_next
) (xchat_plugin
*ph
,
103 const char * (*xchat_list_str
) (xchat_plugin
*ph
,
106 int (*xchat_list_int
) (xchat_plugin
*ph
,
109 void * (*xchat_plugingui_add
) (xchat_plugin
*ph
,
110 const char *filename
,
115 void (*xchat_plugingui_remove
) (xchat_plugin
*ph
,
117 int (*xchat_emit_print
) (xchat_plugin
*ph
,
118 const char *event_name
, ...);
119 int (*xchat_read_fd
) (xchat_plugin
*ph
,
123 time_t (*xchat_list_time
) (xchat_plugin
*ph
,
126 char *(*xchat_gettext
) (xchat_plugin
*ph
,
128 void (*xchat_send_modes
) (xchat_plugin
*ph
,
129 const char **targets
,
134 char *(*xchat_strip
) (xchat_plugin
*ph
,
138 void (*xchat_free
) (xchat_plugin
*ph
,
145 xchat_hook_command (xchat_plugin
*ph
,
148 int (*callback
) (char *word
[], char *word_eol
[], void *user_data
),
149 const char *help_text
,
153 xchat_hook_server (xchat_plugin
*ph
,
156 int (*callback
) (char *word
[], char *word_eol
[], void *user_data
),
160 xchat_hook_print (xchat_plugin
*ph
,
163 int (*callback
) (char *word
[], void *user_data
),
167 xchat_hook_timer (xchat_plugin
*ph
,
169 int (*callback
) (void *user_data
),
173 xchat_hook_fd (xchat_plugin
*ph
,
176 int (*callback
) (int fd
, int flags
, void *user_data
),
180 xchat_unhook (xchat_plugin
*ph
,
184 xchat_print (xchat_plugin
*ph
,
188 xchat_printf (xchat_plugin
*ph
,
189 const char *format
, ...);
192 xchat_command (xchat_plugin
*ph
,
193 const char *command
);
196 xchat_commandf (xchat_plugin
*ph
,
197 const char *format
, ...);
200 xchat_nickcmp (xchat_plugin
*ph
,
205 xchat_set_context (xchat_plugin
*ph
,
209 xchat_find_context (xchat_plugin
*ph
,
210 const char *servname
,
211 const char *channel
);
214 xchat_get_context (xchat_plugin
*ph
);
217 xchat_get_info (xchat_plugin
*ph
,
221 xchat_get_prefs (xchat_plugin
*ph
,
227 xchat_list_get (xchat_plugin
*ph
,
231 xchat_list_free (xchat_plugin
*ph
,
235 xchat_list_fields (xchat_plugin
*ph
,
239 xchat_list_next (xchat_plugin
*ph
,
243 xchat_list_str (xchat_plugin
*ph
,
248 xchat_list_int (xchat_plugin
*ph
,
253 xchat_list_time (xchat_plugin
*ph
,
258 xchat_plugingui_add (xchat_plugin
*ph
,
259 const char *filename
,
266 xchat_plugingui_remove (xchat_plugin
*ph
,
270 xchat_emit_print (xchat_plugin
*ph
,
271 const char *event_name
, ...);
274 xchat_gettext (xchat_plugin
*ph
,
278 xchat_send_modes (xchat_plugin
*ph
,
279 const char **targets
,
286 xchat_strip (xchat_plugin
*ph
,
292 xchat_free (xchat_plugin
*ph
,