+/* $OpenLDAP$ */
/*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include <ac/stdarg.h>
#include <ac/string.h>
-#undef LDAP_F_PRE
-#define LDAP_F_PRE LDAP_F_EXPORT
-
#include "lber-int.h"
+/*
+ * We don't just set ber_pvt_err_file to stderr here, because in NT,
+ * stderr is a symbol imported from a DLL. As such, the compiler
+ * doesn't recognize the symbol as having a constant address. Thus
+ * we set ber_pvt_err_file to stderr later, when it first gets
+ * referenced.
+ */
+FILE *ber_pvt_err_file;
+
+/*
+ * ber errno
+ */
+BER_ERRNO_FN ber_int_errno_fn;
+
+int * ber_errno_addr(void)
+{
+ static int ber_int_errno = LBER_ERROR_NONE;
+
+ if( ber_int_errno_fn ) {
+ return (*ber_int_errno_fn)();
+ }
+
+ return &ber_int_errno;
+}
+
/*
* Print stuff
*/
{
assert( data != NULL );
+ if (!ber_pvt_err_file)
+ ber_pvt_err_file = stderr;
+
+ fputs( data, ber_pvt_err_file );
+
+ /* Print to both streams */
+ if (ber_pvt_err_file != stderr)
+ {
fputs( data, stderr );
fflush( stderr );
+ }
+
+ fflush( ber_pvt_err_file );
}
BER_LOG_PRINT_FN ber_pvt_log_print = ber_error_print;
ber_log_dump(
int errlvl,
int loglvl,
- const BerElement *ber,
+ BerElement *ber,
int inout )
{
assert( ber != NULL );
void
ber_dump(
- LDAP_CONST BerElement *ber,
+ BerElement *ber,
int inout )
{
char buf[132];
ber_log_sos_dump(
int errlvl,
int loglvl,
- const Seqorset *sos )
+ Seqorset *sos )
{
assert( sos != NULL );
void
ber_sos_dump(
- LDAP_CONST Seqorset *sos )
+ Seqorset *sos )
{
char buf[132];