From 2f51153283a3e37de122c1ae5608aa1d0ef76f19 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 14 Mar 2017 09:25:27 +0100 Subject: php-pecl-mysql-xdevapi: 1.0.1 --- REFLECTION | 402 ++++++++++++++++++++++++++++++++++++++++++-- mysql_xdevapi-build.patch | 42 ++--- php-pecl-mysql-xdevapi.spec | 18 +- php_json.h | 114 ------------- php_json_parser.h | 87 ---------- php_json_scanner.h | 47 ------ 6 files changed, 406 insertions(+), 304 deletions(-) delete mode 100644 php_json.h delete mode 100644 php_json_parser.h delete mode 100644 php_json_scanner.h diff --git a/REFLECTION b/REFLECTION index 3531c0d..36e6ae9 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { +Extension [ extension #61 mysql_xdevapi version 1.0.1 ] { - Dependencies { Dependency [ standard (Required) ] @@ -34,20 +34,14 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { - Functions { Function [ function mysql_xdevapi\getSession ] { - - Parameters [4] { - Parameter #0 [ string $hostname ] - Parameter #1 [ string $username ] - Parameter #2 [ string $password ] - Parameter #3 [ integer $port ] + - Parameters [1] { + Parameter #0 [ string $uri_string ] } } Function [ function mysql_xdevapi\getNodeSession ] { - - Parameters [4] { - Parameter #0 [ string $hostname ] - Parameter #1 [ string $username ] - Parameter #2 [ string $password ] - Parameter #3 [ integer $port ] + - Parameters [1] { + Parameter #0 [ string $uri_string ] } } Function [ function mysql_xdevapi\expression ] { @@ -58,7 +52,7 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { } } - - Classes [35] { + - Classes [41] { Interface [ interface mysql_xdevapi\DatabaseObject ] { - Constants [0] { @@ -467,7 +461,7 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { Class [ final class mysql_xdevapi\Driver ] { - Constants [1] { - Constant [ public string version ] { 1.0.0 } + Constant [ public string version ] { 1.0.1 } } - Static properties [0] { @@ -876,7 +870,7 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { Property [ public $name ] } - - Methods [11] { + - Methods [14] { Method [ private method __construct ] { } @@ -942,6 +936,28 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { - Parameters [0] { } } + + Method [ public method createView ] { + + - Parameters [2] { + Parameter #0 [ string $view_name ] + Parameter #1 [ integer $replace_existing ] + } + } + + Method [ public method alterView ] { + + - Parameters [1] { + Parameter #0 [ string $view_name ] + } + } + + Method [ public method dropView ] { + + - Parameters [1] { + Parameter #0 [ string $view_name ] + } + } } } @@ -960,7 +976,7 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { Property [ public $name ] } - - Methods [10] { + - Methods [12] { Method [ private method __construct ] { } @@ -1021,6 +1037,21 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { Parameter #0 [ string $search_condition ] } } + + Method [ public method createIndex ] { + + - Parameters [2] { + Parameter #0 [ string $index_name ] + Parameter #1 [ integer $is_unique ] + } + } + + Method [ public method dropIndex ] { + + - Parameters [1] { + Parameter #0 [ string $index_name ] + } + } } } @@ -1050,6 +1081,67 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { } } + Class [ class mysql_xdevapi\NodeCollectionCreateIndex implements mysql_xdevapi\Executable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [3] { + Method [ private method __construct ] { + } + + Method [ public method field ] { + + - Parameters [3] { + Parameter #0 [ string $doc_path ] + Parameter #1 [ string $column_type ] + Parameter #2 [ integer $is_required ] + } + } + + Method [ public method execute ] { + + - Parameters [0] { + } + } + } + } + + Class [ class mysql_xdevapi\NodeCollectionDropIndex implements mysql_xdevapi\Executable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [2] { + Method [ private method __construct ] { + } + + Method [ public method execute ] { + + - Parameters [0] { + } + } + } + } + Class [ class mysql_xdevapi\NodeCollectionFind implements mysql_xdevapi\Executable, mysql_xdevapi\CrudOperationBindable, mysql_xdevapi\CrudOperationLimitable, mysql_xdevapi\CrudOperationSkippable, mysql_xdevapi\CrudOperationSortable ] { - Constants [0] { @@ -1064,7 +1156,7 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { - Properties [0] { } - - Methods [8] { + - Methods [9] { Method [ private method __construct ] { } @@ -1082,6 +1174,13 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { } } + Method [ public method having ] { + + - Parameters [1] { + Parameter #0 [ $sort_expr ] + } + } + Method [ public method bind ] { - Parameters [1] { @@ -1175,7 +1274,7 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { Method [ public method unset ] { - Parameters [1] { - Parameter #0 [ array $variables ] + Parameter #0 [ $variables ] } } @@ -1272,6 +1371,175 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { } } + Class [ class mysql_xdevapi\ViewCreate implements mysql_xdevapi\Executable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [8] { + Method [ private method __construct ] { + } + + Method [ public method definer ] { + + - Parameters [1] { + Parameter #0 [ string $definer ] + } + } + + Method [ public method algorithm ] { + + - Parameters [1] { + Parameter #0 [ string $algorithm ] + } + } + + Method [ public method security ] { + + - Parameters [1] { + Parameter #0 [ string $security ] + } + } + + Method [ public method withCheckOption ] { + + - Parameters [1] { + Parameter #0 [ string $check_option ] + } + } + + Method [ public method columns ] { + + - Parameters [1] { + Parameter #0 [ $columns ] + } + } + + Method [ public method definedAs ] { + + - Parameters [1] { + Parameter #0 [ object $defined_as ] + } + } + + Method [ public method execute ] { + + - Parameters [0] { + } + } + } + } + + Class [ class mysql_xdevapi\ViewAlter implements mysql_xdevapi\Executable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [8] { + Method [ private method __construct ] { + } + + Method [ public method definer ] { + + - Parameters [1] { + Parameter #0 [ string $definer ] + } + } + + Method [ public method algorithm ] { + + - Parameters [1] { + Parameter #0 [ string $algorithm ] + } + } + + Method [ public method security ] { + + - Parameters [1] { + Parameter #0 [ string $security ] + } + } + + Method [ public method withCheckOption ] { + + - Parameters [1] { + Parameter #0 [ string $check_option ] + } + } + + Method [ public method columns ] { + + - Parameters [1] { + Parameter #0 [ $columns ] + } + } + + Method [ public method definedAs ] { + + - Parameters [1] { + Parameter #0 [ object $defined_as ] + } + } + + Method [ public method execute ] { + + - Parameters [0] { + } + } + } + } + + Class [ class mysql_xdevapi\ViewDrop implements mysql_xdevapi\Executable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [3] { + Method [ private method __construct ] { + } + + Method [ public method ifExists ] { + + - Parameters [1] { + Parameter #0 [ boolean $if_exists ] + } + } + + Method [ public method execute ] { + + - Parameters [0] { + } + } + } + } + Class [ class mysql_xdevapi\NodeStatement ] { - Constants [2] { @@ -1646,6 +1914,98 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { } } + Class [ class mysql_xdevapi\ColumnResult ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [13] { + Method [ private method __construct ] { + } + + Method [ public method getSchemaName ] { + + - Parameters [0] { + } + } + + Method [ public method getTableName ] { + + - Parameters [0] { + } + } + + Method [ public method getTableLabel ] { + + - Parameters [0] { + } + } + + Method [ public method getColumnName ] { + + - Parameters [0] { + } + } + + Method [ public method getColumnLabel ] { + + - Parameters [0] { + } + } + + Method [ public method getLength ] { + + - Parameters [0] { + } + } + + Method [ public method getFractionalDigits ] { + + - Parameters [0] { + } + } + + Method [ public method isNumberSigned ] { + + - Parameters [0] { + } + } + + Method [ public method getCollationName ] { + + - Parameters [0] { + } + } + + Method [ public method getCharacterSetName ] { + + - Parameters [0] { + } + } + + Method [ public method getType ] { + + - Parameters [0] { + } + } + + Method [ public method isPadded ] { + + - Parameters [0] { + } + } + } + } + Class [ class mysql_xdevapi\NodeTable implements mysql_xdevapi\SchemaObject, mysql_xdevapi\DatabaseObject ] { - Constants [0] { @@ -1661,7 +2021,7 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { Property [ public $name ] } - - Methods [10] { + - Methods [11] { Method [ private method __construct ] { } @@ -1677,6 +2037,12 @@ Extension [ extension #61 mysql_xdevapi version 1.0.0 ] { } } + Method [ public method isView ] { + + - Parameters [0] { + } + } + Method [ public method existsInDatabase ] { - Parameters [0] { diff --git a/mysql_xdevapi-build.patch b/mysql_xdevapi-build.patch index c5547ae..74af55c 100644 --- a/mysql_xdevapi-build.patch +++ b/mysql_xdevapi-build.patch @@ -1,29 +1,13 @@ -diff -up mysql_xdevapi-1.0.0/config.m4.old mysql_xdevapi-1.0.0/config.m4 ---- mysql_xdevapi-1.0.0/config.m4.old 2016-12-08 16:59:44.000000000 +0100 -+++ mysql_xdevapi-1.0.0/config.m4 2016-12-08 17:01:29.000000000 +0100 -@@ -170,15 +170,8 @@ if test "$PHP_MYSQL_XDEVAPI" != "no" || - - - AC_DEFINE([MYSQL_XDEVAPI_SSL_SUPPORTED], 1, [Enable core xmysqlnd SSL code]) -+ AC_DEFINE(MYSQL_XDEVAPI_HAVE_SSL,1,[Enable mysql_xdevapi code that uses OpenSSL directly]) - -- test -z "$PHP_OPENSSL" && PHP_OPENSSL=no -- -- if test "$PHP_OPENSSL" != "no" || test "$PHP_OPENSSL_DIR" != "no"; then -- AC_CHECK_LIB(ssl, DSA_get_default_method, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later])) -- AC_CHECK_LIB(crypto, X509_free, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later])) -- -- PHP_SETUP_OPENSSL(MYSQL_XDEVAPI_SHARED_LIBADD, [AC_DEFINE(MYSQL_XDEVAPI_HAVE_SSL,1,[Enable mysql_xdevapi code that uses OpenSSL directly])]) -- fi - - if test "$PHP_MYSQLND" != "yes" && test "$PHP_MYSQLND_ENABLED" != "yes" && test "$PHP_MYSQLI" != "yes" && test "$PHP_MYSQLI" != "mysqlnd"; then - dnl Enable mysqlnd build in case it wasn't passed explicitly in cmd-line -@@ -194,8 +187,6 @@ if test "$PHP_MYSQL_XDEVAPI" != "no" || - - PHP_SUBST(MYSQL_XDEVAPI_SHARED_LIBADD) - -- PHP_ADD_BUILD_DIR($ext_builddir/messages) -- PHP_ADD_BUILD_DIR($ext_builddir/proto_gen) - - this_ext_sources="$xmysqlnd_protobuf_sources $xmysqlnd_expr_parser $xmysqlnd_sources $mysqlx_base_sources $mysqlx_messages" - PHP_NEW_EXTENSION(mysql_xdevapi, $this_ext_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) +diff -up ./config.m4.old ./config.m4 +--- ./config.m4.old 2017-03-14 08:58:13.000000000 +0100 ++++ ./config.m4 2017-03-14 08:58:19.000000000 +0100 +@@ -22,6 +22,9 @@ PHP_ARG_ENABLE(mysql-xdevapi-message-cla + [ --enable-mysql-xdevapi-message-classes + Enable support for the experimental message classes in mysql-xdevapi], yes, no) + ++PHP_ARG_WITH(openssl, for OpenSSL support, ++[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 1.0.1)]) ++ + dnl If some extension uses mysql-xdevapi it will get compiled in PHP core + if test "$PHP_MYSQL_XDEVAPI" != "no" || test "$PHP_MYSQL_XDEVAPI_ENABLED" = "yes"; then + PHP_REQUIRE_CXX diff --git a/php-pecl-mysql-xdevapi.spec b/php-pecl-mysql-xdevapi.spec index 8d412ef..1b9a35b 100644 --- a/php-pecl-mysql-xdevapi.spec +++ b/php-pecl-mysql-xdevapi.spec @@ -19,17 +19,13 @@ Summary: MySQL database access functions Name: %{?sub_prefix}php-pecl-mysql-xdevapi -Version: 1.0.0 +Version: 1.0.1 Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz -# From 7.1.0 official archive -Source1: php_json.h -Source2: php_json_parser.h -Source3: php_json_scanner.h # Workaround for out-of-tree build Patch0: %{pecl_name}-build.patch @@ -41,6 +37,7 @@ BuildRequires: %{?scl_prefix}php-pear BuildRequires: protobuf-devel BuildRequires: protobuf-c-devel BuildRequires: boost-devel +BuildRequires: openssl-devel %if %{with_tests} BuildRequires: community-mysql-server >= 5.7.12 %endif @@ -112,10 +109,6 @@ These are the files needed to compile programs using %{name}. %setup -qc mv %{pecl_name}-%{version} NTS -mkdir -p NTS/ext/json -# Temporary workaround waiting for 7.1.1 -cp %{SOURCE1} %{SOURCE3} %{SOURCE2} NTS/ext/json - %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS @@ -151,6 +144,8 @@ EOF %build +%{?dtsenable} + peclconf() { %configure \ --enable-mysql-xdevapi \ @@ -171,6 +166,8 @@ make %{?_smp_mflags} %install +%{?dtsenable} + # Install the NTS stuff make -C NTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -311,6 +308,9 @@ fi %changelog +* Tue Mar 14 2017 Remi Collet - 1.0.1-1 +- Update to 1.0.1 + * Thu Dec 8 2016 Remi Collet - 1.0.0-1 - initial package, version 1.0.0 (alpha) diff --git a/php_json.h b/php_json.h deleted file mode 100644 index cedb8ae..0000000 --- a/php_json.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2016 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Omar Kilani | - | Jakub Zelenka | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_JSON_H -#define PHP_JSON_H - -#define PHP_JSON_VERSION "1.5.0" -#include "zend_smart_str_public.h" - -extern zend_module_entry json_module_entry; -#define phpext_json_ptr &json_module_entry - -#if defined(PHP_WIN32) && defined(JSON_EXPORTS) -#define PHP_JSON_API __declspec(dllexport) -#else -#define PHP_JSON_API PHPAPI -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -extern PHP_JSON_API zend_class_entry *php_json_serializable_ce; - -/* error codes */ -typedef enum { - PHP_JSON_ERROR_NONE = 0, - PHP_JSON_ERROR_DEPTH, - PHP_JSON_ERROR_STATE_MISMATCH, - PHP_JSON_ERROR_CTRL_CHAR, - PHP_JSON_ERROR_SYNTAX, - PHP_JSON_ERROR_UTF8, - PHP_JSON_ERROR_RECURSION, - PHP_JSON_ERROR_INF_OR_NAN, - PHP_JSON_ERROR_UNSUPPORTED_TYPE, - PHP_JSON_ERROR_INVALID_PROPERTY_NAME, - PHP_JSON_ERROR_UTF16 -} php_json_error_code; - -/* json_encode() options */ -#define PHP_JSON_HEX_TAG (1<<0) -#define PHP_JSON_HEX_AMP (1<<1) -#define PHP_JSON_HEX_APOS (1<<2) -#define PHP_JSON_HEX_QUOT (1<<3) -#define PHP_JSON_FORCE_OBJECT (1<<4) -#define PHP_JSON_NUMERIC_CHECK (1<<5) -#define PHP_JSON_UNESCAPED_SLASHES (1<<6) -#define PHP_JSON_PRETTY_PRINT (1<<7) -#define PHP_JSON_UNESCAPED_UNICODE (1<<8) -#define PHP_JSON_PARTIAL_OUTPUT_ON_ERROR (1<<9) -#define PHP_JSON_PRESERVE_ZERO_FRACTION (1<<10) -#define PHP_JSON_UNESCAPED_LINE_TERMINATORS (1<<11) - -/* json_decode() options */ -#define PHP_JSON_OBJECT_AS_ARRAY (1<<0) -#define PHP_JSON_BIGINT_AS_STRING (1<<1) - -/* Internal flags */ -#define PHP_JSON_OUTPUT_ARRAY 0 -#define PHP_JSON_OUTPUT_OBJECT 1 - -/* default depth */ -#define PHP_JSON_PARSER_DEFAULT_DEPTH 512 - -ZEND_BEGIN_MODULE_GLOBALS(json) - int encoder_depth; - int encode_max_depth; - php_json_error_code error_code; -ZEND_END_MODULE_GLOBALS(json) - -PHP_JSON_API ZEND_EXTERN_MODULE_GLOBALS(json) -#define JSON_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(json, v) - -#if defined(ZTS) && defined(COMPILE_DL_JSON) -ZEND_TSRMLS_CACHE_EXTERN() -#endif - -PHP_JSON_API int php_json_encode(smart_str *buf, zval *val, int options); -PHP_JSON_API int php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth); - -static inline int php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, zend_long depth) -{ - return php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth); -} - - -#endif /* PHP_JSON_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/php_json_parser.h b/php_json_parser.h deleted file mode 100644 index afead52..0000000 --- a/php_json_parser.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2016 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Jakub Zelenka | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_JSON_PARSER_H -#define PHP_JSON_PARSER_H - -#include "php.h" -#include "php_json_scanner.h" - -typedef struct _php_json_parser php_json_parser; - -typedef int (*php_json_parser_func_array_create_t)( - php_json_parser *parser, zval *array); -typedef int (*php_json_parser_func_array_append_t)( - php_json_parser *parser, zval *array, zval *zvalue); -typedef int (*php_json_parser_func_array_start_t)( - php_json_parser *parser); -typedef int (*php_json_parser_func_array_end_t)( - php_json_parser *parser, zval *object); -typedef int (*php_json_parser_func_object_create_t)( - php_json_parser *parser, zval *object); -typedef int (*php_json_parser_func_object_update_t)( - php_json_parser *parser, zval *object, zend_string *key, zval *zvalue); -typedef int (*php_json_parser_func_object_start_t)( - php_json_parser *parser); -typedef int (*php_json_parser_func_object_end_t)( - php_json_parser *parser, zval *object); - -typedef struct _php_json_parser_methods { - php_json_parser_func_array_create_t array_create; - php_json_parser_func_array_append_t array_append; - php_json_parser_func_array_start_t array_start; - php_json_parser_func_array_end_t array_end; - php_json_parser_func_object_create_t object_create; - php_json_parser_func_object_update_t object_update; - php_json_parser_func_object_start_t object_start; - php_json_parser_func_object_end_t object_end; -} php_json_parser_methods; - -struct _php_json_parser { - php_json_scanner scanner; - zval *return_value; - int depth; - int max_depth; - php_json_parser_methods methods; -}; - -PHP_JSON_API void php_json_parser_init_ex( - php_json_parser *parser, - zval *return_value, - char *str, - size_t str_len, - int options, - int max_depth, - const php_json_parser_methods *methods); - -PHP_JSON_API void php_json_parser_init( - php_json_parser *parser, - zval *return_value, - char *str, - size_t str_len, - int options, - int max_depth); - -PHP_JSON_API php_json_error_code php_json_parser_error_code(const php_json_parser *parser); - -PHP_JSON_API int php_json_parse(php_json_parser *parser); - -int php_json_yyparse(php_json_parser *parser); - -#endif /* PHP_JSON_PARSER_H */ - diff --git a/php_json_scanner.h b/php_json_scanner.h deleted file mode 100644 index 0b73a1d..0000000 --- a/php_json_scanner.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2016 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Jakub Zelenka | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_JSON_SCANNER_H -#define PHP_JSON_SCANNER_H - -#include "php.h" -#include "php_json.h" - -typedef unsigned char php_json_ctype; - -typedef struct _php_json_scanner { - php_json_ctype *cursor; /* cursor position */ - php_json_ctype *token; /* token position */ - php_json_ctype *limit; /* the last read character + 1 position */ - php_json_ctype *marker; /* marker position for backtracking */ - php_json_ctype *ctxmarker; /* marker position for context backtracking */ - php_json_ctype *str_start; /* start position of the string */ - php_json_ctype *pstr; /* string pointer for escapes conversion */ - zval value; /* value */ - int str_esc; /* number of extra characters for escaping */ - int state; /* condition state */ - int options; /* options */ - php_json_error_code errcode; /* error type if there is an error */ -} php_json_scanner; - - -void php_json_scanner_init(php_json_scanner *scanner, char *str, size_t str_len, int options); -int php_json_scan(php_json_scanner *s); - -#endif /* PHP_JSON_SCANNER_H */ - -- cgit