mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
reduce size of stream struct
32 bytes are spared on 64-bit build
This commit is contained in:
parent
4b41973ba1
commit
0ca15cbeba
3 changed files with 19 additions and 15 deletions
|
@ -133,8 +133,8 @@ PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len);
|
||||||
PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle,
|
PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle,
|
||||||
size_t needle_len, char *str, size_t str_len);
|
size_t needle_len, char *str, size_t str_len);
|
||||||
PHPAPI zend_string *php_trim(zend_string *str, char *what, size_t what_len, int mode);
|
PHPAPI zend_string *php_trim(zend_string *str, char *what, size_t what_len, int mode);
|
||||||
PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *state, const char *allow, size_t allow_len);
|
PHPAPI size_t php_strip_tags(char *rbuf, size_t len, uint8_t *state, const char *allow, size_t allow_len);
|
||||||
PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, int *stateptr, const char *allow, size_t allow_len, zend_bool allow_tag_spaces);
|
PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, uint8_t *stateptr, const char *allow, size_t allow_len, zend_bool allow_tag_spaces);
|
||||||
PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value);
|
PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value);
|
||||||
PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit);
|
PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit);
|
||||||
|
|
||||||
|
|
|
@ -4599,7 +4599,7 @@ int php_tag_find(char *tag, size_t len, const char *set) {
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *stateptr, const char *allow, size_t allow_len) /* {{{ */
|
PHPAPI size_t php_strip_tags(char *rbuf, size_t len, uint8_t *stateptr, const char *allow, size_t allow_len) /* {{{ */
|
||||||
{
|
{
|
||||||
return php_strip_tags_ex(rbuf, len, stateptr, allow, allow_len, 0);
|
return php_strip_tags_ex(rbuf, len, stateptr, allow, allow_len, 0);
|
||||||
}
|
}
|
||||||
|
@ -4625,11 +4625,11 @@ PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *stateptr, const char *
|
||||||
swm: Added ability to strip <?xml tags without assuming it PHP
|
swm: Added ability to strip <?xml tags without assuming it PHP
|
||||||
code.
|
code.
|
||||||
*/
|
*/
|
||||||
PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, int *stateptr, const char *allow, size_t allow_len, zend_bool allow_tag_spaces)
|
PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, uint8_t *stateptr, const char *allow, size_t allow_len, zend_bool allow_tag_spaces)
|
||||||
{
|
{
|
||||||
char *tbuf, *buf, *p, *tp, *rp, c, lc;
|
char *tbuf, *buf, *p, *tp, *rp, c, lc;
|
||||||
int br, depth=0, in_q = 0;
|
int br, depth=0, in_q = 0;
|
||||||
int state = 0;
|
uint8_t state = 0;
|
||||||
size_t pos, i = 0;
|
size_t pos, i = 0;
|
||||||
char *allow_free = NULL;
|
char *allow_free = NULL;
|
||||||
const char *allow_actual;
|
const char *allow_actual;
|
||||||
|
|
|
@ -197,22 +197,26 @@ struct _php_stream {
|
||||||
void *wrapperthis; /* convenience pointer for a instance of a wrapper */
|
void *wrapperthis; /* convenience pointer for a instance of a wrapper */
|
||||||
zval wrapperdata; /* fgetwrapperdata retrieves this */
|
zval wrapperdata; /* fgetwrapperdata retrieves this */
|
||||||
|
|
||||||
int fgetss_state; /* for fgetss to handle multiline tags */
|
uint8_t is_persistent:1;
|
||||||
int is_persistent;
|
uint8_t in_free:1; /* to prevent recursion during free */
|
||||||
char mode[16]; /* "rwb" etc. ala stdio */
|
uint8_t eof:1;
|
||||||
zend_resource *res; /* used for auto-cleanup */
|
uint8_t __exposed:1; /* non-zero if exposed as a zval somewhere */
|
||||||
int in_free; /* to prevent recursion during free */
|
|
||||||
/* so we know how to clean it up correctly. This should be set to
|
/* so we know how to clean it up correctly. This should be set to
|
||||||
* PHP_STREAM_FCLOSE_XXX as appropriate */
|
* PHP_STREAM_FCLOSE_XXX as appropriate */
|
||||||
int fclose_stdiocast;
|
uint8_t fclose_stdiocast:2;
|
||||||
|
|
||||||
|
uint8_t fgetss_state; /* for fgetss to handle multiline tags */
|
||||||
|
|
||||||
|
char mode[16]; /* "rwb" etc. ala stdio */
|
||||||
|
|
||||||
|
uint32_t flags; /* PHP_STREAM_FLAG_XXX */
|
||||||
|
|
||||||
|
zend_resource *res; /* used for auto-cleanup */
|
||||||
FILE *stdiocast; /* cache this, otherwise we might leak! */
|
FILE *stdiocast; /* cache this, otherwise we might leak! */
|
||||||
int __exposed; /* non-zero if exposed as a zval somewhere */
|
|
||||||
char *orig_path;
|
char *orig_path;
|
||||||
|
|
||||||
zend_resource *ctx;
|
zend_resource *ctx;
|
||||||
uint32_t flags; /* PHP_STREAM_FLAG_XXX */
|
|
||||||
|
|
||||||
int eof;
|
|
||||||
|
|
||||||
/* buffer */
|
/* buffer */
|
||||||
zend_off_t position; /* of underlying stream */
|
zend_off_t position; /* of underlying stream */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue