Files

29 lines
578 B
C
Raw Permalink Normal View History

2015-04-28 10:36:21 -05:00
#ifndef LOCFILE_H
#define LOCFILE_H
2013-05-26 12:42:04 +10:00
2013-11-30 02:05:42 -06:00
#include "jq.h"
typedef struct {
int start, end;
} location;
static const location UNKNOWN_LOCATION = {-1, -1};
struct locfile {
jv fname;
const char* data;
int length;
int* linemap;
int nlines;
2013-11-30 02:05:42 -06:00
char *error;
jq_state *jq;
int refct;
};
struct locfile* locfile_init(jq_state *, const char *, const char *, int);
struct locfile* locfile_retain(struct locfile *);
2015-03-30 15:55:54 -05:00
int locfile_get_line(struct locfile *, int);
void locfile_free(struct locfile *);
void locfile_locate(struct locfile *, location, const char *, ...);
#endif