]> git.sur5r.net Git - openldap/commitdiff
ITS#2434 ber accessors
authorHoward Chu <hyc@openldap.org>
Wed, 9 Apr 2003 09:41:02 +0000 (09:41 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 9 Apr 2003 09:41:02 +0000 (09:41 +0000)
libraries/liblber/io.c
libraries/liblber/lber-int.h

index 4edfb3f9ad06805355b8fd1fc23062c2e3bb3049..16459782bfec78d5624e8db66ab995a7fd436d9e 100644 (file)
@@ -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;
+}
index 9f7409544a3929ba4369ccb73d5e2293fade1f51..638c242acb09939d5bc2cc60e39787beb064d088 100644 (file)
@@ -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
  */