print URL
[pazpar2-moved-to-github.git] / src / settings.c
index 5cb08c1..cbe8baf 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of Pazpar2.
-   Copyright (C) 2006-2008 Index Data
+   Copyright (C) 2006-2009 Index Data
 
 Pazpar2 is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -17,16 +17,20 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 */
 
-
 // This module implements a generic system of settings
 // (attribute-value) that can be associated with search targets. The
 // system supports both default values, per-target overrides, and
 // per-user settings.
 
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
 #include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
-#include <dirent.h>
+#include "direntz.h"
 #include <stdlib.h>
 #include <sys/stat.h>
 
@@ -59,6 +63,9 @@ static char *hard_settings[] = {
     "pz:ip",
     "pz:zproxy",
     "pz:apdulog",
+    "pz:sru",
+    "pz:sru_version",
+    "pz:pqf_prefix",
     0
 };
 
@@ -245,7 +252,7 @@ static void read_settings(const char *path,
         }
         closedir(d);
     }
-    else if ((dot = rindex(path, '.')) && !strcmp(dot + 1, "xml"))
+    else if ((dot = strrchr(path, '.')) && !strcmp(dot + 1, "xml"))
         read_settings_file(path, fun);
 }
 
@@ -368,7 +375,7 @@ static void initialize_hard_settings(struct setting_dictionary *dict)
 
 // Read any settings names introduced in service definition (config) and add to dictionary
 // This is done now to avoid errors if user settings are declared in session overrides
-static void initialize_soft_settings()
+static void initialize_soft_settings(void)
 {
     struct conf_service *service = config->servers->service;
     int i;
@@ -416,7 +423,9 @@ void init_settings(void)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab
  */
+