123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- typedef struct _intl_data {
- zend_object zo;
- intl_error error;
- } intl_object;
- zval* object = NULL; \
- oclass
- intl_error_reset( NULL TSRMLS_CC );
- obj = (oclass
- intl_error_reset( INTL_DATA_ERROR_P(obj) TSRMLS_CC ); \
- intl_error_set_code( NULL, (err) TSRMLS_CC ); \
- if( U_FAILURE((err)) ) \
- { \
- intl_error_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \
- RETURN_FALSE; \
- }
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \
- if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
- { \
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \
- RETURN_FALSE; \
- }
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \
- if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
- { \
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \
- zval_dtor(return_value); \
- RETURN_NULL(); \
- }
- { \
- char *u8value; \
- int u8len; \
- intl_convert_utf16_to_utf8(&u8value, &u8len, ustring, ulen, &INTL_DATA_ERROR_CODE((obj))); \
- if((free_it)) { \
- efree(ustring); \
- } \
- INTL_METHOD_CHECK_STATUS((obj), "Error converting value to UTF-8"); \
- RETVAL_STRINGL(u8value, u8len, 0); \
- }
- if((locale_len) > INTL_MAX_LOCALE_LEN) { \
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
- "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \
- RETURN_NULL(); \
- }
- if((locale_len) > INTL_MAX_LOCALE_LEN) { \
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
- "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \
- zval_dtor(object); \
- ZVAL_NULL(object); \
- RETURN_NULL(); \
- }
|