1 #ifndef XCHAT_COMMONPLUGIN_H
2 #define XCHAT_COMMONPLUGIN_H
7 /* Keep these insync with xchat-plugin.h */
8 /* !!don't change the order, to keep binary compat!! */
9 xchat_hook
*(*xchat_hook_command
) (xchat_plugin
*ph
,
12 int (*callback
) (char *word
[], char *word_eol
[], void *user_data
),
13 const char *help_text
,
15 xchat_hook
*(*xchat_hook_server
) (xchat_plugin
*ph
,
18 int (*callback
) (char *word
[], char *word_eol
[], void *user_data
),
20 xchat_hook
*(*xchat_hook_print
) (xchat_plugin
*ph
,
23 int (*callback
) (char *word
[], void *user_data
),
25 xchat_hook
*(*xchat_hook_timer
) (xchat_plugin
*ph
,
27 int (*callback
) (void *user_data
),
29 xchat_hook
*(*xchat_hook_fd
) (xchat_plugin
*ph
,
32 int (*callback
) (int fd
, int flags
, void *user_data
),
34 void *(*xchat_unhook
) (xchat_plugin
*ph
,
36 void (*xchat_print
) (xchat_plugin
*ph
,
38 void (*xchat_printf
) (xchat_plugin
*ph
,
39 const char *format
, ...);
40 void (*xchat_command
) (xchat_plugin
*ph
,
42 void (*xchat_commandf
) (xchat_plugin
*ph
,
43 const char *format
, ...);
44 int (*xchat_nickcmp
) (xchat_plugin
*ph
,
47 int (*xchat_set_context
) (xchat_plugin
*ph
,
49 xchat_context
*(*xchat_find_context
) (xchat_plugin
*ph
,
52 xchat_context
*(*xchat_get_context
) (xchat_plugin
*ph
);
53 const char *(*xchat_get_info
) (xchat_plugin
*ph
,
55 int (*xchat_get_prefs
) (xchat_plugin
*ph
,
59 xchat_list
* (*xchat_list_get
) (xchat_plugin
*ph
,
61 void (*xchat_list_free
) (xchat_plugin
*ph
,
63 const char * const * (*xchat_list_fields
) (xchat_plugin
*ph
,
65 int (*xchat_list_next
) (xchat_plugin
*ph
,
67 const char * (*xchat_list_str
) (xchat_plugin
*ph
,
70 int (*xchat_list_int
) (xchat_plugin
*ph
,
73 void * (*xchat_plugingui_add
) (xchat_plugin
*ph
,
79 void (*xchat_plugingui_remove
) (xchat_plugin
*ph
,
81 int (*xchat_emit_print
) (xchat_plugin
*ph
,
82 const char *event_name
, ...);
83 void *(*xchat_read_fd
) (xchat_plugin
*ph
);
84 time_t (*xchat_list_time
) (xchat_plugin
*ph
,
87 const char *(*xchat_gettext
) (xchat_plugin
*ph
,
89 void (*xchat_send_modes
) (xchat_plugin
*ph
,
95 char *(*xchat_strip
) (xchat_plugin
*ph
,
99 void (*xchat_free
) (xchat_plugin
*ph
,
101 void *(*xchat_dummy4
) (xchat_plugin
*ph
);
102 void *(*xchat_dummy3
) (xchat_plugin
*ph
);
103 void *(*xchat_dummy2
) (xchat_plugin
*ph
);
104 void *(*xchat_dummy1
) (xchat_plugin
*ph
);
105 /* PRIVATE FIELDS! */
106 void *handle
; /* from dlopen */
107 char *filename
; /* loaded from */
112 void *deinit_callback
; /* pointer to xchat_plugin_deinit */
113 unsigned int fake
:1; /* fake plugin. Added by xchat_plugingui_add() */
114 unsigned int free_strings
:1; /* free name,desc,version? */
118 char *plugin_load (session
*sess
, char *filename
, char *arg
);
119 void plugin_add (session
*sess
, char *filename
, void *handle
, void *init_func
, void *deinit_func
, char *arg
, int fake
);
120 int plugin_kill (char *name
, int by_filename
);
121 void plugin_kill_all (void);
122 void plugin_auto_load (session
*sess
);
123 int plugin_emit_command (session
*sess
, char *name
, char *word
[], char *word_eol
[]);
124 int plugin_emit_server (session
*sess
, char *name
, char *word
[], char *word_eol
[]);
125 int plugin_emit_print (session
*sess
, char *word
[]);
126 int plugin_emit_dummy_print (session
*sess
, char *name
);
127 int plugin_emit_keypress (session
*sess
, unsigned int state
, unsigned int keyval
, int len
, char *string
);
128 GList
* plugin_command_list(GList
*tmp_list
);
129 int plugin_show_help (session
*sess
, char *cmd
);
130 void plugin_command_foreach (session
*sess
, void *userdata
, void (*cb
) (session
*sess
, void *userdata
, char *name
, char *usage
));