Add callback interface for errors
Printing to stderr is not the right answer for a library.
This commit is contained in:
1 parent
04bc2ef7cf
commit
eb165459aa
6 files changed
+123
-42
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user