From 4eb13130a917f8d072a6dc49f10af1d6ed269a8a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 27 Jan 2000 01:04:17 +0000 Subject: [PATCH] typedef ber_int_t ldap_ucs4_t --- include/ldap_pvt.h | 3 +++ libraries/libldap/utf-8.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/ldap_pvt.h b/include/ldap_pvt.h index 5b799d324c..6c03e5577f 100644 --- a/include/ldap_pvt.h +++ b/include/ldap_pvt.h @@ -147,6 +147,9 @@ LIBLDAP_F (int) ldap_pvt_tls_start LDAP_P(( Sockbuf *sb, void *ctx_arg )); * UTF-8 (in utf-8.c) */ +typedef ber_int_t ldap_ucs4_t; +typedef short ldap_ucs2_t; + /* returns the number of bytes in the UTF-8 string */ LIBLDAP_F (ber_len_t) ldap_utf8_bytes( const char * ); /* returns the number of UTF-8 characters in the string */ diff --git a/libraries/libldap/utf-8.c b/libraries/libldap/utf-8.c index 9ea17c11e8..5f6a8c5872 100644 --- a/libraries/libldap/utf-8.c +++ b/libraries/libldap/utf-8.c @@ -109,10 +109,10 @@ int ldap_utf8_charlen( const char * p ) } /* 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 }; @@ -136,7 +136,7 @@ ber_int_t ldap_utf8_to_ucs4( const char * p ) } /* 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;