Back to index

php5  5.3.10
Functions | Variables
mbfilter_byte4.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_wchar_byte4be (int c, mbfl_convert_filter *filter)
int mbfl_filt_conv_byte4be_wchar (int c, mbfl_convert_filter *filter)
int mbfl_filt_conv_wchar_byte4le (int c, mbfl_convert_filter *filter)
int mbfl_filt_conv_byte4le_wchar (int c, mbfl_convert_filter *filter)

Variables

const mbfl_encoding mbfl_encoding_byte4be
const mbfl_encoding mbfl_encoding_byte4le

Function Documentation

int mbfl_filt_conv_byte4be_wchar ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 93 of file mbfilter_byte4.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;
              CK((*filter->output_function)(n, filter->data));
       }
       return c;
}
int mbfl_filt_conv_byte4le_wchar ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 126 of file mbfilter_byte4.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;
              CK((*filter->output_function)(n, filter->data));
       }
       return c;
}
int mbfl_filt_conv_wchar_byte4be ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 117 of file mbfilter_byte4.c.

{
       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));
       return c;
}
int mbfl_filt_conv_wchar_byte4le ( int  c,
mbfl_convert_filter *  filter 
)

Definition at line 150 of file mbfilter_byte4.c.

{
       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));
       return c;
}

Variable Documentation

Definition at line 38 of file mbfilter_byte4.c.

Definition at line 47 of file mbfilter_byte4.c.