cctools
jx_parse.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2015- The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef JX_PARSE_H
8 #define JX_PARSE_H
9 
20 #include "jx.h"
21 #include "link.h"
22 
23 #include <stdio.h>
24 
25 struct jx_parser;
26 
28 struct jx * jx_parse_string( const char *str );
29 
31 struct jx * jx_parse_stream( FILE *file );
32 
34 struct jx * jx_parse_file( const char *name );
35 
37 struct jx * jx_parse_link( struct link *l, time_t stoptime );
38 
40 struct jx_parser * jx_parser_create();
41 
43 void jx_parser_read_stream( struct jx_parser *p, FILE *file );
44 
46 void jx_parser_read_string( struct jx_parser *p, const char *str );
47 
49 void jx_parser_read_link( struct jx_parser *p, struct link *l, time_t stoptime );
50 
52 struct jx * jx_parser_yield( struct jx_parser *p );
53 
55 struct jx * jx_parse( struct jx_parser *p );
56 
58 int jx_parser_errors( struct jx_parser *p );
59 
61 const char *jx_parser_error_string( struct jx_parser *p );
62 
64 void jx_parser_delete( struct jx_parser *p );
65 
66 #endif
int jx_parser_errors(struct jx_parser *p)
Return number of parse errors.
struct jx * jx_parse_string(const char *str)
Parse a JSON string to a JX expression.
struct jx * jx_parse_link(struct link *l, time_t stoptime)
Parse a network link to a JX expression.
const char * jx_parser_error_string(struct jx_parser *p)
Return text of parse error.
void jx_parser_read_link(struct jx_parser *p, struct link *l, time_t stoptime)
Attach parser to a link.
struct jx * jx_parse_stream(FILE *file)
Parse a standard IO stream to a JX expression.
struct jx * jx_parse(struct jx_parser *p)
Parse a JX expression.
void jx_parser_read_string(struct jx_parser *p, const char *str)
Attach parser to a string.
JSON Expressions (JX) library.
struct jx_parser * jx_parser_create()
Create a JX parser object.
void jx_parser_delete(struct jx_parser *p)
Delete a parser.
JX value representing any expression type.
Definition: jx.h:74
struct jx * jx_parse_file(const char *name)
Parse a file to a JX expression.
void jx_parser_read_stream(struct jx_parser *p, FILE *file)
Attach parser to a file.
struct jx * jx_parser_yield(struct jx_parser *p)
Parse and return a single value.