| 6 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
| 7 |
|
|
| 8 |
Written by Philip Hazel |
Written by Philip Hazel |
| 9 |
Copyright (c) 1997-2005 University of Cambridge |
Copyright (c) 1997-2006 University of Cambridge |
| 10 |
|
|
| 11 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 12 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 59 |
Returns: number of characters placed in the buffer |
Returns: number of characters placed in the buffer |
| 60 |
*/ |
*/ |
| 61 |
|
|
| 62 |
EXPORT int |
int |
| 63 |
_pcre_ord2utf8(int cvalue, uschar *buffer) |
_pcre_ord2utf8(int cvalue, uschar *buffer) |
| 64 |
{ |
{ |
| 65 |
|
#ifdef SUPPORT_UTF8 |
| 66 |
register int i, j; |
register int i, j; |
| 67 |
for (i = 0; i < _pcre_utf8_table1_size; i++) |
for (i = 0; i < _pcre_utf8_table1_size; i++) |
| 68 |
if (cvalue <= _pcre_utf8_table1[i]) break; |
if (cvalue <= _pcre_utf8_table1[i]) break; |
| 74 |
} |
} |
| 75 |
*buffer = _pcre_utf8_table2[i] | cvalue; |
*buffer = _pcre_utf8_table2[i] | cvalue; |
| 76 |
return i + 1; |
return i + 1; |
| 77 |
|
#else |
| 78 |
|
return 0; /* Keep compiler happy; this function won't ever be */ |
| 79 |
|
#endif /* called when SUPPORT_UTF8 is not defined. */ |
| 80 |
} |
} |
| 81 |
|
|
| 82 |
/* End of pcre_ord2utf8.c */ |
/* End of pcre_ord2utf8.c */ |