#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <ac/socket.h>
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <ac/string.h>
#include <ldap.h>
#include <ldapconfig.h>
#include "ud.h"
+extern void *Malloc();
extern struct entry Entry;
extern int verbose;
LDAP_F caddr_t
avl_find LDAP_P((Avlnode *, caddr_t, IFP));
+LDAP_F caddr_t
+avl_find_lin LDAP_P((Avlnode *, caddr_t, IFP));
+
LDAP_F caddr_t
avl_getfirst LDAP_P((Avlnode *));
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <ac/string.h>
#ifndef HAVE_SETPROCTITLE
#include <stdlib.h>
+#include <ac/string.h>
#if defined( HAVE_STDARG_H ) && __STDC__
#include <stdarg.h>
#include "slap.h"
extern char **charray_dup();
-extern char *ch_malloc();
extern int errno;
void
extern IDList *idl_alloc();
extern Attribute *attr_find();
extern IDList *filter_candidates();
-extern char *ch_realloc();
extern char *dn_parent();
static IDList *base_candidates();
#include "slap.h"
-char *
+void *
ch_malloc(
unsigned long size
)
{
- char *new;
+ void *new;
- if ( (new = (char *) malloc( size )) == NULL ) {
+ if ( (new = (void *) malloc( size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "malloc of %d bytes failed\n", size, 0, 0 );
exit( 1 );
}
return( new );
}
-char *
+void *
ch_realloc(
- char *block,
+ void *block,
unsigned long size
)
{
- char *new;
+ void *new;
if ( block == NULL ) {
return( ch_malloc( size ) );
}
- if ( (new = (char *) realloc( block, size )) == NULL ) {
+ if ( (new = (void *) realloc( block, size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "realloc of %d bytes failed\n", size, 0, 0 );
exit( 1 );
}
return( new );
}
-char *
+void *
ch_calloc(
unsigned long nelem,
unsigned long size
)
{
- char *new;
+ void *new;
- if ( (new = (char *) calloc( nelem, size )) == NULL ) {
+ if ( (new = (void *) calloc( nelem, size )) == NULL ) {
Debug( LDAP_DEBUG_ANY, "calloc of %d elems of %d bytes failed\n",
nelem, size, 0 );
exit( 1 );
static int get_substring_filter();
extern int get_ava();
-extern char *ch_malloc();
-extern char *ch_realloc();
int
get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr )
* ch_malloc.c
*/
-char * ch_malloc LDAP_P(( unsigned long size ));
-char * ch_realloc LDAP_P(( char *block, unsigned long size ));
-char * ch_calloc LDAP_P(( unsigned long nelem, unsigned long size ));
+void * ch_malloc LDAP_P(( unsigned long size ));
+void * ch_realloc LDAP_P(( void *block, unsigned long size ));
+void * ch_calloc LDAP_P(( unsigned long nelem, unsigned long size ));
/*
* charray.c
extern FILE *lock_fopen();
extern int lock_fclose();
-extern char *ch_malloc();
extern char *entry2str();
void
len = strlen( mods->mod_type );
len = LDIF_SIZE_NEEDED( len,
mods->mod_bvalues[i]->bv_len ) + 1;
- buf = ch_malloc( len );
+ buf = (char *) ch_malloc( len );
bufp = buf;
put_type_and_value( &bufp, mods->mod_type,
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ac/ctype.h>
#include <ac/string.h>
extern FILE *lock_fopen( char *, char *, FILE ** );
extern int lock_fclose( FILE *, FILE * );
-extern char *ch_realloc( char *, unsigned long );
+extern void *ch_realloc( void *, unsigned long );
short ldap_dn_syntax;
PS rps;
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ac/string.h>
#include <ac/socket.h>
* Just like malloc, except we check the returned value and exit
* if anything goes wrong.
*/
-char *
+void *
ch_malloc(
unsigned long size
)
{
- char *new;
+ void *new;
- if ( (new = (char *) malloc( size )) == NULL ) {
+ if ( (new = (void *) malloc( size )) == NULL ) {
fprintf( stderr, "malloc of %lu bytes failed\n", size );
exit( 1 );
}
* Just like realloc, except we check the returned value and exit
* if anything goes wrong.
*/
-char *
+void *
ch_realloc(
- char *block,
+ void *block,
unsigned long size
)
{
- char *new;
+ void *new;
if ( block == NULL ) {
return( ch_malloc( size ) );
}
- if ( (new = (char *) realloc( block, size )) == NULL ) {
+ if ( (new = (void *) realloc( block, size )) == NULL ) {
fprintf( stderr, "realloc of %lu bytes failed\n", size );
exit( 1 );
}
* Just like calloc, except we check the returned value and exit
* if anything goes wrong.
*/
-char *
+void *
ch_calloc(
unsigned long nelem,
unsigned long size
)
{
- char *new;
+ void *new;
- if ( (new = (char *) calloc( nelem, size )) == NULL ) {
+ if ( (new = (void *) calloc( nelem, size )) == NULL ) {
fprintf( stderr, "calloc of %lu elems of %lu bytes failed\n",
nelem, size );
exit( 1 );
*/
void
ch_free(
- char *p
+ void *p
)
{
if ( p != NULL ) {
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include "slurp.h"
#include "globals.h"
static int do_unbind LDAP_P(( Ri * ));
-/* External references */
-extern char *ch_malloc LDAP_P(( unsigned long ));
-
static char *kattrs[] = {"kerberosName", NULL };
static struct timeval kst = {30L, 0L};
/* externs */
extern char *str_getline LDAP_P(( char **next ));
-extern void ch_free LDAP_P(( char *p ));
/* Forward references */
static Rh *get_repl_hosts LDAP_P(( char *, int *, char ** ));
* Externs
*/
extern FILE *lock_fopen LDAP_P(( char *, char *, FILE ** ));
-extern char *ch_malloc LDAP_P(( unsigned long ));
/*
* Forward declarations
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ac/signal.h>
#include "slurp.h"
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include "slurp.h"
#include "globals.h"
} tsl_t;
#endif /* HAVE_LWP */
+/* Public functions */
+
+/* In ch_malloc.c */
+void * ch_malloc LDAP_P(( unsigned long size ));
+void * ch_realloc LDAP_P(( void *block, unsigned long size ));
+void * ch_calloc LDAP_P(( unsigned long nelem, unsigned long size ));
+void ch_free LDAP_P(( void *p ));
/*
LDAP_END_DECL
#endif /* _SLURPD_H_ */
-
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ac/string.h>
#include <ac/unistd.h>