Back to index

php5  5.3.10
Functions | Variables
mbfilter_utf32.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int mbfl_filt_conv_utf32_wchar (int c, mbfl_convert_filter *filter)
int mbfl_filt_conv_utf32be_wchar (int c, mbfl_convert_filter *filter)
int mbfl_filt_conv_wchar_utf32be (int c, mbfl_convert_filter *filter)
int mbfl_filt_conv_utf32le_wchar (int c, mbfl_convert_filter *filter)
int mbfl_filt_conv_wchar_utf32le (int c, mbfl_convert_filter *filter)

Variables

const mbfl_encoding mbfl_encoding_utf32
const mbfl_encoding mbfl_encoding_utf32be
const mbfl_encoding mbfl_encoding_utf32le

Function Documentation

int mbfl_filt_conv_utf32_wchar ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 125 of file mbfilter_utf32.c.

{
       int n, endian;

       endian = filter->status & 0xff00;
       switch (filter->status & 0xff) {
       case 0:
              if (endian) {
                     n = c & 0xff;
              } else {
                     n = (c & 0xff) << 24;
              }
              filter->cache = n;
              filter->status++;
              break;
       case 1:
              if (endian) {
                     n = (c & 0xff) << 8;
              } else {
                     n = (c & 0xff) << 16;
              }
              filter->cache |= n;
              filter->status++;
              break;
       case 2:
              if (endian) {
                     n = (c & 0xff) << 16;
              } else {
                     n = (c & 0xff) << 8;
              }
              filter->cache |= n;
              filter->status++;
              break;
       default:
              if (endian) {
                     n = (c & 0xff) << 24;
              } else {
                     n = c & 0xff;
              }
              n |= filter->cache;
              if ((n & 0xffff) == 0 && ((n >> 16) & 0xffff) == 0xfffe) {
                     if (endian) {
                            filter->status = 0;         /* big-endian */
                     } else {
                            filter->status = 0x100;            /* little-endian */
                     }
                     CK((*filter->output_function)(0xfeff, filter->data));
              } else {
                     filter->status &= ~0xff;
                     if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) {
                            CK((*filter->output_function)(n, filter->data));
                     }
              }
              break;
       }

       return c;
}
int mbfl_filt_conv_utf32be_wchar ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 187 of file mbfilter_utf32.c.

{
       int n;

       if (filter->status == 0) {
              filter->status = 1;
              n = (c & 0xff) << 24;
              filter->cache = n;
       } else if (filter->status == 1) {
              filter->status = 2;
              n = (c & 0xff) << 16;
              filter->cache |= n;
       } else if (filter->status == 2) {
              filter->status = 3;
              n = (c & 0xff) << 8;
              filter->cache |= n;
       } else {
              filter->status = 0;
              n = (c & 0xff) | filter->cache;
              if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) {
                     CK((*filter->output_function)(n, filter->data));
              }
       }
       return c;
}
int mbfl_filt_conv_utf32le_wchar ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 235 of file mbfilter_utf32.c.

{
       int n;

       if (filter->status == 0) {
              filter->status = 1;
              n = (c & 0xff);
              filter->cache = n;
       } else if (filter->status == 1) {
              filter->status = 2;
              n = (c & 0xff) << 8;
              filter->cache |= n;
       } else if (filter->status == 2) {
              filter->status = 3;
              n = (c & 0xff) << 16;
              filter->cache |= n;
       } else {
              filter->status = 0;
              n = ((c & 0xff) << 24) | filter->cache;
              if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) {
                     CK((*filter->output_function)(n, filter->data));
              }
       }
       return c;
}
int mbfl_filt_conv_wchar_utf32be ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 216 of file mbfilter_utf32.c.

{
       if (c >= 0 && c < MBFL_WCSPLANE_UTF32MAX) {
              CK((*filter->output_function)((c >> 24) & 0xff, filter->data));
              CK((*filter->output_function)((c >> 16) & 0xff, filter->data));
              CK((*filter->output_function)((c >> 8) & 0xff, filter->data));
              CK((*filter->output_function)(c & 0xff, filter->data));
       } else {
              if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) {
                     CK(mbfl_filt_conv_illegal_output(c, filter));
              }
       }

       return c;
}

Here is the call graph for this function:

int mbfl_filt_conv_wchar_utf32le ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 264 of file mbfilter_utf32.c.

{
       if (c >= 0 && c < MBFL_WCSPLANE_UTF32MAX) {
              CK((*filter->output_function)(c & 0xff, filter->data));
              CK((*filter->output_function)((c >> 8) & 0xff, filter->data));
              CK((*filter->output_function)((c >> 16) & 0xff, filter->data));
              CK((*filter->output_function)((c >> 24) & 0xff, filter->data));
       } else {
              if (filter->illegal_mode != MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) {
                     CK(mbfl_filt_conv_illegal_output(c, filter));
              }
       }

       return c;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 39 of file mbfilter_utf32.c.

Definition at line 48 of file mbfilter_utf32.c.

Definition at line 57 of file mbfilter_utf32.c.