Sync with trunk (r48545)
[reactos.git] / include / psdk / winber.h
1 /*
2 winber.h - Header file for the Windows LDAP Basic Encoding Rules API
3
4 Written by Filip Navara <xnavara@volny.cz>
5
6 References:
7 The C LDAP Application Program Interface
8 http://www.watersprings.org/pub/id/draft-ietf-ldapext-ldap-c-api-05.txt
9
10 Lightweight Directory Access Protocol Reference
11 http://msdn.microsoft.com/library/en-us/netdir/ldap/ldap_reference.asp
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 */
17
18 #ifndef _WINBER_H
19 #define _WINBER_H
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #ifndef WINBERAPI
26 #define WINBERAPI DECLSPEC_IMPORT
27 #endif
28
29 typedef struct berelement BerElement;
30 typedef ULONG ber_len_t;
31 #include <pshpack4.h>
32 typedef struct berval {
33 ber_len_t bv_len;
34 char *bv_val;
35 } BerValue, LDAP_BERVAL, *PLDAP_BERVAL, BERVAL, *PBERVAL;
36 #include <poppack.h>
37
38 typedef ULONG ber_tag_t;
39 typedef INT ber_int_t;
40 typedef UINT ber_uint_t;
41 typedef INT ber_slen_t;
42
43 #define LBER_ERROR ((ber_tag_t)-1)
44 #define LBER_DEFAULT ((ber_tag_t)-1)
45 #define LBER_USE_DER 0x01
46
47 WINBERAPI BerElement *ber_init(const BerValue*);
48 WINBERAPI int ber_printf(BerElement*,const char*,...);
49 WINBERAPI int ber_flatten(BerElement*,BerValue**);
50 WINBERAPI ber_tag_t ber_scanf(BerElement*,const char*,...);
51 WINBERAPI ber_tag_t ber_peek_tag(BerElement*,ber_len_t*);
52 WINBERAPI ber_tag_t ber_skip_tag(BerElement*,ber_len_t*);
53 WINBERAPI ber_tag_t ber_first_element(BerElement*,ber_len_t*,char**);
54 WINBERAPI ber_tag_t ber_next_element(BerElement*,ber_len_t*,char*);
55 WINBERAPI void ber_bvfree(BerValue*);
56 WINBERAPI void ber_bvecfree(BerValue**);
57 WINBERAPI void ber_free(BerElement*,int);
58 WINBERAPI BerValue *ber_bvdup(BerValue*);
59 WINBERAPI BerElement *ber_alloc_t(int);
60
61 #ifdef __cplusplus
62 }
63 #endif
64 #endif /* _WINBER_H */