Back to index

php5  5.3.10
Functions
pcre_ord2utf8.c File Reference
#include "config.h"
#include "pcre_internal.h"

Go to the source code of this file.

Functions

int _pcre_ord2utf8 (int cvalue, uschar *buffer)

Function Documentation

int _pcre_ord2utf8 ( int  cvalue,
uschar buffer 
)

Definition at line 64 of file pcre_ord2utf8.c.

{
#ifdef SUPPORT_UTF8
register int i, j;
for (i = 0; i < _pcre_utf8_table1_size; i++)
  if (cvalue <= _pcre_utf8_table1[i]) break;
buffer += i;
for (j = i; j > 0; j--)
 {
 *buffer-- = 0x80 | (cvalue & 0x3f);
 cvalue >>= 6;
 }
*buffer = _pcre_utf8_table2[i] | cvalue;
return i + 1;
#else
(void)(cvalue);  /* Keep compiler happy; this function won't ever be */
(void)(buffer);  /* called when SUPPORT_UTF8 is not defined. */
return 0;
#endif
}