Lines Matching refs:ctx
107 static int param_get_bool(void *ctx, const char *key, int def) in param_get_bool() argument
110 if (zend_hash_find(ctx, key, strlen(key) + 1, (void**)&elem) == SUCCESS) { in param_get_bool()
118 static inline void *accounted_emalloc(size_t alloc_size, ser_context *ctx) in accounted_emalloc() argument
121 zend_llist_add_element(&ctx->allocations, &ret); in accounted_emalloc()
124 static inline void *accounted_ecalloc(size_t nmemb, size_t alloc_size, ser_context *ctx) in accounted_ecalloc() argument
127 zend_llist_add_element(&ctx->allocations, &ret); in accounted_ecalloc()
130 …line void *accounted_safe_ecalloc(size_t nmemb, size_t alloc_size, size_t offset, ser_context *ctx) in accounted_safe_ecalloc() argument
134 zend_llist_add_element(&ctx->allocations, &ret); in accounted_safe_ecalloc()
181 static void do_from_zval_err(ser_context *ctx, const char *fmt, ...) in do_from_zval_err() argument
186 do_from_to_zval_err(&ctx->err, &ctx->keys, "user", fmt, ap); in do_from_zval_err()
190 static void do_to_zval_err(res_context *ctx, const char *fmt, ...) in do_to_zval_err() argument
195 do_from_to_zval_err(&ctx->err, &ctx->keys, "native", fmt, ap); in do_to_zval_err()
216 void (*func)(zval **elem, unsigned i, void **args, ser_context *ctx), in from_array_iterate() argument
218 ser_context *ctx) in from_array_iterate()
228 !ctx->err.has_error in from_array_iterate()
234 zend_llist_add_element(&ctx->keys, &bufp); in from_array_iterate()
236 func(elem, i, args, ctx); in from_array_iterate()
238 zend_llist_remove_tail(&ctx->keys); in from_array_iterate()
248 ser_context *ctx) in from_zval_write_aggregation() argument
254 do_from_zval_err(ctx, "%s", "expected an array here"); in from_zval_write_aggregation()
257 for (descr = descriptors; descr->name != NULL && !ctx->err.has_error; descr++) { in from_zval_write_aggregation()
262 do_from_zval_err(ctx, "No information on how to convert value " in from_zval_write_aggregation()
267 zend_llist_add_element(&ctx->keys, (void*)&descr->name); in from_zval_write_aggregation()
268 descr->from_zval(*elem, ((char*)structure) + descr->field_offset, ctx); in from_zval_write_aggregation()
269 zend_llist_remove_tail(&ctx->keys); in from_zval_write_aggregation()
272 do_from_zval_err(ctx, "The key '%s' is required", descr->name); in from_zval_write_aggregation()
280 res_context *ctx) in to_zval_read_aggregation() argument
287 for (descr = descriptors; descr->name != NULL && !ctx->err.has_error; descr++) { in to_zval_read_aggregation()
291 do_to_zval_err(ctx, "No information on how to convert native " in to_zval_read_aggregation()
299 zend_llist_add_element(&ctx->keys, (void*)&descr->name); in to_zval_read_aggregation()
300 descr->to_zval(structure + descr->field_offset, new_zv, ctx); in to_zval_read_aggregation()
301 zend_llist_remove_tail(&ctx->keys); in to_zval_read_aggregation()
306 static long from_zval_integer_common(const zval *arr_value, ser_context *ctx) in from_zval_integer_common() argument
351 do_from_zval_err(ctx, "expected an integer, but got a non numeric " in from_zval_integer_common()
357 do_from_zval_err(ctx, "%s", "expected an integer, either of a PHP " in from_zval_integer_common()
366 void from_zval_write_int(const zval *arr_value, char *field, ser_context *ctx) in from_zval_write_int() argument
371 lval = from_zval_integer_common(arr_value, ctx); in from_zval_write_int()
372 if (ctx->err.has_error) { in from_zval_write_int()
377 do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds " in from_zval_write_int()
385 static void from_zval_write_uint32(const zval *arr_value, char *field, ser_context *ctx) in from_zval_write_uint32() argument
390 lval = from_zval_integer_common(arr_value, ctx); in from_zval_write_uint32()
391 if (ctx->err.has_error) { in from_zval_write_uint32()
396 do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds " in from_zval_write_uint32()
404 static void from_zval_write_net_uint16(const zval *arr_value, char *field, ser_context *ctx) in from_zval_write_net_uint16() argument
409 lval = from_zval_integer_common(arr_value, ctx); in from_zval_write_net_uint16()
410 if (ctx->err.has_error) { in from_zval_write_net_uint16()
415 do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds " in from_zval_write_net_uint16()
423 static void from_zval_write_sa_family(const zval *arr_value, char *field, ser_context *ctx) in from_zval_write_sa_family() argument
428 lval = from_zval_integer_common(arr_value, ctx); in from_zval_write_sa_family()
429 if (ctx->err.has_error) { in from_zval_write_sa_family()
434 do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds " in from_zval_write_sa_family()
442 static void from_zval_write_pid_t(const zval *arr_value, char *field, ser_context *ctx) in from_zval_write_pid_t() argument
447 lval = from_zval_integer_common(arr_value, ctx); in from_zval_write_pid_t()
448 if (ctx->err.has_error) { in from_zval_write_pid_t()
453 do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds " in from_zval_write_pid_t()
461 static void from_zval_write_uid_t(const zval *arr_value, char *field, ser_context *ctx) in from_zval_write_uid_t() argument
466 lval = from_zval_integer_common(arr_value, ctx); in from_zval_write_uid_t()
467 if (ctx->err.has_error) { in from_zval_write_uid_t()
474 do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds " in from_zval_write_uid_t()
480 do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds " in from_zval_write_uid_t()
490 void to_zval_read_int(const char *data, zval *zv, res_context *ctx) in to_zval_read_int() argument
497 static void to_zval_read_unsigned(const char *data, zval *zv, res_context *ctx) in to_zval_read_unsigned() argument
504 static void to_zval_read_net_uint16(const char *data, zval *zv, res_context *ctx) in to_zval_read_net_uint16() argument
511 static void to_zval_read_uint32(const char *data, zval *zv, res_context *ctx) in to_zval_read_uint32() argument
518 static void to_zval_read_sa_family(const char *data, zval *zv, res_context *ctx) in to_zval_read_sa_family() argument
525 static void to_zval_read_pid_t(const char *data, zval *zv, res_context *ctx) in to_zval_read_pid_t() argument
532 static void to_zval_read_uid_t(const char *data, zval *zv, res_context *ctx) in to_zval_read_uid_t() argument
541 static void from_zval_write_sin_addr(const zval *zaddr_str, char *inaddr, ser_context *ctx) in from_zval_write_sin_addr() argument
555 res = php_set_inet_addr(&saddr, Z_STRVAL_P(zaddr_str), ctx->sock TSRMLS_CC); in from_zval_write_sin_addr()
560 do_from_zval_err(ctx, "could not resolve address '%s' to get an AF_INET " in from_zval_write_sin_addr()
566 static void to_zval_read_sin_addr(const char *data, zval *zv, res_context *ctx) in to_zval_read_sin_addr() argument
576 do_to_zval_err(ctx, "could not convert IPv4 address to string " in to_zval_read_sin_addr()
589 static void from_zval_write_sockaddr_in(const zval *container, char *sockaddr, ser_context *ctx) in from_zval_write_sockaddr_in() argument
591 from_zval_write_aggregation(container, sockaddr, descriptors_sockaddr_in, ctx); in from_zval_write_sockaddr_in()
593 static void to_zval_read_sockaddr_in(const char *data, zval *zv, res_context *ctx) in to_zval_read_sockaddr_in() argument
595 to_zval_read_aggregation(data, zv, descriptors_sockaddr_in, ctx); in to_zval_read_sockaddr_in()
598 static void from_zval_write_sin6_addr(const zval *zaddr_str, char *addr6, ser_context *ctx) in from_zval_write_sin6_addr() argument
613 Z_STRVAL_P(zaddr_str), ctx->sock TSRMLS_CC); in from_zval_write_sin6_addr()
618 do_from_zval_err(ctx, "could not resolve address '%s' to get an AF_INET6 " in from_zval_write_sin6_addr()
624 static void to_zval_read_sin6_addr(const char *data, zval *zv, res_context *ctx) in to_zval_read_sin6_addr() argument
634 do_to_zval_err(ctx, "could not convert IPv6 address to string " in to_zval_read_sin6_addr()
649 static void from_zval_write_sockaddr_in6(const zval *container, char *sockaddr6, ser_context *ctx) in from_zval_write_sockaddr_in6() argument
651 from_zval_write_aggregation(container, sockaddr6, descriptors_sockaddr_in6, ctx); in from_zval_write_sockaddr_in6()
653 static void to_zval_read_sockaddr_in6(const char *data, zval *zv, res_context *ctx) in to_zval_read_sockaddr_in6() argument
655 to_zval_read_aggregation(data, zv, descriptors_sockaddr_in6, ctx); in to_zval_read_sockaddr_in6()
658 static void from_zval_write_sun_path(const zval *path, char *sockaddr_un_c, ser_context *ctx) in from_zval_write_sun_path() argument
674 do_from_zval_err(ctx, "%s", "the path is cannot be empty"); in from_zval_write_sun_path()
678 do_from_zval_err(ctx, "the path is too long, the maximum permitted " in from_zval_write_sun_path()
688 static void to_zval_read_sun_path(const char *data, zval *zv, res_context *ctx) { in to_zval_read_sun_path() argument
694 do_to_zval_err(ctx, "could not find a NUL in the path"); in to_zval_read_sun_path()
705 static void from_zval_write_sockaddr_un(const zval *container, char *sockaddr, ser_context *ctx) in from_zval_write_sockaddr_un() argument
707 from_zval_write_aggregation(container, sockaddr, descriptors_sockaddr_un, ctx); in from_zval_write_sockaddr_un()
709 static void to_zval_read_sockaddr_un(const char *data, zval *zv, res_context *ctx) in to_zval_read_sockaddr_un() argument
711 to_zval_read_aggregation(data, zv, descriptors_sockaddr_un, ctx); in to_zval_read_sockaddr_un()
716 ser_context *ctx) in from_zval_write_sockaddr_aux() argument
723 do_from_zval_err(ctx, "%s", "expected an array here"); in from_zval_write_sockaddr_aux()
727 fill_sockaddr = param_get_bool(ctx, KEY_FILL_SOCKADDR, 1); in from_zval_write_sockaddr_aux()
732 zend_llist_add_element(&ctx->keys, &node); in from_zval_write_sockaddr_aux()
733 from_zval_write_int(*elem, (char*)&family, ctx); in from_zval_write_sockaddr_aux()
734 zend_llist_remove_tail(&ctx->keys); in from_zval_write_sockaddr_aux()
736 family = ctx->sock->type; in from_zval_write_sockaddr_aux()
742 if (ctx->sock->type != AF_INET && ctx->sock->type != AF_INET6) { in from_zval_write_sockaddr_aux()
743 do_from_zval_err(ctx, "the specified family (number %d) is not " in from_zval_write_sockaddr_aux()
747 *sockaddr_ptr = accounted_ecalloc(1, sizeof(struct sockaddr_in), ctx); in from_zval_write_sockaddr_aux()
750 from_zval_write_sockaddr_in(container, (char*)*sockaddr_ptr, ctx); in from_zval_write_sockaddr_aux()
757 if (ctx->sock->type != AF_INET6) { in from_zval_write_sockaddr_aux()
758 do_from_zval_err(ctx, "the specified family (AF_INET6) is not " in from_zval_write_sockaddr_aux()
762 *sockaddr_ptr = accounted_ecalloc(1, sizeof(struct sockaddr_in6), ctx); in from_zval_write_sockaddr_aux()
765 from_zval_write_sockaddr_in6(container, (char*)*sockaddr_ptr, ctx); in from_zval_write_sockaddr_aux()
772 if (ctx->sock->type != AF_UNIX) { in from_zval_write_sockaddr_aux()
773 do_from_zval_err(ctx, "the specified family (AF_UNIX) is not " in from_zval_write_sockaddr_aux()
777 *sockaddr_ptr = accounted_ecalloc(1, sizeof(struct sockaddr_un), ctx); in from_zval_write_sockaddr_aux()
781 from_zval_write_sockaddr_un(container, (char*)*sockaddr_ptr, ctx); in from_zval_write_sockaddr_aux()
798 do_from_zval_err(ctx, "%s", "the only families currently supported are " in from_zval_write_sockaddr_aux()
803 static void to_zval_read_sockaddr_aux(const char *sockaddr_c, zval *zv, res_context *ctx) in to_zval_read_sockaddr_aux() argument
816 to_zval_read_sockaddr_in(sockaddr_c, zv, ctx); in to_zval_read_sockaddr_aux()
821 to_zval_read_sockaddr_in6(sockaddr_c, zv, ctx); in to_zval_read_sockaddr_aux()
826 to_zval_read_sockaddr_un(sockaddr_c, zv, ctx); in to_zval_read_sockaddr_aux()
830 do_to_zval_err(ctx, "cannot read struct sockaddr with family %d; " in to_zval_read_sockaddr_aux()
852 ser_context *ctx) in from_zval_write_control() argument
875 from_zval_write_aggregation(arr, (char *)&level, descriptor_level, ctx); in from_zval_write_control()
876 if (ctx->err.has_error) { in from_zval_write_control()
879 from_zval_write_aggregation(arr, (char *)&type, descriptor_type, ctx); in from_zval_write_control()
880 if (ctx->err.has_error) { in from_zval_write_control()
886 do_from_zval_err(ctx, "cmsghdr with level %d and type %d not supported", in from_zval_write_control()
896 do_from_zval_err(ctx, "cmsghdr should have a 'data' element here"); in from_zval_write_control()
899 data_len = entry->calc_space(*data_elem, ctx); in from_zval_write_control()
900 if (ctx->err.has_error) { in from_zval_write_control()
923 from_zval_write_aggregation(arr, (char*)CMSG_DATA(cmsghdr), descriptor_data, ctx); in from_zval_write_control()
927 static void from_zval_write_control_array(const zval *arr, char *msghdr_c, ser_context *ctx) in from_zval_write_control_array() argument
942 do_from_zval_err(ctx, "%s", "expected an array here"); in from_zval_write_control_array()
952 control_buf = accounted_safe_ecalloc(num_elems, CMSG_SPACE(20), 0, ctx); in from_zval_write_control_array()
953 alloc = ctx->allocations.tail; in from_zval_write_control_array()
958 !ctx->err.has_error in from_zval_write_control_array()
965 zend_llist_add_element(&ctx->keys, &bufp); in from_zval_write_control_array()
968 &cur_offset, ctx); in from_zval_write_control_array()
970 zend_llist_remove_tail(&ctx->keys); in from_zval_write_control_array()
976 static void to_zval_read_cmsg_data(const char *cmsghdr_c, zval *zv, res_context *ctx) in to_zval_read_cmsg_data() argument
985 do_to_zval_err(ctx, "cmsghdr with level %d and type %d not supported", in to_zval_read_cmsg_data()
990 do_to_zval_err(ctx, "the cmsghdr structure is unexpectedly small; " in to_zval_read_cmsg_data()
997 if (zend_hash_add(&ctx->params, KEY_CMSG_LEN, sizeof(KEY_CMSG_LEN), in to_zval_read_cmsg_data()
999 do_to_zval_err(ctx, "%s", "could not set parameter " KEY_CMSG_LEN); in to_zval_read_cmsg_data()
1003 entry->to_array((const char *)CMSG_DATA(cmsg), zv, ctx); in to_zval_read_cmsg_data()
1005 zend_hash_del(&ctx->params, KEY_CMSG_LEN, sizeof(KEY_CMSG_LEN)); in to_zval_read_cmsg_data()
1007 static void to_zval_read_control(const char *cmsghdr_c, zval *zv, res_context *ctx) in to_zval_read_control() argument
1018 to_zval_read_aggregation(cmsghdr_c, zv, descriptors, ctx); in to_zval_read_control()
1020 static void to_zval_read_control_array(const char *msghdr_c, zval *zv, res_context *ctx) in to_zval_read_control_array() argument
1038 cmsg != NULL && !ctx->err.has_error; in to_zval_read_control_array()
1048 zend_llist_add_element(&ctx->keys, &bufp); in to_zval_read_control_array()
1050 to_zval_read_control((const char *)cmsg, elem, ctx); in to_zval_read_control_array()
1052 zend_llist_remove_tail(&ctx->keys); in to_zval_read_control_array()
1057 static void from_zval_write_name(const zval *zname_arr, char *msghdr_c, ser_context *ctx) in from_zval_write_name() argument
1063 from_zval_write_sockaddr_aux(zname_arr, &sockaddr, &sockaddr_len, ctx); in from_zval_write_name()
1068 static void to_zval_read_name(const char *sockaddr_p, zval *zv, res_context *ctx) in to_zval_read_name() argument
1074 to_zval_read_sockaddr_aux(name, zv, ctx); in to_zval_read_name()
1077 static void from_zval_write_msghdr_buffer_size(const zval *elem, char *msghdr_c, ser_context *ctx) in from_zval_write_msghdr_buffer_size() argument
1082 lval = from_zval_integer_common(elem, ctx); in from_zval_write_msghdr_buffer_size()
1083 if (ctx->err.has_error) { in from_zval_write_msghdr_buffer_size()
1088 do_from_zval_err(ctx, "the buffer size must be between 1 and %ld; " in from_zval_write_msghdr_buffer_size()
1094 msghdr->msg_iov = accounted_emalloc(sizeof(*msghdr->msg_iov) * 1, ctx); in from_zval_write_msghdr_buffer_size()
1095 msghdr->msg_iov[0].iov_base = accounted_emalloc((size_t)lval, ctx); in from_zval_write_msghdr_buffer_size()
1098 static void from_zval_write_iov_array_aux(zval **elem, unsigned i, void **args, ser_context *ctx) in from_zval_write_iov_array_aux() argument
1107 msg->msg_iov[i - 1].iov_base = accounted_emalloc(len, ctx); in from_zval_write_iov_array_aux()
1113 static void from_zval_write_iov_array(const zval *arr, char *msghdr_c, ser_context *ctx) in from_zval_write_iov_array() argument
1119 do_from_zval_err(ctx, "%s", "expected an array here"); in from_zval_write_iov_array()
1128 msg->msg_iov = accounted_safe_ecalloc(num_elem, sizeof *msg->msg_iov, 0, ctx); in from_zval_write_iov_array()
1131 from_array_iterate(arr, from_zval_write_iov_array_aux, (void**)&msg, ctx); in from_zval_write_iov_array()
1133 static void from_zval_write_controllen(const zval *elem, char *msghdr_c, ser_context *ctx) in from_zval_write_controllen() argument
1141 from_zval_write_uint32(elem, (char*)&len, ctx); in from_zval_write_controllen()
1142 if (!ctx->err.has_error && len == 0) { in from_zval_write_controllen()
1143 do_from_zval_err(ctx, "controllen cannot be 0"); in from_zval_write_controllen()
1146 msghdr->msg_control = accounted_emalloc(len, ctx); in from_zval_write_controllen()
1149 void from_zval_write_msghdr_send(const zval *container, char *msghdr_c, ser_context *ctx) in from_zval_write_msghdr_send() argument
1158 from_zval_write_aggregation(container, msghdr_c, descriptors, ctx); in from_zval_write_msghdr_send()
1160 void from_zval_write_msghdr_recv(const zval *container, char *msghdr_c, ser_context *ctx) in from_zval_write_msghdr_recv() argument
1186 if (zend_hash_add(&ctx->params, KEY_FILL_SOCKADDR, sizeof(KEY_FILL_SOCKADDR), in from_zval_write_msghdr_recv()
1188 do_from_zval_err(ctx, "could not add fill_sockaddr; this is a bug"); in from_zval_write_msghdr_recv()
1192 from_zval_write_aggregation(container, msghdr_c, descriptors, ctx); in from_zval_write_msghdr_recv()
1194 zend_hash_del(&ctx->params, KEY_FILL_SOCKADDR, sizeof(KEY_FILL_SOCKADDR)); in from_zval_write_msghdr_recv()
1195 if (ctx->err.has_error) { in from_zval_write_msghdr_recv()
1201 msghdr->msg_iov = accounted_emalloc(sizeof(*msghdr->msg_iov) * 1, ctx); in from_zval_write_msghdr_recv()
1202 msghdr->msg_iov[0].iov_base = accounted_emalloc((size_t)DEFAULT_BUFF_SIZE, ctx); in from_zval_write_msghdr_recv()
1207 static void to_zval_read_iov(const char *msghdr_c, zval *zv, res_context *ctx) in to_zval_read_iov() argument
1216 do_to_zval_err(ctx, "unexpectedly large value for iov_len: %lu", in to_zval_read_iov()
1221 if (zend_hash_find(&ctx->params, KEY_RECVMSG_RET, sizeof(KEY_RECVMSG_RET), in to_zval_read_iov()
1223 do_to_zval_err(ctx, "recvmsg_ret not found in params. This is a bug"); in to_zval_read_iov()
1242 void to_zval_read_msghdr(const char *msghdr_c, zval *zv, res_context *ctx) in to_zval_read_msghdr() argument
1254 to_zval_read_aggregation(msghdr_c, zv, descriptors, ctx); in to_zval_read_msghdr()
1258 static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context *ctx) in from_zval_write_ifindex() argument
1265 do_from_zval_err(ctx, "the interface index cannot be negative or " in from_zval_write_ifindex()
1281 do_from_zval_err(ctx, "no interface with name \"%s\" could be " in from_zval_write_ifindex()
1289 do_from_zval_err(ctx, "the interface name \"%s\" is too large ", in from_zval_write_ifindex()
1291 } else if (ioctl(ctx->sock->bsd_socket, SIOCGIFINDEX, &ifr) < 0) { in from_zval_write_ifindex()
1293 do_from_zval_err(ctx, "no interface with name \"%s\" could be " in from_zval_write_ifindex()
1296 do_from_zval_err(ctx, "error fetching interface index for " in from_zval_write_ifindex()
1305 do_from_zval_err(ctx, in from_zval_write_ifindex()
1311 if (!ctx->err.has_error) { in from_zval_write_ifindex()
1325 void from_zval_write_in6_pktinfo(const zval *container, char *in6_pktinfo_c, ser_context *ctx) in from_zval_write_in6_pktinfo() argument
1327 from_zval_write_aggregation(container, in6_pktinfo_c, descriptors_in6_pktinfo, ctx); in from_zval_write_in6_pktinfo()
1329 void to_zval_read_in6_pktinfo(const char *data, zval *zv, res_context *ctx) in to_zval_read_in6_pktinfo() argument
1333 to_zval_read_aggregation(data, zv, descriptors_in6_pktinfo, ctx); in to_zval_read_in6_pktinfo()
1346 void from_zval_write_ucred(const zval *container, char *ucred_c, ser_context *ctx) in from_zval_write_ucred() argument
1348 from_zval_write_aggregation(container, ucred_c, descriptors_ucred, ctx); in from_zval_write_ucred()
1350 void to_zval_read_ucred(const char *data, zval *zv, res_context *ctx) in to_zval_read_ucred() argument
1354 to_zval_read_aggregation(data, zv, descriptors_ucred, ctx); in to_zval_read_ucred()
1360 size_t calculate_scm_rights_space(const zval *arr, ser_context *ctx) in calculate_scm_rights_space() argument
1365 do_from_zval_err(ctx, "%s", "expected an array here"); in calculate_scm_rights_space()
1371 do_from_zval_err(ctx, "%s", "expected at least one element in this array"); in calculate_scm_rights_space()
1377 static void from_zval_write_fd_array_aux(zval **elem, unsigned i, void **args, ser_context *ctx) in from_zval_write_fd_array_aux() argument
1396 do_from_zval_err(ctx, "resource is not a stream or a socket"); in from_zval_write_fd_array_aux()
1402 do_from_zval_err(ctx, "cast stream to file descriptor failed"); in from_zval_write_fd_array_aux()
1406 do_from_zval_err(ctx, "expected a resource variable"); in from_zval_write_fd_array_aux()
1409 void from_zval_write_fd_array(const zval *arr, char *int_arr, ser_context *ctx) in from_zval_write_fd_array() argument
1412 do_from_zval_err(ctx, "%s", "expected an array here"); in from_zval_write_fd_array()
1416 from_array_iterate(arr, &from_zval_write_fd_array_aux, (void**)&int_arr, ctx); in from_zval_write_fd_array()
1418 void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx) in to_zval_read_fd_array() argument
1430 if (zend_hash_find(&ctx->params, KEY_CMSG_LEN, sizeof(KEY_CMSG_LEN), in to_zval_read_fd_array()
1432 do_to_zval_err(ctx, "could not get value of parameter " KEY_CMSG_LEN); in to_zval_read_fd_array()
1437 do_to_zval_err(ctx, "length of cmsg is smaller than its data member " in to_zval_read_fd_array()
1456 do_to_zval_err(ctx, "error creating resource for received file " in to_zval_read_fd_array()
1487 ser_context ctx = {{0}}; in from_zval_run_conversions() local
1496 zend_hash_init(&ctx.params, 8, NULL, NULL, 0); in from_zval_run_conversions()
1497 zend_llist_init(&ctx.keys, sizeof(const char *), NULL, 0); in from_zval_run_conversions()
1498 zend_llist_init(&ctx.allocations, sizeof(void *), &free_from_zval_allocation, 0); in from_zval_run_conversions()
1499 ctx.sock = sock; in from_zval_run_conversions()
1503 zend_llist_add_element(&ctx.keys, &top_name); in from_zval_run_conversions()
1504 zend_llist_add_element(&ctx.allocations, &structure); in from_zval_run_conversions()
1507 writer(container, structure, &ctx); in from_zval_run_conversions()
1509 if (ctx.err.has_error) { in from_zval_run_conversions()
1510 zend_llist_destroy(&ctx.allocations); /* deallocates structure as well */ in from_zval_run_conversions()
1512 *err = ctx.err; in from_zval_run_conversions()
1515 **allocations = ctx.allocations; in from_zval_run_conversions()
1518 zend_llist_destroy(&ctx.keys); in from_zval_run_conversions()
1519 zend_hash_destroy(&ctx.params); in from_zval_run_conversions()
1529 res_context ctx = {{0}, {0}}; in to_zval_run_conversions() local
1539 zend_llist_init(&ctx.keys, sizeof(const char *), NULL, 0); in to_zval_run_conversions()
1540 zend_llist_add_element(&ctx.keys, &top_name); in to_zval_run_conversions()
1542 zend_hash_init(&ctx.params, 8, NULL, NULL, 0); in to_zval_run_conversions()
1544 zend_hash_update(&ctx.params, kv->key, kv->key_size, in to_zval_run_conversions()
1549 reader(structure, zv, &ctx); in to_zval_run_conversions()
1551 if (ctx.err.has_error) { in to_zval_run_conversions()
1554 *err = ctx.err; in to_zval_run_conversions()
1557 zend_llist_destroy(&ctx.keys); in to_zval_run_conversions()
1558 zend_hash_destroy(&ctx.params); in to_zval_run_conversions()