Browse code

Remove trailing whitespace

John Hawthorn authored on 10/12/2024 02:01:31
Showing 1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
 
4 4
 #include <math.h>
5 5
 
6
-#ifdef __cplusplus 
6
+#ifdef __cplusplus
7 7
 extern "C" {
8 8
 #endif
9 9
 
... ...
@@ -17,7 +17,7 @@ int has_match(const char *needle, const char *haystack);
17 17
 score_t match_positions(const char *needle, const char *haystack, size_t *positions);
18 18
 score_t match(const char *needle, const char *haystack);
19 19
 
20
-#ifdef __cplusplus 
20
+#ifdef __cplusplus
21 21
 }
22 22
 #endif
23 23
 
Browse code

Add extern C

Ben Judd authored on 03/01/2024 16:38:45
Showing 1 changed files
... ...
@@ -3,6 +3,10 @@
3 3
 
4 4
 #include <math.h>
5 5
 
6
+#ifdef __cplusplus 
7
+extern "C" {
8
+#endif
9
+
6 10
 typedef double score_t;
7 11
 #define SCORE_MAX INFINITY
8 12
 #define SCORE_MIN -INFINITY
... ...
@@ -13,4 +17,8 @@ int has_match(const char *needle, const char *haystack);
13 17
 score_t match_positions(const char *needle, const char *haystack, size_t *positions);
14 18
 score_t match(const char *needle, const char *haystack);
15 19
 
20
+#ifdef __cplusplus 
21
+}
22
+#endif
23
+
16 24
 #endif
Browse code

Avoid VLA in tty_interface

John Hawthorn authored on 28/12/2019 03:39:50
Showing 1 changed files
... ...
@@ -7,6 +7,8 @@ typedef double score_t;
7 7
 #define SCORE_MAX INFINITY
8 8
 #define SCORE_MIN -INFINITY
9 9
 
10
+#define MATCH_MAX_LEN 1024
11
+
10 12
 int has_match(const char *needle, const char *haystack);
11 13
 score_t match_positions(const char *needle, const char *haystack, size_t *positions);
12 14
 score_t match(const char *needle, const char *haystack);
Browse code

Add tests for exact scores

Preparing for some changes to the match method

John Hawthorn authored on 14/06/2016 06:36:51
Showing 1 changed files
... ...
@@ -1,6 +1,8 @@
1 1
 #ifndef MATCH_H
2 2
 #define MATCH_H MATCH_H
3 3
 
4
+#include <math.h>
5
+
4 6
 typedef double score_t;
5 7
 #define SCORE_MAX INFINITY
6 8
 #define SCORE_MIN -INFINITY
Browse code

Move sources into src directory

John Hawthorn authored on 21/05/2016 21:56:03
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+#ifndef MATCH_H
2
+#define MATCH_H MATCH_H
3
+
4
+typedef double score_t;
5
+#define SCORE_MAX INFINITY
6
+#define SCORE_MIN -INFINITY
7
+
8
+int has_match(const char *needle, const char *haystack);
9
+score_t match_positions(const char *needle, const char *haystack, size_t *positions);
10
+score_t match(const char *needle, const char *haystack);
11
+
12
+#endif