Index: trunk/SConstruct
===================================================================
--- trunk/SConstruct	(revision 231)
+++ trunk/SConstruct	(revision 232)
@@ -1,6 +1,8 @@
 import sys
 import os
+from regfi_version import REGFI_VERSION
 
 cflags = '-std=gnu99 -pedantic -Wall -D_FILE_OFFSET_BITS=64 -fvisibility=hidden'
+cflags += ' -DREGFI_VERSION=\'"%s"\'' % REGFI_VERSION
 cflags += ' -ggdb'
 
Index: trunk/include/regfi.h
===================================================================
--- trunk/include/regfi.h	(revision 231)
+++ trunk/include/regfi.h	(revision 232)
@@ -79,4 +79,9 @@
 #include <range_list.h>
 #include <lru_cache.h>
+
+/* Library version can be overridden at build time */
+#ifndef REGFI_VERSION
+#define REGFI_VERSION "trunk"
+#endif
 
 /* GCC-specific macro for library exports */
Index: trunk/python/pyregfi/__init__.py
===================================================================
--- trunk/python/pyregfi/__init__.py	(revision 231)
+++ trunk/python/pyregfi/__init__.py	(revision 232)
@@ -189,5 +189,5 @@
 # should be reported to the user.  Failure to retrieve these could result in 
 # excessive memory consumption.
-def GetLogMessages():
+def getLogMessages():
     msgs = regfi.regfi_log_get_str()
     if not msgs:
@@ -206,5 +206,5 @@
 # Example:
 # @code
-# SetLogMask((LOG_TYPES.ERROR, LOG_TYPES.WARN, LOG_TYPES.INFO))
+# setLogMask((LOG_TYPES.ERROR, LOG_TYPES.WARN, LOG_TYPES.INFO))
 # @endcode
 #
@@ -212,5 +212,5 @@
 # For more information, see @ref regfi_log_set_mask.
 #
-def SetLogMask(log_types):
+def setLogMask(log_types):
     mask = 0
     for m in log_types:
@@ -219,4 +219,15 @@
 
 
+## Opens a file as a registry hive
+#
+# @param path The file path of a hive, as one would provide to the 
+#             open() built-in
+#
+# @return A new Hive instance
+def openHive(path):
+    fh = open(path, 'rb')
+    return Hive(fh)
+
+
 ## Abstract class for most objects returned by the library
 class _StructureWrapper(object):
@@ -228,9 +239,9 @@
             raise Exception("Could not create _StructureWrapper,"
                             + " hive is NULL.  Current log:\n"
-                            + GetLogMessages())
+                            + getLogMessages())
         if not base:
             raise Exception("Could not create _StructureWrapper,"
                             + " base is NULL.  Current log:\n"
-                            + GetLogMessages())
+                            + getLogMessages())
         self._hive = hive
         self._base = base
@@ -297,9 +308,9 @@
         if not key:
             raise Exception("Could not create _GenericList; key is NULL."
-                            + "Current log:\n" + GetLogMessages())
+                            + "Current log:\n" + getLogMessages())
         
         if not regfi.regfi_reference_record(key._hive.file, key._base):
             raise Exception("Could not create _GenericList; memory error."
-                            + "Current log:\n" + GetLogMessages())
+                            + "Current log:\n" + getLogMessages())
         self._key_base = key._base
         self._length = self._fetch_num(self._key_base)
@@ -650,8 +661,8 @@
     minor_version = 5
 
-    # XXX: Possibly add a second or factory function which opens a 
-    #      hive file for you
-
     ## Constructor
+    #
+    # Initialize a new Hive based on a Python file object.  To open a file by 
+    # path, see @ref openHive.
     #
     # @param fh A Python file object.  The constructor first looks for a valid
@@ -660,5 +671,10 @@
     #           access.
     #
-    # @note Supplied file must be seekable
+    # @note Supplied file must be seekable.  Do not perform any operation on
+    #       the provided file object while a Hive is using it.  Do not 
+    #       construct multiple Hive instances from the same file object.
+    #       If a file must be accessed by separate code and pyregfi 
+    #       simultaneously, use a separate file descriptor.  Hives are 
+    #       thread-safe, so multiple threads may use a single Hive object.
     def __init__(self, fh):
         # The fileno method may not exist, or it may throw an exception
@@ -678,5 +694,5 @@
                 # XXX: switch to non-generic exception
                 raise Exception("Could not open registry file.  Current log:\n"
-                                + GetLogMessages())
+                                + getLogMessages())
         else:
             fh.seek(0)
@@ -689,5 +705,5 @@
                 # XXX: switch to non-generic exception
                 raise Exception("Could not open registry file.  Current log:\n"
-                                + GetLogMessages())
+                                + getLogMessages())
 
 
@@ -753,5 +769,5 @@
         if not self._iter:
             raise Exception("Could not create iterator.  Current log:\n"
-                            + GetLogMessages())
+                            + getLogMessages())
         self._hive = hive
         self._lock = threading.RLock()
@@ -797,5 +813,5 @@
                 self._lock.release()
                 raise Exception('Error traversing iterator downward.'+
-                                ' Current log:\n'+ GetLogMessages())
+                                ' Current log:\n'+ getLogMessages())
 
         regfi.regfi_iterator_first_subkey(self._iter)
@@ -977,5 +993,5 @@
         if not result:
             # XXX: Use non-generic exception
-            raise Exception('Could not locate path.\n'+GetLogMessages())
+            raise Exception('Could not locate path.\n'+getLogMessages())
 
 
Index: trunk/regfi_version.py
===================================================================
--- trunk/regfi_version.py	(revision 231)
+++ trunk/regfi_version.py	(revision 232)
@@ -1,3 +1,2 @@
-
 SVN_REV = "$Rev$"
-REGFI_VERSION = "svn-%s" % SVN_REV.split(' ')[2]
+REGFI_VERSION = "svn-%s" % SVN_REV.split(' ')[1]
Index: trunk/src/common.c
===================================================================
--- trunk/src/common.c	(revision 231)
+++ trunk/src/common.c	(revision 232)
@@ -3,5 +3,5 @@
  * XXX: This should be converted to a proper library.
  *
- * Copyright (C) 2005-2008 Timothy D. Morgan
+ * Copyright (C) 2005-2008,2011 Timothy D. Morgan
  * Copyright (C) 2002 Richard Sharpe, rsharpe@richardsharpe.com
  *
@@ -28,6 +28,4 @@
 const char* subfield_special_chars = ",\"\\|";
 const char* common_special_chars = ",\"\\";
-
-#define REGLOOKUP_VERSION "0.1?.0"
 
 #define REGLOOKUP_EXIT_OK       0
Index: trunk/src/reglookup-recover.c
===================================================================
--- trunk/src/reglookup-recover.c	(revision 231)
+++ trunk/src/reglookup-recover.c	(revision 232)
@@ -336,5 +336,5 @@
 {
   fprintf(stderr, "Usage: reglookup-recover [options] <REGISTRY_FILE>\n");
-  fprintf(stderr, "Version: %s\n", REGLOOKUP_VERSION);
+  fprintf(stderr, "Version: %s\n", REGFI_VERSION);
   fprintf(stderr, "Options:\n");
   fprintf(stderr, "\t-v\t sets verbose mode.\n");
Index: trunk/src/reglookup.c
===================================================================
--- trunk/src/reglookup.c	(revision 231)
+++ trunk/src/reglookup.c	(revision 232)
@@ -551,5 +551,5 @@
 	  " [-p <PATH_FILTER>] [-t <TYPE_FILTER>]"
 	  " <REGISTRY_FILE>\n");
-  fprintf(stderr, "Version: %s\n", REGLOOKUP_VERSION);
+  fprintf(stderr, "Version: %s\n", REGFI_VERSION);
   fprintf(stderr, "Options:\n");
   fprintf(stderr, "\t-v\t sets verbose mode.\n");
