summaryrefslogtreecommitdiff
path: root/src/match.h
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-12-27 22:26:48 -0800
committerGitHub <noreply@github.com>2019-12-27 22:26:48 -0800
commit25ebdd4f95f024bce2ec5b84f72c30bbd63ed57a (patch)
treeba3ff5313500d3b0078c78e1daadce36460c8a3d /src/match.h
parentf770d7da17850036df887b2f41a86c38ba255135 (diff)
parent66316266df901eab81ae116c6e0728d10d0214e4 (diff)
Merge pull request #132 from jhawthorn/no_vla
Avoid use of VLA and reduce memory usage in match to O(m)
Diffstat (limited to 'src/match.h')
-rw-r--r--src/match.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/match.h b/src/match.h
index 0fa7b6f..d4f292c 100644
--- a/src/match.h
+++ b/src/match.h
@@ -7,6 +7,8 @@ typedef double score_t;
#define SCORE_MAX INFINITY
#define SCORE_MIN -INFINITY
+#define MATCH_MAX_LEN 1024
+
int has_match(const char *needle, const char *haystack);
score_t match_positions(const char *needle, const char *haystack, size_t *positions);
score_t match(const char *needle, const char *haystack);