fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

commit 5e5cc7c1cf8d94a9b068ddc5cb22b929a1bf50db
parent f2366a5db363064eb01a3da9bfa9b672d34ba9a8
Author: John Hawthorn <john.hawthorn@gmail.com>
Date:   Sun, 21 Sep 2014 14:12:47 -0700

Move some score definitions into header

Diffstat:
Mmatch.c | 3---
Mmatch.h | 8++++++--
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/match.c b/match.c @@ -24,9 +24,6 @@ int has_match(const char *needle, const char *haystack){ } #define max(a, b) (((a) > (b)) ? (a) : (b)) -typedef double score_t; -#define SCORE_MAX INFINITY -#define SCORE_MIN -INFINITY /* print one of the internal matrices */ void mat_print(score_t *mat, const char *needle, const char *haystack){ diff --git a/match.h b/match.h @@ -1,8 +1,12 @@ #ifndef MATCH_H #define MATCH_H MATCH_H +typedef double score_t; +#define SCORE_MAX INFINITY +#define SCORE_MIN -INFINITY + 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); +score_t match_positions(const char *needle, const char *haystack, size_t *positions); +score_t match(const char *needle, const char *haystack); #endif