ReactOS 0.4.15-dev-8236-g99f0937
ber.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winldap.h"
#include "wine/debug.h"
Include dependency graph for ber.c:

Go to the source code of this file.

Macros

#define LBER_ERROR   (~0U)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wldap32)
 
BerElement *CDECL WLDAP32_ber_alloc_t (INT options)
 
BERVAL *CDECL WLDAP32_ber_bvdup (BERVAL *berval)
 
void CDECL WLDAP32_ber_bvecfree (PBERVAL *berval)
 
void CDECL WLDAP32_ber_bvfree (BERVAL *berval)
 
ULONG CDECL WLDAP32_ber_first_element (BerElement *berelement, ULONG *len, CHAR **opaque)
 
INT CDECL WLDAP32_ber_flatten (BerElement *berelement, PBERVAL *berval)
 
void CDECL WLDAP32_ber_free (BerElement *berelement, INT buf)
 
BerElement *CDECL WLDAP32_ber_init (BERVAL *berval)
 
ULONG CDECL WLDAP32_ber_next_element (BerElement *berelement, ULONG *len, CHAR *opaque)
 
ULONG CDECL WLDAP32_ber_peek_tag (BerElement *berelement, ULONG *len)
 
ULONG CDECL WLDAP32_ber_skip_tag (BerElement *berelement, ULONG *len)
 
INT WINAPIV WLDAP32_ber_printf (BerElement *berelement, PCHAR fmt,...)
 
INT WINAPIV WLDAP32_ber_scanf (BerElement *berelement, PCHAR fmt,...)
 

Macro Definition Documentation

◆ LBER_ERROR

#define LBER_ERROR   (~0U)

Definition at line 32 of file ber.c.

Function Documentation

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wldap32  )

◆ WLDAP32_ber_alloc_t()

BerElement *CDECL WLDAP32_ber_alloc_t ( INT  options)

Definition at line 50 of file ber.c.

51{
52#ifdef HAVE_LDAP
53 return ber_alloc_t( options );
54#else
55 return NULL;
56#endif
57}
#define NULL
Definition: types.h:112
WINBERAPI BerElement * ber_alloc_t(int)

◆ WLDAP32_ber_bvdup()

BERVAL *CDECL WLDAP32_ber_bvdup ( BERVAL berval)

Definition at line 75 of file ber.c.

76{
77#ifdef HAVE_LDAP
78 return ber_bvdup( berval );
79#else
80 return NULL;
81#endif
82}
Definition: winber.h:32
WINBERAPI BerValue * ber_bvdup(BerValue *)

◆ WLDAP32_ber_bvecfree()

void CDECL WLDAP32_ber_bvecfree ( PBERVAL berval)

Definition at line 100 of file ber.c.

101{
102#ifdef HAVE_LDAP
104#endif
105}
WINBERAPI void ber_bvecfree(BerValue **)

◆ WLDAP32_ber_bvfree()

void CDECL WLDAP32_ber_bvfree ( BERVAL berval)

Definition at line 123 of file ber.c.

124{
125#ifdef HAVE_LDAP
127#endif
128}
WINBERAPI void ber_bvfree(BerValue *)

◆ WLDAP32_ber_first_element()

ULONG CDECL WLDAP32_ber_first_element ( BerElement berelement,
ULONG len,
CHAR **  opaque 
)

Definition at line 148 of file ber.c.

149{
150#ifdef HAVE_LDAP
151 return ber_first_element( berelement, len, opaque );
152#else
153 return LBER_ERROR;
154#endif
155}
#define LBER_ERROR
Definition: ber.c:32
GLenum GLsizei len
Definition: glext.h:6722
WINBERAPI ber_tag_t ber_first_element(BerElement *, ber_len_t *, char **)

◆ WLDAP32_ber_flatten()

INT CDECL WLDAP32_ber_flatten ( BerElement berelement,
PBERVAL berval 
)

Definition at line 174 of file ber.c.

175{
176#ifdef HAVE_LDAP
177 return ber_flatten( berelement, berval );
178#else
179 return LBER_ERROR;
180#endif
181}
WINBERAPI int ber_flatten(BerElement *, BerValue **)

◆ WLDAP32_ber_free()

void CDECL WLDAP32_ber_free ( BerElement berelement,
INT  buf 
)

Definition at line 200 of file ber.c.

201{
202#ifdef HAVE_LDAP
204#endif
205}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
WINBERAPI void ber_free(BerElement *, int)

◆ WLDAP32_ber_init()

BerElement *CDECL WLDAP32_ber_init ( BERVAL berval)

Definition at line 223 of file ber.c.

224{
225#ifdef HAVE_LDAP
226 return ber_init( berval );
227#else
228 return NULL;
229#endif
230}
WINBERAPI BerElement * ber_init(const BerValue *)

◆ WLDAP32_ber_next_element()

ULONG CDECL WLDAP32_ber_next_element ( BerElement berelement,
ULONG len,
CHAR opaque 
)

Definition at line 251 of file ber.c.

252{
253#ifdef HAVE_LDAP
254 return ber_next_element( berelement, len, opaque );
255#else
256 return LBER_ERROR;
257#endif
258}
WINBERAPI ber_tag_t ber_next_element(BerElement *, ber_len_t *, char *)

◆ WLDAP32_ber_peek_tag()

ULONG CDECL WLDAP32_ber_peek_tag ( BerElement berelement,
ULONG len 
)

Definition at line 274 of file ber.c.

275{
276#ifdef HAVE_LDAP
277 return ber_peek_tag( berelement, len );
278#else
279 return LBER_ERROR;
280#endif
281}
WINBERAPI ber_tag_t ber_peek_tag(BerElement *, ber_len_t *)

◆ WLDAP32_ber_printf()

INT WINAPIV WLDAP32_ber_printf ( BerElement berelement,
PCHAR  fmt,
  ... 
)

Definition at line 325 of file ber.c.

326{
327#ifdef HAVE_LDAP
329 int ret = 0;
330 char new_fmt[2];
331
332 new_fmt[1] = 0;
334 while (*fmt)
335 {
336 new_fmt[0] = *fmt++;
337 switch(new_fmt[0])
338 {
339 case 'b':
340 case 'e':
341 case 'i':
342 {
343 int i = va_arg( list, int );
344 ret = ber_printf( berelement, new_fmt, i );
345 break;
346 }
347 case 'o':
348 case 's':
349 {
350 char *str = va_arg( list, char * );
351 ret = ber_printf( berelement, new_fmt, str );
352 break;
353 }
354 case 't':
355 {
356 unsigned int tag = va_arg( list, unsigned int );
357 ret = ber_printf( berelement, new_fmt, tag );
358 break;
359 }
360 case 'v':
361 {
362 char **array = va_arg( list, char ** );
363 ret = ber_printf( berelement, new_fmt, array );
364 break;
365 }
366 case 'V':
367 {
368 struct berval **array = va_arg( list, struct berval ** );
369 ret = ber_printf( berelement, new_fmt, array );
370 break;
371 }
372 case 'X':
373 {
374 char *str = va_arg( list, char * );
375 int len = va_arg( list, int );
376 new_fmt[0] = 'B'; /* 'X' is deprecated */
377 ret = ber_printf( berelement, new_fmt, str, len );
378 break;
379 }
380 case 'n':
381 case '{':
382 case '}':
383 case '[':
384 case ']':
385 ret = ber_printf( berelement, new_fmt );
386 break;
387 default:
388 FIXME( "Unknown format '%c'\n", new_fmt[0] );
389 ret = -1;
390 break;
391 }
392 if (ret == -1) break;
393 }
394 __ms_va_end( list );
395 return ret;
396#else
397 return LBER_ERROR;
398#endif
399}
#define va_arg(ap, T)
Definition: acmsvcex.h:89
#define FIXME(fmt,...)
Definition: debug.h:114
Definition: list.h:37
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define list
Definition: rosglue.h:35
const WCHAR * str
Definition: dsound.c:943
Definition: ecma_167.h:138
int ret
WINBERAPI int ber_printf(BerElement *, const char *,...)
#define __ms_va_list
Definition: windef.h:456
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457

◆ WLDAP32_ber_scanf()

INT WINAPIV WLDAP32_ber_scanf ( BerElement berelement,
PCHAR  fmt,
  ... 
)

Definition at line 420 of file ber.c.

421{
422#ifdef HAVE_LDAP
424 int ret = 0;
425 char new_fmt[2];
426
427 new_fmt[1] = 0;
429 while (*fmt)
430 {
431 new_fmt[0] = *fmt++;
432 switch(new_fmt[0])
433 {
434 case 'a':
435 {
436 char **ptr = va_arg( list, char ** );
437 ret = ber_scanf( berelement, new_fmt, ptr );
438 break;
439 }
440 case 'b':
441 case 'e':
442 case 'i':
443 {
444 int *i = va_arg( list, int * );
445 ret = ber_scanf( berelement, new_fmt, i );
446 break;
447 }
448 case 't':
449 {
450 unsigned int *tag = va_arg( list, unsigned int * );
451 ret = ber_scanf( berelement, new_fmt, tag );
452 break;
453 }
454 case 'v':
455 {
456 char ***array = va_arg( list, char *** );
457 ret = ber_scanf( berelement, new_fmt, array );
458 break;
459 }
460 case 'B':
461 {
462 char **str = va_arg( list, char ** );
463 int *len = va_arg( list, int * );
464 ret = ber_scanf( berelement, new_fmt, str, len );
465 break;
466 }
467 case 'O':
468 {
469 struct berval **ptr = va_arg( list, struct berval ** );
470 ret = ber_scanf( berelement, new_fmt, ptr );
471 break;
472 }
473 case 'V':
474 {
475 struct berval ***array = va_arg( list, struct berval *** );
476 ret = ber_scanf( berelement, new_fmt, array );
477 break;
478 }
479 case 'n':
480 case 'x':
481 case '{':
482 case '}':
483 case '[':
484 case ']':
485 ret = ber_scanf( berelement, new_fmt );
486 break;
487 default:
488 FIXME( "Unknown format '%c'\n", new_fmt[0] );
489 ret = -1;
490 break;
491 }
492 if (ret == -1) break;
493 }
494 __ms_va_end( list );
495 return ret;
496#else
497 return LBER_ERROR;
498#endif
499}
static PVOID ptr
Definition: dispmode.c:27
WINBERAPI ber_tag_t ber_scanf(BerElement *, const char *,...)

◆ WLDAP32_ber_skip_tag()

ULONG CDECL WLDAP32_ber_skip_tag ( BerElement berelement,
ULONG len 
)

Definition at line 297 of file ber.c.

298{
299#ifdef HAVE_LDAP
300 return ber_skip_tag( berelement, len );
301#else
302 return LBER_ERROR;
303#endif
304}
WINBERAPI ber_tag_t ber_skip_tag(BerElement *, ber_len_t *)