From: Howard Chu Date: Tue, 20 Mar 2007 12:29:06 +0000 (+0000) Subject: Add ber_skip_data() to help positioning in structured BER data X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~603 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=23ba7dfa121c12baa6f1133b02903d24e1667a60;p=openldap Add ber_skip_data() to help positioning in structured BER data --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 503735819f..6e929110f5 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -47,6 +47,25 @@ #include "lber-int.h" #include "ldap_log.h" +ber_slen_t +ber_skip_data( + BerElement *ber, + ber_len_t len ) +{ + ber_len_t actuallen, nleft; + + assert( ber != NULL ); + + assert( LBER_VALID( ber ) ); + + nleft = ber_pvt_ber_remaining( ber ); + actuallen = nleft < len ? nleft : len; + ber->ber_ptr += actuallen; + ber->ber_tag = *(unsigned char *)ber->ber_ptr; + + return( (ber_slen_t) actuallen ); +} + ber_slen_t ber_read( BerElement *ber,