| 1 |
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */ |
| 2 |
|
| 3 |
typedef __SIZE_TYPE__ size_t; |
| 4 |
typedef struct { |
| 5 |
} |
| 6 |
HashTable; |
| 7 |
typedef struct _zval_struct zval; |
| 8 |
typedef struct _zend_guard { |
| 9 |
HashTable *ht; |
| 10 |
} |
| 11 |
zvalue_value; |
| 12 |
struct _zval_struct { |
| 13 |
zvalue_value value; |
| 14 |
} |
| 15 |
php_output_globals; |
| 16 |
typedef struct _php_stream php_stream; |
| 17 |
typedef struct _php_stream_filter php_stream_filter; |
| 18 |
typedef struct _php_stream_bucket_brigade php_stream_bucket_brigade; |
| 19 |
typedef enum { |
| 20 |
PSFS_ERR_FATAL, PSFS_FEED_ME, PSFS_PASS_ON, } |
| 21 |
php_stream_filter_status_t; |
| 22 |
typedef struct _php_stream_filter_ops { |
| 23 |
php_stream_filter_status_t (*filter)( php_stream *stream, php_stream_filter *thisfilter, php_stream_bucket_brigade *buckets_in, php_stream_bucket_brigade *buckets_out, size_t *bytes_consumed, int flags ); |
| 24 |
void (*dtor)(php_stream_filter *thisfilter ); |
| 25 |
const char *label; |
| 26 |
} |
| 27 |
php_stream_filter_ops; |
| 28 |
struct _php_stream_filter { |
| 29 |
}; |
| 30 |
typedef struct _php_stream_filter_factory { |
| 31 |
php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent ); |
| 32 |
} |
| 33 |
php_stream_filter_factory; |
| 34 |
typedef enum _php_conv_err_t { |
| 35 |
PHP_CONV_ERR_SUCCESS = 0, PHP_CONV_ERR_UNKNOWN, PHP_CONV_ERR_TOO_BIG, PHP_CONV_ERR_INVALID_SEQ, PHP_CONV_ERR_UNEXPECTED_EOS, PHP_CONV_ERR_EXISTS, PHP_CONV_ERR_MORE, PHP_CONV_ERR_ALLOC, PHP_CONV_ERR_NOT_FOUND } |
| 36 |
php_conv_err_t; |
| 37 |
typedef struct _php_conv php_conv; |
| 38 |
typedef php_conv_err_t (*php_conv_convert_func)(php_conv *, const char **, size_t *, char **, size_t *); |
| 39 |
struct _php_conv { |
| 40 |
php_conv_convert_func convert_op; |
| 41 |
} |
| 42 |
php_conv_base64_decode; |
| 43 |
typedef struct _php_conv_qprint_decode { |
| 44 |
php_conv _super; |
| 45 |
const char *lbchars; |
| 46 |
} |
| 47 |
php_conv_qprint_decode; |
| 48 |
static php_conv_err_t php_conv_qprint_decode_convert(php_conv_qprint_decode *inst, const char **in_pp, size_t *in_left_p, char **out_pp, size_t *out_left_p) { |
| 49 |
size_t icnt, ocnt; |
| 50 |
unsigned char *ps, *pd; |
| 51 |
unsigned int scan_stat; |
| 52 |
unsigned int lb_ptr, lb_cnt; |
| 53 |
for (; |
| 54 |
; |
| 55 |
) { |
| 56 |
switch (scan_stat) { |
| 57 |
case 0: { |
| 58 |
if (*ps == '=') { |
| 59 |
scan_stat = 1; |
| 60 |
} |
| 61 |
else { |
| 62 |
if (ocnt < 1) { |
| 63 |
goto out; |
| 64 |
} |
| 65 |
*(pd++) = *ps; |
| 66 |
ocnt--; |
| 67 |
} |
| 68 |
} |
| 69 |
break; |
| 70 |
case 1: { |
| 71 |
if (*ps == ' ' || *ps == '\t') { |
| 72 |
} |
| 73 |
else if (!inst->lbchars && lb_cnt == 0 && *ps == '\r') { |
| 74 |
lb_cnt++; |
| 75 |
scan_stat = 5; |
| 76 |
break; |
| 77 |
} |
| 78 |
else if (!inst->lbchars && lb_cnt == 0 && *ps == '\n') { |
| 79 |
scan_stat = 0; |
| 80 |
break; |
| 81 |
} |
| 82 |
} |
| 83 |
case 2: { |
| 84 |
if (icnt <= 0) { |
| 85 |
goto out; |
| 86 |
} |
| 87 |
} |
| 88 |
case 3: { |
| 89 |
} |
| 90 |
case 4: { |
| 91 |
ps++, icnt--; |
| 92 |
} |
| 93 |
} |
| 94 |
} |
| 95 |
out: *in_pp = (const char *)ps; |
| 96 |
} |
| 97 |
static php_conv_err_t php_conv_qprint_decode_ctor(php_conv_qprint_decode *inst, const char *lbchars, size_t lbchars_len, int lbchars_dup, int persistent) { |
| 98 |
inst->_super.convert_op = (php_conv_convert_func) php_conv_qprint_decode_convert; |
| 99 |
} |
| 100 |
typedef struct _php_convert_filter { |
| 101 |
php_conv *cd; |
| 102 |
} |
| 103 |
php_convert_filter; |
| 104 |
static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent) { |
| 105 |
php_conv *retval = ((void *)0); |
| 106 |
switch (conv_mode) { |
| 107 |
case 4: { |
| 108 |
char *lbchars = ((void *)0); |
| 109 |
size_t lbchars_len; |
| 110 |
if (lbchars != ((void *)0)) { |
| 111 |
if (php_conv_qprint_decode_ctor((php_conv_qprint_decode *)retval, lbchars, lbchars_len, 1, persistent)) { |
| 112 |
} |
| 113 |
} |
| 114 |
} |
| 115 |
} |
| 116 |
} |
| 117 |
static int php_convert_filter_ctor(php_convert_filter *inst, int conv_mode, HashTable *conv_opts, const char *filtername, int persistent) { |
| 118 |
if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent)) == ((void *)0)) { |
| 119 |
} |
| 120 |
} |
| 121 |
static php_stream_filter_status_t strfilter_convert_filter( php_stream *stream, php_stream_filter *thisfilter, php_stream_bucket_brigade *buckets_in, php_stream_bucket_brigade *buckets_out, size_t *bytes_consumed, int flags ) { |
| 122 |
} |
| 123 |
static void strfilter_convert_dtor(php_stream_filter *thisfilter ) { |
| 124 |
} |
| 125 |
static php_stream_filter_ops strfilter_convert_ops = { |
| 126 |
strfilter_convert_filter, strfilter_convert_dtor, "convert.*" }; |
| 127 |
static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, int persistent ) { |
| 128 |
php_convert_filter *inst; |
| 129 |
int conv_mode = 0; |
| 130 |
if (php_convert_filter_ctor(inst, conv_mode, (filterparams != ((void *)0) ? (*filterparams).value.ht : ((void *)0)), filtername, persistent) != 0) { |
| 131 |
} |
| 132 |
} |
| 133 |
static php_stream_filter_factory strfilter_convert_factory = { |
| 134 |
strfilter_convert_create }; |
| 135 |
static const struct { |
| 136 |
php_stream_filter_ops *ops; |
| 137 |
php_stream_filter_factory *factory; |
| 138 |
} |
| 139 |
standard_filters[] = { |
| 140 |
{ |
| 141 |
&strfilter_convert_ops, &strfilter_convert_factory } |
| 142 |
}; |
| 143 |
int zm_startup_standard_filters(int type, int module_number ) { |
| 144 |
int i; |
| 145 |
for (i = 0; |
| 146 |
standard_filters[i].ops; |
| 147 |
i++) { |
| 148 |
} |
| 149 |
} |