Lines Matching refs:objval
50 static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error, cons… in php_converter_throw_failure() argument
51 intl_error *err = objval ? &(objval->error) : NULL; in php_converter_throw_failure()
71 php_converter_object *objval = (php_converter_object*)CONV_GET(zobj); in php_converter_default_callback() local
75 if(!objval->src) { in php_converter_default_callback()
76 …php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initiali… in php_converter_default_callback()
92 ucnv_getSubstChars(objval->src, chars, &chars_len, &uerror); in php_converter_default_callback()
94 THROW_UFAILURE(objval, "ucnv_getSubstChars", uerror); in php_converter_default_callback()
137 static inline bool php_converter_check_limits(php_converter_object *objval, zend_long available, ze… in php_converter_check_limits() argument
139 …php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR, "Buffer overrun " ZEND_LONG_FMT " byt… in php_converter_check_limits()
146 #define TARGET_CHECK(cnvargs, needed) php_converter_check_limits(objval, cnvargs->targetLimit - cnv…
149 …r_append_toUnicode_target(zval *val, UConverterToUnicodeArgs *args, php_converter_object *objval) { in php_converter_append_toUnicode_target() argument
158 … php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "Invalid codepoint U+%04lx", lval); in php_converter_append_toUnicode_target()
194 php_converter_append_toUnicode_target(tmpzval, args, objval); in php_converter_append_toUnicode_target()
199 php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, in php_converter_append_toUnicode_target()
211 php_converter_object *objval = (php_converter_object*)context; in php_converter_to_u_callback() local
229 objval->to_cb.param_count = 4; in php_converter_to_u_callback()
230 objval->to_cb.params = zargs; in php_converter_to_u_callback()
231 objval->to_cb.retval = &retval; in php_converter_to_u_callback()
232 if (zend_call_function(&(objval->to_cb), &(objval->to_cache)) == FAILURE) { in php_converter_to_u_callback()
234 …php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling toUCallb… in php_converter_to_u_callback()
236 php_converter_append_toUnicode_target(&retval, args, objval); in php_converter_to_u_callback()
254 …pend_fromUnicode_target(zval *val, UConverterFromUnicodeArgs *args, php_converter_object *objval) { in php_converter_append_fromUnicode_target() argument
278 php_converter_append_fromUnicode_target(tmpzval, args, objval); in php_converter_append_fromUnicode_target()
283 …php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "fromUCallback() specified illegal t… in php_converter_append_fromUnicode_target()
294 php_converter_object *objval = (php_converter_object*)context; in php_converter_from_u_callback() local
311 objval->from_cb.param_count = 4; in php_converter_from_u_callback()
312 objval->from_cb.params = zargs; in php_converter_from_u_callback()
313 objval->from_cb.retval = &retval; in php_converter_from_u_callback()
314 if (zend_call_function(&(objval->from_cb), &(objval->from_cache)) == FAILURE) { in php_converter_from_u_callback()
316 …php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling fromUCal… in php_converter_from_u_callback()
318 php_converter_append_fromUnicode_target(&retval, args, objval); in php_converter_from_u_callback()
336 static inline bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv) { in php_converter_set_callbacks() argument
340 if (objval->obj.ce == php_converter_ce) { in php_converter_set_callbacks()
347 ucnv_setToUCallBack(cnv, (UConverterToUCallback)php_converter_to_u_callback, (const void*)objval, in php_converter_set_callbacks()
350 THROW_UFAILURE(objval, "ucnv_setToUCallBack", error); in php_converter_set_callbacks()
355 …_setFromUCallBack(cnv, (UConverterFromUCallback)php_converter_from_u_callback, (const void*)objval, in php_converter_set_callbacks()
358 THROW_UFAILURE(objval, "ucnv_setFromUCallBack", error); in php_converter_set_callbacks()
366 static bool php_converter_set_encoding(php_converter_object *objval, in php_converter_set_encoding() argument
381 if (objval) { in php_converter_set_encoding()
382 THROW_UFAILURE(objval, "ucnv_open", error); in php_converter_set_encoding()
389 if (objval && !php_converter_set_callbacks(objval, cnv)) { in php_converter_set_encoding()
403 php_converter_object *objval = CONV_GET(ZEND_THIS); in php_converter_do_set_encoding() local
410 intl_errors_reset(&objval->error); in php_converter_do_set_encoding()
412 RETURN_BOOL(php_converter_set_encoding(objval, pcnv, enc, enc_len)); in php_converter_do_set_encoding()
418 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
419 php_converter_do_set_encoding(&(objval->src), INTERNAL_FUNCTION_PARAM_PASSTHRU); in PHP_METHOD()
425 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
426 php_converter_do_set_encoding(&(objval->dest), INTERNAL_FUNCTION_PARAM_PASSTHRU); in PHP_METHOD()
431 static void php_converter_do_get_encoding(php_converter_object *objval, UConverter *cnv, INTERNAL_F… in php_converter_do_get_encoding() argument
438 intl_errors_reset(&objval->error); in php_converter_do_get_encoding()
444 name = ucnv_getName(cnv, &objval->error.code); in php_converter_do_get_encoding()
445 if (U_FAILURE(objval->error.code)) { in php_converter_do_get_encoding()
446 THROW_UFAILURE(objval, "ucnv_getName()", objval->error.code); in php_converter_do_get_encoding()
456 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
457 php_converter_do_get_encoding(objval, objval->src, INTERNAL_FUNCTION_PARAM_PASSTHRU); in PHP_METHOD()
463 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
464 php_converter_do_get_encoding(objval, objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU); in PHP_METHOD()
469 static void php_converter_do_get_type(php_converter_object *objval, UConverter *cnv, INTERNAL_FUNCT… in php_converter_do_get_type() argument
475 intl_errors_reset(&objval->error); in php_converter_do_get_type()
482 if (U_FAILURE(objval->error.code)) { in php_converter_do_get_type()
483 THROW_UFAILURE(objval, "ucnv_getType", objval->error.code); in php_converter_do_get_type()
493 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
494 php_converter_do_get_type(objval, objval->src, INTERNAL_FUNCTION_PARAM_PASSTHRU); in PHP_METHOD()
500 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
501 php_converter_do_get_type(objval, objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU); in PHP_METHOD()
507 php_converter_object *objval, in php_converter_resolve_callback() argument
519 …php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Error setting converter callback: %… in php_converter_resolve_callback()
531 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
543 php_converter_set_encoding(objval, &(objval->src), src, src_len ); in PHP_METHOD()
544 php_converter_set_encoding(objval, &(objval->dest), dest, dest_len); in PHP_METHOD()
545 …php_converter_resolve_callback(ZEND_THIS, objval, "toUCallback", &(objval->to_cb), &(objval->t… in PHP_METHOD()
546 …php_converter_resolve_callback(ZEND_THIS, objval, "fromUCallback", &(objval->from_cb), &(objval->f… in PHP_METHOD()
552 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
560 intl_errors_reset(&objval->error); in PHP_METHOD()
562 if (objval->src) { in PHP_METHOD()
564 ucnv_setSubstChars(objval->src, chars, chars_len, &error); in PHP_METHOD()
566 THROW_UFAILURE(objval, "ucnv_setSubstChars", error); in PHP_METHOD()
570 …php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initiali… in PHP_METHOD()
574 if (objval->dest) { in PHP_METHOD()
576 ucnv_setSubstChars(objval->dest, chars, chars_len, &error); in PHP_METHOD()
578 THROW_UFAILURE(objval, "ucnv_setSubstChars", error); in PHP_METHOD()
582 …php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Destination Converter has not been ini… in PHP_METHOD()
592 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
600 intl_errors_reset(&objval->error); in PHP_METHOD()
602 if (!objval->src) { in PHP_METHOD()
609 ucnv_getSubstChars(objval->src, chars, &chars_len, &error); in PHP_METHOD()
611 THROW_UFAILURE(objval, "ucnv_getSubstChars", error); in PHP_METHOD()
622 php_converter_object *objval in php_converter_do_convert() argument
630 php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, in php_converter_do_convert()
638 THROW_UFAILURE(objval, "ucnv_toUChars", error); in php_converter_do_convert()
647 THROW_UFAILURE(objval, "ucnv_toUChars", error); in php_converter_do_convert()
656 THROW_UFAILURE(objval, "ucnv_fromUChars", error); in php_converter_do_convert()
668 THROW_UFAILURE(objval, "ucnv_fromUChars", error); in php_converter_do_convert()
703 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
713 intl_errors_reset(&objval->error); in PHP_METHOD()
715 ret = php_converter_do_convert(reverse ? objval->src : objval->dest, in PHP_METHOD()
716 reverse ? objval->dest : objval->src, in PHP_METHOD()
718 objval); in PHP_METHOD()
786 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
792 RETURN_LONG(intl_error_get_code(&(objval->error))); in PHP_METHOD()
798 php_converter_object *objval = CONV_GET(ZEND_THIS); in PHP_METHOD() local
804 zend_string *message = intl_error_get_message(&(objval->error)); in PHP_METHOD()
891 php_converter_object *objval = php_converter_fetch_object(obj); in php_converter_free_object() local
893 if (objval->src) { in php_converter_free_object()
894 ucnv_close(objval->src); in php_converter_free_object()
897 if (objval->dest) { in php_converter_free_object()
898 ucnv_close(objval->dest); in php_converter_free_object()
901 intl_error_reset(&objval->error); in php_converter_free_object()
906 php_converter_object *objval; in php_converter_object_ctor() local
908 objval = zend_object_alloc(sizeof(php_converter_object), ce); in php_converter_object_ctor()
910 zend_object_std_init(&objval->obj, ce); in php_converter_object_ctor()
911 object_properties_init(&objval->obj, ce); in php_converter_object_ctor()
912 intl_error_init(&(objval->error)); in php_converter_object_ctor()
914 objval->obj.handlers = &php_converter_object_handlers; in php_converter_object_ctor()
915 *pobjval = objval; in php_converter_object_ctor()
917 return &objval->obj; in php_converter_object_ctor()
921 php_converter_object *objval = NULL; in php_converter_create_object() local
922 zend_object *retval = php_converter_object_ctor(ce, &objval); in php_converter_create_object()
924 object_properties_init(&(objval->obj), ce); in php_converter_create_object()
930 php_converter_object *objval, *oldobj = php_converter_fetch_object(object); in php_converter_clone_object() local
931 zend_object *retval = php_converter_object_ctor(object->ce, &objval); in php_converter_clone_object()
937 objval->src = ucnv_clone(oldobj->src, &error); in php_converter_clone_object()
939 objval->src = ucnv_safeClone(oldobj->src, NULL, NULL, &error); in php_converter_clone_object()
944 objval->dest = ucnv_clone(oldobj->dest, &error); in php_converter_clone_object()
946 objval->dest = ucnv_safeClone(oldobj->dest, NULL, NULL, &error); in php_converter_clone_object()
961 php_converter_set_callbacks(objval, objval->src ); in php_converter_clone_object()
962 php_converter_set_callbacks(objval, objval->dest); in php_converter_clone_object()
964 zend_objects_clone_members(&(objval->obj), &(oldobj->obj)); in php_converter_clone_object()