Index: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	(revision 141)
+++ trunk/src/Makefile	(revision 143)
@@ -3,6 +3,6 @@
 ################################################################################
 
-REGLOOKUP=$(BUILD_BIN)/reglookup
-REGLOOKUP_RECOVER=$(BUILD_BIN)/reglookup-recover
+REGLOOKUP=$(BUILD_BIN)/reglookup$(BIN_EXT)
+REGLOOKUP_RECOVER=$(BUILD_BIN)/reglookup-recover$(BIN_EXT)
 OBJ=$(wildcard ../lib/*.o)
 FILES=$(REGLOOKUP) $(REGLOOKUP_RECOVER)
@@ -11,8 +11,8 @@
 
 $(REGLOOKUP): reglookup.o $(OBJ)
-	$(CC) $(CFLAGS) $(OPTS) $(LIB) -o $@ reglookup.o $(OBJ)
+	$(CC) $(CFLAGS) $(OPTS) $(LIB) -o $@ reglookup.o $(OBJ) $(EXTRA_OBJ)
 
 $(REGLOOKUP_RECOVER): reglookup-recover.o $(OBJ)
-	$(CC) $(CFLAGS) $(OPTS) $(LIB) -o $@ reglookup-recover.o $(OBJ)
+	$(CC) $(CFLAGS) $(OPTS) $(LIB) -o $@ reglookup-recover.o $(OBJ) $(EXTRA_OBJ)
 
 reglookup.o: reglookup.c
Index: trunk/src/common.c
===================================================================
--- trunk/src/common.c	(revision 141)
+++ trunk/src/common.c	(revision 143)
@@ -31,4 +31,10 @@
 #define REGLOOKUP_VERSION "0.10.0"
 
+#define REGLOOKUP_EXIT_OK       0
+#define REGLOOKUP_EXIT_OSERR   71
+#define REGLOOKUP_EXIT_USAGE   64
+#define REGLOOKUP_EXIT_DATAERR 65
+#define REGLOOKUP_EXIT_NOINPUT 66
+
 
 void bailOut(int code, char* message)
Index: trunk/src/reglookup-recover.c
===================================================================
--- trunk/src/reglookup-recover.c	(revision 141)
+++ trunk/src/reglookup-recover.c	(revision 143)
@@ -22,5 +22,4 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <sysexits.h>
 
 #include "../include/regfi.h"
@@ -84,5 +83,5 @@
     quoted_name = malloc(1*sizeof(char));
     if(quoted_name == NULL)
-      bailOut(EX_OSERR, "ERROR: Could not allocate sufficient memory.\n");
+      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n");
     quoted_name[0] = '\0';
 
@@ -140,5 +139,5 @@
     quoted_name = malloc(1*sizeof(char));
     if(quoted_name == NULL)
-      bailOut(EX_OSERR, "ERROR: Could not allocate sufficient memory.\n");
+      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n");
     quoted_name[0] = '\0';
   }
@@ -149,5 +148,5 @@
     quoted_value = malloc(1*sizeof(char));
     if(quoted_value == NULL)
-      bailOut(EX_OSERR, "ERROR: Could not allocate sufficient memory.\n");
+      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n");
     quoted_value[0] = '\0';
 
@@ -714,5 +713,5 @@
   {
     usage();
-    bailOut(EX_USAGE, "ERROR: Requires at least one argument.\n");
+    bailOut(REGLOOKUP_EXIT_USAGE, "ERROR: Requires at least one argument.\n");
   }
   
@@ -738,5 +737,5 @@
       usage();
       fprintf(stderr, "ERROR: Unrecognized option: %s\n", argv[argi]);
-      bailOut(EX_USAGE, "");
+      bailOut(REGLOOKUP_EXIT_USAGE, "");
     }
   }
@@ -744,5 +743,5 @@
 
   if((registry_file = strdup(argv[argi])) == NULL)
-    bailOut(EX_OSERR, "ERROR: Memory allocation problem.\n");
+    bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Memory allocation problem.\n");
 
   f = regfi_open(registry_file);
@@ -750,5 +749,5 @@
   {
     fprintf(stderr, "ERROR: Couldn't open registry file: %s\n", registry_file);
-    bailOut(EX_NOINPUT, "");
+    bailOut(REGLOOKUP_EXIT_NOINPUT, "");
   }
   if(print_verbose)
Index: trunk/src/reglookup.c
===================================================================
--- trunk/src/reglookup.c	(revision 141)
+++ trunk/src/reglookup.c	(revision 143)
@@ -23,5 +23,4 @@
 
 #include <stdlib.h>
-#include <sysexits.h>
 #include <stdio.h>
 #include <string.h>
@@ -82,5 +81,5 @@
     quoted_name = malloc(1*sizeof(char));
     if(quoted_name == NULL)
-      bailOut(EX_OSERR, "ERROR: Could not allocate sufficient memory.\n");
+      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n");
     quoted_name[0] = '\0';
   }
@@ -161,5 +160,5 @@
       copy = (char*)malloc((next-cur+1)*sizeof(char));
       if(copy == NULL)
-	bailOut(EX_OSERR, "ERROR: Memory allocation problem.\n");
+	bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Memory allocation problem.\n");
 	  
       memcpy(copy, cur, next-cur);
@@ -169,5 +168,5 @@
 	ret_val[ret_cur] = NULL;
       else
-	bailOut(EX_DATAERR, "ERROR: Registry maximum depth exceeded.\n");
+	bailOut(REGLOOKUP_EXIT_DATAERR, "ERROR: Registry maximum depth exceeded.\n");
     }
     cur = next+1;
@@ -182,5 +181,5 @@
       ret_val[ret_cur] = NULL;
     else
-      bailOut(EX_DATAERR, "ERROR: Registry maximum depth exceeded.\n");
+      bailOut(REGLOOKUP_EXIT_DATAERR, "ERROR: Registry maximum depth exceeded.\n");
   }
 
@@ -384,5 +383,5 @@
 
   if(root == NULL)
-    bailOut(EX_DATAERR, "ERROR: root cannot be NULL.\n");
+    bailOut(REGLOOKUP_EXIT_DATAERR, "ERROR: root cannot be NULL.\n");
   
   do
@@ -392,5 +391,5 @@
       path = iter2Path(iter);
       if(path == NULL)
-	bailOut(EX_OSERR, "ERROR: Could not construct iterator's path.\n");
+	bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not construct iterator's path.\n");
 
       if(!type_filter_enabled || (key_type == type_filter))
@@ -410,5 +409,5 @@
 	{
 	  printMsgs(iter->f);
-	  bailOut(EX_DATAERR, "ERROR: could not traverse iterator upward.\n");
+	  bailOut(REGLOOKUP_EXIT_DATAERR, "ERROR: could not traverse iterator upward.\n");
 	}
 
@@ -417,5 +416,5 @@
 	{
 	  printMsgs(iter->f);
-	  bailOut(EX_DATAERR, "ERROR: unexpected NULL for key.\n");
+	  bailOut(REGLOOKUP_EXIT_DATAERR, "ERROR: unexpected NULL for key.\n");
 	}
 
@@ -431,5 +430,5 @@
       {
 	printMsgs(iter->f);
-	bailOut(EX_DATAERR, "ERROR: could not traverse iterator downward.\n");
+	bailOut(REGLOOKUP_EXIT_DATAERR, "ERROR: could not traverse iterator downward.\n");
       }
 
@@ -507,5 +506,5 @@
 
     if((value == NULL) || (tmp_path_joined == NULL))
-      bailOut(EX_OSERR, "ERROR: Unexpected error before printValue.\n");
+      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Unexpected error before printValue.\n");
 
     if(!type_filter_enabled || (value->type == type_filter))
@@ -525,5 +524,5 @@
     {
       printMsgs(iter->f);
-      bailOut(EX_DATAERR, "ERROR: Unexpected error on traversing path filter key.\n");
+      bailOut(REGLOOKUP_EXIT_DATAERR, "ERROR: Unexpected error on traversing path filter key.\n");
     }
 
@@ -568,5 +567,5 @@
   {
     usage();
-    bailOut(EX_USAGE, "ERROR: Requires at least one argument.\n");
+    bailOut(REGLOOKUP_EXIT_USAGE, "ERROR: Requires at least one argument.\n");
   }
   
@@ -579,8 +578,8 @@
       {
 	usage();
-	bailOut(EX_USAGE, "ERROR: '-p' option requires parameter.\n");
+	bailOut(REGLOOKUP_EXIT_USAGE, "ERROR: '-p' option requires parameter.\n");
       }
       if((path_filter = strdup(argv[argi])) == NULL)
-	bailOut(EX_OSERR, "ERROR: Memory allocation problem.\n");
+	bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Memory allocation problem.\n");
 
       path_filter_enabled = true;
@@ -591,10 +590,10 @@
       {
 	usage();
-	bailOut(EX_USAGE, "ERROR: '-t' option requires parameter.\n");
+	bailOut(REGLOOKUP_EXIT_USAGE, "ERROR: '-t' option requires parameter.\n");
       }
       if((type_filter = regfi_type_str2val(argv[argi])) < 0)
       {
 	fprintf(stderr, "ERROR: Invalid type specified: %s.\n", argv[argi]);
-	bailOut(EX_USAGE, "");
+	bailOut(REGLOOKUP_EXIT_USAGE, "");
       }
       type_filter_enabled = true;
@@ -614,9 +613,9 @@
       usage();
       fprintf(stderr, "ERROR: Unrecognized option: %s\n", argv[argi]);
-      bailOut(EX_USAGE, "");
+      bailOut(REGLOOKUP_EXIT_USAGE, "");
     }
   }
   if((registry_file = strdup(argv[argi])) == NULL)
-    bailOut(EX_OSERR, "ERROR: Memory allocation problem.\n");
+    bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Memory allocation problem.\n");
 
   f = regfi_open(registry_file);
@@ -624,5 +623,5 @@
   {
     fprintf(stderr, "ERROR: Couldn't open registry file: %s\n", registry_file);
-    bailOut(EX_NOINPUT, "");
+    bailOut(REGLOOKUP_EXIT_NOINPUT, "");
   }
 
@@ -632,5 +631,5 @@
   iter = regfi_iterator_new(f);
   if(iter == NULL)
-    bailOut(EX_OSERR, "ERROR: Couldn't create registry iterator.\n");
+    bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Couldn't create registry iterator.\n");
 
   if(print_header)
@@ -659,5 +658,6 @@
       fprintf(stderr, "ERROR: retrievePath() returned %d.\n", 
 	      retr_path_ret);
-      bailOut(EX_DATAERR,"ERROR: Unknown error occurred in retrieving path.\n");
+      bailOut(REGLOOKUP_EXIT_DATAERR,
+	      "ERROR: Unknown error occurred in retrieving path.\n");
     }
   }
