]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/charset.c
Add support for useronly configuration attributes.
[openldap] / libraries / libldap / charset.c
index 2a88da32a818ee1d9865cb6a19c5ba12737aeca4..1f348dc2093bf514f755ebbdbd4cdf6791c6d81b 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 #ifdef STR_TRANSLATION
 
 #include <stdio.h>
-#include <stdlib.h>
 
+#include <ac/stdlib.h>
+
+#include <ac/param.h>
 #include <ac/socket.h>
 #include <ac/string.h>
 #include <ac/time.h>
 
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
 
 #include "ldap-int.h"
 
@@ -39,9 +39,9 @@ ldap_set_string_translators( LDAP *ld, BERTranslateProc encode_proc,
 void
 ldap_enable_translation( LDAP *ld, LDAPMessage *entry, int enable )
 {
-       short   *optionsp;
+       unsigned short  *optionsp;
 
-       optionsp = ( entry == NULLMSG ) ? &ld->ld_lberoptions :
+       optionsp = ( entry == NULL ) ? &ld->ld_lberoptions :
            &entry->lm_ber->ber_options;
                
        if ( enable ) {
@@ -53,7 +53,7 @@ ldap_enable_translation( LDAP *ld, LDAPMessage *entry, int enable )
 
 
 int
-ldap_translate_from_t61( LDAP *ld, char **bufp, unsigned long *lenp,
+ldap_translate_from_t61( LDAP *ld, char **bufp, ber_len_t *lenp,
     int free_input )
 {
        if ( ld->ld_lber_decode_translate_proc == 0 ) {
@@ -65,7 +65,7 @@ ldap_translate_from_t61( LDAP *ld, char **bufp, unsigned long *lenp,
 
 
 int
-ldap_translate_to_t61( LDAP *ld, char **bufp, unsigned long *lenp,
+ldap_translate_to_t61( LDAP *ld, char **bufp, ber_len_t *lenp,
     int free_input )
 {
        if ( ld->ld_lber_encode_translate_proc == 0 ) {
@@ -147,7 +147,7 @@ ldap_translate_to_t61( LDAP *ld, char **bufp, unsigned long *lenp,
 
 
 #include <stdio.h>
-#include <stdlib.h>
+#include <ac/stdlib.h>
 #include <ac/string.h>
 
 /* Character set used: ISO 8859-1, ISO 8859-2, ISO 8859-3, ... */
@@ -1021,12 +1021,12 @@ c_to_cc( Byte *o, const Couple *cc, Byte c )
 /* --- routine to convert from T.61 to ISO 8859-n --- */
 
 int
-ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input )
+ldap_t61_to_8859( char **bufp, ber_len_t *buflenp, int free_input )
 {
   Byte         *s, *oo, *o;
   unsigned int  n;
   int           c;
-  unsigned long len;
+  ber_len_t len;
 
   Debug( LDAP_DEBUG_TRACE, "ldap_t61_to_8859 input length: %ld\n",
        *buflenp, 0, 0 );
@@ -1558,11 +1558,11 @@ cc_to_t61( Byte *o, const Byte *s )
 /* --- routine to convert from ISO 8859-n to T.61 --- */
 
 int
-ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input )
+ldap_8859_to_t61( char **bufp, ber_len_t *buflenp, int free_input )
 {
   Byte         *s, *oo, *o, *aux;
   int          c;
-  unsigned long len; 
+  ber_len_t len; 
   const Couple *cc;
 
   Debug( LDAP_DEBUG_TRACE, "ldap_8859_to_t61 input length: %ld\n",