]> git.sur5r.net Git - openldap/commitdiff
Add ber_skip_data() to help positioning in structured BER data
authorHoward Chu <hyc@openldap.org>
Tue, 20 Mar 2007 12:29:06 +0000 (12:29 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 20 Mar 2007 12:29:06 +0000 (12:29 +0000)
libraries/liblber/io.c

index 503735819f42a5c7737c3c69f561465b8bb8e2ae..6e929110f5c08e6c444980d0e8db0750035deede 100644 (file)
 #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,