}
/* conv UTF-8 to UCS-4, useful for comparisons */
-ber_int_t ldap_utf8_to_ucs4( const char * p )
+ldap_ucs4_t ldap_utf8_to_ucs4( const char * p )
{
const unsigned char *c = p;
- ber_int_t ch;
+ ldap_ucs4_t ch;
int len, i;
static unsigned char mask[] = {
0, 0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01 };
}
/* conv UCS-4 to UTF-8, not used */
-int ldap_ucs4_to_utf8( ber_int_t c, char *buf )
+int ldap_ucs4_to_utf8( ldap_ucs4_t c, char *buf )
{
int len=0;
unsigned char* p = buf;
}
for( i=1; i<6; i++ ) {
- if ( u[i] & 0xc0 != 0x80 ) {
+ if ( ( u[i] & 0xc0 ) != 0x80 ) {
return (char *) &p[i];
}
}
const unsigned char *u = p;
for( i=-1; i>-6 ; i-- ) {
- if ( u[i] & 0xc0 != 0x80 ) {
+ if ( ( u[i] & 0xc0 ) != 0x80 ) {
return (char *) &p[i];
}
}
}
for( i=1; i<6; i++ ) {
- if ( u[i] & 0xc0 != 0x80 ) {
+ if ( ( u[i] & 0xc0 ) != 0x80 ) {
return i;
}
dst[i] = src[i];
/* like strpbrk(), replaces strchr() as well */
char *(ldap_utf8_strpbrk)( const char *str, const char *set )
{
- int len;
-
for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) {
const char *cset;