Cthulhu
0.2.10
Cthulhu compiler collection
json_scan.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: LGPL-3.0-only
2
3
#pragma once
4
5
#include "
scan/node.h
"
// IWYU pragma: export
6
#include "
core/where.h
"
7
8
#include <gmp.h>
9
10
#ifndef JSONLTYPE
11
# define JSONLTYPE json_where_t
12
#endif
13
14
typedef
struct
logger_t
logger_t
;
15
typedef
struct
set_t
set_t
;
16
17
typedef
struct
json_where_t
18
{
19
size_t
offset
;
20
where_t
where
;
21
}
json_where_t
;
22
23
typedef
struct
json_scan_t
24
{
25
logger_t
*
reports
;
26
}
json_scan_t
;
27
28
CT_LOCAL
json_scan_t
*
json_scan_context
(
scan_t
*scan);
29
30
CT_LOCAL
void
json_parse_integer
(mpz_t integer,
scan_t
*scan,
where_t
where,
const
char
*text,
int
base);
31
CT_LOCAL
void
json_parse_float
(
float
*real,
scan_t
*scan,
where_t
where,
const
char
*text);
32
CT_LOCAL
void
json_parse_string
(
text_view_t
*
string
,
scan_t
*scan,
json_where_t
where,
const
char
*text,
size_t
length);
CT_LOCAL
#define CT_LOCAL
Definition:
compiler.h:166
json_scan_context
CT_LOCAL json_scan_t * json_scan_context(scan_t *scan)
Definition:
scan.c:15
json_parse_float
CT_LOCAL void json_parse_float(float *real, scan_t *scan, where_t where, const char *text)
Definition:
scan.c:30
json_parse_string
CT_LOCAL void json_parse_string(text_view_t *string, scan_t *scan, json_where_t where, const char *text, size_t length)
Definition:
scan.c:42
json_parse_integer
CT_LOCAL void json_parse_integer(mpz_t integer, scan_t *scan, where_t where, const char *text, int base)
Definition:
scan.c:20
node.h
json_scan_t
Definition:
json_scan.h:24
json_scan_t::reports
logger_t * reports
Definition:
json_scan.h:25
json_where_t
Definition:
json_scan.h:18
json_where_t::offset
size_t offset
Definition:
json_scan.h:19
json_where_t::where
where_t where
Definition:
json_scan.h:20
logger_t
a logging sink
Definition:
notify.c:14
scan_t
a source file scanner
Definition:
scan.h:24
set_t
an unordered hash set
Definition:
set.c:19
text_view_t
a non-owning view of text
Definition:
text.h:24
where_t
a location inside a scanner locations are inclusive and 0-based
Definition:
where.h:23
where.h
support
json
src
json_scan.h
Generated by
1.9.1