Add callback interface for errors

Printing to stderr is not the right answer for a library.
This commit is contained in:
Nicolas Williams committed 2013-12-04 18:21:41 -06:00
1 parent 04bc2ef7cf
commit eb165459aa
6 files changed
+123 -42

No files matched your search

+5 -1
View File
@@ -1,6 +1,8 @@
#ifndef _LOCFILE_H
#define _LOCFILE_H
#include "jq.h"
typedef struct {
int start, end;
} location;
@@ -12,9 +14,11 @@ struct locfile {
int length;
int* linemap;
int nlines;
char *error;
jq_state *jq;
};
void locfile_init(struct locfile* l, const char* data, int length);
void locfile_init(struct locfile* l, jq_state *jq, const char* data, int length);
void locfile_free(struct locfile* l);