Code calls xfree() instead of free().
[idzebra-moved-to-github.git] / index / main.c
index 4991924..5add43e 100644 (file)
@@ -4,7 +4,19 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: main.c,v $
- * Revision 1.49  1997-09-17 12:19:15  adam
+ * Revision 1.52  1997-10-31 12:34:04  adam
+ * Added missing nmem_init.
+ *
+ * Revision 1.51  1997/10/27 14:33:05  adam
+ * Moved towards generic character mapping depending on "structure"
+ * field in abstract syntax file. Fixed a few memory leaks. Fixed
+ * bug with negative integers when doing searches with relational
+ * operators.
+ *
+ * Revision 1.50  1997/09/25 14:55:52  adam
+ * Minor changes.
+ *
+ * Revision 1.49  1997/09/17 12:19:15  adam
  * Zebra version corresponds to YAZ version 1.4.
  * Changed Zebra server so that it doesn't depend on global common_resource.
  *
@@ -214,7 +226,9 @@ int main (int argc, char **argv)
     int disableCommit = 0;
 
     struct recordGroup rGroupDef;
-    
+
+    nmem_init ();
+
     rGroupDef.groupName = NULL;
     rGroupDef.databaseName = NULL;
     rGroupDef.path = NULL;
@@ -224,6 +238,7 @@ int main (int argc, char **argv)
     rGroupDef.flagStoreKeys = -1;
     rGroupDef.flagShowRecords = 0;
     rGroupDef.fileVerboseLimit = 100000;
+    rGroupDef.zebra_maps = NULL;
     rGroupDef.dh = data1_create ();
 
     prog = *argv;
@@ -277,7 +292,8 @@ int main (int argc, char **argv)
 
                     bf_lockDir (rGroupDef.bfs,
                                res_get (common_resource, "lockDir"));
-                   init_charmap(common_resource);
+                   rGroupDef.zebra_maps = zebra_maps_open (res_get(
+                       common_resource, "profilePath"));
                 }
                 if (!strcmp (arg, "update"))
                     cmd = 'u';
@@ -308,7 +324,9 @@ int main (int argc, char **argv)
                         zebraIndexWait (1);
                         logf (LOG_LOG, "commit execute");
                         bf_commitExec (rGroupDef.bfs);
+#ifndef WINDOWS
                         sync ();
+#endif
                         zebraIndexLockMsg ("d");
                         zebraIndexWait (0);
                         logf (LOG_LOG, "commit clean");
@@ -407,7 +425,9 @@ int main (int argc, char **argv)
                 {
                     logf (LOG_LOG, "merging with index");
                     key_input (rGroup.bfs, nsections, 60);
+#ifndef WINDOWS
                     sync ();
+#endif
                 }
                 log_event_end (NULL, NULL);
             }
@@ -447,5 +467,6 @@ int main (int argc, char **argv)
     }
     data1_destroy (rGroupDef.dh);
     exit (0);
+    return 0;
 }