file = ch_malloc( strlen( name ) + sizeof(BDB_SUFFIX) );
sprintf( file, "%s" BDB_SUFFIX, name );
+#ifdef HAVE_EBCDIC
+ __atoe( file );
+#endif
rc = DB_OPEN( db->bdi_db,
file, name,
DB_HASH, bdb->bi_db_opflags | DB_CREATE | DB_THREAD,
void bdb_errcall( const char *pfx, char * msg )
{
+#ifdef HAVE_EBCDIC
+ if ( msg[0] > 0x7f )
+ __etoa( msg );
+#endif
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, INFO, "bdb(%s): %s\n", pfx, msg, 0 );
#else
Debug( LDAP_DEBUG_ANY, "bdb(%s): %s\n", pfx, msg, 0 );
#endif
}
+
+#ifdef HAVE_EBCDIC
+
+#undef db_strerror
+
+/* Not re-entrant! */
+char *ebcdic_dberror( int rc )
+{
+ static char msg[1024];
+
+ strcpy( msg, db_strerror( rc ) );
+ __etoa( msg );
+ return msg;
+}
+#endif
int rc, i;
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
u_int32_t flags;
+#ifdef HAVE_EBCDIC
+ char path[MAXPATHLEN];
+#endif
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ARGS,
bdb->bi_dbenv_home, 0, 0);
#endif
+#ifdef HAVE_EBCDIC
+ strcpy( path, bdb->bi_dbenv_home );
+ __atoe( path );
+ rc = bdb->bi_dbenv->open( bdb->bi_dbenv,
+ path,
+ flags,
+ bdb->bi_dbenv_mode );
+#else
rc = bdb->bi_dbenv->open( bdb->bi_dbenv,
bdb->bi_dbenv_home,
flags,
bdb->bi_dbenv_mode );
+#endif
if( rc != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, ERR,
BDB_PAGESIZE );
}
+#ifdef HAVE_EBCDIC
+ strcpy( path, bdbi_databases[i].file );
+ __atoe( path );
+ rc = DB_OPEN( db->bdi_db,
+ path,
+ /* bdbi_databases[i].name, */ NULL,
+ bdbi_databases[i].type,
+ bdbi_databases[i].flags | flags,
+ bdb->bi_dbenv_mode );
+#else
rc = DB_OPEN( db->bdi_db,
bdbi_databases[i].file,
/* bdbi_databases[i].name, */ NULL,
bdbi_databases[i].type,
bdbi_databases[i].flags | flags,
bdb->bi_dbenv_mode );
+#endif
if( rc != 0 ) {
#ifdef NEW_LOGGING
{ /* version check */
int major, minor, patch;
char *version = db_version( &major, &minor, &patch );
+#ifdef HAVE_EBCDIC
+ char v2[1024];
+
+ /* All our stdio does an ASCII to EBCDIC conversion on
+ * the output. Strings from the BDB library are already
+ * in EBCDIC; we have to go back and forth...
+ */
+ strcpy( v2, version );
+ __etoa( v2 );
+ version = v2;
+#endif
if( major != DB_VERSION_MAJOR ||
minor != DB_VERSION_MINOR ||