/* attr.c - routines for dealing with attributes */
+#include "portable.h"
+
#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#endif
+
+#include <ac/ctype.h>
+#include <ac/errno.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+
#include <sys/stat.h>
-#include "portable.h"
-#include "slap.h"
-extern char **charray_dup();
-extern char *ch_malloc();
-extern int errno;
+#include "slap.h"
void
attr_free( Attribute *a )
if ( **a == NULL ) {
**a = (Attribute *) ch_malloc( sizeof(Attribute) );
- (**a)->a_type = attr_normalize( strdup( type ) );
+ (**a)->a_type = attr_normalize( ch_strdup( type ) );
(**a)->a_vals = NULL;
(**a)->a_syntax = attr_syntax( type );
(**a)->a_next = NULL;
if ( *a == NULL ) {
*a = (Attribute *) ch_malloc( sizeof(Attribute) );
- (*a)->a_type = attr_normalize( strdup( type ) );
+ (*a)->a_type = attr_normalize( ch_strdup( type ) );
(*a)->a_vals = NULL;
(*a)->a_syntax = attr_syntax( type );
(*a)->a_next = NULL;
} else {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown syntax \"%s\" in attribute line (ignored)\n",
- fname, lineno, 0 );
+ fname, lineno, argv[lasti] );
Debug( LDAP_DEBUG_ANY,
"possible syntaxes are \"cis\", \"ces\", \"tel\", \"dn\", or \"bin\"\n",
0, 0, 0 );
a->asi_names = charray_dup( argv );
argv[lasti] = save;
- switch ( avl_insert( &attr_syntaxes, a, attr_syntax_cmp,
+ switch ( avl_insert( &attr_syntaxes, (caddr_t) a, attr_syntax_cmp,
attr_syntax_dup ) ) {
case -1: /* duplicate - different syntaxes */
Debug( LDAP_DEBUG_ARGS, "%s: line %d: duplicate attribute\n",
#ifdef LDAP_DEBUG
-static
+static int
attr_syntax_printnode( struct asyntaxinfo *a )
{
int i;
return( 0 );
}
-static
-attr_syntax_print()
+static void
+attr_syntax_print( void )
{
(void) avl_apply( attr_syntaxes, attr_syntax_printnode, 0, -1,
AVL_INORDER );