Back to index

php5  5.3.10
Functions
msgformat_data.c File Reference
#include <unicode/ustring.h>
#include "msgformat_data.h"

Go to the source code of this file.

Functions

void msgformat_data_init (msgformat_data *mf_data TSRMLS_DC)
void msgformat_data_free (msgformat_data *mf_data TSRMLS_DC)
msgformat_datamsgformat_data_create (TSRMLS_D)
int msgformat_fix_quotes (UChar **spattern, uint32_t *spattern_len, UErrorCode *ec)

Function Documentation

Definition at line 62 of file msgformat_data.c.

{
       msgformat_data* mf_data = ecalloc( 1, sizeof(msgformat_data) );

       msgformat_data_init( mf_data TSRMLS_CC );

       return mf_data;
}

Here is the call graph for this function:

void msgformat_data_free ( msgformat_data *mf_data  TSRMLS_DC)

Definition at line 41 of file msgformat_data.c.

{
       if( !mf_data )
              return;

       if( mf_data->umsgf )
              umsg_close( mf_data->umsgf );

       if(mf_data->orig_format) {
              efree(mf_data->orig_format);
              mf_data->orig_format = NULL;
       }

       mf_data->umsgf = NULL;
       intl_error_reset( &mf_data->error TSRMLS_CC );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void msgformat_data_init ( msgformat_data *mf_data  TSRMLS_DC)

Definition at line 27 of file msgformat_data.c.

{
       if( !mf_data )
              return;

       mf_data->umsgf = NULL;
       mf_data->orig_format = NULL;
       intl_error_reset( &mf_data->error TSRMLS_CC );
}

Here is the call graph for this function:

Here is the caller graph for this function:

int msgformat_fix_quotes ( UChar **  spattern,
uint32_t spattern_len,
UErrorCode *  ec 
)

Definition at line 72 of file msgformat_data.c.

{
       if(*spattern && *spattern_len && u_strchr(*spattern, (UChar)'\'')) {
              UChar *npattern = emalloc(sizeof(UChar)*(2*(*spattern_len)+1));
              uint32_t npattern_len;
              npattern_len = umsg_autoQuoteApostrophe(*spattern, *spattern_len, npattern, 2*(*spattern_len)+1, ec);
              efree(*spattern);
              if( U_FAILURE(*ec) )
              {
                     return FAILURE;
              }
              npattern = erealloc(npattern, sizeof(UChar)*(npattern_len+1));
              *spattern = npattern;
              *spattern_len = npattern_len;
       }
       return SUCCESS;
}

Here is the caller graph for this function: