• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KLDAP Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kldap
w32-ldap-help.h
1 //krazy:excludeall=style
2 /* w32-ldap-help.h - Map utf8 based API into a wchar_t API.
3 
4  Copyright (c) 2010 Andre Heinecke <aheinecke@intevation.de>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef W32_LDAP_HELP_H
23 #define W32_LDAP_HELP_H
24 
25 #include <windows.h>
26 #ifdef UNICODE
27 # undef UNICODE
28 # include <winldap.h>
29 # include <winber.h>
30 # define UNICODE
31 #else
32 # include <winldap.h>
33 # include <winber.h>
34 #endif // UNICODE
35 
36 /*
37  * From the openldap manpage:
38  * ber_len_t is an unsigned integer of at least 32 bits used to represent
39  * a length. It is commonly equivalent to a size_t. ber_slen_t is the
40  * signed variant to ber_len_t.
41  */
42 typedef ULONG ber_len_t;
43 
44 #ifndef timeval
45 #define timeval l_timeval
46 #endif
47 
48 #ifdef _WIN32_WCE //krazy:exclude=cpp allow as this is a non-Qt source file
49 #include "wce-ldap-help.h"
50 #endif
51 
52 /* Redirect used ldap functions to functions with win_ prefix
53  * to further redirect those depending on the Windows Flavour */
54 //#define ldap_err2string(a) win_ldap_err2string(a)
55 #define ldap_init(a,b) win_ldap_init(a,b)
56 #define ldap_sasl_bind(a, b, c, d, e, f, g) \
57  win_ldap_sasl_bind(a, b, c, d, e, f, g)
58 #define ldap_sasl_bind_s(a, b, c, d, e, f, g) \
59  win_ldap_sasl_bind_s(a, b, c, d, e, f, g)
60 #define ldap_parse_sasl_bind_result ( a, b, c, d, e ) \
61  win_ldap_parse_sasl_bind_result((a), (b), (c), (d), (e))
62 #define ldap_get_dn(a, b) win_ldap_get_dn(a,b)
63 #define ldap_memfree(a) win_ldap_memfree(a)
64 #define ldap_mods_free(a, b) win_ldap_mods_free(a, b)
65 #define ldap_first_attribute(a, b, c) \
66  win_ldap_first_attribute(a, b, c)
67 #define ldap_get_values_len(a, b, c) \
68  win_ldap_get_values_len(a, b, c)
69 #define ldap_next_attribute(a, b, c ) \
70  win_ldap_next_attribute(a, b, c)
71 #define ldap_parse_result(a, b, c, d, e, f, g, h) \
72  win_ldap_parse_result(a, b, c, d, e, f, g, h)
73 #define ldap_parse_extended_result(a, b, c, d, e) \
74  win_ldap_parse_extended_result(a, b, c, d, e)
75 #define ldap_add_ext(a, b, c, d, e, f) \
76  win_ldap_add_ext((a), (b), (c), (d), (e), (f))
77 #define ldap_add_ext_s(a, b, c, d, e) \
78  win_ldap_add_ext_s((a), (b), (c), (d), (e))
79 # define ldap_compare_ext_s(a, b, c, d, e, f) \
80  win_ldap_compare_ext_s((a), (b), (c), (d), (e), (f))
81 # define ldap_compare_ext(a, b, c, d, e, f, g) \
82  win_ldap_compare_ext((a), (b), (c), (d), (e), (f), (g))
83 # define ldap_modify_ext_s(a, b, c, d, e ) \
84  win_ldap_modify_ext_s((a), (b), (c), (d), (e))
85 # define ldap_search_ext(a, b, c, d, e, f, g, h, i, j, k) \
86  win_ldap_search_ext((a), (b), (c), (d), (e), (f), (g), (h), (i), (j), (k))
87 #define ldap_rename_ext( a, b, c, d, e, f, g, h ) \
88  win_ldap_rename_ext((a), (b), (c), (d), (e), (f), (g), (h) )
89 #define ldap_rename( a, b, c, d, e, f, g, h ) \
90  ldap_rename_ext((a), (b), (c), (d), (e), (f), (g), (h) )
91 #define ldap_delete_ext(a, b, c, d, e ) \
92  win_ldap_delete_ext((a), (b), (c), (d), (e) )
93 #define ldap_modify_ext(a, b, c, d, e, f ) \
94  win_ldap_modify_ext( (a), (b), (c), (d), (e), (f))
95 #define ldap_abandon_ext(a, b, c, d) \
96  win_ldap_abandon_ext((a), (b), (c), (d))
97 #define ldap_controls_free(a) win_ldap_controls_free(a)
98 
99 // Use the functions that are available on the platform
100 // or redirect to wrapper functions
101 #ifdef _WIN32_WCE //krazy:exclude=cpp allow as this is a non-Qt source file
102 # define win_ldap_init(a,b) \
103  my_win_ldap_initA ((a), (b))
104 # define win_ldap_simple_bind_s(a,b,c) \
105  my_win_ldap_simple_bind_sA ((a),(b),(c))
106 /* Contrary to documentation the sasl_bind functions
107  * are not availabe for wince
108 
109 # define win_ldap_sasl_bind(a, b, c, d, e, f, g) \
110  ldap_sasl_bindA(a, b, c, d, e, f, g)
111 # define win_ldap_sasl_bind_result ( a, b, c, d, e ) \
112  my_win_ldap_sasl_bind_result (((a), (b), (c), (d), (e))
113 # define win_ldap_sasl_bind_s(a, b, c, d, e, f, g) \
114  ldap_sasl_bind_s(a, b, c, d, e, f, g)*/
115 # define win_ldap_search_st(a,b,c,d,e,f,g,h) \
116  my_win_ldap_search_stA ((a), (b), (c), (d), (e), (f), (g), (h))
117 # define win_ldap_first_attribute(a,b,c) \
118  my_win_ldap_first_attributeA ((a),(b),(c))
119 # define win_ldap_next_attribute(a,b,c) \
120  my_win_ldap_next_attributeA ((a),(b),(c))
121 # define win_ldap_get_values_len(a,b,c) \
122  my_win_ldap_get_values_lenA ((a),(b),(c))
123 # define win_ldap_get_dn(a,b) \
124  my_win_ldap_get_dnA((a),(b))
125 # define win_ldap_parse_extended_result(a, b, c, d, e ) \
126  my_win_ldap_parse_extended_resultA((a), (b), (c), (d), (e))
127 # define win_ldap_memfree(a) free(a)
128 # define win_ldap_controls_free(a) \
129  my_win_ldap_controls_freeA((a))
130 # define win_ldap_mods_free(a, b) \
131  my_win_ldap_mods_freeA((a), (b))
132 # define win_ldap_parse_result(a, b, c, d, e, f, g, h ) \
133  my_win_ldap_parse_resultA((a), (b), ((ulong *) c), (d), (e), (f), (g), (h))
134 # define win_ldap_search_ext(a, b, c, d, e, f, g, h, i, j, k) \
135  my_win_ldap_search_extA((a), (b), (c), (d), (e), (f), (g), (h), (i), (j), (k))
136 # define win_ldap_add_ext_s(a, b, c, d, e) \
137  my_win_ldap_add_ext_sA((a), (b), (c), (d), (e))
138 # define win_ldap_add_ext(a, b, c, d, e, f) \
139  my_win_ldap_add_extA((a), (b), (c), (d), (e), ( (ulong * ) f))
140 #define win_ldap_rename_ext( a, b, c, d, e, f, g, h ) \
141  ldap_rename_extA((a), (b), (c), (d), (e), (f), (g), ( ( ulong * ) h) )
142 #define win_ldap_delete_ext( a, b, c, d, e ) \
143  ldap_delete_extA((a), (b), (c), (d), ( ( ulong * ) e) )
144 #define win_ldap_modify_ext( a, b, c, d, e, f ) \
145  ldap_modify_extA( (a), (b), (c), (d), (e), ( ( ulong * ) f) )
146 #define win_ldap_modify_ext_s( a, b, c, d, e ) \
147  ldap_modify_ext_sA( (a), (b), (c), (d), (e) )
148 # define win_ldap_compare_ext(a, b, c, d, e, f, g) \
149  my_win_ldap_compare_extA((a), (b), (c), NULL, (d), (e), (f), ( ( ulong * ) g))
150 #define win_ldap_compare_ext_s(a, b, c, d, e, f) \
151  my_win_ldap_compare_ext_sA( (a), (b), (c), NULL, (d), (e), (f) )
152 #define win_ldap_abandon_ext(a, b, c, d) \
153  ldap_abandon((a), (b))
154 #else
155 /* Windows offers ASCII variants of most LDAP functions
156  * we only have to ensure that those are used */
157 # define LDAPControl LDAPControlA
158 # define LDAPMod LDAPModA
159 # define win_ldap_init(a,b) ldap_initA ((a), (b))
160 # define win_ldap_simple_bind_s(a,b,c) ldap_simple_bind_sA ((a), (b), (c))
161 # define win_ldap_sasl_bind(a, b, c, d, e, f, g) \
162  ldap_sasl_bindA(a, b, c, d, e, f, g)
163 # define win_ldap_sasl_bind_s(a, b, c, d, e, f, g) \
164  ldap_sasl_bind_sA(a, b, c, d, e, f, g)
165 # define win_ldap_search_st(a,b,c,d,e,f,g,h) \
166  ldap_search_stA ((a), (b), (c), (d), (e), (f), (g), (h))
167 # define win_ldap_search_ext(a, b, c, d, e, f, g, h, i, j, k) \
168  my_win_ldap_search_ext((a), (b), (c), (d), (e), (f), (g), (h), (i), (j), (k))
169 # define win_ldap_get_dn(a, b) ldap_get_dnA((a), (b))
170 # define win_ldap_first_attribute(a,b,c) ldap_first_attributeA ((a), (b), (c))
171 # define win_ldap_next_attribute(a,b,c) ldap_next_attributeA ((a), (b), (c))
172 # define win_ldap_get_values_len(a,b,c) ldap_get_values_lenA ((a), (b), (c))
173 # define win_ldap_memfree(a) ldap_memfreeA ((a))
174 # define win_ldap_err2string(a) ldap_err2stringA((a))
175 # define win_ldap_controls_free(a) ldap_controls_freeA((a))
176 # define win_ldap_mods_free(a, b) ldap_mods_freeA((a), (b))
177 # define win_ldap_add_ext(a, b, c, d, e, f) \
178  ldap_add_extA((a), (b), (c), (d), (e), ((ulong*)f))
179 # define win_ldap_add_ext_s(a, b, c, d, e) \
180  ldap_add_ext_sA((a), (b), (c), (d), (e))
181 # define win_ldap_parse_extended_result(a, b, c, d, e ) \
182  ldap_parse_extended_resultA((*a), (b), (c), (d), (e))
183 # define win_ldap_parse_result(a, b, c, d, e, f, g, h ) \
184  ldap_parse_resultA((a), (b), ((ulong *)c), (d), (e), (f), (g), (h))
185 # define win_ldap_modify_ext_s(a, b, c, d, e ) \
186  ldap_modify_ext_sW((a), (b), (c), (d), (e))
187 # define win_ldap_compare_ext_s(a, b, c, d, e, f ) \
188  ldap_compare_ext_sA((a), (b), (c), (d), (e), (f))
189 #endif /*_WIN32_WCE*/
190 #endif /*W32_LDAP_HELP_H*/
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KLDAP Library

Skip menu "KLDAP Library"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal