aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/shingles.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/shingles.h')
-rw-r--r--src/libutil/shingles.h38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/libutil/shingles.h b/src/libutil/shingles.h
index 5a107bdc4..2b2af9737 100644
--- a/src/libutil/shingles.h
+++ b/src/libutil/shingles.h
@@ -21,6 +21,10 @@
#define RSPAMD_SHINGLE_SIZE 32
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rspamd_shingle {
guint64 hashes[RSPAMD_SHINGLE_SIZE];
};
@@ -39,7 +43,7 @@ enum rspamd_shingle_alg {
* @return shingle value
*/
typedef guint64 (*rspamd_shingles_filter) (guint64 *input, gsize count,
- gint shno, const guchar *key, gpointer ud);
+ gint shno, const guchar *key, gpointer ud);
/**
* Generate shingles from the input of fixed size strings using lemmatizer
@@ -51,12 +55,12 @@ typedef guint64 (*rspamd_shingles_filter) (guint64 *input, gsize count,
* @param filterd opaque data for filtering function
* @return shingles array
*/
-struct rspamd_shingle* rspamd_shingles_from_text (GArray *input,
- const guchar key[16],
- rspamd_mempool_t *pool,
- rspamd_shingles_filter filter,
- gpointer filterd,
- enum rspamd_shingle_alg alg);
+struct rspamd_shingle *rspamd_shingles_from_text (GArray *input,
+ const guchar key[16],
+ rspamd_mempool_t *pool,
+ rspamd_shingles_filter filter,
+ gpointer filterd,
+ enum rspamd_shingle_alg alg);
/**
* Generate shingles from the DCT matrix of an image
@@ -67,12 +71,12 @@ struct rspamd_shingle* rspamd_shingles_from_text (GArray *input,
* @param filterd opaque data for filtering function
* @return shingles array
*/
-struct rspamd_shingle* rspamd_shingles_from_image (guchar *dct,
- const guchar key[16],
- rspamd_mempool_t *pool,
- rspamd_shingles_filter filter,
- gpointer filterd,
- enum rspamd_shingle_alg alg);
+struct rspamd_shingle *rspamd_shingles_from_image (guchar *dct,
+ const guchar key[16],
+ rspamd_mempool_t *pool,
+ rspamd_shingles_filter filter,
+ gpointer filterd,
+ enum rspamd_shingle_alg alg);
/**
* Compares two shingles and return result as a floating point value - 1.0
@@ -82,12 +86,16 @@ struct rspamd_shingle* rspamd_shingles_from_image (guchar *dct,
* @return
*/
gdouble rspamd_shingles_compare (const struct rspamd_shingle *a,
- const struct rspamd_shingle *b);
+ const struct rspamd_shingle *b);
/**
* Default filtering function
*/
guint64 rspamd_shingles_default_filter (guint64 *input, gsize count,
- gint shno, const guchar *key, gpointer ud);
+ gint shno, const guchar *key, gpointer ud);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* SHINGLES_H_ */