summaryrefslogtreecommitdiff
path: root/rabincarp.h
diff options
context:
space:
mode:
authordianshi <dianshi@main.lv>2020-05-10 12:53:03 +0100
committerdianshi <dianshi@main.lv>2020-05-10 12:53:03 +0100
commita571b8c92b0ec149f7691e786671ac5939cbf3c5 (patch)
tree3d6e215584477cf08151d3ed7025663fbad2d5b8 /rabincarp.h
parent54da7a3169200cba754b176383ee35bf75401429 (diff)
downloadMATCH-2-master.tar.gz
MATCH-2-master.zip
working versionHEADmaster
Diffstat (limited to 'rabincarp.h')
-rw-r--r--rabincarp.h36
1 files changed, 36 insertions, 0 deletions
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 <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+
+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