2 * WLDAP32 - LDAP support for Wine
4 * Copyright 2005 Hans Leidekker
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
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 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(wldap32
);
32 # define LBER_ERROR (~0U)
35 /***********************************************************************
36 * ber_alloc_t (WLDAP32.@)
38 BerElement
*WLDAP32_ber_alloc_t( INT options
)
41 return ber_alloc_t( options
);
48 /***********************************************************************
49 * ber_bvdup (WLDAP32.@)
51 BERVAL
*WLDAP32_ber_bvdup( BERVAL
*berval
)
54 return ber_bvdup( berval
);
61 /***********************************************************************
62 * ber_bvecfree (WLDAP32.@)
64 void WLDAP32_ber_bvecfree( PBERVAL
*berval
)
67 ber_bvecfree( berval
);
72 /***********************************************************************
73 * ber_bvfree (WLDAP32.@)
75 void WLDAP32_ber_bvfree( BERVAL
*berval
)
83 /***********************************************************************
84 * ber_first_element (WLDAP32.@)
86 ULONG
WLDAP32_ber_first_element( BerElement
*berelement
, ULONG
*len
, CHAR
**opaque
)
89 return ber_first_element( berelement
, len
, opaque
);
96 /***********************************************************************
97 * ber_flatten (WLDAP32.@)
99 INT
WLDAP32_ber_flatten( BerElement
*berelement
, PBERVAL
*berval
)
102 return ber_flatten( berelement
, berval
);
109 /***********************************************************************
110 * ber_free (WLDAP32.@)
112 void WLDAP32_ber_free( BerElement
*berelement
, INT buf
)
115 ber_free( berelement
, buf
);
120 /***********************************************************************
121 * ber_init (WLDAP32.@)
123 BerElement
*WLDAP32_ber_init( BERVAL
*berval
)
126 return ber_init( berval
);
133 /***********************************************************************
134 * ber_next_element (WLDAP32.@)
136 ULONG
WLDAP32_ber_next_element( BerElement
*berelement
, ULONG
*len
, CHAR
*opaque
)
139 return ber_next_element( berelement
, len
, opaque
);
146 /***********************************************************************
147 * ber_peek_tag (WLDAP32.@)
149 ULONG
WLDAP32_ber_peek_tag( BerElement
*berelement
, ULONG
*len
)
152 return ber_peek_tag( berelement
, len
);
159 /***********************************************************************
160 * ber_skip_tag (WLDAP32.@)
162 ULONG
WLDAP32_ber_skip_tag( BerElement
*berelement
, ULONG
*len
)
165 return ber_skip_tag( berelement
, len
);
172 /***********************************************************************
173 * ber_printf (WLDAP32.@)
175 INT
WLDAP32_ber_printf( BerElement
*berelement
, PCHAR fmt
, ... )
183 va_start( list
, fmt
);
193 int i
= va_arg( list
, int );
194 ret
= ber_printf( berelement
, new_fmt
, i
);
200 char *str
= va_arg( list
, char * );
201 ret
= ber_printf( berelement
, new_fmt
, str
);
206 unsigned int tag
= va_arg( list
, unsigned int );
207 ret
= ber_printf( berelement
, new_fmt
, tag
);
212 char **array
= va_arg( list
, char ** );
213 ret
= ber_printf( berelement
, new_fmt
, array
);
218 struct berval
**array
= va_arg( list
, struct berval
** );
219 ret
= ber_printf( berelement
, new_fmt
, array
);
224 char *str
= va_arg( list
, char * );
225 int len
= va_arg( list
, int );
226 ret
= ber_printf( berelement
, "B" /* 'X' is deprecated */, str
, len
);
234 ret
= ber_printf( berelement
, new_fmt
);
237 FIXME( "Unknown format '%c'\n", new_fmt
[0] );
241 if (ret
== -1) break;
251 /***********************************************************************
252 * ber_scanf (WLDAP32.@)
254 INT
WLDAP32_ber_scanf( BerElement
*berelement
, PCHAR fmt
, ... )
262 va_start( list
, fmt
);
270 char **ptr
= va_arg( list
, char ** );
271 ret
= ber_scanf( berelement
, new_fmt
, ptr
);
278 int *i
= va_arg( list
, int * );
279 ret
= ber_scanf( berelement
, new_fmt
, i
);
284 unsigned int *tag
= va_arg( list
, unsigned int * );
285 ret
= ber_scanf( berelement
, new_fmt
, tag
);
290 char ***array
= va_arg( list
, char *** );
291 ret
= ber_scanf( berelement
, new_fmt
, array
);
296 char **str
= va_arg( list
, char ** );
297 int *len
= va_arg( list
, int * );
298 ret
= ber_scanf( berelement
, new_fmt
, str
, len
);
303 struct berval
**ptr
= va_arg( list
, struct berval
** );
304 ret
= ber_scanf( berelement
, new_fmt
, ptr
);
309 struct berval
***array
= va_arg( list
, struct berval
*** );
310 ret
= ber_scanf( berelement
, new_fmt
, array
);
319 ret
= ber_scanf( berelement
, new_fmt
);
322 FIXME( "Unknown format '%c'\n", new_fmt
[0] );
326 if (ret
== -1) break;