diff options
Diffstat (limited to 'lib/librspamdclient.h')
-rw-r--r-- | lib/librspamdclient.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/lib/librspamdclient.h b/lib/librspamdclient.h index 180566fe5..54695a34d 100644 --- a/lib/librspamdclient.h +++ b/lib/librspamdclient.h @@ -27,6 +27,7 @@ struct rspamd_metric { }; struct rspamd_connection; +struct rspamd_client; /** * Result of scan */ @@ -40,87 +41,88 @@ struct rspamd_result { /* * Init rspamd client library */ -void rspamd_client_init (void); +struct rspamd_client* rspamd_client_init (void); /* * Add rspamd server */ -gboolean rspamd_add_server (const gchar *host, guint16 port, guint16 controller_port, GError **err); +gboolean rspamd_add_server (struct rspamd_client* client, const gchar *host, + guint16 port, guint16 controller_port, GError **err); /* * Set timeouts (values in milliseconds) */ -void rspamd_set_timeout (guint connect_timeout, guint read_timeout); +void rspamd_set_timeout (struct rspamd_client* client, guint connect_timeout, guint read_timeout); /* * Scan message from memory */ -struct rspamd_result * rspamd_scan_memory (const guchar *message, gsize length, GHashTable *headers, GError **err); +struct rspamd_result * rspamd_scan_memory (struct rspamd_client* client, const guchar *message, gsize length, GHashTable *headers, GError **err); /* * Scan message from file */ -struct rspamd_result * rspamd_scan_file (const guchar *filename, GHashTable *headers, GError **err); +struct rspamd_result * rspamd_scan_file (struct rspamd_client* client, const guchar *filename, GHashTable *headers, GError **err); /* * Scan message from fd */ -struct rspamd_result * rspamd_scan_fd (int fd, GHashTable *headers, GError **err); +struct rspamd_result * rspamd_scan_fd (struct rspamd_client* client, int fd, GHashTable *headers, GError **err); /* * Learn message from memory */ -gboolean rspamd_learn_spam_memory (const guchar *message, gsize length, const gchar *classifier, gboolean is_spam, const gchar *password, GError **err); +gboolean rspamd_learn_spam_memory (struct rspamd_client* client, const guchar *message, gsize length, const gchar *classifier, gboolean is_spam, const gchar *password, GError **err); /* * Learn message from file */ -gboolean rspamd_learn_spam_file (const guchar *filename, const gchar *classifier, gboolean is_spam, const gchar *password, GError **err); +gboolean rspamd_learn_spam_file (struct rspamd_client* client, const guchar *filename, const gchar *classifier, gboolean is_spam, const gchar *password, GError **err); /* * Learn message from fd */ -gboolean rspamd_learn_spam_fd (int fd, const gchar *classifier, gboolean is_spam, const gchar *password, GError **err); +gboolean rspamd_learn_spam_fd (struct rspamd_client* client, int fd, const gchar *classifier, gboolean is_spam, const gchar *password, GError **err); /* * Learn message from memory */ -gboolean rspamd_learn_memory (const guchar *message, gsize length, const gchar *symbol, const gchar *password, GError **err); +gboolean rspamd_learn_memory (struct rspamd_client* client, const guchar *message, gsize length, const gchar *symbol, const gchar *password, GError **err); /* * Learn message from file */ -gboolean rspamd_learn_file (const guchar *filename, const gchar *symbol, const gchar *password, GError **err); +gboolean rspamd_learn_file (struct rspamd_client* client, const guchar *filename, const gchar *symbol, const gchar *password, GError **err); /* * Learn message from fd */ -gboolean rspamd_learn_fd (int fd, const gchar *symbol, const gchar *password, GError **err); +gboolean rspamd_learn_fd (struct rspamd_client* client, int fd, const gchar *symbol, const gchar *password, GError **err); /* * Learn message fuzzy from memory */ -gboolean rspamd_fuzzy_memory (const guchar *message, gsize length, const gchar *password, gint weight, gint flag, gboolean delete, GError **err); +gboolean rspamd_fuzzy_memory (struct rspamd_client* client, const guchar *message, gsize length, const gchar *password, gint weight, gint flag, gboolean delete, GError **err); /* * Learn message fuzzy from file */ -gboolean rspamd_fuzzy_file (const guchar *filename, const gchar *password, gint weight, gint flag, gboolean delete, GError **err); +gboolean rspamd_fuzzy_file (struct rspamd_client* client, const guchar *filename, const gchar *password, gint weight, gint flag, gboolean delete, GError **err); /* * Learn message fuzzy from fd */ -gboolean rspamd_fuzzy_fd (int fd, const gchar *password, gint weight, gint flag, gboolean delete, GError **err); +gboolean rspamd_fuzzy_fd (struct rspamd_client* client, int fd, const gchar *password, gint weight, gint flag, gboolean delete, GError **err); /* * Get statistic from server */ -GString *rspamd_get_stat (GError **err); +GString *rspamd_get_stat (struct rspamd_client* client, GError **err); /* * Get uptime from server */ -GString *rspamd_get_uptime (GError **err); +GString *rspamd_get_uptime (struct rspamd_client* client, GError **err); /* * Free results @@ -130,6 +132,6 @@ void rspamd_free_result (struct rspamd_result *result); /* * Close library and free associated resources */ -void rspamd_client_close (void); +void rspamd_client_close (struct rspamd_client *client); #endif |