php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
intl_data.h File Reference
#include <unicode/utypes.h>
#include "intl_error.h"

Go to the source code of this file.

Data Structures

struct  _intl_data
 

Macros

#define INTL_METHOD_INIT_VARS(oclass, obj)
 
#define INTL_DATA_ERROR(obj)
 
#define INTL_DATA_ERROR_P(obj)
 
#define INTL_DATA_ERROR_CODE(obj)
 
#define INTL_METHOD_FETCH_OBJECT(oclass, obj)
 
#define INTL_CHECK_STATUS(err, msg)
 
#define INTL_CHECK_STATUS_OR_NULL(err, msg)
 
#define INTL_METHOD_CHECK_STATUS(obj, msg)
 
#define INTL_METHOD_CHECK_STATUS_OR_GOTO(obj, msg, label)
 
#define INTL_METHOD_CHECK_STATUS_OR_NULL(obj, msg)
 
#define INTL_CTOR_CHECK_STATUS(obj, msg)
 
#define INTL_METHOD_RETVAL_UTF8(obj, ustring, ulen, free_it)
 
#define INTL_MAX_LOCALE_LEN   (ULOC_FULLNAME_CAPACITY-1)
 
#define INTL_CHECK_LOCALE_LEN(locale_len)
 
#define INTL_CHECK_LOCALE_LEN_OR_FAILURE(locale_len)
 

Typedefs

typedef struct _intl_data intl_object
 

Macro Definition Documentation

◆ INTL_CHECK_LOCALE_LEN

#define INTL_CHECK_LOCALE_LEN ( locale_len)
Value:
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
char *_msg; \
spprintf(&_msg, 0, "Locale string too long, should be no longer than %d characters", INTL_MAX_LOCALE_LEN); \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, _msg, 1); \
efree(_msg); \
RETURN_NULL(); \
}
const U_ILLEGAL_ARGUMENT_ERROR
#define NULL
Definition gdcache.h:45
#define INTL_MAX_LOCALE_LEN
Definition intl_data.h:114

Definition at line 116 of file intl_data.h.

◆ INTL_CHECK_LOCALE_LEN_OR_FAILURE

#define INTL_CHECK_LOCALE_LEN_OR_FAILURE ( locale_len)
Value:
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
char *_msg; \
spprintf(&_msg, 0, "Locale string too long, should be no longer than %d characters", INTL_MAX_LOCALE_LEN); \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, _msg, 1); \
efree(_msg); \
return FAILURE; \
}
@ FAILURE
Definition zend_types.h:61

Definition at line 125 of file intl_data.h.

◆ INTL_CHECK_STATUS

#define INTL_CHECK_STATUS ( err,
msg )
Value:
if( U_FAILURE((err)) ) \
{ \
intl_error_set_custom_msg( NULL, msg, 0 ); \
}
char * err
Definition ffi.c:3029
void intl_error_set_code(intl_error *err, UErrorCode err_code)
Definition intl_error.c:141
char * msg
Definition phpdbg.h:289
#define RETURN_FALSE
Definition zend_API.h:1058

Definition at line 47 of file intl_data.h.

◆ INTL_CHECK_STATUS_OR_NULL

#define INTL_CHECK_STATUS_OR_NULL ( err,
msg )
Value:
if( U_FAILURE((err)) ) \
{ \
intl_error_set_custom_msg( NULL, msg, 0 ); \
RETURN_NULL(); \
}

Definition at line 56 of file intl_data.h.

◆ INTL_CTOR_CHECK_STATUS

#define INTL_CTOR_CHECK_STATUS ( obj,
msg )
Value:
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
{ \
intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
return FAILURE; \
}
#define INTL_DATA_ERROR_P(obj)
Definition intl_data.h:39
#define INTL_DATA_ERROR_CODE(obj)
Definition intl_data.h:40

Definition at line 95 of file intl_data.h.

◆ INTL_DATA_ERROR

#define INTL_DATA_ERROR ( obj)
Value:
(((intl_object *)(obj))->error)
error($message)
Definition ext_skel.php:22
struct _intl_data intl_object

Definition at line 38 of file intl_data.h.

◆ INTL_DATA_ERROR_CODE

#define INTL_DATA_ERROR_CODE ( obj)
Value:
#define INTL_DATA_ERROR(obj)
Definition intl_data.h:38
#define INTL_ERROR_CODE(e)
Definition intl_error.h:24

Definition at line 40 of file intl_data.h.

◆ INTL_DATA_ERROR_P

#define INTL_DATA_ERROR_P ( obj)
Value:
(&(INTL_DATA_ERROR((obj))))

Definition at line 39 of file intl_data.h.

◆ INTL_MAX_LOCALE_LEN

#define INTL_MAX_LOCALE_LEN   (ULOC_FULLNAME_CAPACITY-1)

Definition at line 114 of file intl_data.h.

◆ INTL_METHOD_CHECK_STATUS

#define INTL_METHOD_CHECK_STATUS ( obj,
msg )
Value:
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
{ \
intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
}

Definition at line 66 of file intl_data.h.

◆ INTL_METHOD_CHECK_STATUS_OR_GOTO

#define INTL_METHOD_CHECK_STATUS_OR_GOTO ( obj,
msg,
label )
Value:
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
{ \
intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
goto label; \
}
#define RETVAL_FALSE
Definition zend_API.h:1032

Definition at line 75 of file intl_data.h.

◆ INTL_METHOD_CHECK_STATUS_OR_NULL

#define INTL_METHOD_CHECK_STATUS_OR_NULL ( obj,
msg )
Value:
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
{ \
intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
zval_ptr_dtor(return_value); \
RETURN_NULL(); \
}
zval * return_value

Definition at line 85 of file intl_data.h.

◆ INTL_METHOD_FETCH_OBJECT

#define INTL_METHOD_FETCH_OBJECT ( oclass,
obj )
Value:
obj = Z_##oclass##_P( object ); \
intl_error_reset( INTL_DATA_ERROR_P(obj) ); \

Definition at line 42 of file intl_data.h.

◆ INTL_METHOD_INIT_VARS

#define INTL_METHOD_INIT_VARS ( oclass,
obj )
Value:
zval* object = NULL; \
oclass##_object* obj = NULL; \
intl_error_reset( NULL );
struct _zval_struct zval

Definition at line 33 of file intl_data.h.

◆ INTL_METHOD_RETVAL_UTF8

#define INTL_METHOD_RETVAL_UTF8 ( obj,
ustring,
ulen,
free_it )
Value:
{ \
zend_string *u8str; \
u8str = intl_convert_utf16_to_utf8(ustring, ulen, &INTL_DATA_ERROR_CODE((obj))); \
if((free_it)) { \
efree(ustring); \
} \
INTL_METHOD_CHECK_STATUS((obj), "Error converting value to UTF-8"); \
RETVAL_NEW_STR(u8str); \
}
zend_string * intl_convert_utf16_to_utf8(const UChar *src, int32_t src_len, UErrorCode *status)
struct _zend_string zend_string

Definition at line 103 of file intl_data.h.

Typedef Documentation

◆ intl_object

typedef struct _intl_data intl_object