summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2015-11-07 01:37:03 -0800
committerJohn Hawthorn <john.hawthorn@gmail.com>2015-11-07 18:19:18 -0800
commit0f7b650cd1edfc1706f1c9dffd746f7fae2d35e3 (patch)
tree8837e0116a78a7433d26c0fab319d70ab888fbf9
parentafef1c979c0955a7bced155ea91984acda067429 (diff)
Allow customization of config.h via config.def.h
-rw-r--r--.gitignore1
-rw-r--r--Makefile3
-rw-r--r--choices.c1
-rw-r--r--config.def.h (renamed from config.h)0
4 files changed, 5 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 8a74f1f..0a47f55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
fzy
fzytest
*.o
+config.h
diff --git a/Makefile b/Makefile
index 9018404..41ea0c7 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,9 @@ fzy: fzy.o match.o tty.o choices.o
%.o: %.c config.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+config.h:
+ cp config.def.h config.h
+
install: fzy
mkdir -p $(DESTDIR)$(BINDIR)
cp fzy $(DESTDIR)$(BINDIR)/
diff --git a/choices.c b/choices.c
index 455aacc..25b9217 100644
--- a/choices.c
+++ b/choices.c
@@ -89,6 +89,7 @@ const char *choices_get(choices_t *c, size_t n) {
return NULL;
}
}
+
double choices_getscore(choices_t *c, size_t n) {
return c->results[n].score;
}
diff --git a/config.h b/config.def.h
index 98cc915..98cc915 100644
--- a/config.h
+++ b/config.def.h