Move smart_str implementation into Zend/

So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
This commit is contained in:
Nikita Popov 2014-09-20 22:42:02 +02:00
parent e1fe5cb8c2
commit e33f3d3b7c
64 changed files with 69 additions and 78 deletions

View File

@ -16,15 +16,11 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef ZEND_SMART_STR_H
#define ZEND_SMART_STR_H
#ifndef PHP_SMART_STR_H
#define PHP_SMART_STR_H
#include "php_smart_str_public.h"
#include <stdlib.h>
#include <zend.h>
#include "zend_smart_str_public.h"
#ifndef SMART_STR_PREALLOC
#define SMART_STR_PREALLOC 128
@ -34,8 +30,6 @@
#define SMART_STR_START_SIZE 78
#endif
/* wrapper */
#define smart_str_appends_ex(dest, src, what) \
smart_str_appendl_ex((dest), (src), strlen(src), (what))
#define smart_str_appends(dest, src) \
@ -122,3 +116,4 @@ static zend_always_inline void smart_str_setl(smart_str *dest, const char *src,
}
#endif

View File

@ -16,12 +16,8 @@
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_SMART_STR_PUBLIC_H
#define PHP_SMART_STR_PUBLIC_H
#include <sys/types.h>
#ifndef ZEND_SMART_STR_PUBLIC_H
#define ZEND_SMART_STR_PUBLIC_H
typedef struct {
zend_string *s;

View File

@ -82,7 +82,7 @@
#define SMART_STR_PREALLOC 4096
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/info.h"
#include "ext/standard/file.h"
#include "ext/standard/url.h"

View File

@ -23,7 +23,7 @@
#define _PHP_CURL_H
#include "php.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str_public.h"
#ifdef COMPILE_DL_CURL
#undef HAVE_CURL

View File

@ -999,7 +999,7 @@ PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D)
/* {{{ date() and gmdate() data */
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
static char *mon_full_names[] = {
"January", "February", "March", "April",

View File

@ -519,7 +519,7 @@ PHP_MSHUTDOWN_FUNCTION(dba)
}
/* }}} */
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
/* {{{ PHP_MINFO_FUNCTION
*/

View File

@ -20,7 +20,7 @@
#include "php_filter.h"
#include "filter_private.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
/* {{{ STRUCTS */
typedef unsigned long filter_map[256];

View File

@ -25,7 +25,7 @@
#include "php_gmp.h"
#include "ext/standard/info.h"
#include "ext/standard/php_var.h"
#include "ext/standard/php_smart_str_public.h"
#include "zend_smart_str_public.h"
#include "zend_exceptions.h"
#if HAVE_GMP

View File

@ -55,7 +55,7 @@
#undef iconv
#endif
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/base64.h"
#include "ext/standard/quot_print.h"

View File

@ -40,7 +40,7 @@
#include "ext/standard/php_string.h"
#include "ext/standard/info.h"
#include "ext/standard/file.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/pcre/php_pcre.h"
#ifdef ERROR

View File

@ -21,7 +21,7 @@
#include <unicode/utypes.h>
#include <unicode/parseerr.h>
#include <ext/standard/php_smart_str.h>
#include <zend_smart_str_public.h>
#define INTL_ERROR_CODE(e) (e).code

View File

@ -36,7 +36,7 @@
#include <zend.h>
#include <php.h>
#include "main/php_ini.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
ZEND_EXTERN_MODULE_GLOBALS( intl )

View File

@ -21,7 +21,7 @@
#include <unicode/utypes.h>
#include <unicode/utrans.h>
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str_public.h"
void transliterator_register_constants( INIT_FUNC_ARGS );
smart_str transliterator_parse_error_to_string( UParseError* pe );

View File

@ -4,8 +4,8 @@
#define JSON_PARSER_H
#include "php.h"
#include "ext/standard/php_smart_str.h"
#include "php_json.h"
#include "zend_smart_str.h"
#define JSON_PARSER_DEFAULT_DEPTH 512

View File

@ -26,7 +26,7 @@
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/html.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "JSON_parser.h"
#include "php_json.h"
#include <zend_exceptions.h>

View File

@ -22,7 +22,7 @@
#define PHP_JSON_H
#define PHP_JSON_VERSION "1.2.1"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str_public.h"
extern zend_module_entry json_module_entry;
#define phpext_json_ptr &json_module_entry

View File

@ -34,7 +34,7 @@ extern zend_module_entry libxml_module_entry;
# define PHP_LIBXML_API
#endif
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str_public.h"
#include <libxml/tree.h>
#define LIBXML_SAVE_NOEMPTYTAG 1<<2

View File

@ -28,7 +28,7 @@
#if HAVE_MBREGEX
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/info.h"
#include "php_mbregex.h"
#include "mbstring.h"

View File

@ -40,7 +40,7 @@
#include "php_globals.h"
#include "ext/standard/info.h"
#include "ext/standard/php_rand.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "php_mcrypt_filter.h"
static int le_mcrypt;
@ -452,7 +452,7 @@ static PHP_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */
}
/* }}} */
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
PHP_MINFO_FUNCTION(mcrypt) /* {{{ */
{

View File

@ -30,7 +30,7 @@
#include "php_ini.h"
#include "php_globals.h"
#include "ext/standard/info.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "php_mysqli_structs.h"
#include "mysqli_priv.h"

View File

@ -29,7 +29,7 @@
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "php_mysqli_structs.h"
#include "mysqli_priv.h"

View File

@ -27,7 +27,7 @@
#include "mysqlnd_statistics.h"
#include "mysqlnd_charset.h"
#include "mysqlnd_debug.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
/*
TODO :

View File

@ -539,7 +539,7 @@ void _mysqlnd_free(void *ptr MYSQLND_MEM_D)
#define SMART_STR_START_SIZE 2048
#define SMART_STR_PREALLOC 512
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
/* {{{ _mysqlnd_pestrndup */

View File

@ -23,7 +23,7 @@
#ifndef MYSQLND_STRUCTS_H
#define MYSQLND_STRUCTS_H
#include "ext/standard/php_smart_str_public.h"
#include "zend_smart_str_public.h"
#define MYSQLND_TYPEDEFED_METHODS

View File

@ -27,7 +27,7 @@
#include "mysqlnd_statistics.h"
#include "mysqlnd_reverse_api.h"
#include "ext/standard/info.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
/* {{{ mysqlnd_functions[]
*

View File

@ -33,7 +33,7 @@
#include "php.h"
#include "ext/standard/info.h"
#include "php_ini.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#if HAVE_OCI8

View File

@ -28,7 +28,7 @@
#include "ext/standard/file.h"
#include "ext/standard/url.h"
#include "streams/php_streams_int.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "php_openssl.h"
#include "php_network.h"
#include <openssl/ssl.h>

View File

@ -23,7 +23,7 @@
#include "php_globals.h"
#include "php_pcre.h"
#include "ext/standard/info.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#if HAVE_PCRE || HAVE_BUNDLED_PCRE

View File

@ -35,7 +35,7 @@
#include "php.h"
#include "php_ini.h"
#include "ext/standard/php_standard.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/ereg/php_regex.h"
#ifdef PHP_WIN32
# include "win32/time.h"

View File

@ -35,6 +35,7 @@
#include "zend_operators.h"
#include "zend_qsort.h"
#include "zend_vm.h"
#include "zend_smart_str.h"
#include "main/php_streams.h"
#include "main/streams/php_stream_plain_wrapper.h"
#include "main/SAPI.h"
@ -49,7 +50,6 @@
#include "ext/standard/md5.h"
#include "ext/standard/sha1.h"
#include "ext/standard/php_var.h"
#include "ext/standard/php_smart_str.h"
#include "ext/standard/php_versioning.h"
#ifndef PHP_WIN32
#include "TSRM/tsrm_strtok_r.h"

View File

@ -42,7 +42,7 @@
#include "php_main.h"
#include "fopen_wrappers.h"
#include "ext/standard/php_standard.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#ifdef __riscos__
#include <unixlib/local.h>

View File

@ -20,7 +20,7 @@
/* $Id$ */
#include "php.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str_public.h"
ZEND_BEGIN_MODULE_GLOBALS(cli_readline)
char *pager;

View File

@ -48,7 +48,7 @@
#include "ext/standard/url_scanner_ex.h"
#include "ext/standard/php_rand.h" /* for RAND_MAX */
#include "ext/standard/info.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/url.h"
#include "ext/standard/basic_functions.h"
#include "ext/standard/head.h"

View File

@ -29,7 +29,7 @@
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
#include "ext/session/php_session.h"
#endif
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "php_ini.h"
#include "SAPI.h"
#include <libxml/parser.h>

View File

@ -6,7 +6,7 @@
#endif
#include <Zend/zend_llist.h>
#include <ext/standard/php_smart_str.h>
#include <zend_smart_str.h>
#ifndef PHP_WIN32
# include <sys/types.h>

View File

@ -26,7 +26,7 @@
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/php_var.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "zend_interfaces.h"
#include "zend_exceptions.h"

View File

@ -29,7 +29,7 @@
#include "php_spl.h"
#include "ext/standard/info.h"
#include "ext/standard/php_var.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "spl_functions.h"
#include "spl_engine.h"
#include "spl_iterators.h"

View File

@ -35,7 +35,7 @@
#include "spl_directory.h"
#include "spl_array.h"
#include "spl_exceptions.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#ifdef accept
#undef accept

View File

@ -28,7 +28,7 @@
#include "ext/standard/info.h"
#include "ext/standard/php_array.h"
#include "ext/standard/php_var.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "zend_interfaces.h"
#include "zend_exceptions.h"

View File

@ -45,7 +45,7 @@
#include "basic_functions.h"
#include "php_string.h"
#include "php_rand.h"
#include "php_smart_str.h"
#include "zend_smart_str.h"
#ifdef HAVE_SPL
#include "ext/spl/spl_array.h"
#endif

View File

@ -35,7 +35,7 @@
#include "php_open_temporary_file.h"
#include "ext/standard/basic_functions.h"
#include "php_ini.h"
#include "php_smart_str.h"
#include "zend_smart_str.h"
#include <stdio.h>
#include <stdlib.h>

View File

@ -27,7 +27,7 @@
#include "ext/standard/basic_functions.h"
#include "ext/standard/file.h"
#include "ext/standard/php_string.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
/* {{{ rot13 stream filter implementation */
static char rot13_from[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

View File

@ -27,7 +27,7 @@
#include "php_network.h"
#include "php_ini.h"
#include "ext/standard/basic_functions.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include <stdio.h>
#include <stdlib.h>

View File

@ -22,7 +22,7 @@
#define PHP_HTTP_H
#include "php.h"
#include "php_smart_str.h"
#include "zend_smart_str.h"
PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *num_prefix, int num_prefix_len,

View File

@ -22,7 +22,7 @@
#define PHP_VAR_H
#include "ext/standard/basic_functions.h"
#include "ext/standard/php_smart_str_public.h"
#include "zend_smart_str_public.h"
PHP_FUNCTION(var_dump);
PHP_FUNCTION(var_export);

View File

@ -56,7 +56,7 @@
#include "zend_execute.h"
#include "php_globals.h"
#include "basic_functions.h"
#include "php_smart_str.h"
#include "zend_smart_str.h"
#include <Zend/zend_exceptions.h>
#ifdef ZTS
#include "TSRM.h"

View File

@ -42,7 +42,7 @@
#define url_scanner url_scanner_ex
#include "php_smart_str.h"
#include "zend_smart_str.h"
static void tag_dtor(zval *zv)
{

View File

@ -31,7 +31,7 @@ PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, co
PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC);
PHPAPI int php_url_scanner_reset_vars(TSRMLS_D);
#include "php_smart_str_public.h"
#include "zend_smart_str_public.h"
typedef struct {
/* Used by the mainloop of the scanner */

View File

@ -40,7 +40,7 @@
#define url_scanner url_scanner_ex
#include "php_smart_str.h"
#include "zend_smart_str.h"
static void tag_dtor(zval *zv)
{

View File

@ -28,7 +28,7 @@
#include "php.h"
#include "php_string.h"
#include "php_var.h"
#include "php_smart_str.h"
#include "zend_smart_str.h"
#include "basic_functions.h"
#include "php_incomplete_class.h"

View File

@ -27,7 +27,7 @@
#include "ext/standard/info.h"
#include "php_sysvmsg.h"
#include "ext/standard/php_var.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
/* In order to detect MSG_EXCEPT use at run time; we have no way
* of knowing what the bit definitions are, so we can't just define

View File

@ -36,7 +36,7 @@
#include "php_sysvshm.h"
#include "ext/standard/php_var.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "php_ini.h"
/* {{{ arginfo */

View File

@ -21,7 +21,7 @@
#ifndef PHP_WDDX_API_H
#define PHP_WDDX_API_H
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str_public.h"
#define WDDX_ARRAY_S "<array length='%d'>"
#define WDDX_ARRAY_E "</array>"

View File

@ -35,7 +35,7 @@
#include "ext/standard/php_incomplete_class.h"
#include "ext/standard/base64.h"
#include "ext/standard/info.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/html.h"
#include "ext/standard/php_string.h"
#include "ext/date/php_date.h"

View File

@ -23,7 +23,7 @@
#include "php.h"
#include "ext/standard/php_standard.h"
#include "ext/standard/credits.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "php_variables.h"
#include "php_globals.h"
#include "php_content_types.h"

View File

@ -111,7 +111,7 @@
#define FLOAT_DIGITS 6
#define EXPONENT_LENGTH 10
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/php_smart_string.h"
/* {{{ macros */

View File

@ -22,7 +22,7 @@
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
#include "php.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/info.h"
#include "SAPI.h"

View File

@ -30,7 +30,7 @@
#include "php_variables.h"
#include "SAPI.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#ifndef NETWARE
#include "ext/standard/php_standard.h"
#else

View File

@ -21,7 +21,7 @@
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
#include "php.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/info.h"
#include "ext/standard/head.h"
#include "php_ini.h"

View File

@ -30,7 +30,7 @@
#include <fcntl.h>
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#ifndef NETWARE
#include "ext/standard/php_standard.h"
#else

View File

@ -96,7 +96,7 @@
#endif
#include "ext/standard/file.h" /* for php_set_sock_blocking() :-( */
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "ext/standard/html.h"
#include "ext/standard/url.h" /* for php_url_decode() */
#include "ext/standard/php_string.h" /* for php_dirname() */

View File

@ -27,7 +27,7 @@
#include "php_ini.h"
#include "zend_highlight.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include <sys/time.h>
#include <sys/types.h>

View File

@ -240,7 +240,7 @@ diff -ur thttpd-2.21b/libhttpd.c thttpd-2.21b-cool/libhttpd.c
+
+#define SMART_STR_USE_REALLOC
+
+#include "ext/standard/php_smart_str.h"
+#include "zend_smart_str.h"
static void
-send_mime( httpd_conn* hc, int status, char* title, char* encodings, char* extraheads, char* type, int length, time_t mod )

View File

@ -21,7 +21,7 @@
#include "php_main.h"
#include "php_variables.h"
#include "ext/standard/php_smart_str.h"
#include "zend_smart_str.h"
#include "tuxmodule.h"