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/libutil/regexp.h | |
parent | b266445f47dec06392a7e058f499325fa3c052b9 (diff) | |
download | rspamd-c271eb36656a4ff88a9c8c1d59934949260275a3.tar.gz rspamd-c271eb36656a4ff88a9c8c1d59934949260275a3.zip |
[Rework] Add C++ guards to all headers
Diffstat (limited to 'src/libutil/regexp.h')
-rw-r--r-- | src/libutil/regexp.h | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/src/libutil/regexp.h b/src/libutil/regexp.h index b982c08f6..f7ed05dad 100644 --- a/src/libutil/regexp.h +++ b/src/libutil/regexp.h @@ -35,6 +35,11 @@ #define RSPAMD_REGEXP_FLAG_DISABLE_JIT (1 << 5) #define RSPAMD_REGEXP_FLAG_UTF (1 << 6) + +#ifdef __cplusplus +extern "C" { +#endif + struct rspamd_config; typedef struct rspamd_regexp_s rspamd_regexp_t; @@ -51,8 +56,8 @@ struct rspamd_re_capture { * @param err error pointer set if compilation failed * @return new regexp object */ -rspamd_regexp_t* rspamd_regexp_new (const gchar *pattern, const gchar *flags, - GError **err); +rspamd_regexp_t *rspamd_regexp_new (const gchar *pattern, const gchar *flags, + GError **err); /** * Search the specified regexp in the text @@ -66,9 +71,9 @@ rspamd_regexp_t* rspamd_regexp_new (const gchar *pattern, const gchar *flags, * @return */ gboolean rspamd_regexp_search (rspamd_regexp_t *re, - const gchar *text, gsize len, - const gchar **start, const gchar **end, gboolean raw, - GArray *captures); + const gchar *text, gsize len, + const gchar **start, const gchar **end, gboolean raw, + GArray *captures); /** @@ -79,12 +84,12 @@ gboolean rspamd_regexp_search (rspamd_regexp_t *re, * @return */ gboolean rspamd_regexp_match (rspamd_regexp_t *re, - const gchar *text, gsize len, gboolean raw); + const gchar *text, gsize len, gboolean raw); /** * Increase refcount for a regexp object */ -rspamd_regexp_t* rspamd_regexp_ref (rspamd_regexp_t *re); +rspamd_regexp_t *rspamd_regexp_ref (rspamd_regexp_t *re); /** * Unref regexp object @@ -118,12 +123,13 @@ gpointer rspamd_regexp_get_id (rspamd_regexp_t *re); * @param re * @return */ -const char* rspamd_regexp_get_pattern (rspamd_regexp_t *re); +const char *rspamd_regexp_get_pattern (rspamd_regexp_t *re); /** * Get PCRE flags for the regexp */ guint rspamd_regexp_get_pcre_flags (rspamd_regexp_t *re); + /** * Get rspamd flags for the regexp */ @@ -179,7 +185,7 @@ gpointer rspamd_regexp_set_class (rspamd_regexp_t *re, gpointer re_class); * Create new regexp cache * @return */ -struct rspamd_regexp_cache* rspamd_regexp_cache_new (void); +struct rspamd_regexp_cache *rspamd_regexp_cache_new (void); /** * Query rspamd cache for a specified regexp @@ -188,9 +194,9 @@ struct rspamd_regexp_cache* rspamd_regexp_cache_new (void); * @param flags * @return */ -rspamd_regexp_t* rspamd_regexp_cache_query (struct rspamd_regexp_cache* cache, - const gchar *pattern, - const gchar *flags); +rspamd_regexp_t *rspamd_regexp_cache_query (struct rspamd_regexp_cache *cache, + const gchar *pattern, + const gchar *flags); /** * Insert item to the cache using custom pattern and flags @@ -199,9 +205,9 @@ rspamd_regexp_t* rspamd_regexp_cache_query (struct rspamd_regexp_cache* cache, * @param flags * @param re */ -void rspamd_regexp_cache_insert (struct rspamd_regexp_cache* cache, - const gchar *pattern, - const gchar *flags, rspamd_regexp_t *re); +void rspamd_regexp_cache_insert (struct rspamd_regexp_cache *cache, + const gchar *pattern, + const gchar *flags, rspamd_regexp_t *re); /** * Create or get cached regexp from the specified cache @@ -211,9 +217,9 @@ void rspamd_regexp_cache_insert (struct rspamd_regexp_cache* cache, * @param err error pointer set if compilation failed * @return new regexp object */ -rspamd_regexp_t* rspamd_regexp_cache_create (struct rspamd_regexp_cache *cache, - const gchar *pattern, - const gchar *flags, GError **err); +rspamd_regexp_t *rspamd_regexp_cache_create (struct rspamd_regexp_cache *cache, + const gchar *pattern, + const gchar *flags, GError **err); /** * Remove regexp from the cache @@ -222,7 +228,7 @@ rspamd_regexp_t* rspamd_regexp_cache_create (struct rspamd_regexp_cache *cache, * @return TRUE if a regexp has been removed */ gboolean rspamd_regexp_cache_remove (struct rspamd_regexp_cache *cache, - rspamd_regexp_t *re); + rspamd_regexp_t *re); /** * Destroy regexp cache and unref all elements inside it @@ -268,4 +274,8 @@ void rspamd_regexp_library_finalize (void); */ rspamd_regexp_t *rspamd_regexp_from_glob (const gchar *gl, gsize sz, GError **err); +#ifdef __cplusplus +} +#endif + #endif /* REGEXP_H_ */ |