pazpar2  1.14.1
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
 

Functions

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

◆ conf_dir_path()

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

Definition at line 260 of file pazpar2_config.c.

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

Referenced by conf_get_fname(), and server_create().

◆ conf_get_fname()

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().

◆ conf_service_add_metadata()

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

◆ conf_service_add_sortkey()

static struct conf_sortkey* conf_service_add_sortkey ( struct conf_service service,
int  field_id,
const char *  name,
enum conf_metadata_type  type 
)
static

◆ conf_service_metadata_field_id()

int conf_service_metadata_field_id ( struct conf_service service,
const char *  name 
)

◆ conf_service_sortkey_field_id()

int conf_service_sortkey_field_id ( struct conf_service service,
const char *  name 
)

Definition at line 246 of file pazpar2_config.c.

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

◆ config_create()

struct conf_config* config_create ( const char *  fname)

◆ config_destroy()

void config_destroy ( struct conf_config config)

◆ config_process_events()

void config_process_events ( struct conf_config conf)

◆ config_start_listeners()

int config_start_listeners ( struct conf_config conf,
const char *  listener_override,
const char *  record_fname 
)

◆ config_stop_listeners()

void config_stop_listeners ( struct conf_config conf)

Definition at line 1392 of file pazpar2_config.c.

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

Referenced by sc_stop().

◆ count_metadata()

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

Definition at line 532 of file pazpar2_config.c.

Referenced by service_create_static().

◆ info_service_databases()

static void info_service_databases ( struct conf_service service,
WRBUF  w 
)
static

◆ info_service_metadata()

static void info_service_metadata ( struct conf_service service,
WRBUF  w 
)
static

◆ info_services()

void info_services ( struct conf_server server,
WRBUF  w 
)

◆ inherit_server_settings()

static int inherit_server_settings ( struct conf_service s)
static

◆ locate_service()

struct conf_service* locate_service ( struct conf_server server,
const char *  service_id 
)

◆ parse_config()

static int parse_config ( struct conf_config config,
xmlNode *  root 
)
static

◆ parse_metadata()

static int parse_metadata ( struct conf_service service,
xmlNode *  n,
int *  md_node,
int *  sk_node 
)
static

◆ server_create()

static struct conf_server* server_create ( struct conf_config config,
NMEM  nmem,
xmlNode *  node 
)
static

◆ server_destroy()

void server_destroy ( struct conf_server server)

◆ service_create()

struct conf_service* service_create ( struct conf_server server,
xmlNode *  node 
)

◆ service_create_static()

static struct conf_service* service_create_static ( struct conf_server server,
xmlNode *  node,
const char *  service_id 
)
static

◆ service_destroy()

void service_destroy ( struct conf_service service)

◆ service_incref()

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().

◆ service_init()

struct conf_service* service_init ( struct conf_server server,
int  num_metadata,
int  num_sortkeys,
const char *  service_id 
)

◆ xml_context()

static char* xml_context ( const xmlNode *  ptr,
char *  res,
size_t  len 
)
static

Definition at line 69 of file pazpar2_config.c.