| ... | ... |
@@ -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 |
|
| ... | ... |
@@ -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 |
| ... | ... |
@@ -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); |
Preparing for some changes to the match method
| 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 |