Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions
intl_error.h File Reference
#include <unicode/utypes.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _intl_error

Defines

#define INTL_ERROR_CODE(e)   (e).code

Typedefs

typedef struct _intl_error intl_error

Functions

intl_errorintl_error_create (TSRMLS_D)
void intl_error_init (intl_error *err TSRMLS_DC)
void intl_error_reset (intl_error *err TSRMLS_DC)
void intl_error_set_code (intl_error *err, UErrorCode err_code TSRMLS_DC)
void intl_error_set_custom_msg (intl_error *err, char *msg, int copyMsg TSRMLS_DC)
void intl_error_set (intl_error *err, UErrorCode code, char *msg, int copyMsg TSRMLS_DC)
UErrorCode intl_error_get_code (intl_error *err TSRMLS_DC)
char * intl_error_get_message (intl_error *err TSRMLS_DC)
void intl_errors_reset (intl_error *err TSRMLS_DC)
void intl_errors_set_custom_msg (intl_error *err, char *msg, int copyMsg TSRMLS_DC)
void intl_errors_set_code (intl_error *err, UErrorCode err_code TSRMLS_DC)
void intl_errors_set (intl_error *err, UErrorCode code, char *msg, int copyMsg TSRMLS_DC)

Class Documentation

struct _intl_error

Definition at line 26 of file intl_error.h.

Class Members
UErrorCode code
char * custom_error_message
int free_custom_error_message

Define Documentation

#define INTL_ERROR_CODE (   e)    (e).code

Definition at line 24 of file intl_error.h.


Typedef Documentation

typedef struct _intl_error intl_error

Function Documentation

Definition at line 59 of file intl_error.c.

{
       intl_error* err = ecalloc( 1, sizeof( intl_error ) );

       intl_error_init( err TSRMLS_CC );

       return err;
}

Here is the call graph for this function:

UErrorCode intl_error_get_code ( intl_error *err  TSRMLS_DC)

Definition at line 164 of file intl_error.c.

{
       if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
              return U_ZERO_ERROR;

       return err->code;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* intl_error_get_message ( intl_error *err  TSRMLS_DC)

Definition at line 125 of file intl_error.c.

{
       const char* uErrorName = NULL;
       char*       errMessage = 0;

       if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
              return estrdup( "" );

       uErrorName = u_errorName( err->code );

       /* Format output string */
       if( err->custom_error_message )
       {
              spprintf( &errMessage, 0, "%s: %s", err->custom_error_message, uErrorName );
       }
       else
       {
              spprintf( &errMessage, 0, "%s", uErrorName );
       }

       return errMessage;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_error_init ( intl_error *err  TSRMLS_DC)

Definition at line 72 of file intl_error.c.

{
       if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
              return;

       err->code                      = U_ZERO_ERROR;
       err->custom_error_message      = NULL;
       err->free_custom_error_message = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_error_reset ( intl_error *err  TSRMLS_DC)

Definition at line 86 of file intl_error.c.

{
       if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
              return;

       err->code = U_ZERO_ERROR;

       intl_free_custom_error_msg( err TSRMLS_CC );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_error_set ( intl_error err,
UErrorCode  code,
char *  msg,
int copyMsg  TSRMLS_DC 
)

Definition at line 176 of file intl_error.c.

{
       intl_error_set_code( err, code TSRMLS_CC );
       intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_error_set_code ( intl_error err,
UErrorCode err_code  TSRMLS_DC 
)

Definition at line 152 of file intl_error.c.

{
       if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
              return;

       err->code = err_code;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_error_set_custom_msg ( intl_error err,
char *  msg,
int copyMsg  TSRMLS_DC 
)

Definition at line 100 of file intl_error.c.

{
       if( !msg )
              return;

       if(!err && INTL_G(error_level)) {
              php_error_docref(NULL TSRMLS_CC, INTL_G(error_level), "%s", msg);            
       }
       if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
              return;

       /* Free previous message if any */
       intl_free_custom_error_msg( err TSRMLS_CC );

       /* Mark message copied if any */
       err->free_custom_error_message = copyMsg;

       /* Set user's error text message */
       err->custom_error_message = copyMsg ? estrdup( msg ) : msg;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_errors_reset ( intl_error *err  TSRMLS_DC)

Definition at line 195 of file intl_error.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_errors_set ( intl_error err,
UErrorCode  code,
char *  msg,
int copyMsg  TSRMLS_DC 
)

Definition at line 186 of file intl_error.c.

{
       intl_errors_set_code( err, code TSRMLS_CC );
       intl_errors_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_errors_set_code ( intl_error err,
UErrorCode err_code  TSRMLS_DC 
)

Definition at line 217 of file intl_error.c.

{
       if(err) {
              intl_error_set_code( err, err_code TSRMLS_CC );
       }
       intl_error_set_code( NULL, err_code TSRMLS_CC );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void intl_errors_set_custom_msg ( intl_error err,
char *  msg,
int copyMsg  TSRMLS_DC 
)

Definition at line 206 of file intl_error.c.

{
       if(err) {
              intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
       }
       intl_error_set_custom_msg( NULL, msg, copyMsg TSRMLS_CC );
}

Here is the call graph for this function:

Here is the caller graph for this function: