From a571b8c92b0ec149f7691e786671ac5939cbf3c5 Mon Sep 17 00:00:00 2001 From: dianshi Date: Sun, 10 May 2020 12:53:03 +0100 Subject: working version --- rabincarp.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'rabincarp.h') diff --git a/rabincarp.h b/rabincarp.h index e69de29..753ff66 100644 --- a/rabincarp.h +++ b/rabincarp.h @@ -0,0 +1,36 @@ +#ifndef __RABINCARP_H +#define __RABINCARP_H + +#include +#include +#include +#include +#include +#include + +typedef struct rol_hash_isearch +{ + int b; + int m; + int pow; + + int pattern_len; + int text_len; + int pattern_hash; + int text_hash; + char *text; + char *pattern; + int iter_pos; + + char *pre_text; + int count; + int chunk_done; +} rol_hash_isearch; + +int rlsi_hash_reset(rol_hash_isearch *rlh); +int rlsi_hash_init(rol_hash_isearch *rlh, int b, int m); +int rlsi_hash_precalc(rol_hash_isearch *rlh, char *pattern, int plen, char *text, int tlen); +int rlsi_hash_search(rol_hash_isearch *rlh, char *pattern, int plen, char *text, int tlen); +int rlsi_hash_get(rol_hash_isearch *rlh); + +#endif \ No newline at end of file -- cgit v1.2.3