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
23typedef unsigned char php_json_ctype;
24
25typedef 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 */
41
42
43void php_json_scanner_init(php_json_scanner *scanner, const char *str, size_t str_len, int options);
45
46#endif /* PHP_JSON_SCANNER_H */
char s[4]
Definition cdf.c:77
php_json_error_code
Definition php_json.h:42
PHP_JSON_API size_t int options
Definition php_json.h:102
unsigned char php_json_ctype
int php_json_scan(php_json_scanner *s)
struct _php_json_scanner php_json_scanner
void php_json_scanner_init(php_json_scanner *scanner, const char *str, size_t str_len, int options)
php_json_ctype * ctxmarker
php_json_ctype * limit
php_json_ctype * marker
php_json_ctype * cursor
php_json_ctype * pstr
php_json_ctype * token
php_json_ctype * str_start
php_json_error_code errcode
struct _zval_struct zval