Annotation of embedaddon/php/ext/json/JSON_parser.h, revision 1.1.1.2

1.1       misho       1: /* JSON_parser.h */
                      2: 
                      3: #ifndef JSON_PARSER_H
                      4: #define JSON_PARSER_H
                      5: 
                      6: #include "php.h"
                      7: #include "ext/standard/php_smart_str.h"
1.1.1.2 ! misho       8: #include "php_json.h"
1.1       misho       9: 
                     10: #define JSON_PARSER_DEFAULT_DEPTH 512
                     11: 
                     12: typedef struct JSON_parser_struct {
                     13:     int state;
                     14:     int depth;
                     15:     int top;
                     16:        int error_code;
                     17:     int* stack;
                     18:     zval **the_zstack;
                     19:     zval *the_static_zstack[JSON_PARSER_DEFAULT_DEPTH];
                     20: } * JSON_parser;
                     21: 
                     22: enum error_codes {
                     23:        PHP_JSON_ERROR_NONE = 0,
                     24:     PHP_JSON_ERROR_DEPTH, 
                     25:     PHP_JSON_ERROR_STATE_MISMATCH,  
                     26:     PHP_JSON_ERROR_CTRL_CHAR,   
                     27:     PHP_JSON_ERROR_SYNTAX,
                     28:     PHP_JSON_ERROR_UTF8
                     29: };
                     30: 
                     31: extern JSON_parser new_JSON_parser(int depth);
1.1.1.2 ! misho      32: extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC);
1.1       misho      33: extern int free_JSON_parser(JSON_parser jp);
1.1.1.2 ! misho      34: 
        !            35: static inline int parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int assoc TSRMLS_DC)
        !            36: {
        !            37:        return parse_JSON_ex(jp, z, utf16_json, length, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0 TSRMLS_CC);
        !            38: }
        !            39: 
1.1       misho      40: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>