/[pcre]/code/branches/pcre16/pcre_ord2utf8.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_ord2utf8.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 763 by ph10, Mon Nov 21 10:48:42 2011 UTC revision 764 by zherczeg, Wed Nov 23 17:23:20 2011 UTC
# Line 63  Returns: number of characters placed Line 63  Returns: number of characters placed
63  */  */
64    
65  int  int
66  _pcre_ord2utf8(int cvalue, pcre_uint8 *buffer)  PRIV(ord2utf8)(int cvalue, pcre_uint8 *buffer)
67  {  {
68  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
69  register int i, j;  register int i, j;
70  for (i = 0; i < _pcre_utf8_table1_size; i++)  for (i = 0; i < PRIV(utf8_table1_size); i++)
71    if (cvalue <= _pcre_utf8_table1[i]) break;    if (cvalue <= PRIV(utf8_table1)[i]) break;
72  buffer += i;  buffer += i;
73  for (j = i; j > 0; j--)  for (j = i; j > 0; j--)
74   {   {
75   *buffer-- = 0x80 | (cvalue & 0x3f);   *buffer-- = 0x80 | (cvalue & 0x3f);
76   cvalue >>= 6;   cvalue >>= 6;
77   }   }
78  *buffer = _pcre_utf8_table2[i] | cvalue;  *buffer = PRIV(utf8_table2)[i] | cvalue;
79  return i + 1;  return i + 1;
80  #else  #else
81  (void)(cvalue);  /* Keep compiler happy; this function won't ever be */  (void)(cvalue);  /* Keep compiler happy; this function won't ever be */

Legend:
Removed from v.763  
changed lines
  Added in v.764

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12