1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00
stedolan-jq/locfile.h
Nicolas Williams eb165459aa Add callback interface for errors
Printing to stderr is not the right answer for a library.
2013-12-04 18:21:41 -06:00

28 lines
478 B
C

#ifndef _LOCFILE_H
#define _LOCFILE_H
#include "jq.h"
typedef struct {
int start, end;
} location;
static const location UNKNOWN_LOCATION = {-1, -1};
struct locfile {
const char* data;
int length;
int* linemap;
int nlines;
char *error;
jq_state *jq;
};
void locfile_init(struct locfile* l, jq_state *jq, const char* data, int length);
void locfile_free(struct locfile* l);
void locfile_locate(struct locfile* l, location loc, const char* fmt, ...);
#endif