Back to index

openldap  2.4.31
error.c
Go to the documentation of this file.
00001 /* error.c - BDB errcall routine */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 2000-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in the file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 #include "portable.h"
00018 
00019 #include <stdio.h>
00020 #include <ac/string.h>
00021 
00022 #include "slap.h"
00023 #include "back-bdb.h"
00024 
00025 #if DB_VERSION_FULL < 0x04030000
00026 void bdb_errcall( const char *pfx, char * msg )
00027 #else
00028 void bdb_errcall( const DB_ENV *env, const char *pfx, const char * msg )
00029 #endif
00030 {
00031 #ifdef HAVE_EBCDIC
00032        if ( msg[0] > 0x7f )
00033               __etoa( msg );
00034 #endif
00035        Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
00036 }
00037 
00038 #if DB_VERSION_FULL >= 0x04030000
00039 void bdb_msgcall( const DB_ENV *env, const char *msg )
00040 {
00041 #ifdef HAVE_EBCDIC
00042        if ( msg[0] > 0x7f )
00043               __etoa( msg );
00044 #endif
00045        Debug( LDAP_DEBUG_TRACE, "bdb: %s\n", msg, 0, 0 );
00046 }
00047 #endif
00048 
00049 #ifdef HAVE_EBCDIC
00050 
00051 #undef db_strerror
00052 
00053 /* Not re-entrant! */
00054 char *ebcdic_dberror( int rc )
00055 {
00056        static char msg[1024];
00057 
00058        strcpy( msg, db_strerror( rc ) );
00059        __etoa( msg );
00060        return msg;
00061 }
00062 #endif