KLDAP Library
w32-ldap-help.h
00001 //krazy:excludeall=style 00002 /* w32-ldap-help.h - Map utf8 based API into a wchar_t API. 00003 00004 Copyright (c) 2010 Andre Heinecke <aheinecke@intevation.de> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef W32_LDAP_HELP_H 00023 #define W32_LDAP_HELP_H 00024 00025 #include <windows.h> 00026 #ifdef UNICODE 00027 # undef UNICODE 00028 # include <winldap.h> 00029 # include <winber.h> 00030 # define UNICODE 00031 #else 00032 # include <winldap.h> 00033 # include <winber.h> 00034 #endif // UNICODE 00035 00036 /* 00037 * From the openldap manpage: 00038 * ber_len_t is an unsigned integer of at least 32 bits used to represent 00039 * a length. It is commonly equivalent to a size_t. ber_slen_t is the 00040 * signed variant to ber_len_t. 00041 */ 00042 typedef ULONG ber_len_t; 00043 00044 #ifndef timeval 00045 #define timeval l_timeval 00046 #endif 00047 00048 #ifdef _WIN32_WCE //krazy:exclude=cpp allow as this is a non-Qt source file 00049 #include "wce-ldap-help.h" 00050 #endif 00051 00052 /* Redirect used ldap functions to functions with win_ prefix 00053 * to further redirect those depending on the Windows Flavour */ 00054 //#define ldap_err2string(a) win_ldap_err2string(a) 00055 #define ldap_init(a,b) win_ldap_init(a,b) 00056 #define ldap_sasl_bind(a, b, c, d, e, f, g) \ 00057 win_ldap_sasl_bind(a, b, c, d, e, f, g) 00058 #define ldap_sasl_bind_s(a, b, c, d, e, f, g) \ 00059 win_ldap_sasl_bind_s(a, b, c, d, e, f, g) 00060 #define ldap_parse_sasl_bind_result ( a, b, c, d, e ) \ 00061 win_ldap_parse_sasl_bind_result((a), (b), (c), (d), (e)) 00062 #define ldap_get_dn(a, b) win_ldap_get_dn(a,b) 00063 #define ldap_memfree(a) win_ldap_memfree(a) 00064 #define ldap_mods_free(a, b) win_ldap_mods_free(a, b) 00065 #define ldap_first_attribute(a, b, c) \ 00066 win_ldap_first_attribute(a, b, c) 00067 #define ldap_get_values_len(a, b, c) \ 00068 win_ldap_get_values_len(a, b, c) 00069 #define ldap_next_attribute(a, b, c ) \ 00070 win_ldap_next_attribute(a, b, c) 00071 #define ldap_parse_result(a, b, c, d, e, f, g, h) \ 00072 win_ldap_parse_result(a, b, c, d, e, f, g, h) 00073 #define ldap_parse_extended_result(a, b, c, d, e) \ 00074 win_ldap_parse_extended_result(a, b, c, d, e) 00075 #define ldap_add_ext(a, b, c, d, e, f) \ 00076 win_ldap_add_ext((a), (b), (c), (d), (e), (f)) 00077 #define ldap_add_ext_s(a, b, c, d, e) \ 00078 win_ldap_add_ext_s((a), (b), (c), (d), (e)) 00079 # define ldap_compare_ext_s(a, b, c, d, e, f) \ 00080 win_ldap_compare_ext_s((a), (b), (c), (d), (e), (f)) 00081 # define ldap_compare_ext(a, b, c, d, e, f, g) \ 00082 win_ldap_compare_ext((a), (b), (c), (d), (e), (f), (g)) 00083 # define ldap_modify_ext_s(a, b, c, d, e ) \ 00084 win_ldap_modify_ext_s((a), (b), (c), (d), (e)) 00085 # define ldap_search_ext(a, b, c, d, e, f, g, h, i, j, k) \ 00086 win_ldap_search_ext((a), (b), (c), (d), (e), (f), (g), (h), (i), (j), (k)) 00087 #define ldap_rename_ext( a, b, c, d, e, f, g, h ) \ 00088 win_ldap_rename_ext((a), (b), (c), (d), (e), (f), (g), (h) ) 00089 #define ldap_rename( a, b, c, d, e, f, g, h ) \ 00090 ldap_rename_ext((a), (b), (c), (d), (e), (f), (g), (h) ) 00091 #define ldap_delete_ext(a, b, c, d, e ) \ 00092 win_ldap_delete_ext((a), (b), (c), (d), (e) ) 00093 #define ldap_modify_ext(a, b, c, d, e, f ) \ 00094 win_ldap_modify_ext( (a), (b), (c), (d), (e), (f)) 00095 #define ldap_abandon_ext(a, b, c, d) \ 00096 win_ldap_abandon_ext((a), (b), (c), (d)) 00097 #define ldap_controls_free(a) win_ldap_controls_free(a) 00098 00099 // Use the functions that are available on the platform 00100 // or redirect to wrapper functions 00101 #ifdef _WIN32_WCE //krazy:exclude=cpp allow as this is a non-Qt source file 00102 # define win_ldap_init(a,b) \ 00103 my_win_ldap_initA ((a), (b)) 00104 # define win_ldap_simple_bind_s(a,b,c) \ 00105 my_win_ldap_simple_bind_sA ((a),(b),(c)) 00106 /* Contrary to documentation the sasl_bind functions 00107 * are not availabe for wince 00108 00109 # define win_ldap_sasl_bind(a, b, c, d, e, f, g) \ 00110 ldap_sasl_bindA(a, b, c, d, e, f, g) 00111 # define win_ldap_sasl_bind_result ( a, b, c, d, e ) \ 00112 my_win_ldap_sasl_bind_result (((a), (b), (c), (d), (e)) 00113 # define win_ldap_sasl_bind_s(a, b, c, d, e, f, g) \ 00114 ldap_sasl_bind_s(a, b, c, d, e, f, g)*/ 00115 # define win_ldap_search_st(a,b,c,d,e,f,g,h) \ 00116 my_win_ldap_search_stA ((a), (b), (c), (d), (e), (f), (g), (h)) 00117 # define win_ldap_first_attribute(a,b,c) \ 00118 my_win_ldap_first_attributeA ((a),(b),(c)) 00119 # define win_ldap_next_attribute(a,b,c) \ 00120 my_win_ldap_next_attributeA ((a),(b),(c)) 00121 # define win_ldap_get_values_len(a,b,c) \ 00122 my_win_ldap_get_values_lenA ((a),(b),(c)) 00123 # define win_ldap_get_dn(a,b) \ 00124 my_win_ldap_get_dnA((a),(b)) 00125 # define win_ldap_parse_extended_result(a, b, c, d, e ) \ 00126 my_win_ldap_parse_extended_resultA((a), (b), (c), (d), (e)) 00127 # define win_ldap_memfree(a) free(a) 00128 # define win_ldap_controls_free(a) \ 00129 my_win_ldap_controls_freeA((a)) 00130 # define win_ldap_mods_free(a, b) \ 00131 my_win_ldap_mods_freeA((a), (b)) 00132 # define win_ldap_parse_result(a, b, c, d, e, f, g, h ) \ 00133 my_win_ldap_parse_resultA((a), (b), ((ulong *) c), (d), (e), (f), (g), (h)) 00134 # define win_ldap_search_ext(a, b, c, d, e, f, g, h, i, j, k) \ 00135 my_win_ldap_search_extA((a), (b), (c), (d), (e), (f), (g), (h), (i), (j), (k)) 00136 # define win_ldap_add_ext_s(a, b, c, d, e) \ 00137 my_win_ldap_add_ext_sA((a), (b), (c), (d), (e)) 00138 # define win_ldap_add_ext(a, b, c, d, e, f) \ 00139 my_win_ldap_add_extA((a), (b), (c), (d), (e), ( (ulong * ) f)) 00140 #define win_ldap_rename_ext( a, b, c, d, e, f, g, h ) \ 00141 ldap_rename_extA((a), (b), (c), (d), (e), (f), (g), ( ( ulong * ) h) ) 00142 #define win_ldap_delete_ext( a, b, c, d, e ) \ 00143 ldap_delete_extA((a), (b), (c), (d), ( ( ulong * ) e) ) 00144 #define win_ldap_modify_ext( a, b, c, d, e, f ) \ 00145 ldap_modify_extA( (a), (b), (c), (d), (e), ( ( ulong * ) f) ) 00146 #define win_ldap_modify_ext_s( a, b, c, d, e ) \ 00147 ldap_modify_ext_sA( (a), (b), (c), (d), (e) ) 00148 # define win_ldap_compare_ext(a, b, c, d, e, f, g) \ 00149 my_win_ldap_compare_extA((a), (b), (c), NULL, (d), (e), (f), ( ( ulong * ) g)) 00150 #define win_ldap_compare_ext_s(a, b, c, d, e, f) \ 00151 my_win_ldap_compare_ext_sA( (a), (b), (c), NULL, (d), (e), (f) ) 00152 #define win_ldap_abandon_ext(a, b, c, d) \ 00153 ldap_abandon((a), (b)) 00154 #else 00155 /* Windows offers ASCII variants of most LDAP functions 00156 * we only have to ensure that those are used */ 00157 # define LDAPControl LDAPControlA 00158 # define LDAPMod LDAPModA 00159 # define win_ldap_init(a,b) ldap_initA ((a), (b)) 00160 # define win_ldap_simple_bind_s(a,b,c) ldap_simple_bind_sA ((a), (b), (c)) 00161 # define win_ldap_sasl_bind(a, b, c, d, e, f, g) \ 00162 ldap_sasl_bindA(a, b, c, d, e, f, g) 00163 # define win_ldap_sasl_bind_s(a, b, c, d, e, f, g) \ 00164 ldap_sasl_bind_sA(a, b, c, d, e, f, g) 00165 # define win_ldap_search_st(a,b,c,d,e,f,g,h) \ 00166 ldap_search_stA ((a), (b), (c), (d), (e), (f), (g), (h)) 00167 # define win_ldap_search_ext(a, b, c, d, e, f, g, h, i, j, k) \ 00168 my_win_ldap_search_ext((a), (b), (c), (d), (e), (f), (g), (h), (i), (j), (k)) 00169 # define win_ldap_get_dn(a, b) ldap_get_dnA((a), (b)) 00170 # define win_ldap_first_attribute(a,b,c) ldap_first_attributeA ((a), (b), (c)) 00171 # define win_ldap_next_attribute(a,b,c) ldap_next_attributeA ((a), (b), (c)) 00172 # define win_ldap_get_values_len(a,b,c) ldap_get_values_lenA ((a), (b), (c)) 00173 # define win_ldap_memfree(a) ldap_memfreeA ((a)) 00174 # define win_ldap_err2string(a) ldap_err2stringA((a)) 00175 # define win_ldap_controls_free(a) ldap_controls_freeA((a)) 00176 # define win_ldap_mods_free(a, b) ldap_mods_freeA((a), (b)) 00177 # define win_ldap_add_ext(a, b, c, d, e, f) \ 00178 ldap_add_extA((a), (b), (c), (d), (e), ((ulong*)f)) 00179 # define win_ldap_add_ext_s(a, b, c, d, e) \ 00180 ldap_add_ext_sA((a), (b), (c), (d), (e)) 00181 # define win_ldap_parse_extended_result(a, b, c, d, e ) \ 00182 ldap_parse_extended_resultA((*a), (b), (c), (d), (e)) 00183 # define win_ldap_parse_result(a, b, c, d, e, f, g, h ) \ 00184 ldap_parse_resultA((a), (b), ((ulong *)c), (d), (e), (f), (g), (h)) 00185 # define win_ldap_modify_ext_s(a, b, c, d, e ) \ 00186 ldap_modify_ext_sW((a), (b), (c), (d), (e)) 00187 # define win_ldap_compare_ext_s(a, b, c, d, e, f ) \ 00188 ldap_compare_ext_sA((a), (b), (c), (d), (e), (f)) 00189 #endif /*_WIN32_WCE*/ 00190 #endif /*W32_LDAP_HELP_H*/
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue May 8 2012 00:00:06 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue May 8 2012 00:00:06 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.