fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit f635fc53a3900ce75d01ea26e8eb97411718049f parent 2cb2d6b9841b20b7d9630ff5bac8c59f70955fcf Author: John Hawthorn <john.hawthorn@gmail.com> Date: Sun, 14 Sep 2014 19:42:43 -0700 Cleanup headers Diffstat:
| M | Makefile | | | 2 | +- |
| M | choices.c | | | 2 | +- |
| M | choices.h | | | 4 | ++++ |
| M | fzy.c | | | 2 | +- |
| D | fzy.h | | | 8 | -------- |
| M | fzytest.c | | | 2 | +- |
| M | match.c | | | 2 | +- |
| A | match.h | | | 8 | ++++++++ |
8 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile @@ -19,7 +19,7 @@ test: fzytest fzy: fzy.o match.o tty.o choices.o $(CC) $(CFLAGS) $(CCFLAGS) -o $@ $^ -%.o: %.c fzy.h +%.o: %.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< install: fzy diff --git a/choices.c b/choices.c @@ -2,7 +2,7 @@ #include <stdlib.h> #include "choices.h" -#include "fzy.h" +#include "match.h" #define INITIAL_CAPACITY 1 diff --git a/choices.h b/choices.h @@ -1,3 +1,6 @@ +#ifndef CHOICES_H +#define CHOICES_H CHOICES_H + typedef struct { size_t capacity; size_t size; @@ -20,3 +23,4 @@ double choices_getscore(choices_t *c, size_t n); void choices_prev(choices_t *c); void choices_next(choices_t *c); +#endif diff --git a/fzy.c b/fzy.c @@ -5,7 +5,7 @@ #include <ctype.h> #include <getopt.h> -#include "fzy.h" +#include "match.h" #include "tty.h" #include "choices.h" diff --git a/fzy.h b/fzy.h @@ -1,8 +0,0 @@ -#ifndef FZY_H -#define FZY_H FZY_H - -int has_match(const char *needle, const char *haystack); -double match_positions(const char *needle, const char *haystack, size_t *positions); -double match(const char *needle, const char *haystack); - -#endif diff --git a/fzytest.c b/fzytest.c @@ -1,5 +1,5 @@ #include <stdio.h> -#include "fzy.h" +#include "match.h" int testsrun = 0, testsfailed = 0, assertionsrun = 0; diff --git a/match.c b/match.c @@ -5,7 +5,7 @@ #include <float.h> #include <math.h> -#include "fzy.h" +#include "match.h" int has_match(const char *needle, const char *haystack){ while(*needle){ diff --git a/match.h b/match.h @@ -0,0 +1,8 @@ +#ifndef MATCH_H +#define MATCH_H MATCH_H + +int has_match(const char *needle, const char *haystack); +double match_positions(const char *needle, const char *haystack, size_t *positions); +double match(const char *needle, const char *haystack); + +#endif