X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Fliblber%2Flber-int.h;h=16cabd995cbb0d8893e07abf50105eacdb63d510;hb=d34fffcaf9edc00262209fbe6e04bb15805dbd37;hp=638c242acb09939d5bc2cc60e39787beb064d088;hpb=e240135305c21e63b69c8f3b8db8fbab35e51cfe;p=openldap diff --git a/libraries/liblber/lber-int.h b/libraries/liblber/lber-int.h index 638c242acb..16cabd995c 100644 --- a/libraries/liblber/lber-int.h +++ b/libraries/liblber/lber-int.h @@ -1,10 +1,18 @@ /* $OpenLDAP$ */ -/* - * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file +/* This work is part of OpenLDAP Software . + * + * Copyright 1998-2005 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . */ -/* Portions - * Copyright (c) 1990 Regents of the University of Michigan. +/* Portions Copyright (c) 1990 Regents of the University of Michigan. * All rights reserved. * * Redistribution and use in source and binary forms are permitted @@ -30,30 +38,22 @@ typedef void (*BER_LOG_FN)(FILE *file, LBER_V (BER_ERRNO_FN) ber_int_errno_fn; +#ifdef LDAP_MEMORY_TRACE +# ifndef LDAP_MEMORY_DEBUG +# define LDAP_MEMORY_DEBUG 1 +# endif +#endif + +#ifdef LDAP_MEMORY_DEBUG +LBER_V (long) ber_int_meminuse; +#endif + struct lber_options { short lbo_valid; unsigned short lbo_options; int lbo_debug; - long lbo_meminuse; }; -#ifdef NEW_LOGGING -/* -# ifdef LDAP_DEBUG -# ifdef LDAP_LOG -# undef LDAP_LOG -# endif -# define LDAP_LOG(a) ber_pvt_log_output a - */ -# define BER_DUMP(a) ber_output_dump a -/* -# else -# define LDAP_LOG(a) -# define BER_DUMP(a) -# endif - */ -#endif - LBER_F( int ) ber_pvt_log_output( const char *subsystem, int level, @@ -84,6 +84,7 @@ struct berelement { struct seqorset *ber_sos; char *ber_rwptr; + void *ber_memctx; }; #define LBER_VALID(ber) ((ber)->ber_valid==LBER_VALID_BERELEMENT) @@ -133,15 +134,6 @@ LBER_F (void) ber_rewind LDAP_P(( BerElement * )); */ #define ber_log_printf ber_pvt_log_printf -#ifdef NEW_LOGGING -LBER_F( int ) -ber_output_dump LDAP_P(( - const char *subsys, - int level, - BerElement *ber, - int inout )); -#endif - LBER_F( int ) ber_log_bprint LDAP_P(( int errlvl, @@ -169,18 +161,8 @@ LBER_V (FILE *) ber_pvt_err_file; /* simple macros to realloc for now */ LBER_V (BerMemoryFunctions *) ber_int_memory_fns; LBER_F (char *) ber_strndup( LDAP_CONST char *, ber_len_t ); -LBER_F (char *) ber_strndup__( LDAP_CONST char *, size_t ); - -#ifdef CSRIMALLOC -#define LBER_MALLOC malloc -#define LBER_CALLOC calloc -#define LBER_REALLOC realloc -#define LBER_FREE free -#define LBER_VFREE ber_memvfree -#define LBER_STRDUP strdup -#define LBER_STRNDUP ber_strndup__ - -#else +LBER_F (char *) ber_strndup_x( LDAP_CONST char *, ber_len_t, void *ctx ); + #define LBER_MALLOC(s) ber_memalloc((s)) #define LBER_CALLOC(n,s) ber_memcalloc((n),(s)) #define LBER_REALLOC(p,s) ber_memrealloc((p),(s)) @@ -188,7 +170,6 @@ LBER_F (char *) ber_strndup__( LDAP_CONST char *, size_t ); #define LBER_VFREE(v) ber_memvfree((void**)(v)) #define LBER_STRDUP(s) ber_strdup((s)) #define LBER_STRNDUP(s,l) ber_strndup((s),(l)) -#endif /* sockbuf.c */