1 /**
2  * Windows API header module
3  *
4  * Translated from MinGW Windows headers
5  *
6  * Authors: Stewart Gordon
7  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
8  * Source: $(DRUNTIMESRC core/sys/windows/_winber.d)
9  */
10 /// Automatically imported and edited from the druntime module
11 /// core.sys.windows.winber for the auto-generated win32 package.
12 module win32.winber;
13 //version (Windows):
14 @system:
15 
16 /* Comment from MinGW
17   winber.h - Header file for the Windows LDAP Basic Encoding Rules API
18 
19   Written by Filip Navara <xnavara@volny.cz>
20 
21   References:
22     The C LDAP Application Program Interface
23     http://www.watersprings.org/pub/id/draft-ietf-ldapext-ldap-c-api-05.txt
24 
25     Lightweight Directory Access Protocol Reference
26     http://msdn.microsoft.com/library/en-us/netdir/ldap/ldap_reference.asp
27 
28   This library is distributed in the hope that it will be useful,
29   but WITHOUT ANY WARRANTY; without even the implied warranty of
30   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31  */
32 
33  import win32.basetsd;
34 
35 /* Opaque structure
36  *  http://msdn.microsoft.com/library/en-us/ldap/ldap/berelement.asp
37  */
38 struct BerElement;
39 
40 alias int ber_int_t, ber_slen_t;
41 alias uint ber_uint_t, ber_len_t, ber_tag_t;
42 
43 align(4):
44 struct BerValue {
45     ber_len_t bv_len;
46     char*     bv_val;
47 }
48 alias BerValue LDAP_BERVAL, BERVAL;
49 alias BerValue* PLDAP_BERVAL, PBERVAL;
50 
51 enum ber_tag_t
52     LBER_ERROR   = -1,
53     LBER_DEFAULT = -1,
54     LBER_USE_DER =  1;
55 
56 /*  FIXME: In MinGW, these are WINBERAPI == DECLSPEC_IMPORT.  Linkage
57  *  attribute?
58  */
59 extern (C) {
60     BerElement* ber_init(const(BerValue)*);
61     int ber_printf(BerElement*, const(char)*, ...);
62     int ber_flatten(BerElement*, BerValue**);
63     ber_tag_t ber_scanf(BerElement*, const(char)*, ...);
64     ber_tag_t ber_peek_tag(BerElement*, ber_len_t*);
65     ber_tag_t ber_skip_tag(BerElement*, ber_len_t*);
66     ber_tag_t ber_first_element(BerElement*, ber_len_t*, char**);
67     ber_tag_t ber_next_element(BerElement*, ber_len_t*, char*);
68     void ber_bvfree(BerValue*);
69     void ber_bvecfree(BerValue**);
70     void ber_free(BerElement*, int);
71     BerValue* ber_bvdup(BerValue*);
72     BerElement* ber_alloc_t(int);
73 }