diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-08 15:22:05 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-08 15:22:05 +0100 |
commit | c271eb36656a4ff88a9c8c1d59934949260275a3 (patch) | |
tree | 3dd586e38b5b37cfebc7c12b6ff6f434904167c7 /src/libserver/re_cache.h | |
parent | b266445f47dec06392a7e058f499325fa3c052b9 (diff) | |
download | rspamd-c271eb36656a4ff88a9c8c1d59934949260275a3.tar.gz rspamd-c271eb36656a4ff88a9c8c1d59934949260275a3.zip |
[Rework] Add C++ guards to all headers
Diffstat (limited to 'src/libserver/re_cache.h')
-rw-r--r-- | src/libserver/re_cache.h | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/src/libserver/re_cache.h b/src/libserver/re_cache.h index 15146c5dd..b9f80375e 100644 --- a/src/libserver/re_cache.h +++ b/src/libserver/re_cache.h @@ -19,6 +19,10 @@ #include "config.h" #include "libutil/regexp.h" +#ifdef __cplusplus +extern "C" { +#endif + struct rspamd_re_cache; struct rspamd_re_runtime; struct rspamd_task; @@ -76,14 +80,14 @@ rspamd_re_cache_add (struct rspamd_re_cache *cache, rspamd_regexp_t *re, * @param with regexp object to replace the origin */ void rspamd_re_cache_replace (struct rspamd_re_cache *cache, - rspamd_regexp_t *what, - rspamd_regexp_t *with); + rspamd_regexp_t *what, + rspamd_regexp_t *with); /** * Initialize and optimize re cache structure */ void rspamd_re_cache_init (struct rspamd_re_cache *cache, - struct rspamd_config *cfg); + struct rspamd_config *cfg); /** * Returns true when hyperscan is loaded @@ -95,13 +99,13 @@ gboolean rspamd_re_cache_is_hs_loaded (struct rspamd_re_cache *cache); /** * Get runtime data for a cache */ -struct rspamd_re_runtime* rspamd_re_cache_runtime_new (struct rspamd_re_cache *cache); +struct rspamd_re_runtime *rspamd_re_cache_runtime_new (struct rspamd_re_cache *cache); /** * Get runtime statistics */ const struct rspamd_re_cache_stat * - rspamd_re_cache_get_stat (struct rspamd_re_runtime *rt); +rspamd_re_cache_get_stat (struct rspamd_re_runtime *rt); /** * Process regexp runtime and return the result for a specific regexp @@ -114,17 +118,17 @@ const struct rspamd_re_cache_stat * * @param is_strong use case sensitive match when looking for headers */ gint rspamd_re_cache_process (struct rspamd_task *task, - rspamd_regexp_t *re, - enum rspamd_re_type type, - gconstpointer type_data, - gsize datalen, - gboolean is_strong); + rspamd_regexp_t *re, + enum rspamd_re_type type, + gconstpointer type_data, + gsize datalen, + gboolean is_strong); int rspamd_re_cache_process_ffi (void *ptask, - void *pre, - int type, - void *type_data, - int is_strong); + void *pre, + int type, + void *type_data, + int is_strong); /** * Destroy runtime data @@ -135,6 +139,7 @@ void rspamd_re_cache_runtime_destroy (struct rspamd_re_runtime *rt); * Unref re cache */ void rspamd_re_cache_unref (struct rspamd_re_cache *cache); + /** * Retain reference to re cache */ @@ -148,7 +153,7 @@ guint rspamd_re_cache_set_limit (struct rspamd_re_cache *cache, guint limit); /** * Convert re type to a human readable string (constant one) */ -const gchar * rspamd_re_cache_type_to_string (enum rspamd_re_type type); +const gchar *rspamd_re_cache_type_to_string (enum rspamd_re_type type); /** * Convert re type string to the type enum @@ -159,25 +164,30 @@ enum rspamd_re_type rspamd_re_cache_type_from_string (const char *str); * Compile expressions to the hyperscan tree and store in the `cache_dir` */ gint rspamd_re_cache_compile_hyperscan (struct rspamd_re_cache *cache, - const char *cache_dir, gdouble max_time, gboolean silent, - GError **err); + const char *cache_dir, gdouble max_time, gboolean silent, + GError **err); /** * Returns TRUE if the specified file is valid hyperscan cache */ gboolean rspamd_re_cache_is_valid_hyperscan_file (struct rspamd_re_cache *cache, - const char *path, gboolean silent, gboolean try_load); + const char *path, gboolean silent, gboolean try_load); /** * Loads all hyperscan regexps precompiled */ gboolean rspamd_re_cache_load_hyperscan (struct rspamd_re_cache *cache, - const char *cache_dir); + const char *cache_dir); /** * Registers lua selector in the cache */ void rspamd_re_cache_add_selector (struct rspamd_re_cache *cache, - const gchar *sname, gint ref); + const gchar *sname, gint ref); + +#ifdef __cplusplus +} +#endif + #endif |