📄 lber-types.3
字号:
.TH LBER_TYPES 3 "RELEASEDATE" "OpenLDAP LDVERSION".\" $OpenLDAP: pkg/ldap/doc/man/man3/lber-types.3,v 1.16.2.4 2007/01/02 21:43:44 kurt Exp $.\" Copyright 1998-2007 The OpenLDAP Foundation All Rights Reserved..\" Copying restrictions apply. See COPYRIGHT/LICENSE..SH NAMEber_int_t, ber_uint_t, ber_len_t, ber_slen_t, ber_tag_t,struct berval, BerValue, BerVarray, BerElement,ber_bvfree, ber_bvecfree, ber_bvecadd, ber_bvarray_free, ber_bvarray_add,ber_bvdup, ber_dupbv, ber_bvstr, ber_bvstrdup, ber_str2bv, ber_free\- LBER types and allocation functions.SH LIBRARYOpenLDAP LBER (liblber, -llber).SH SYNOPSIS.B #include <lber.h>.LP.nf.ft Btypedef impl_tag_t ber_tag_t;typedef impl_int_t ber_int_t;typedef impl_uint_t ber_uint_t;typedef impl_len_t ber_len_t;typedef impl_slen_t ber_slen_t;typedef struct berval { ber_len_t bv_len; char *bv_val;} BerValue, *BerVarray;typedef struct berelement BerElement;.ft.fi.LP.BI "void ber_bvfree(struct berval *" bv ");".LP.BI "void ber_bvecfree(struct berval **" bvec ");".LP.BI "void ber_bvecadd(struct berval ***" bvec ", struct berval *" bv ");".LP.BI "void ber_bvarray_free(struct berval *" bvarray ");".LP.BI "void ber_bvarray_add(BerVarray *" bvarray ", BerValue *" bv ");".LP.BI "struct berval *ber_bvdup(const struct berval *" bv ");".LP.BI "struct berval *ber_dupbv(const struct berval *" dst ", struct berval *" src ");".LP.BI "struct berval *ber_bvstr(const char *" str ");".LP.BI "struct berval *ber_bvstrdup(const char *" str ");".LP.BI "struct berval *ber_str2bv(const char *" str ", ber_len_t " len ", int " dup ", struct berval *" bv ");".LP.BI "void ber_free(BerElement *" ber ", int " freebuf ");".SH DESCRIPTION.LPThe following are the basic types and structures defined for usewith the Lightweight BER library. .LP.B ber_int_tis a signed integer of at least 32 bits. It is commonly equivalent to.BR int ..B ber_uint_tis the unsigned variant of.BR ber_int_t ..LP.B ber_len_tis an unsigned integer of at least 32 bits used to represent a length. It is commonly equivalent to a.BR size_t ..B ber_slen_tis the signed variant to.BR ber_len_t ..LP.B ber_tag_tis an unsigned integer of at least 32 bits used to represent aBER tag. It is commonly equivalent to a.BR unsigned\ long ..LPThe actual definitions of the integral impl_TYPE_t types are platformspecific..LP.BR BerValue ,commonly used as.BR struct\ berval ,is used to hold an arbitrary sequence of octets..B bv_valpoints to.B bv_lenoctets..B bv_valis not necessarily terminated by a NUL (zero) octet..BR ber_bvfree ()frees a BerValue, pointed to by \fIbv\fP, returned from this API. If \fIbv\fPis NULL, the routine does nothing..LP.BR ber_bvecfree ()frees an array of BerValues (and the array), pointed to by \fIbvec\fP,returned from this API. If \fIbvec\fP is NULL, the routine does nothing..BR ber_bvecadd ()appends the \fIbv\fP pointer to the \fIbvec\fP array. Space for the arrayis allocated as needed. The end of the array is marked by a NULL pointer..LP.BR ber_bvarray_free ()frees an array of BerValues (and the array), pointed to by \fIbvarray\fP,returned from this API. If \fIbvarray\fP is NULL, the routine does nothing..BR ber_bvarray_add ()appends the contents of the BerValue pointed to by \fIbv\fP to the\fIbvarray\fP array. Space for the new element is allocated as needed.The end of the array is marked by a BerValue with a NULL bv_val field..LP.BR ber_bvdup ()returns a copy of a BerValue. The routine returns NULL upon error(e.g. out of memory). The caller should use.BR ber_bvfree ()to deallocate the resulting BerValue..BR ber_dupbv ()copies a BerValue from \fIsrc\fP to \fIdst\fP. If \fIdst\fP is NULL anew BerValue will be allocated to hold the copy. The routine returns NULLupon error, otherwise it returns a pointer to the copy. If \fIdst\fP isNULL the caller should use.BR ber_bvfree ()to deallocate the resulting BerValue, otherwise.BR ber_memfree ()should be used to deallocate the \fIdst->bv_val\fP. (The.BR ber_bvdup ()function is internally implemented as ber_dupbv(NULL, bv)..BR ber_bvdup ()is provided only for compatibility with an expired draft of the LDAP C API;.BR ber_dupbv ()is the preferred interface.).LP.BR ber_bvstr ()returns a BerValue containing the string pointed to by \fIstr\fP..BR ber_bvstrdup ()returns a BerValue containing a copy of the string pointed to by \fIstr\fP..BR ber_str2bv ()returns a BerValue containing the string pointed to by \fIstr\fP, whoselength may be optionally specified in \fIlen\fP. If \fIdup\fP is non-zero,the BerValue will contain a copy of \fIstr\fP. If \fIlen\fP is zero, thenumber of bytes to copy will be determined by.BR strlen (3),otherwise \fIlen\fP bytes will be copied. If \fIbv\fP is non-NULL, the resultwill be stored in the given BerValue, otherwise a new BerValue will beallocated to store the result. NOTE: Both.BR ber_bvstr ()and.BR ber_bvstrdup ()are implemented as macros using.BR ber_str2bv ()in this version of the library..LP.B BerElementis an opaque structure used to maintain state information used inencoding and decoding. BerElement structures are created using.BR ber_alloc_t (3)and.BR ber_init (3)..BR ber_free ()frees a BerElement pointed to by \fIber\fP. If \fIber\fP is NULL, the routinedoes nothing. If \fIfreebuf\fP is zero, the internal buffer is not freed..SH SEE ALSO.BR lber-encode (3),.BR lber-decode (3),.BR lber-memory (3).LP.SH ACKNOWLEDGEMENTS.B OpenLDAPis developed and maintained by The OpenLDAP Project (http://www.openldap.org/)..B OpenLDAPis derived from University of Michigan LDAP 3.3 Release.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -