pazpar2  1.13.0
Data Structures | Functions
pazpar2_config.c File Reference
#include <string.h>
#include <assert.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xinclude.h>
#include <yaz/yaz-util.h>
#include <yaz/nmem.h>
#include <yaz/snprintf.h>
#include <yaz/tpath.h>
#include <yaz/xml_include.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "ppmutex.h"
#include "incref.h"
#include "pazpar2_config.h"
#include "service_xslt.h"
#include "settings.h"
#include "eventl.h"
#include "http.h"

Go to the source code of this file.

Data Structures

struct  conf_config
struct  service_xslt


static char * xml_context (const xmlNode *ptr, char *res, size_t len)
struct conf_serviceservice_init (struct conf_server *server, int num_metadata, int num_sortkeys, const char *service_id)
static struct conf_metadataconf_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, const char *rank, int sortkey_offset, enum conf_metadata_mergekey mt, const char *facetrule, const char *limitmap, const char *limitcluster, const char *icurule)
static struct conf_sortkeyconf_service_add_sortkey (struct conf_service *service, int field_id, const char *name, enum conf_metadata_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)
static void conf_dir_path (struct conf_config *config, WRBUF w, const char *src)
void service_destroy (struct conf_service *service)
void service_incref (struct conf_service *service)
static int parse_metadata (struct conf_service *service, xmlNode *n, int *md_node, int *sk_node)
static void count_metadata (xmlNode *n, int *num_metadata, int *num_sortkeys)
static struct conf_serviceservice_create_static (struct conf_server *server, xmlNode *node, const char *service_id)
static int inherit_server_settings (struct conf_service *s)
struct conf_serviceservice_create (struct conf_server *server, xmlNode *node)
static struct conf_serverserver_create (struct conf_config *config, NMEM nmem, xmlNode *node)
WRBUF conf_get_fname (struct conf_config *config, const char *fname)
struct conf_servicelocate_service (struct conf_server *server, const char *service_id)
static void info_service_metadata (struct conf_service *service, WRBUF w)
static void info_service_databases (struct conf_service *service, WRBUF w)
void info_services (struct conf_server *server, WRBUF w)
static int parse_config (struct conf_config *config, xmlNode *root)
struct conf_configconfig_create (const char *fname)
void server_destroy (struct conf_server *server)
void config_destroy (struct conf_config *config)
void config_stop_listeners (struct conf_config *conf)
void config_process_events (struct conf_config *conf)
int config_start_listeners (struct conf_config *conf, const char *listener_override, const char *record_fname)

Function Documentation

static void conf_dir_path ( struct conf_config config,
const char *  src 

Definition at line 260 of file pazpar2_config.c.

References conf_config::confdir, and conf_config::path.

Referenced by conf_get_fname(), server_create(), and service_create_static().

WRBUF conf_get_fname ( struct conf_config config,
const char *  fname 

Definition at line 1023 of file pazpar2_config.c.

References conf_dir_path().

Referenced by normalize_record_create().

static 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,
const char *  rank,
int  sortkey_offset,
enum conf_metadata_mergekey  mt,
const char *  facetrule,
const char *  limitmap,
const char *  limitcluster,
const char *  icurule 
static struct conf_sortkey* conf_service_add_sortkey ( struct conf_service service,
int  field_id,
const char *  name,
enum conf_metadata_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 

Definition at line 246 of file pazpar2_config.c.

References conf_service::num_sortkeys, and conf_service::sortkeys.

struct conf_config* config_create ( const char *  fname)
void config_destroy ( struct conf_config config)
void config_process_events ( struct conf_config conf)
int config_start_listeners ( struct conf_config conf,
const char *  listener_override,
const char *  record_fname 
void config_stop_listeners ( struct conf_config conf)

Definition at line 1391 of file pazpar2_config.c.

References http_close_server(), conf_server::next, and conf_config::servers.

Referenced by sc_stop().

static void count_metadata ( xmlNode *  n,
int *  num_metadata,
int *  num_sortkeys 

Definition at line 532 of file pazpar2_config.c.

Referenced by service_create_static().

static void info_service_databases ( struct conf_service service,
static void info_service_metadata ( struct conf_service service,
void info_services ( struct conf_server server,
static int inherit_server_settings ( struct conf_service s)
struct conf_service* locate_service ( struct conf_server server,
const char *  service_id 

Definition at line 1031 of file pazpar2_config.c.

References conf_service::id, conf_service::next, conf_server::service, and service_incref().

Referenced by cmd_init().

static int parse_config ( struct conf_config config,
xmlNode *  root 
static int parse_metadata ( struct conf_service service,
xmlNode *  n,
int *  md_node,
int *  sk_node 
static struct conf_server* server_create ( struct conf_config config,
NMEM  nmem,
xmlNode *  node 
void server_destroy ( struct conf_server server)
struct conf_service* service_create ( struct conf_server server,
xmlNode *  node 
static struct conf_service* service_create_static ( struct conf_server server,
xmlNode *  node,
const char *  service_id 
void service_destroy ( struct conf_service service)
void service_incref ( struct conf_service service)

Definition at line 293 of file pazpar2_config.c.

References conf_service::mutex, pazpar2_incref(), and conf_service::ref_count.

Referenced by locate_service().

struct conf_service* service_init ( struct conf_server server,
int  num_metadata,
int  num_sortkeys,
const char *  service_id 
static char* xml_context ( const xmlNode *  ptr,
char *  res,
size_t  len 

Definition at line 69 of file pazpar2_config.c.

Referenced by service_create_static().