Browse code

Move declarations into fzy.h

John Hawthorn authored on 26/07/2014 09:37:24
Showing 4 changed files

  • Makefile index 6253311..ba1de16 100644
  • fzy.c index ac3d938..2f37ffb 100644
  • fzy.h index 0000000..658c0cc
  • match.c index 3bf0e89..b501327 100644
... ...
@@ -11,5 +11,8 @@ test: testscore
11 11
 fzy: fzy.o match.o
12 12
 	$(CC) $(CCFLAGS) -o $@ $^
13 13
 
14
+%.o: %.c fzy.h
15
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
16
+
14 17
 clean:
15 18
 	$(RM) fzy testscore *.o
... ...
@@ -8,9 +8,7 @@
8 8
 #include <fcntl.h>
9 9
 #include <ctype.h>
10 10
 
11
-/* from match.c */
12
-double match(const char *needle, const char *haystack);
13
-double match_positions(const char *needle, const char *haystack, size_t *positions);
11
+#include "fzy.h"
14 12
 
15 13
 #define INITIAL_CAPACITY 1
16 14
 int choices_capacity = 0;
17 15
new file mode 100644
... ...
@@ -0,0 +1,7 @@
1
+#ifndef FZY_H
2
+#define FZY_H FZY_H
3
+
4
+double match_positions(const char *needle, const char *haystack, size_t *positions);
5
+double match(const char *needle, const char *haystack);
6
+
7
+#endif
... ...
@@ -3,6 +3,8 @@
3 3
 #include <strings.h>
4 4
 #include <stdio.h>
5 5
 
6
+#include "fzy.h"
7
+
6 8
 #define SCORE_MIN -1
7 9
 
8 10
 static int is_subset(const char *needle, const char *haystack){