summary refs log tree commit diff stats
path: root/src/common/hexchat-plugin.h
diff options
context:
space:
mode:
authorDiogo Sousa <diogogsousa@gmail.com>2013-07-14 11:29:24 -0700
committerDiogo Sousa <diogogsousa@gmail.com>2013-07-14 11:29:24 -0700
commit6c8d9c2194d220ba26b8be09e8a6bffa4cf99b7f (patch)
tree67421013c2f1fcdbeeb4db8142606cbf35c957ff /src/common/hexchat-plugin.h
parent62d52d55b235479a83baa3fa4749ea33e34cbea4 (diff)
parent35989660692d5550808eeec066d52043431484cc (diff)
Merge pull request #675 from orium/server-time-plugins
Server time plugins
Diffstat (limited to 'src/common/hexchat-plugin.h')
-rw-r--r--src/common/hexchat-plugin.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/common/hexchat-plugin.h b/src/common/hexchat-plugin.h
index 36dc544f..61597181 100644
--- a/src/common/hexchat-plugin.h
+++ b/src/common/hexchat-plugin.h
@@ -49,6 +49,10 @@ typedef struct _hexchat_hook hexchat_hook;
 #ifndef PLUGIN_C
 typedef struct _hexchat_context hexchat_context;
 #endif
+typedef struct
+{
+	time_t server_time_utc; /* 0 if not used */
+} hexchat_event_attrs;
 
 #ifndef PLUGIN_C
 struct _hexchat_plugin
@@ -164,6 +168,23 @@ struct _hexchat_plugin
 		const char *var);
 	int (*hexchat_pluginpref_list) (hexchat_plugin *ph,
 		char *dest);
+	hexchat_hook *(*hexchat_hook_server_attrs) (hexchat_plugin *ph,
+		   const char *name,
+		   int pri,
+		   int (*callback) (char *word[], char *word_eol[],
+							hexchat_event_attrs *attrs, void *user_data),
+		   void *userdata);
+	hexchat_hook *(*hexchat_hook_print_attrs) (hexchat_plugin *ph,
+		  const char *name,
+		  int pri,
+		  int (*callback) (char *word[], hexchat_event_attrs *attrs,
+						   void *user_data),
+		  void *userdata);
+	int (*hexchat_emit_print_attrs) (hexchat_plugin *ph, hexchat_event_attrs *attrs,
+									 const char *event_name, ...);
+	hexchat_event_attrs *(*hexchat_event_attrs_create) (hexchat_plugin *ph);
+	void (*hexchat_event_attrs_free) (hexchat_plugin *ph,
+									  hexchat_event_attrs *attrs);
 };
 #endif
 
@@ -176,6 +197,10 @@ hexchat_hook_command (hexchat_plugin *ph,
 		    const char *help_text,
 		    void *userdata);
 
+hexchat_event_attrs *hexchat_event_attrs_create (hexchat_plugin *ph);
+
+void hexchat_event_attrs_free (hexchat_plugin *ph, hexchat_event_attrs *attrs);
+
 hexchat_hook *
 hexchat_hook_server (hexchat_plugin *ph,
 		   const char *name,
@@ -184,6 +209,14 @@ hexchat_hook_server (hexchat_plugin *ph,
 		   void *userdata);
 
 hexchat_hook *
+hexchat_hook_server_attrs (hexchat_plugin *ph,
+		   const char *name,
+		   int pri,
+		   int (*callback) (char *word[], char *word_eol[],
+							hexchat_event_attrs *attrs, void *user_data),
+		   void *userdata);
+
+hexchat_hook *
 hexchat_hook_print (hexchat_plugin *ph,
 		  const char *name,
 		  int pri,
@@ -191,6 +224,14 @@ hexchat_hook_print (hexchat_plugin *ph,
 		  void *userdata);
 
 hexchat_hook *
+hexchat_hook_print_attrs (hexchat_plugin *ph,
+		  const char *name,
+		  int pri,
+		  int (*callback) (char *word[], hexchat_event_attrs *attrs,
+						   void *user_data),
+		  void *userdata);
+
+hexchat_hook *
 hexchat_hook_timer (hexchat_plugin *ph,
 		  int timeout,
 		  int (*callback) (void *user_data),
@@ -297,6 +338,10 @@ int
 hexchat_emit_print (hexchat_plugin *ph,
 		  const char *event_name, ...);
 
+int 
+hexchat_emit_print_attrs (hexchat_plugin *ph, hexchat_event_attrs *attrs,
+						  const char *event_name, ...);
+
 char *
 hexchat_gettext (hexchat_plugin *ph,
 	       const char *msgid);
@@ -350,8 +395,12 @@ hexchat_pluginpref_list (hexchat_plugin *ph,
 #define HEXCHAT_PLUGIN_HANDLE (ph)
 #endif
 #define hexchat_hook_command ((HEXCHAT_PLUGIN_HANDLE)->hexchat_hook_command)
+#define hexchat_event_attrs_create ((HEXCHAT_PLUGIN_HANDLE)->hexchat_event_attrs_create)
+#define hexchat_event_attrs_free ((HEXCHAT_PLUGIN_HANDLE)->hexchat_event_attrs_free)
 #define hexchat_hook_server ((HEXCHAT_PLUGIN_HANDLE)->hexchat_hook_server)
+#define hexchat_hook_server_attrs ((HEXCHAT_PLUGIN_HANDLE)->hexchat_hook_server_attrs)
 #define hexchat_hook_print ((HEXCHAT_PLUGIN_HANDLE)->hexchat_hook_print)
+#define hexchat_hook_print_attrs ((HEXCHAT_PLUGIN_HANDLE)->hexchat_hook_print_attrs)
 #define hexchat_hook_timer ((HEXCHAT_PLUGIN_HANDLE)->hexchat_hook_timer)
 #define hexchat_hook_fd ((HEXCHAT_PLUGIN_HANDLE)->hexchat_hook_fd)
 #define hexchat_unhook ((HEXCHAT_PLUGIN_HANDLE)->hexchat_unhook)
@@ -374,6 +423,7 @@ hexchat_pluginpref_list (hexchat_plugin *ph,
 #define hexchat_plugingui_add ((HEXCHAT_PLUGIN_HANDLE)->hexchat_plugingui_add)
 #define hexchat_plugingui_remove ((HEXCHAT_PLUGIN_HANDLE)->hexchat_plugingui_remove)
 #define hexchat_emit_print ((HEXCHAT_PLUGIN_HANDLE)->hexchat_emit_print)
+#define hexchat_emit_print_attrs ((HEXCHAT_PLUGIN_HANDLE)->hexchat_emit_print_attrs)
 #define hexchat_list_time ((HEXCHAT_PLUGIN_HANDLE)->hexchat_list_time)
 #define hexchat_gettext ((HEXCHAT_PLUGIN_HANDLE)->hexchat_gettext)
 #define hexchat_send_modes ((HEXCHAT_PLUGIN_HANDLE)->hexchat_send_modes)