--- xmlhelp/source/com/sun/star/help/StringDbt.java.ark	2005-07-23 01:11:19.000000000 +0200
+++ xmlhelp/source/com/sun/star/help/StringDbt.java	2005-07-23 01:44:19.000000000 +0200
@@ -12,7 +12,7 @@
 import java.io.UnsupportedEncodingException;
 import com.sleepycat.db.*;
 
-public class StringDbt extends Dbt
+public class StringDbt extends DatabaseEntry
 {
 	private String _Title = null;
 	private String _Database = null;
@@ -22,14 +22,14 @@
 
     public StringDbt()
     {
-        set_flags(Db.DB_DBT_MALLOC); // tell Db to allocate on retrieval
+        setReuseBuffer(false); // tell Db to allocate on retrieval
     }
 
 
     public StringDbt(String value)
     {
         setString(value);
-        set_flags(Db.DB_DBT_MALLOC); // tell Db to allocate on retrieval
+        setReuseBuffer(false); // tell Db to allocate on retrieval
     }
 
 
@@ -44,23 +44,23 @@
 		{
 			b = value.getBytes();
 		}
-		set_size( b.length );
-		set_data( b );
+		setSize( b.length );
+		setData( b );
     }
 
 
     public final String getString()
     {
-		byte[] b = get_data();
+		byte[] b = getData();
 		if( b != null )
 		{
 			try
 			{
-				return new String( b,0,get_size(),"UTF8" );
+				return new String( b,0,getSize(),"UTF8" );
 			}
 			catch( UnsupportedEncodingException e )
 			{
-				return new String( b,0,get_size() );
+				return new String( b,0,getSize() );
 			}
 		}
 		else
@@ -76,7 +76,7 @@
 
     public final String getHash()
     {
-	    byte[] b =get_data();
+	    byte[] b =getData();
  		if( b != null )
    		{
 			int sizeOfFile = ( int ) b[0];
@@ -102,7 +102,7 @@
 
 	public final String getFile()
 	{
-	    byte[] b = get_data();
+	    byte[] b = getData();
  		if( b != null )
    		{
 			int sizeOfFile = ( int ) b[0];
@@ -129,7 +129,7 @@
 	
 	public final String getDatabase()
 	{
-	    byte[] b = get_data();
+	    byte[] b = getData();
 		if( b != null )
   		{
 			int sizeOfDatabase = ( int ) b[ 1+ ( int ) b[0] ];
@@ -155,7 +155,7 @@
 		if( isHelptextEntry() )
   			return "";
 
-		byte[] b = get_data();
+		byte[] b = getData();
      	if( b != null )
       	{
 			int sizeOfTitle = ( int ) b[  2 + b[0] +  ( int ) b[ 1+ ( int ) b[0] ] ];
--- xmlhelp/source/com/sun/star/help/HelpKeyword.java.ark	2005-07-23 01:21:45.000000000 +0200
+++ xmlhelp/source/com/sun/star/help/HelpKeyword.java	2005-07-23 02:06:20.000000000 +0200
@@ -9,8 +9,8 @@
 import java.util.Enumeration;
 import java.util.Hashtable;
 
-import com.sleepycat.db.Db;
-import com.sleepycat.db.DbException;
+import com.sleepycat.db.Database;
+import com.sleepycat.db.DatabaseException;
 
 /**
  * @author ab106281
@@ -61,1 +61,1 @@
-	void dump(Db table) {
+	void dump(Database table) {
@@ -71,8 +71,8 @@
 			StringDbt key = new StringDbt(list[i]);
 			StringDbt value = new StringDbt(data.getString());
 			try {
-				table.put(null, key, value, 0);
-			} catch (DbException e) {
+				table.put(null, key, value);
+			} catch (DatabaseException e) {
 				// TODO Auto-generated catch block
 				e.printStackTrace();
 			}
--- xmlhelp/source/com/sun/star/help/HelpIndexer.java.ark	2005-07-23 01:22:18.000000000 +0200
+++ xmlhelp/source/com/sun/star/help/HelpIndexer.java	2005-07-23 02:14:01.000000000 +0200
@@ -151,12 +151,14 @@
 	private void schnitzel() {
 		// Determine the location of the database
 		String installDirectory = HelpDatabases.getInstallDirectory();
-		Db table = null;
+		Database table = null;
 
 		try {
-			table = new Db(null, 0);
-			table.set_error_stream(System.err);
-			table.set_errpfx("indexing");
+			DatabaseConfig cfg=DatabaseConfig.DEFAULT;
+			cfg.setType(DatabaseType.BTREE);
+			cfg.setErrorStream(System.err);
+			cfg.setErrorPrefix("indexing");
+			cfg.setReadOnly(true);
 
 			// Create indexDirectory, if not existent
 			String indexDirectory =
@@ -191,16 +193,16 @@
 			String fileName =
 				installDirectory + _language + File.separator + _module + ".db";
 
-			table.open(null,fileName, null, Db.DB_BTREE, Db.DB_RDONLY, 0644);
-			Dbc cursor = table.cursor(null, 0);
+			table = new Database(fileName, null, cfg);
+			Cursor cursor = table.openCursor(null, CursorConfig.DEFAULT);
 			StringDbt key = new StringDbt();
 			StringDbt data = new StringDbt();
 
 			boolean first = true;
 			// Initially the cursor must allocate the necessary memory
-			key.set_flags(Db.DB_DBT_MALLOC);
-			data.set_flags(Db.DB_DBT_MALLOC);
-			while (Db.DB_NOTFOUND != cursor.get(key, data, Db.DB_NEXT)) {
+			key.setReuseBuffer(false);
+			data.setReuseBuffer(false);
+			while (OperationStatus.NOTFOUND != cursor.getNext(key, data, LockMode.DEFAULT)) {
 				try {
 					String keyStr = key.getString();
 					String dataStr = data.getFile();
@@ -229,13 +231,13 @@
 				} catch (Exception e) {
 				}
 				if (first) {
-					key.set_flags(Db.DB_DBT_REALLOC);
-					data.set_flags(Db.DB_DBT_REALLOC);
+					key.setReuseBuffer(true);
+					data.setReuseBuffer(true);
 					first = false;
 				}
 			}
 			cursor.close();
-			table.close(0);
+			table.close(false);
 
 			System.out.println("Indexing...");
 			Enumeration enum = _hashDocInfo.elements();
@@ -314,10 +316,10 @@
 			} catch (Exception e) {
 				System.err.println(e.getMessage());
 			}
-		} catch (DbRunRecoveryException e) {
+		} catch (RunRecoveryException e) {
 			System.out.println("Not able to create cursor: " + e.getMessage());
 			System.exit(1);
-		} catch (DbException e) {
+		} catch (DatabaseException e) {
 			System.out.println("Error initializing database");
 			System.exit(1);
 		} catch (FileNotFoundException fnfe) {
@@ -429,9 +431,12 @@
 				list[j++] = (String) enum.nextElement();
 			}
 
-			Db table;
+			Database table;
 			try {
-				table = new Db(null, 0);
+				DatabaseConfig cfg=DatabaseConfig.DEFAULT;
+				cfg.setType(DatabaseType.BTREE);
+				cfg.setAllowCreate(true);
+				cfg.setMode(0644);
 
 				String fileName =
 					HelpDatabases.getInstallDirectory()
@@ -440,15 +445,15 @@
 						+ _module
 						+ ".key";
 
-				table.open(null,fileName, null, Db.DB_BTREE, Db.DB_CREATE, 0644);
+				table = new Database(fileName, null, cfg);
 
 				for (int i = 0; i < list.length; ++i) {
 					Data data = (Data) _hash.get(list[i]);
 					StringDbt key = new StringDbt(list[i]);
 					StringDbt value = new StringDbt(data.getString());
-					table.put(null, key, value, 0);
+					table.put(null, key, value);
 				}
-				table.close(0);
+				table.close(false);
 			} catch (Exception e) {
 				System.out.println("error writing keydata");
 			}
@@ -464,10 +469,8 @@
 			list[j++] = (String) enum.nextElement();
 		}
 
-		Db table;
+		Database table;
 		try {
-			table = new Db(null, 0);
-
 			String fileName =
 				HelpDatabases.getInstallDirectory()
 					+ _language
@@ -475,15 +478,19 @@
 					+ _module
 					+ ".ht";
 
-			table.open(null,fileName, null, Db.DB_BTREE, Db.DB_CREATE, 0644);
+			DatabaseConfig cfg=DatabaseConfig.DEFAULT;
+			cfg.setType(DatabaseType.BTREE);
+			cfg.setAllowCreate(true);
+			cfg.setMode(0644);
+			table = new Database(fileName, null, cfg);
 
 			for (int i = 0; i < list.length; ++i) {
 				String data = (String) _hashHelptext.get(list[i]);
 				StringDbt key = new StringDbt(list[i]);
 				StringDbt value = new StringDbt(data);
-				table.put(null, key, value, 0);
+				table.put(null, key, value);
 			}
-			table.close(0);
+			table.close(false);
 		} catch (Exception e) {
 			System.out.println("error writing keydata");
 		}
--- xmlhelp/source/com/sun/star/help/HelpURLParameter.java.ark	2005-07-23 01:23:23.000000000 +0200
+++ xmlhelp/source/com/sun/star/help/HelpURLParameter.java	2005-07-23 02:16:33.000000000 +0200
@@ -195,12 +195,12 @@
   	{
  		try
 		{
-			Db db = HelpDatabases.getHelptextDbForLanguage( get_module(),get_language() );
+			Database db = HelpDatabases.getHelptextDbForLanguage( get_module(),get_language() );
 
    			StringDbt key = new StringDbt( _id );
-      		StringDbt data = new StringDbt();
+			StringDbt data = new StringDbt();
 
-			int err = db.get(null,key,data,0);
+			OperationStatus err = db.get(null,key,data,LockMode.DEFAULT);
 			if( data != null )
 				try
 				{
@@ -213,7 +213,7 @@
        		else
          		return new byte[0];
 		}
-		catch( DbException err )
+		catch( DatabaseException err )
 		{
       		System.out.println( "No database for language: HelpURLParameter._readBerkeley" );
         	return new byte[0];
@@ -284,24 +284,24 @@
 	{
 		if( !get_id().equals("") )
 		{
-		    try
-		    {
-			    Db db = HelpDatabases.getDatabaseForLanguage( get_module(),get_language() );
+			try
+			{
+				Database db = HelpDatabases.getDatabaseForLanguage( get_module(),get_language() );
 
-   			    StringDbt key = new StringDbt( _id );
-      		    StringDbt data = new StringDbt();
+				StringDbt key = new StringDbt( _id );
+				StringDbt data = new StringDbt();
 
-			    int err = db.get(null,key,data,0);
-			    if( data != null )
+				OperationStatus err = db.get(null,key,data,LockMode.DEFAULT);
+				if( data != null )
 				{
-				    _title = data.getTitle();
-			        _path = data.getFile();
-				    _jar = data.getDatabase();
-        			_tag = data.getHash();
+					_title = data.getTitle();
+					_path = data.getFile();
+					_jar = data.getDatabase();
+					_tag = data.getHash();
 				}
 
 		    }
-		    catch( DbException err )
+		    catch( DatabaseException err )
 		    {
       			System.out.println( "No database for language: HelpURLParameter._readBerkeley" );
 	        }
--- xmlhelp/source/com/sun/star/help/HelpDatabases.java.ark	2005-07-23 01:24:06.000000000 +0200
+++ xmlhelp/source/com/sun/star/help/HelpDatabases.java	2005-07-23 02:23:44.000000000 +0200
@@ -225,23 +225,25 @@
 
 
 
-	public static synchronized Db getDatabaseForLanguage( String Database,String Language )
+	public static synchronized Database getDatabaseForLanguage( String Database,String Language )
 	{
 		if( Database == null || Language == null )
 			return null;
 		String key = lang(Language) + File.separator + Database;       // For example de/swriter
-		Db table = ( Db ) _dbHash.get( key );
+		Database table = ( Database ) _dbHash.get( key );
 		if( table == null )
 		{
             try
             {
-				table = new Db( null,0 );
-
 				String tablePath = _installDirectory + key + ".db";
-				table.open( null,tablePath,null,Db.DB_BTREE,Db.DB_RDONLY,0644 );
+				DatabaseConfig cfg=DatabaseConfig.DEFAULT;
+				cfg.setType(DatabaseType.BTREE);
+				cfg.setReadOnly(true);
+				cfg.setMode(0644);
+				table = new Database( tablePath,null,cfg );
 				_dbHash.put( key,table );
             }
-            catch( DbException e )
+            catch( DatabaseException e )
             {
 				System.err.println( "Unsupported language in helpsystem: " + Language );
     			System.err.println( "module: " + Database );
@@ -262,32 +264,35 @@
  	static Hashtable _helptextHash = new Hashtable();
 
 
-	public static synchronized Db getHelptextDbForLanguage( String Database,String Language )
+	public static synchronized Database getHelptextDbForLanguage( String Database,String Language )
 	{
 		String key = lang( Language ) + File.separator + Database;       // For example de/swriter
-		Db table = ( Db ) _helptextHash.get( key );
+		Database table = ( Database ) _helptextHash.get( key );
 		if( table == null )
 		{
-            try
-            {
-				table = new Db( null,0 );
+			try
+			{
 
 				String tablePath = _installDirectory + key + ".ht";
-				table.open( null,tablePath,null,Db.DB_BTREE,Db.DB_RDONLY,0644 );
+				DatabaseConfig cfg=DatabaseConfig.DEFAULT;
+				cfg.setType(DatabaseType.BTREE);
+				cfg.setReadOnly(true);
+				cfg.setMode(0644);
+				table = new Database( tablePath, null, cfg );
 				_dbHash.put( key,table );
-            }
-            catch( DbException e )
-            {
+			}
+			catch( DatabaseException e )
+			{
 				System.err.println( "Unsupported language in helpsystem: " + Language );
-    			System.err.println( "module: " + Database );
-    			System.err.println( e.getMessage() );
-            }
-            catch( FileNotFoundException e )
-            {
+				System.err.println( "module: " + Database );
+				System.err.println( e.getMessage() );
+			}
+			catch( FileNotFoundException e )
+			{
 				System.err.println( "Unsupported language in helpsystem: " + Language );
    				System.err.println( "module: " + Database );
-    			System.err.println( e.getMessage() );
-            }
+				System.err.println( e.getMessage() );
+			}
 		}
 
 		return table;
@@ -514,39 +519,42 @@
        		{
 				HashMap internalHash = new HashMap();
 				String fileName = HelpDatabases.getInstallDirectory() + keyStr + ".key";
-        		Db table = new Db( null,0 );
 				System.err.println( fileName );
-				table.open( null,fileName,null,Db.DB_BTREE,Db.DB_RDONLY,0644 );
-				Dbc cursor = table.cursor( null,0 );
+				DatabaseConfig cfg=DatabaseConfig.DEFAULT;
+				cfg.setType(DatabaseType.BTREE);
+				cfg.setReadOnly(true);
+				cfg.setMode(0644);
+				Database table = new Database( fileName,null,cfg );
+				Cursor cursor = table.openCursor( null,CursorConfig.DEFAULT );
 				StringDbt key = new StringDbt();
 				StringDbt data = new StringDbt();
 
 				boolean first = true;
-  				key.set_flags( Db.DB_DBT_MALLOC );      // Initially the cursor must allocate the necessary memory
-     			data.set_flags( Db.DB_DBT_MALLOC );
-        		info = new KeywordInfo();
+  				key.setReuseBuffer(false);
+				data.setReuseBuffer(false);
+				info = new KeywordInfo();
 
 				String keyStri;
 				
-				while( Db.DB_NOTFOUND != cursor.get( key,data,Db.DB_NEXT ) )
+				while( OperationStatus.NOTFOUND != cursor.getNext( key,data,LockMode.DEFAULT ) )
 				{
 					keyStri = key.getString();
 					info.insert( keyStri );
 		       		internalHash.put( keyStri,data.getString() );
 					if( first )
-          			{
-						key.set_flags( Db.DB_DBT_REALLOC );
-     					data.set_flags( Db.DB_DBT_REALLOC );
-         				first = false;
+					{
+						key.setReuseBuffer(true);
+						data.setReuseBuffer(true);
+						first = false;
             		}
             	}
 
              	info.sort();
             	cursor.close();
-            	table.close( 0 );
+            	table.close( false );
 				
     			String[] keywords = info.getKeywordList();
-       			Db table2 = getDatabaseForLanguage( Database,Language );
+       			Database table2 = getDatabaseForLanguage( Database,Language );
        			for( int i = 0; i < keywords.length; ++i )
           		{
 					String[] id = info.insertId( i,((String)internalHash.get( keywords[i])) );
@@ -559,7 +567,7 @@
       					StringDbt data1 = new StringDbt();
 						try
       					{
-         					table2.get( null,key1,data1,0 );
+         					table2.get( null,key1,data1,LockMode.DEFAULT );
 							title[j] = data1.getTitle();
        					}
             			catch( Exception e )
--- xmlhelp/source/com/sun/star/help/HelpLinker.java.ark	2005-07-23 01:26:36.000000000 +0200
+++ xmlhelp/source/com/sun/star/help/HelpLinker.java	2005-07-23 02:28:26.000000000 +0200
@@ -89,9 +89,11 @@
 import java.util.jar.JarOutputStream;
 import java.util.zip.CRC32;
 
-import com.sleepycat.db.Db;
-import com.sleepycat.db.DbException;
-import com.sleepycat.db.Dbt;
+import com.sleepycat.db.Database;
+import com.sleepycat.db.DatabaseConfig;
+import com.sleepycat.db.DatabaseException;
+import com.sleepycat.db.DatabaseEntry;
+import com.sleepycat.db.DatabaseType;
 import com.sun.xmlsearch.util.PrefixTranslator;
 import com.sun.xmlsearch.xml.indexer.XmlIndexBuilder;
 
@@ -394,20 +396,23 @@
 		File helpTextFile = File.createTempFile("helptext", ".ht");
 		helpTextFile.deleteOnExit();
 		String helpTextFileName = helpTextFile.getAbsolutePath();
-		Db helpText = new Db(null, 0);
-		helpText.open(null,helpTextFileName, null, Db.DB_BTREE, Db.DB_TRUNCATE, 0644);
+		DatabaseConfig cfg=DatabaseConfig.DEFAULT;
+		cfg.setType(DatabaseType.BTREE);
+		cfg.setAllowCreate(true);
+		cfg.setTruncate(true);
+		cfg.setReadOnly(false);
+		cfg.setMode(0644);
+		Database helpText = new Database(helpTextFileName, null, cfg);
 
 		File dbBaseFile = File.createTempFile("database", "db");
 		dbBaseFile.deleteOnExit();
 		String dbBaseFileName = dbBaseFile.getAbsolutePath();
-		Db dbBase = new Db(null, 0);
-		dbBase.open(null,dbBaseFileName, null, Db.DB_BTREE, Db.DB_TRUNCATE, 0644);
+		Database dbBase = new Database(dbBaseFileName, null, cfg);
 
 		File keyWordFile = File.createTempFile("keybase", "key");
 		keyWordFile.deleteOnExit();
 		String keyWordFileName = keyWordFile.getAbsolutePath();
-		Db keyWord = new Db(null, 0);
-		keyWord.open(null,keyWordFileName, null, Db.DB_BTREE, Db.DB_TRUNCATE, 0644);
+		Database keyWord = new Database(keyWordFileName, null, cfg);
 		HelpKeyword helpKeyword = new HelpKeyword();
 
 		// now input the hid.lst and store it into a hashmap
@@ -610,9 +614,9 @@
 					if (tHid != null)
 						helpTextId = tHid;
 					helpTextId = URLEncoder.encode(helpTextId);
-					Dbt keyDbt = new Dbt(helpTextId.getBytes("UTF8"));
-					Dbt textDbt = new Dbt(helpTextText.getBytes("UTF8"));
-					helpText.put(null, keyDbt, textDbt, 0);
+					DatabaseEntry keyDbt = new DatabaseEntry(helpTextId.getBytes("UTF8"));
+					DatabaseEntry textDbt = new DatabaseEntry(helpTextText.getBytes("UTF8"));
+					helpText.put(null, keyDbt, textDbt);
 				}
 			}
 			// now the indexing
@@ -635,10 +639,10 @@
 			}
 		} // while loop over hzip files ending
 
-		helpText.close(0);
-		dbBase.close(0);
+		helpText.close(false);
+		dbBase.close(false);
 		helpKeyword.dump(keyWord);
-		keyWord.close(0);
+		keyWord.close(false);
 		if (!helpFiles.isEmpty())
 			closeXMLIndexBuilder();
 
@@ -734,13 +738,13 @@
 	}
 
 	private void addBookmark(
-		Db dbBase,
+		Database dbBase,
 		String hid,
 		byte[] fileB,
 		byte[] anchorB,
 		byte[] jarfileB,
 		byte[] titleB)
-		throws DbException, UnsupportedEncodingException {
+		throws DatabaseException, UnsupportedEncodingException {
 
 		String translatedHid =
 			(String) hidlistTranslation.get(
@@ -748,7 +752,7 @@
 		if (translatedHid != null)
 			hid = translatedHid;
 		hid = URLEncoder.encode(hid);
-		Dbt key = new Dbt(hid.getBytes("UTF8"));
+		DatabaseEntry key = new DatabaseEntry(hid.getBytes("UTF8"));
 
 		int fileLen = fileB.length;
 		if (anchorB != null)
@@ -771,8 +775,8 @@
 		dataB[i++] = (byte) titleB.length;
 		for (int j = 0; j < titleB.length; ++j)
 			dataB[i++] = titleB[j];
-		Dbt data = new Dbt(dataB);
-		dbBase.put(null, key, data, 0);
+		DatabaseEntry data = new DatabaseEntry(dataB);
+		dbBase.put(null, key, data);
 	}
 
 	private void addEntryToJarFile(
