fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit 0e4ae2b032aa9a9b9cdbaab313e080ff4b4dfc5b parent f352f10b46660491f802b2cdf46fff453311f07c Author: John Hawthorn <john.hawthorn@gmail.com> Date: Sat, 26 Jul 2014 02:37:24 -0700 Move declarations into fzy.h Diffstat:
| M | Makefile | | | 3 | +++ |
| M | fzy.c | | | 4 | +--- |
| A | fzy.h | | | 7 | +++++++ |
| M | match.c | | | 2 | ++ |
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile @@ -11,5 +11,8 @@ test: testscore fzy: fzy.o match.o $(CC) $(CCFLAGS) -o $@ $^ +%.o: %.c fzy.h + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + clean: $(RM) fzy testscore *.o diff --git a/fzy.c b/fzy.c @@ -8,9 +8,7 @@ #include <fcntl.h> #include <ctype.h> -/* from match.c */ -double match(const char *needle, const char *haystack); -double match_positions(const char *needle, const char *haystack, size_t *positions); +#include "fzy.h" #define INITIAL_CAPACITY 1 int choices_capacity = 0; diff --git a/fzy.h b/fzy.h @@ -0,0 +1,7 @@ +#ifndef FZY_H +#define FZY_H FZY_H + +double match_positions(const char *needle, const char *haystack, size_t *positions); +double match(const char *needle, const char *haystack); + +#endif diff --git a/match.c b/match.c @@ -3,6 +3,8 @@ #include <strings.h> #include <stdio.h> +#include "fzy.h" + #define SCORE_MIN -1 static int is_subset(const char *needle, const char *haystack){