Index: /gsdl/trunk/lib/gdbmclass.cpp
===================================================================
--- /gsdl/trunk/lib/gdbmclass.cpp	(revision 15643)
+++ /gsdl/trunk/lib/gdbmclass.cpp	(revision 15644)
@@ -34,4 +34,5 @@
   closedatabase();
 }
+
 
 // returns true if opened
@@ -93,4 +94,96 @@
   gdbmfile = NULL;
   openfile.clear();
+}
+
+
+void gdbmclass::deletekey (const text_t &key)
+{
+  if (gdbmfile == NULL) return;
+
+  // get a utf-8 encoded c string of the unicode key
+  datum key_data;
+  key_data.dptr = (to_utf8(key)).getcstr();
+  if (key_data.dptr == NULL) return;
+  key_data.dsize = strlen (key_data.dptr);
+
+  // delete the key
+  gdbm_delete (gdbmfile, key_data);
+
+  // free up the key memory
+  delete []key_data.dptr;
+}
+
+
+// returns true if exists
+bool gdbmclass::exists (const text_t& key)
+{
+  text_t data;
+  return getkeydata (key, data);
+}
+
+
+// returns true on success
+bool gdbmclass::getinfo (const text_t& key, infodbclass &info)
+{
+  text_t data;
+  
+  if (!getkeydata (key, data)) return false;
+  text_t::iterator here = data.begin ();
+  text_t::iterator end = data.end ();
+  
+  text_t ikey, ivalue;
+  info.clear (); // reset info
+  
+  while (getinfoline (here, end, ikey, ivalue)) {
+    info.addinfo (ikey, ivalue);
+  }
+  
+  return true;
+}
+
+
+// returns true on success
+bool gdbmclass::getkeydata (const text_t& key, text_t &data)
+{
+  datum key_data;
+  datum return_data;
+
+  if (gdbmfile == NULL) return false;
+  
+  // get a utf-8 encoded c string of the unicode key
+  key_data.dptr = (to_utf8(key)).getcstr();
+  if (key_data.dptr == NULL) {
+    if (logout != NULL) (*logout) << "gdbmclass: out of memory\n";
+    return false;
+  }
+  key_data.dsize = strlen (key_data.dptr);
+  
+  // fetch the result
+  return_data = gdbm_fetch (gdbmfile, key_data);
+  delete []key_data.dptr;
+  
+  if (return_data.dptr == NULL) return false;
+
+  data.setcarr (return_data.dptr, return_data.dsize);
+  free (return_data.dptr);
+  data = to_uni(data);  // convert to unicode
+
+  return true;
+}
+
+
+// returns array of keys
+text_tarray gdbmclass::getkeys ()
+{
+  text_tarray keys;
+
+  text_t key = getfirstkey();
+  while (!key.empty())
+  {
+    keys.push_back(key);
+    key = getnextkey(key);
+  }
+
+  return keys;
 }
 
@@ -188,5 +281,5 @@
 
 
-//returns true on success
+// returns true on success
 bool gdbmclass::setinfo (const text_t &key, const text_t &data)
 {
@@ -221,36 +314,7 @@
 
 
-void gdbmclass::deletekey (const text_t &key)
-{
-  if (gdbmfile == NULL) return;
-
-  // get a utf-8 encoded c string of the unicode key
-  datum key_data;
-  key_data.dptr = (to_utf8(key)).getcstr();
-  if (key_data.dptr == NULL) return;
-  key_data.dsize = strlen (key_data.dptr);
-
-  // delete the key
-  gdbm_delete (gdbmfile, key_data);
-
-  // free up the key memory
-  delete []key_data.dptr;
-}
-
-
-text_tarray gdbmclass::getkeys ()
-{
-  text_tarray keys;
-
-  text_t key = getfirstkey();
-  while (!key.empty())
-  {
-    keys.push_back(key);
-    key = getnextkey(key);
-  }
-
-  return keys;
-}
-
+// ----------------------------------------------------------------------------------------
+//   GDBM-ONLY FUNCTIONS
+// ----------------------------------------------------------------------------------------
 
 // getfirstkey and getnextkey are used for traversing the database
@@ -297,62 +361,4 @@
   delete []key_data.dptr;
   return to_uni(nextkey);  // convert to unicode
-}
-
-
-// returns true on success
-bool gdbmclass::getinfo (const text_t& key, infodbclass &info)
-{
-  text_t data;
-  
-  if (!getkeydata (key, data)) return false;
-  text_t::iterator here = data.begin ();
-  text_t::iterator end = data.end ();
-  
-  text_t ikey, ivalue;
-  info.clear (); // reset info
-  
-  while (getinfoline (here, end, ikey, ivalue)) {
-    info.addinfo (ikey, ivalue);
-  }
-  
-  return true;
-}
-
-
-// returns true if exists
-bool gdbmclass::exists (const text_t& key)
-{
-  text_t data;
-  return getkeydata (key, data);
-}
-
-
-// returns true on success
-bool gdbmclass::getkeydata (const text_t& key, text_t &data)
-{
-  datum key_data;
-  datum return_data;
-
-  if (gdbmfile == NULL) return false;
-  
-  // get a utf-8 encoded c string of the unicode key
-  key_data.dptr = (to_utf8(key)).getcstr();
-  if (key_data.dptr == NULL) {
-    if (logout != NULL) (*logout) << "gdbmclass: out of memory\n";
-    return false;
-  }
-  key_data.dsize = strlen (key_data.dptr);
-  
-  // fetch the result
-  return_data = gdbm_fetch (gdbmfile, key_data);
-  delete []key_data.dptr;
-  
-  if (return_data.dptr == NULL) return false;
-
-  data.setcarr (return_data.dptr, return_data.dsize);
-  free (return_data.dptr);
-  data = to_uni(data);  // convert to unicode
-
-  return true;
 }
 
Index: /gsdl/trunk/lib/gdbmclass.h
===================================================================
--- /gsdl/trunk/lib/gdbmclass.h	(revision 15643)
+++ /gsdl/trunk/lib/gdbmclass.h	(revision 15644)
@@ -54,12 +54,11 @@
   gdbmclass() { gdbmfile = NULL; };
   ~gdbmclass();
-  
+
   // returns true if opened
-  bool opendatabase (const text_t &filename, int mode, int num_retrys, 
-		     bool need_filelock);
+  bool opendatabase (const text_t &filename, int mode, int num_retrys, bool need_filelock);
+
   void closedatabase ();
 
-  // returns true on success
-  bool getinfo (const text_t& key, infodbclass &info);
+  void deletekey (const text_t &key);
 
   // returns true if exists
@@ -67,14 +66,16 @@
 
   // returns true on success
+  bool getinfo (const text_t& key, infodbclass &info);
+
+  // returns true on success
+  bool getkeydata (const text_t& key, text_t &data);
+
+  // returns array of keys
+  text_tarray getkeys ();
+
+  // returns true on success
   bool setinfo (const text_t &key, const infodbclass &info);
   // returns true on success
   bool setinfo (const text_t &key, const text_t &data);
-
-  void deletekey (const text_t &key);
-
-  text_tarray getkeys ();
-
-    // returns true on success
-  bool getkeydata (const text_t& key, text_t &data);
 
 protected:
@@ -90,6 +91,5 @@
 
   // returns true on success
-  bool getinfoline (text_t::iterator &here, text_t::iterator end, 
-		   text_t &key, text_t &value);
+  bool getinfoline (text_t::iterator &here, text_t::iterator end, text_t &key, text_t &value);
 };
 
