summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'data.c')
-rw-r--r--data.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/data.c b/data.c
index 5f5e8c1..4a05f1b 100644
--- a/data.c
+++ b/data.c
@@ -306,6 +306,25 @@ int index_in(const char *fn, const char *id)
306} 306}
307 307
308 308
309int index_first(const char *fn, char *line, int size)
310/* reads the first entry of an index */
311{
312 FILE *f;
313 int ret = 0;
314
315 if ((f = fopen(fn, "r")) != NULL) {
316 if (fgets(line, size, f) != NULL) {
317 line[32] = '\0';
318 ret = 1;
319 }
320
321 fclose(f);
322 }
323
324 return ret;
325}
326
327
309d_char *index_list(const char *fn, int max) 328d_char *index_list(const char *fn, int max)
310/* returns an index as a list */ 329/* returns an index as a list */
311{ 330{