X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;ds=sidebyside;f=src%2Fpazpar2_config.h;h=ddd987b28de6882441796def5f8e51f465811172;hb=fdf549621a2712e2e7fafd5966bbbf9a5c891adf;hp=a26aeae405c5a5f6c0332a234b785db938151dc5;hpb=c61cbac9542ca9443e4fb0c215240bd9053a54f8;p=pazpar2-moved-to-github.git diff --git a/src/pazpar2_config.h b/src/pazpar2_config.h index a26aeae..ddd987b 100644 --- a/src/pazpar2_config.h +++ b/src/pazpar2_config.h @@ -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, @@ -101,34 +103,29 @@ struct conf_service int num_sortkeys; struct conf_sortkey *sortkeys; struct setting_dictionary *dictionary; + struct conf_service *next; + char *id; + char *settings; NMEM nmem; -}; - -struct conf_service * conf_service_create(int num_metadata, int num_sortkeys); - -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); + int session_timeout; + int z3950_session_timeout; + int z3950_connect_timeout; -struct conf_sortkey * conf_service_add_sortkey(struct conf_service *service, - int field_id, - const char *name, - enum conf_sortkey_type type); + int ref_count; + /* duplicated from conf_server */ + pp2_charset_t relevance_pct; + pp2_charset_t sort_pct; + pp2_charset_t mergekey_pct; + struct database *databases; + struct conf_targetprofiles *targetprofiles; + struct conf_server *server; +}; 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); - struct conf_server { char *host; @@ -136,14 +133,16 @@ struct conf_server char *proxy_host; int proxy_port; char *myurl; - char *settings; + struct sockaddr_in *proxy_addr; + int listener_socket; + char *server_settings; pp2_charset_t relevance_pct; pp2_charset_t sort_pct; pp2_charset_t mergekey_pct; - struct conf_service *service; struct conf_server *next; + struct conf_config *config; }; struct conf_targetprofiles @@ -154,21 +153,25 @@ struct conf_targetprofiles char *src; }; -struct conf_config -{ - NMEM nmem; - struct conf_server *servers; - struct conf_targetprofiles *targetprofiles; -}; +struct conf_config *config_create(const char *fname, int verbose); +void config_destroy(struct conf_config *config); +xsltStylesheet *conf_load_stylesheet(struct conf_service *service, + const char *fname); -#ifndef CONFIG_NOEXTERNS +void config_start_databases(struct conf_config *config); -extern struct conf_config *config; +struct conf_service *locate_service(struct conf_server *server, + const char *service_id); -#endif +struct conf_service *service_create(struct conf_server *server, + xmlNode *node); +void service_incref(struct conf_service *service); +void service_destroy(struct conf_service *service); + +int config_start_listeners(struct conf_config *conf, + const char *listener_override); -int read_config(const char *fname); -xsltStylesheet *conf_load_stylesheet(const char *fname); +void config_stop_listeners(struct conf_config *conf); #endif