aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/ldapschema.h
diff options
context:
space:
mode:
authorDavid M. Syzdek <syzdek@bindlebinaries.com>2019-10-15 19:46:34 -0800
committerDavid M. Syzdek <syzdek@bindlebinaries.com>2019-10-15 19:46:34 -0800
commita54f07bb1da533f3b9be6996ac838346968b7ba9 (patch)
tree107d6a595f385489a5377a6f9d9e81cc3506091b /include/ldapschema.h
parentead967ba680610912e3d979edf904832a1e99de9 (diff)
downloadldap-utils-a54f07bb1da533f3b9be6996ac838346968b7ba9.tar.gz
ldap-utils-a54f07bb1da533f3b9be6996ac838346968b7ba9.tar.bz2
ldap-utils-a54f07bb1da533f3b9be6996ac838346968b7ba9.tar.xz
ldap-utils-a54f07bb1da533f3b9be6996ac838346968b7ba9.zip
libldapschema: adding stub for new library
Diffstat (limited to 'include/ldapschema.h')
-rw-r--r--include/ldapschema.h155
1 files changed, 155 insertions, 0 deletions
diff --git a/include/ldapschema.h b/include/ldapschema.h
new file mode 100644
index 0000000..72b46fb
--- /dev/null
+++ b/include/ldapschema.h
@@ -0,0 +1,155 @@
1/*
2 * LDAP Utilities
3 * Copyright (C) 2019 David M. Syzdek <david@syzdek.net>.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * 3. Neither the name of the copyright holder nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32/*
33 * include/ldapschema.h - common includes and prototypes
34 */
35#ifndef __LDAPSCHEMA_H
36#define __LDAPSCHEMA_H 1
37#undef __LDAPSCHEMA_PMARK
38
39///////////////
40// //
41// Headers //
42// //
43///////////////
44#ifdef __LDAPSCHEMA_PMARK
45#pragma mark - Headers
46#endif
47
48#ifdef WIN32
49#include <windows.h>
50#endif
51
52#ifdef __APPLE__
53# include "TargetConditionals.h"
54# ifdef TARGET_OS_MAC
55# include <libkern/OSAtomic.h>
56# endif
57#endif
58
59#include <inttypes.h>
60
61
62//////////////
63// //
64// Macros //
65// //
66//////////////
67#ifdef __LDAPSCHEMA_PMARK
68#pragma mark - Macros
69#endif
70
71// Exports function type
72#undef LDAPSCHEMA_C_DECLS
73#undef LDAPSCHEMA_BEGIN_C_DECLS
74#undef LDAPSCHEMA_END_C_DECLS
75#undef _LDAPSCHEMA_I
76#undef _LDAPSCHEMA_F
77#undef _LDAPSCHEMA_V
78#if defined(__cplusplus) || defined(c_plusplus)
79# define _LDAPSCHEMA_I extern "C" inline
80# define LDAPSCHEMA_C_DECLS "C" ///< exports as C functions
81# define LDAPSCHEMA_BEGIN_C_DECLS extern "C" { ///< exports as C functions
82# define LDAPSCHEMA_END_C_DECLS } ///< exports as C functions
83#else
84# define _LDAPSCHEMA_I inline
85# define LDAPSCHEMA_C_DECLS /* empty */ ///< exports as C functions
86# define LDAPSCHEMA_BEGIN_C_DECLS /* empty */ ///< exports as C functions
87# define LDAPSCHEMA_END_C_DECLS /* empty */ ///< exports as C functions
88#endif
89#ifdef WIN32
90# ifdef _LIB_LIBLDAPSCHEMA_H
91# define _LDAPSCHEMA_F extern LDAPSCHEMA_C_DECLS __declspec(dllexport) ///< used for library calls
92# define _LDAPSCHEMA_V extern LDAPSCHEMA_C_DECLS __declspec(dllexport) ///< used for library calls
93# else
94# define _LDAPSCHEMA_F extern LDAPSCHEMA_C_DECLS __declspec(dllimport) ///< used for library calls
95# define _LDAPSCHEMA_V extern LDAPSCHEMA_C_DECLS __declspec(dllimport) ///< used for library calls
96# endif
97#else
98# ifdef _LIB_LIBLDAPSCHEMA_H
99# define _LDAPSCHEMA_F /* empty */ ///< used for library calls
100# define _LDAPSCHEMA_V extern LDAPSCHEMA_C_DECLS ///< used for library calls
101# else
102# define _LDAPSCHEMA_F extern LDAPSCHEMA_C_DECLS ///< used for library calls
103# define _LDAPSCHEMA_V extern LDAPSCHEMA_C_DECLS ///< used for library calls
104# endif
105#endif
106
107
108///////////////////
109// //
110// Definitions //
111// //
112///////////////////
113#ifdef __LDAPSCHEMA_PMARK
114#pragma mark - Definitions
115#endif
116
117// result codes
118#define LDAPSCHEMA_SUCCESS 0x00 ///< operation was successful
119#define LDAPSCHEMA_NO_MEMORY (-10) ///< an memory allocation failed
120
121
122/////////////////
123// //
124// Datatypes //
125// //
126/////////////////
127#ifdef __LDAPSCHEMA_PMARK
128#pragma mark - Datatypes
129#endif
130
131/// LDAP schema descriptor state
132typedef struct ldap_schema LDAPSchema;
133
134
135//////////////////
136// //
137// Prototypes //
138// //
139//////////////////
140#ifdef __LDAPSCHEMA_PMARK
141#pragma mark - Prototypes
142#endif
143LDAPSCHEMA_BEGIN_C_DECLS
144
145// error functions
146_LDAPSCHEMA_F const char * ldapschema_err2string( int err );
147_LDAPSCHEMA_F int ldapschema_errno( LDAPSchema * lsd );
148
149// memory functions
150_LDAPSCHEMA_F void ldapschema_free( LDAPSchema * lsd) ;
151_LDAPSCHEMA_F int ldapschema_initialize( LDAPSchema ** lsdp );
152
153
154LDAPSCHEMA_END_C_DECLS
155#endif /* end of header */