$82 GRAYBYTE WORDPRESS FILE MANAGER $62

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/php71/usr/include/php/ext/standard/

HOME
Current File : /opt/alt/php71/usr/include/php/ext/standard//php_smart_string.h
/*
   +----------------------------------------------------------------------+
   | PHP Version 7                                                        |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997-2018 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: Sascha Schumann <sascha@schumann.cx>                         |
   |         Xinchen Hui <laruence@php.net>                               |
   +----------------------------------------------------------------------+
 */

/* $Id$ */

#ifndef PHP_SMART_STRING_H
#define PHP_SMART_STRING_H

#include "php_smart_string_public.h"

#include <stdlib.h>
#ifndef SMART_STR_USE_REALLOC
#include <zend.h>
#endif

#define smart_string_0(x) do {										\
	if ((x)->c) {													\
		(x)->c[(x)->len] = '\0';									\
	}																\
} while (0)

#ifndef SMART_STRING_PREALLOC
#define SMART_STRING_PREALLOC 128
#endif

#ifndef SMART_STRING_START_SIZE
#define SMART_STRING_START_SIZE 78
#endif

#ifdef SMART_STRING_USE_REALLOC
#define SMART_STRING_REALLOC(a,b,c) realloc((a),(b))
#else
#define SMART_STRING_REALLOC(a,b,c) perealloc((a),(b),(c))
#endif

#define SMART_STRING_DO_REALLOC(d, what) \
	(d)->c = (char *) SMART_STRING_REALLOC((d)->c, (d)->a + 1, (what))

#define smart_string_alloc4(d, n, what, newlen) do {				\
	if (!(d)->c) {													\
		(d)->len = 0;												\
		newlen = (n);												\
		(d)->a = newlen < SMART_STRING_START_SIZE 					\
				? SMART_STRING_START_SIZE 							\
				: newlen + SMART_STRING_PREALLOC;					\
		SMART_STRING_DO_REALLOC(d, what);							\
	} else {														\
		if(UNEXPECTED((size_t)n > SIZE_MAX - (d)->len)) {					\
			zend_error(E_ERROR, "String size overflow");			\
		}															\
		newlen = (d)->len + (n);									\
		if (newlen >= (d)->a) {										\
			(d)->a = newlen + SMART_STRING_PREALLOC;				\
			SMART_STRING_DO_REALLOC(d, what);						\
		}															\
	}																\
} while (0)

#define smart_string_alloc(d, n, what) \
	smart_string_alloc4((d), (n), (what), newlen)

/* wrapper */

#define smart_string_appends_ex(dest, src, what) \
	smart_string_appendl_ex((dest), (src), strlen(src), (what))
#define smart_string_appends(dest, src) \
	smart_string_appendl((dest), (src), strlen(src))

#define smart_string_appendc(dest, c) \
	smart_string_appendc_ex((dest), (c), 0)
#define smart_string_free(s) \
	smart_string_free_ex((s), 0)
#define smart_string_appendl(dest, src, len) \
	smart_string_appendl_ex((dest), (src), (len), 0)
#define smart_string_append(dest, src) \
	smart_string_append_ex((dest), (src), 0)
#define smart_string_append_long(dest, val) \
	smart_string_append_long_ex((dest), (val), 0)
#define smart_string_append_unsigned(dest, val) \
	smart_string_append_unsigned_ex((dest), (val), 0)

#define smart_string_appendc_ex(dest, ch, what) do {					\
	size_t __nl;													\
	smart_string_alloc4((dest), 1, (what), __nl);						\
	(dest)->len = __nl;												\
	((unsigned char *) (dest)->c)[(dest)->len - 1] = (ch);			\
} while (0)

#define smart_string_free_ex(s, what) do {								\
	smart_string *__s = (smart_string *) (s);								\
	if (__s->c) {													\
		pefree(__s->c, what);										\
		__s->c = NULL;												\
	}																\
	__s->a = __s->len = 0;											\
} while (0)

#define smart_string_appendl_ex(dest, src, nlen, what) do {			\
	size_t __nl;													\
	smart_string *__dest = (smart_string *) (dest);						\
																	\
	smart_string_alloc4(__dest, (nlen), (what), __nl);					\
	memcpy(__dest->c + __dest->len, (src), (nlen));					\
	__dest->len = __nl;												\
} while (0)

#define smart_string_append_generic_ex(dest, num, type, vartype, func) do {	\
	char __b[32];															\
	char *__t = zend_print##func##_to_buf(__b + sizeof(__b) - 1, (num));	\
	smart_string_appendl_ex((dest), __t, __b + sizeof(__b) - 1 - __t, (type));	\
} while (0)

#define smart_string_append_unsigned_ex(dest, num, type) \
	smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _ulong)

#define smart_string_append_long_ex(dest, num, type) \
	smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _long)

#define smart_string_append_ex(dest, src, what) \
	smart_string_appendl_ex((dest), ((smart_string *)(src))->c, \
		((smart_string *)(src))->len, (what));


#define smart_string_setl(dest, src, nlen) do {						\
	(dest)->len = (nlen);											\
	(dest)->a = (nlen) + 1;											\
	(dest)->c = (char *) (src);										\
} while (0)

#define smart_string_sets(dest, src) \
	smart_string_setl((dest), (src), strlen(src));

#endif

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
13 Aug 2025 1.54 AM
root / 996
0755
base64.h
1.557 KB
9 Jul 2025 2.45 PM
root / 996
0644
basic_functions.h
7.55 KB
9 Jul 2025 2.45 PM
root / 996
0644
crc32.h
4.78 KB
9 Jul 2025 2.45 PM
root / 996
0644
credits.h
1.686 KB
9 Jul 2025 2.45 PM
root / 996
0644
credits_ext.h
5.386 KB
9 Jul 2025 2.45 PM
root / 996
0644
credits_sapi.h
0.831 KB
9 Jul 2025 2.45 PM
root / 996
0644
crypt_blowfish.h
1.023 KB
9 Jul 2025 2.45 PM
root / 996
0644
crypt_freesec.h
0.649 KB
9 Jul 2025 2.45 PM
root / 996
0644
css.h
1.205 KB
9 Jul 2025 2.45 PM
root / 996
0644
cyr_convert.h
1.236 KB
9 Jul 2025 2.45 PM
root / 996
0644
datetime.h
1.354 KB
9 Jul 2025 2.45 PM
root / 996
0644
dl.h
1.552 KB
9 Jul 2025 2.45 PM
root / 996
0644
exec.h
1.692 KB
9 Jul 2025 2.45 PM
root / 996
0644
file.h
4.714 KB
9 Jul 2025 2.45 PM
root / 996
0644
flock_compat.h
2.07 KB
9 Jul 2025 2.45 PM
root / 996
0644
fsock.h
1.572 KB
9 Jul 2025 2.45 PM
root / 996
0644
head.h
1.804 KB
9 Jul 2025 2.45 PM
root / 996
0644
html.h
2.651 KB
9 Jul 2025 2.45 PM
root / 996
0644
html_tables.h
472.423 KB
9 Jul 2025 2.45 PM
root / 996
0644
info.h
22.611 KB
9 Jul 2025 2.45 PM
root / 996
0644
md5.h
2.112 KB
9 Jul 2025 2.45 PM
root / 996
0644
microtime.h
1.333 KB
9 Jul 2025 2.45 PM
root / 996
0644
pack.h
1.249 KB
9 Jul 2025 2.45 PM
root / 996
0644
pageinfo.h
1.435 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_array.h
4.378 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_assert.h
1.396 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_browscap.h
1.296 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_crypt.h
1.622 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_crypt_r.h
2.004 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_dir.h
1.674 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_dns.h
2.932 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_ext_syslog.h
1.475 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_filestat.h
3.15 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_fopen_wrappers.h
1.927 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_ftok.h
1.234 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_http.h
1.752 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_image.h
2.38 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_incomplete_class.h
2.248 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_iptc.h
1.243 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_lcg.h
1.496 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_link.h
1.339 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_mail.h
1.363 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_math.h
4.657 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_metaphone.h
1.213 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_mt_rand.h
1.967 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_password.h
1.579 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_rand.h
3.246 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_random.h
2.123 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_smart_string.h
5.174 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_smart_string_public.h
1.371 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_standard.h
2.303 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_string.h
5.96 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_type.h
1.603 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_uuencode.h
1.46 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_var.h
3.26 KB
9 Jul 2025 2.45 PM
root / 996
0644
php_versioning.h
1.372 KB
9 Jul 2025 2.45 PM
root / 996
0644
proc_open.h
1.746 KB
9 Jul 2025 2.45 PM
root / 996
0644
quot_print.h
1.463 KB
9 Jul 2025 2.45 PM
root / 996
0644
scanf.h
2.254 KB
9 Jul 2025 2.45 PM
root / 996
0644
sha1.h
1.7 KB
9 Jul 2025 2.45 PM
root / 996
0644
streamsfuncs.h
2.781 KB
9 Jul 2025 2.45 PM
root / 996
0644
uniqid.h
1.242 KB
9 Jul 2025 2.45 PM
root / 996
0644
url.h
2.342 KB
9 Jul 2025 2.45 PM
root / 996
0644
url_scanner_ex.h
2.452 KB
9 Jul 2025 2.45 PM
root / 996
0644
winver.h
6.228 KB
9 Jul 2025 2.45 PM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF