📄 gsms-plugin.h
字号:
/* * code for loading plugins * * Authors: Michael Jochum <e9725005@stud3.tuwien.ac.at> * * TODO: * * Fixes: * * For license terms, see the file COPYING in the project directory. */#ifndef __GSMS_PLUGIN_H__#define __GSMS_PLUGIN_H__#include <gmodule.h>#ifdef GSMS_PLUGIN# include "httpr.h"# include "http.h"#endifenum { PLUGIN_OK, PLUGIN_ERROR, PLUGIN_DEAD};typedef struct { gchar *prefix; gchar *name;} GSMNetwork;typedef struct _PluginData PluginData;struct _PluginData { gint api_version; /* this should help if we have to change this interface in a later version an use old plugins set this to 0 for this version */ gchar *file; /* filled in by the plugin loader */ GModule *handle; /* filled in by the plugin loader */ gint priority; /* filled in by the plugin loader */ gint (*init_plugin) (PluginData *); gboolean (*can_unload) (PluginData *); void (*destroy_plugin) (PluginData *); /* the last parameter is the parent window - this is of the type gpoiner to avoid including aditional headers for plugins without gtk calls */ void (*configuration_dialog) (PluginData *, gpointer); void (*about_dialog) (PluginData *, gpointer); gint (*send_sms) (PluginData *, gchar *, gchar *); /* Plugin Information */ gchar *name; /* plugin name */ GSList *networks; /* GSList of GSMNetworks */ gchar *authors; gchar *info; /* some information about the plugin (URL of the service) */ gchar *version; /* version of the plugin */ gint default_priority; /* this is an important parameter [0..999]*/ /* plugin should initialze this to: */ /* 100 ... if it is a native plugin (eg. message are sent */ /* through the webpage of the gsms netork) */ /* 500 ... country specific web sites specializd on */ /* gsm networks in this country */ /* 999 ... global sms providers */ /* filled in by plugin */ void *private_data;};/* define the interface functions only if we compile a plugin */#ifdef GSMS_PLUGIN#define MODULE_LOG_DOMAIN "PLUGIN"#define PLUGIN_LOG_DOMAIN "PLUGIN"/* don't use gnome-config use this functions to save your settings */void gsms_plugin_config_save(PluginData *pd, const gchar *str);gchar *gsms_plugin_config_load(PluginData *pd);GsmsHttpConnection * gsms_plugin_http_connect(gchar *host, guint16 port);gchar * gsms_plugin_http_request_simple(GsmsHttpConnection *c, gchar *url, gchar *referer, gchar *method, gchar *ctype, gchar *body);GsmsHttpResponse * gsms_plugin_http_request(GsmsHttpConnection *c, GSmsHttp *ht); void gsms_plugin_http_close(GsmsHttpConnection *c);void gsms_plugin_http_response_free(GsmsHttpResponse *response);gint gsms_send_http_request(gchar *host, gint port, GSmsHttp *ht, gchar *buffer, gint len);gint gsms_send_mail(gchar *to, gchar *subject, gchar *body);#endif#endif /* __GSMS_PLUGIN_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -