Re-structure conf/server/service ptrs
[pazpar2-moved-to-github.git] / src / pazpar2_config.h
index 7400c9f..f56ea7f 100644 (file)
@@ -90,6 +90,8 @@ struct conf_sortkey
     enum conf_sortkey_type type;
 };
 
+struct conf_server;
+
 // It is conceivable that there will eventually be several 'services'
 // offered from one server, with separate configuration -- possibly
 // more than one services associated with the same port. For now,
@@ -105,7 +107,10 @@ struct conf_service
     char *id;
     char *settings;
     NMEM nmem;
-
+    int session_timeout;
+    int z3950_session_timeout;
+    int z3950_connect_timeout;
+    
     /* duplicated from conf_server */
     pp2_charset_t relevance_pct;
     pp2_charset_t sort_pct;
@@ -113,31 +118,9 @@ struct conf_service
 
     struct database *databases;
     struct conf_targetprofiles *targetprofiles;
-    struct conf_config *config;
+    struct conf_server *server;
 };
 
-struct conf_service * conf_service_create(struct conf_config *config,
-                                          int num_metadata, int num_sortkeys,
-                                          const char *service_id);
-
-struct conf_metadata* conf_service_add_metadata(struct conf_service *service,
-                                                int field_id,
-                                                const char *name,
-                                                enum conf_metadata_type type,
-                                                enum conf_metadata_merge merge,
-                                                enum conf_setting_type setting,
-                                                int brief,
-                                                int termlist,
-                                                int rank,
-                                                int sortkey_offset,
-                                                enum conf_metadata_mergekey mt);
-
-struct conf_sortkey * conf_service_add_sortkey(struct conf_service *service,
-                                               int field_id,
-                                               const char *name,
-                                               enum conf_sortkey_type type);
-
-
 int conf_service_metadata_field_id(struct conf_service *service, const char * name);
 
 int conf_service_sortkey_field_id(struct conf_service *service, const char * name);
@@ -151,7 +134,6 @@ struct conf_server
     char *myurl;
     struct sockaddr_in *proxy_addr;
     int listener_socket;
-
     char *server_settings;
 
     pp2_charset_t relevance_pct;
@@ -159,6 +141,7 @@ struct conf_server
     pp2_charset_t mergekey_pct;
     struct conf_service *service;
     struct conf_server *next;
+    struct conf_config *config;
 };
 
 struct conf_targetprofiles
@@ -171,10 +154,10 @@ struct conf_targetprofiles
 
 struct conf_config *config_create(const char *fname, int verbose);
 void config_destroy(struct conf_config *config);
-xsltStylesheet *conf_load_stylesheet(struct conf_config *config,
+xsltStylesheet *conf_load_stylesheet(struct conf_service *service,
                                      const char *fname);
 
-void config_read_settings(struct conf_config *config);
+void config_start_databases(struct conf_config *config);
 
 struct conf_service *locate_service(struct conf_server *server,
                                     const char *service_id);