Browse code

Cleanup headers

John Hawthorn authored on 15/09/2014 02:42:43
Showing 7 changed files

  • Makefile index e997299..37f9b54 100644
  • choices.c index bd3f016..9681de9 100644
  • choices.h index d11fbac..e87d2b7 100644
  • fzy.c index b1abd80..1168b2a 100644
  • fzytest.c index 3842920..cc20d0e 100644
  • match.c index 125106d..2721179 100644
  • fzy.h index 67f182b..b6d19b1 100644
... ...
@@ -19,7 +19,7 @@ test: fzytest
19 19
 fzy: fzy.o match.o tty.o choices.o
20 20
 	$(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^
21 21
 
22
-%.o: %.c fzy.h
22
+%.o: %.c
23 23
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
24 24
 
25 25
 install: fzy
... ...
@@ -2,7 +2,7 @@
2 2
 #include <stdlib.h>
3 3
 
4 4
 #include "choices.h"
5
-#include "fzy.h"
5
+#include "match.h"
6 6
 
7 7
 #define INITIAL_CAPACITY 1
8 8
 
... ...
@@ -1,3 +1,6 @@
1
+#ifndef CHOICES_H
2
+#define CHOICES_H CHOICES_H
3
+
1 4
 typedef struct {
2 5
 	size_t capacity;
3 6
 	size_t size;
... ...
@@ -20,3 +23,4 @@ double choices_getscore(choices_t *c, size_t n);
20 23
 void choices_prev(choices_t *c);
21 24
 void choices_next(choices_t *c);
22 25
 
26
+#endif
... ...
@@ -5,7 +5,7 @@
5 5
 #include <ctype.h>
6 6
 #include <getopt.h>
7 7
 
8
-#include "fzy.h"
8
+#include "match.h"
9 9
 #include "tty.h"
10 10
 #include "choices.h"
11 11
 
... ...
@@ -1,5 +1,5 @@
1 1
 #include <stdio.h>
2
-#include "fzy.h"
2
+#include "match.h"
3 3
 
4 4
 int testsrun = 0, testsfailed = 0, assertionsrun = 0;
5 5
 
... ...
@@ -5,7 +5,7 @@
5 5
 #include <float.h>
6 6
 #include <math.h>
7 7
 
8
-#include "fzy.h"
8
+#include "match.h"
9 9
 
10 10
 int has_match(const char *needle, const char *haystack){
11 11
 	while(*needle){
12 12
similarity index 83%
13 13
rename from fzy.h
14 14
rename to match.h
... ...
@@ -1,5 +1,5 @@
1
-#ifndef FZY_H
2
-#define FZY_H FZY_H
1
+#ifndef MATCH_H
2
+#define MATCH_H MATCH_H
3 3
 
4 4
 int has_match(const char *needle, const char *haystack);
5 5
 double match_positions(const char *needle, const char *haystack, size_t *positions);