From: Howard Chu Date: Wed, 9 Apr 2003 09:41:02 +0000 (+0000) Subject: ITS#2434 ber accessors X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~416 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e240135305c21e63b69c8f3b8db8fbab35e51cfe;p=openldap ITS#2434 ber accessors --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 4edfb3f9ad..16459782bf 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -681,3 +681,30 @@ done: assert( 0 ); /* ber structure is messed up ?*/ return LBER_DEFAULT; } + +char * +ber_start( BerElement* ber ) +{ + return ber->ber_buf; +} + +int +ber_len( BerElement* ber ) +{ + return ( ber->ber_end - ber->ber_buf ); +} + +int +ber_ptrlen( BerElement* ber ) +{ + return ( ber->ber_ptr - ber->ber_buf ); +} + +void +ber_rewind ( BerElement * ber ) +{ + ber->ber_rwptr = NULL; + ber->ber_sos = NULL; + ber->ber_end = ber->ber_ptr; + ber->ber_ptr = ber->ber_buf; +} diff --git a/libraries/liblber/lber-int.h b/libraries/liblber/lber-int.h index 9f7409544a..638c242acb 100644 --- a/libraries/liblber/lber-int.h +++ b/libraries/liblber/lber-int.h @@ -123,6 +123,11 @@ ber_realloc LDAP_P(( BerElement *ber, ber_len_t len )); +LBER_F (char *) ber_start LDAP_P(( BerElement * )); +LBER_F (int) ber_len LDAP_P(( BerElement * )); +LBER_F (int) ber_ptrlen LDAP_P(( BerElement * )); +LBER_F (void) ber_rewind LDAP_P(( BerElement * )); + /* * bprint.c */