converts the binary representation of data to hex */
PHP_FUNCTION(bin2hex)
{
- pval **data;
+ zval **data;
char *new;
size_t newlen;
}
/* }}} */
-PHPAPI void php_trim(pval *str, pval * return_value, int mode)
+PHPAPI void php_trim(zval *str, zval * return_value, int mode)
/* mode 1 : trim left
mode 2 : trim right
mode 3 : trim left and right
Remove trailing whitespace */
PHP_FUNCTION(chop)
{
- pval **str;
+ zval **str;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
Strip whitespace from the beginning and end of a string */
PHP_FUNCTION(trim)
{
- pval **str;
+ zval **str;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
Strip whitespace from the beginning of a string */
PHP_FUNCTION(ltrim)
{
- pval **str;
+ zval **str;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
}
/* }}} */
-PHPAPI void php_explode(pval *delim, pval *str, pval *return_value)
+PHPAPI void php_explode(zval *delim, zval *str, zval *return_value)
{
char *p1, *p2, *endp;
int i = 0;
Split a string on string separator and return array of components */
PHP_FUNCTION(explode)
{
- pval **str, **delim;
+ zval **str, **delim;
if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &delim, &str) == FAILURE) {
WRONG_PARAM_COUNT;
/* {{{ proto string join(array src, string glue)
An alias for implode */
/* }}} */
-PHPAPI void php_implode(pval *delim, pval *arr, pval *return_value)
+PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
{
- pval **tmp;
+ zval **tmp;
int len = 0, count = 0, target = 0;
/* convert everything to strings, and calculate length */
Join array elements placing glue string between items and return one string */
PHP_FUNCTION(implode)
{
- pval **arg1, **arg2, *delim, *arr;
+ zval **arg1, **arg2, *delim, *arr;
if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
Tokenize a string */
PHP_FUNCTION(strtok)
{
- pval **str, **tok;
+ zval **str, **tok;
char *token = NULL, *tokp=NULL;
char *first = NULL;
int argc;
Make a string uppercase */
PHP_FUNCTION(strtoupper)
{
- pval **arg;
+ zval **arg;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &arg)) {
WRONG_PARAM_COUNT;
Make a string lowercase */
PHP_FUNCTION(strtolower)
{
- pval **str;
+ zval **str;
char *ret;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str)) {
Return the filename component of the path */
PHP_FUNCTION(basename)
{
- pval **str;
+ zval **str;
char *ret, *c;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str)) {
Return the directory name component of the path */
PHP_FUNCTION(dirname)
{
- pval **str;
+ zval **str;
char *ret;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str)) {
Find position of first occurrence of a string within another */
PHP_FUNCTION(strpos)
{
- pval **haystack, **needle, **OFFSET;
+ zval **haystack, **needle, **OFFSET;
int offset = 0;
char *found = NULL;
char *endp;
Find the last occurrence of a character in a string within another */
PHP_FUNCTION(strrpos)
{
- pval **haystack, **needle;
+ zval **haystack, **needle;
char *found = NULL;
if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &haystack, &needle) == FAILURE) {
Find the last occurrence of a character in a string within another */
PHP_FUNCTION(strrchr)
{
- pval **haystack, **needle;
+ zval **haystack, **needle;
char *found = NULL;
if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &haystack, &needle) ==
Return split line */
PHP_FUNCTION(chunk_split)
{
- pval **p_str, **p_chunklen, **p_ending;
+ zval **p_str, **p_chunklen, **p_ending;
int argc;
char *result;
char *end = "\r\n";
Return part of a string */
PHP_FUNCTION(substr)
{
- pval **string, **from, **len;
+ zval **string, **from, **len;
int argc, l;
int f;
Return ASCII value of character */
PHP_FUNCTION(ord)
{
- pval **str;
+ zval **str;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
Convert ASCII code to a character */
PHP_FUNCTION(chr)
{
- pval **num;
+ zval **num;
char temp[2];
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
Make a string's first character uppercase */
PHP_FUNCTION(ucfirst)
{
- pval **arg;
+ zval **arg;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
Translate characters in str using given translation tables */
PHP_FUNCTION(strtr)
{ /* strtr(STRING,FROM,TO) */
- pval **str, **from, **to;
+ zval **str, **from, **to;
int ac = ARG_COUNT(ht);
if (ac < 2 || ac > 3 || zend_get_parameters_ex(ac, &str, &from, &to) == FAILURE) {
Reverse a string */
PHP_FUNCTION(strrev)
{
- pval **str;
+ zval **str;
int i,len;
char c;
convert_to_string_ex(str);
*return_value = **str;
- pval_copy_constructor(return_value);
+ zval_copy_ctor(return_value);
len = return_value->value.str.len;
Calculates the similarity between two strings */
PHP_FUNCTION(similar_text)
{
- pval **t1, **t2, **percent;
+ zval **t1, **t2, **percent;
int ac = ARG_COUNT(ht);
int sim;
or with ASCII<32 (except '\n', '\r', '\t' etc...) */
PHP_FUNCTION(addcslashes)
{
- pval **str, **what;
+ zval **str, **what;
if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &str, &what) == FAILURE) {
WRONG_PARAM_COUNT;
Escape single quote, double quotes and backslash characters in a string with backslashes */
PHP_FUNCTION(addslashes)
{
- pval **str;
+ zval **str;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
Strip backslashes from a string. Uses C-style conventions*/
PHP_FUNCTION(stripcslashes)
{
- pval **str;
+ zval **str;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
Strip backslashes from a string */
PHP_FUNCTION(stripslashes)
{
- pval **str;
+ zval **str;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
#define _isblank(c) (((((unsigned char) c)==' ' || ((unsigned char) c)=='\t')) ? 1 : 0)
#define _isnewline(c) (((((unsigned char) c)=='\n' || ((unsigned char) c)=='\r')) ? 1 : 0)
-PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,pval *result)
+PHPAPI void php_char_to_str(char *str,uint len,char from,char *to,int to_len,zval *result)
{
int char_count=0;
char *source,*target,*tmp,*source_end=str+len, *tmp_end=NULL;
Replace all occurrences of needle in haystack with str */
PHP_FUNCTION(str_replace)
{
- pval **haystack, **needle, **str;
+ zval **haystack, **needle, **str;
char *new;
int len = 0;
*/
static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS,int convert_newlines)
{
- pval **str,**max_chars_per_line;
+ zval **str,**max_chars_per_line;
char *heb_str,*tmp,*target,*opposite_target,*broken_str;
int block_start, block_end, block_type, block_length, i;
int block_ended;
Converts newlines to HTML line breaks */
PHP_FUNCTION(nl2br)
{
- pval **str;
+ zval **str;
if (ARG_COUNT(ht)!=1 || zend_get_parameters_ex(1, &str)==FAILURE) {
WRONG_PARAM_COUNT;
PHP_FUNCTION(strip_tags)
{
char *buf;
- pval **str, **allow=NULL;
+ zval **str, **allow=NULL;
switch(ARG_COUNT(ht)) {
case 1:
Set locale information */
PHP_FUNCTION(setlocale)
{
- pval **pcategory, **plocale;
- pval *category, *locale;
+ zval **pcategory, **plocale;
+ zval *category, *locale;
int cat;
char *loc, *retval;
BLS_FETCH();
Parses GET/POST/COOKIE data and sets global variables. */
PHP_FUNCTION(parse_str)
{
- pval **arg;
+ zval **arg;
char *res = NULL;
ELS_FETCH();
PLS_FETCH();