ReactOS 0.4.15-dev-8096-ga0eec98
value.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
Include dependency graph for value.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
ULONG CDECL WLDAP32_ldap_count_values_len (struct WLDAP32_berval **vals)
 
ULONG CDECL ldap_count_valuesA (PCHAR *vals)
 
ULONG CDECL ldap_count_valuesW (PWCHAR *vals)
 
PCHAR *CDECL ldap_get_valuesA (WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, PCHAR attr)
 
PWCHAR *CDECL ldap_get_valuesW (WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, PWCHAR attr)
 
struct WLDAP32_berval **CDECL ldap_get_values_lenA (WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *message, PCHAR attr)
 
struct WLDAP32_berval **CDECL ldap_get_values_lenW (WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *message, PWCHAR attr)
 
ULONG CDECL WLDAP32_ldap_value_free_len (struct WLDAP32_berval **vals)
 
ULONG CDECL ldap_value_freeA (PCHAR *vals)
 
ULONG CDECL ldap_value_freeW (PWCHAR *vals)
 

Function Documentation

◆ ldap_count_valuesA()

ULONG CDECL ldap_count_valuesA ( PCHAR vals)

Definition at line 72 of file value.c.

73{
75#ifdef HAVE_LDAP
76 WCHAR **valsW = NULL;
77
78 TRACE( "(%p)\n", vals );
79
80 if (!vals) return 0;
81
82 valsW = strarrayAtoW( vals );
83 if (!valsW) return WLDAP32_LDAP_NO_MEMORY;
84
85 ret = ldap_count_valuesW( valsW );
86 strarrayfreeW( valsW );
87
88#endif
89 return ret;
90}
#define NULL
Definition: types.h:112
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t ULONG
Definition: typedefs.h:59
ULONG CDECL ldap_count_valuesW(PWCHAR *vals)
Definition: value.c:108
int ret
@ WLDAP32_LDAP_NOT_SUPPORTED
@ WLDAP32_LDAP_NO_MEMORY
static void strarrayfreeW(LPWSTR *strarray)
Definition: wldap32.h:224
static LPWSTR * strarrayAtoW(LPSTR *strarray)
Definition: wldap32.h:134
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ldap_count_valuesW()

ULONG CDECL ldap_count_valuesW ( PWCHAR vals)

Definition at line 108 of file value.c.

109{
111#ifdef HAVE_LDAP
112 WCHAR **p = vals;
113
114 TRACE( "(%p)\n", vals );
115
116 if (!vals) return 0;
117
118 ret = 0;
119 while (*p++) ret++;
120
121#endif
122 return ret;
123}
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by ldap_count_valuesA().

◆ ldap_get_values_lenA()

struct WLDAP32_berval **CDECL ldap_get_values_lenA ( WLDAP32_LDAP ld,
WLDAP32_LDAPMessage message,
PCHAR  attr 
)

Definition at line 249 of file value.c.

251{
252#ifdef HAVE_LDAP
253 WCHAR *attrW = NULL;
254 struct WLDAP32_berval **ret;
255
256 TRACE( "(%p, %p, %s)\n", ld, message, debugstr_a(attr) );
257
258 if (!ld || !message || !attr) return NULL;
259
260 attrW = strAtoW( attr );
261 if (!attrW) return NULL;
262
263 ret = ldap_get_values_lenW( ld, message, attrW );
264
265 strfreeW( attrW );
266 return ret;
267
268#else
269 return NULL;
270#endif
271}
static LPWSTR strAtoW(const char *str)
#define debugstr_a
Definition: kernel32.h:31
Definition: cookie.c:202
Definition: tftpd.h:60
struct WLDAP32_berval **CDECL ldap_get_values_lenW(WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *message, PWCHAR attr)
Definition: value.c:292
static void strfreeW(LPWSTR str)
Definition: wldap32.h:103

◆ ldap_get_values_lenW()

struct WLDAP32_berval **CDECL ldap_get_values_lenW ( WLDAP32_LDAP ld,
WLDAP32_LDAPMessage message,
PWCHAR  attr 
)

Definition at line 292 of file value.c.

294{
295#ifdef HAVE_LDAP
296 char *attrU = NULL;
297 struct berval **ret;
298
299 TRACE( "(%p, %p, %s)\n", ld, message, debugstr_w(attr) );
300
301 if (!ld || !message || !attr) return NULL;
302
303 attrU = strWtoU( attr );
304 if (!attrU) return NULL;
305
306 ret = ldap_get_values_len( ld, message, attrU );
307
308 strfreeU( attrU );
309 return (struct WLDAP32_berval **)ret;
310
311#else
312 return NULL;
313#endif
314}
#define debugstr_w
Definition: kernel32.h:32
Definition: winber.h:32
#define ldap_get_values_len
Definition: winldap.h:671
static void strfreeU(char *str)
Definition: wldap32.h:108
static char * strWtoU(LPCWSTR str)
Definition: wldap32.h:74

Referenced by ldap_get_values_lenA().

◆ ldap_get_valuesA()

PCHAR *CDECL ldap_get_valuesA ( WLDAP32_LDAP ld,
WLDAP32_LDAPMessage entry,
PCHAR  attr 
)

Definition at line 130 of file value.c.

131{
132 PCHAR *ret = NULL;
133#ifdef HAVE_LDAP
134 WCHAR *attrW = NULL, **retW;
135
136 TRACE( "(%p, %p, %s)\n", ld, entry, debugstr_a(attr) );
137
138 if (!ld || !entry || !attr) return NULL;
139
140 attrW = strAtoW( attr );
141 if (!attrW) return NULL;
142
143 retW = ldap_get_valuesW( ld, entry, attrW );
144
145 ret = strarrayWtoA( retW );
146 ldap_value_freeW( retW );
147 strfreeW( attrW );
148
149#endif
150 return ret;
151}
uint32_t entry
Definition: isohybrid.c:63
char * PCHAR
Definition: typedefs.h:51
PWCHAR *CDECL ldap_get_valuesW(WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, PWCHAR attr)
Definition: value.c:217
ULONG CDECL ldap_value_freeW(PWCHAR *vals)
Definition: value.c:364
static LPSTR * strarrayWtoA(LPWSTR *strarray)
Definition: wldap32.h:154

◆ ldap_get_valuesW()

PWCHAR *CDECL ldap_get_valuesW ( WLDAP32_LDAP ld,
WLDAP32_LDAPMessage entry,
PWCHAR  attr 
)

Definition at line 217 of file value.c.

218{
219 PWCHAR *ret = NULL;
220#ifdef HAVE_LDAP
221 char *attrU = NULL, **retU;
222 struct berval **bv;
223
224 TRACE( "(%p, %p, %s)\n", ld, entry, debugstr_w(attr) );
225
226 if (!ld || !entry || !attr) return NULL;
227
228 attrU = strWtoU( attr );
229 if (!attrU) return NULL;
230
231 bv = ldap_get_values_len( ld, entry, attrU );
232
233 retU = bv2str_array( bv );
234 ret = strarrayUtoW( retU );
235
237 strarrayfreeU( retU );
238 strfreeU( attrU );
239
240#endif
241 return ret;
242}
uint16_t * PWCHAR
Definition: typedefs.h:56
WINLDAPAPI ULONG ldap_value_free_len(struct berval **)
static void strarrayfreeU(char **strarray)
Definition: wldap32.h:234
static LPWSTR * strarrayUtoW(char **strarray)
Definition: wldap32.h:194

Referenced by ldap_get_valuesA().

◆ ldap_value_freeA()

ULONG CDECL ldap_value_freeA ( PCHAR vals)

Definition at line 344 of file value.c.

345{
346 TRACE( "(%p)\n", vals );
347
348 strarrayfreeA( vals );
350}
@ WLDAP32_LDAP_SUCCESS
static void strarrayfreeA(LPSTR *strarray)
Definition: wldap32.h:214

◆ ldap_value_freeW()

ULONG CDECL ldap_value_freeW ( PWCHAR vals)

Definition at line 364 of file value.c.

365{
366 TRACE( "(%p)\n", vals );
367
368 strarrayfreeW( vals );
370}

Referenced by ldap_explode_dnA(), ldap_get_optionA(), ldap_get_valuesA(), ldap_parse_referenceA(), and ldap_parse_resultA().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )

◆ WLDAP32_ldap_count_values_len()

ULONG CDECL WLDAP32_ldap_count_values_len ( struct WLDAP32_berval **  vals)

Definition at line 55 of file value.c.

56{
58#ifdef HAVE_LDAP
59
60 TRACE( "(%p)\n", vals );
61 ret = ldap_count_values_len( (struct berval **)vals );
62
63#endif
64 return ret;
65}
WINLDAPAPI ULONG ldap_count_values_len(struct berval **)

◆ WLDAP32_ldap_value_free_len()

ULONG CDECL WLDAP32_ldap_value_free_len ( struct WLDAP32_berval **  vals)

Definition at line 328 of file value.c.

329{
330#ifdef HAVE_LDAP
331
332 TRACE( "(%p)\n", vals );
333 ldap_value_free_len( (struct berval **)vals );
334
335#endif
337}