php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_json_scanner.h
Go to the documentation of this file.
1
/*
2
+----------------------------------------------------------------------+
3
| Copyright (c) The PHP Group |
4
+----------------------------------------------------------------------+
5
| This source file is subject to version 3.01 of the PHP license, |
6
| that is bundled with this package in the file LICENSE, and is |
7
| available through the world-wide-web at the following url: |
8
| https://www.php.net/license/3_01.txt |
9
| If you did not receive a copy of the PHP license and are unable to |
10
| obtain it through the world-wide-web, please send a note to |
11
| license@php.net so we can mail you a copy immediately. |
12
+----------------------------------------------------------------------+
13
| Author: Jakub Zelenka <bukka@php.net> |
14
+----------------------------------------------------------------------+
15
*/
16
17
#ifndef PHP_JSON_SCANNER_H
18
#define PHP_JSON_SCANNER_H
19
20
#include "
php.h
"
21
#include "
php_json.h
"
22
23
typedef
unsigned
char
php_json_ctype
;
24
25
typedef
struct
_php_json_scanner
{
26
php_json_ctype
*
cursor
;
/* cursor position */
27
php_json_ctype
*
token
;
/* token position */
28
php_json_ctype
*
limit
;
/* the last read character + 1 position */
29
php_json_ctype
*
marker
;
/* marker position for backtracking */
30
php_json_ctype
*
ctxmarker
;
/* marker position for context backtracking */
31
php_json_ctype
*
str_start
;
/* start position of the string */
32
php_json_ctype
*
pstr
;
/* string pointer for escapes conversion */
33
zval
value
;
/* value */
34
int
str_esc
;
/* number of extra characters for escaping */
35
int
state
;
/* condition state */
36
int
options
;
/* options */
37
php_json_error_code
errcode
;
/* error type if there is an error */
38
int
utf8_invalid
;
/* whether utf8 is invalid */
39
int
utf8_invalid_count
;
/* number of extra character for invalid utf8 */
40
}
php_json_scanner
;
41
42
43
void
php_json_scanner_init
(
php_json_scanner
*scanner,
const
char
*str,
size_t
str_len,
int
options
);
44
int
php_json_scan
(
php_json_scanner
*
s
);
45
46
#endif
/* PHP_JSON_SCANNER_H */
s
char s[4]
Definition
cdf.c:77
php.h
php_json.h
php_json_error_code
php_json_error_code
Definition
php_json.h:42
options
PHP_JSON_API size_t int options
Definition
php_json.h:102
php_json_ctype
unsigned char php_json_ctype
Definition
php_json_scanner.h:23
php_json_scan
int php_json_scan(php_json_scanner *s)
php_json_scanner
struct _php_json_scanner php_json_scanner
php_json_scanner_init
void php_json_scanner_init(php_json_scanner *scanner, const char *str, size_t str_len, int options)
_php_json_scanner
Definition
php_json_scanner.h:25
_php_json_scanner::ctxmarker
php_json_ctype * ctxmarker
Definition
php_json_scanner.h:30
_php_json_scanner::options
int options
Definition
php_json_scanner.h:36
_php_json_scanner::utf8_invalid
int utf8_invalid
Definition
php_json_scanner.h:38
_php_json_scanner::utf8_invalid_count
int utf8_invalid_count
Definition
php_json_scanner.h:39
_php_json_scanner::state
int state
Definition
php_json_scanner.h:35
_php_json_scanner::limit
php_json_ctype * limit
Definition
php_json_scanner.h:28
_php_json_scanner::marker
php_json_ctype * marker
Definition
php_json_scanner.h:29
_php_json_scanner::str_esc
int str_esc
Definition
php_json_scanner.h:34
_php_json_scanner::cursor
php_json_ctype * cursor
Definition
php_json_scanner.h:26
_php_json_scanner::pstr
php_json_ctype * pstr
Definition
php_json_scanner.h:32
_php_json_scanner::token
php_json_ctype * token
Definition
php_json_scanner.h:27
_php_json_scanner::str_start
php_json_ctype * str_start
Definition
php_json_scanner.h:31
_php_json_scanner::value
zval value
Definition
php_json_scanner.h:33
_php_json_scanner::errcode
php_json_error_code errcode
Definition
php_json_scanner.h:37
zval
struct _zval_struct zval
Definition
zend_builtin_functions.h:25
ext
json
php_json_scanner.h
Generated on Sat Aug 23 2025 01:46:09 for php-internal-docs by
1.13.2