static void convert_browscap_pattern(zval *pattern) /* {{{ */ { int i, j=0; char *t; php_strtolower(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern)); t = (char *) safe_pemalloc(Z_STRLEN_P(pattern), 2, 5, 1); t[j++] = '§'; t[j++] = '^'; for (i=0; i<Z_STRLEN_P(pattern); i++, j++) { switch (Z_STRVAL_P(pattern)[i]) { case '?': t[j] = '.'; break; case '*': t[j++] = '.'; t[j] = '*'; break; case '.': t[j++] = '\\'; t[j] = '.'; break; case '\\': t[j++] = '\\'; t[j] = '\\'; break; case '(': t[j++] = '\\'; t[j] = '('; break; case ')': t[j++] = '\\'; t[j] = ')'; break; case '§': t[j++] = '\\'; t[j] = '§'; break; default: t[j] = Z_STRVAL_P(pattern)[i]; break; } } t[j++] = '$'; t[j++] = '§'; t[j]=0; Z_STRVAL_P(pattern) = t; Z_STRLEN_P(pattern) = j; }
static voidpf php_zlib_alloc(voidpf opaque, uInt items, uInt size) { return (voidpf)safe_pemalloc(items, size, 0, ((php_zlib_filter_data*)opaque)->persistent); }
static void *php_bz2_alloc(void *opaque, int items, int size) { return (void *)safe_pemalloc(items, size, 0, ((php_bz2_filter_data*)opaque)->persistent); }