pazpar2  1.14.1
Data Structures | Macros | Functions | Variables
settings.c File Reference
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <sys/types.h>
#include <yaz/dirent.h>
#include <yaz/xml_get.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <yaz/nmem.h>
#include <yaz/log.h>
#include "session.h"
#include "database.h"
#include "settings.h"

Go to the source code of this file.

Data Structures

struct  setting_dictionary
 
struct  update_database_context
 

Macros

#define SETTING_WILDCARD_NO   0
 
#define SETTING_WILDCARD_DB   1
 
#define SETTING_WILDCARD_YES   2
 

Functions

int settings_num (struct conf_service *service)
 
static int settings_index_lookup (struct setting_dictionary *dictionary, const char *name, NMEM nmem)
 
int settings_create_offset (struct conf_service *service, const char *name)
 
int settings_lookup_offset (struct conf_service *service, const char *name)
 
char * settings_name (struct conf_service *service, int offset)
 
static int isdir (const char *path)
 
int settings_read_node_x (xmlNode *n, void *client_data, void(*fun)(void *client_data, struct setting *set))
 
static int read_settings_file (const char *path, void *client_data, void(*fun)(void *client_data, struct setting *set))
 
static int read_settings (const char *path, void *client_data, void(*fun)(void *client_data, struct setting *set))
 
static int zurl_wildcard (const char *zurl)
 
void expand_settings_array (struct setting ***set_ar, int *num, int offset, NMEM nmem)
 
void expand_settings_array2 (struct settings_array *settings, int offset, NMEM nmem)
 
static void update_settings (struct setting *set, struct settings_array *settings, int offset, NMEM nmem)
 
static void update_database_fun (void *context, struct database *db)
 
static void update_databases (void *client_data, struct setting *set)
 
static void initialize_hard_settings (struct conf_service *service)
 
void initialize_soft_settings (struct conf_service *service)
 
static void prepare_target_dictionary (void *client_data, struct setting *set)
 
void init_settings (struct conf_service *service)
 
int settings_read_file (struct conf_service *service, const char *path, int pass)
 
int settings_read_node (struct conf_service *service, xmlNode *n, int pass)
 

Variables

static char * hard_settings []
 

Macro Definition Documentation

◆ SETTING_WILDCARD_DB

#define SETTING_WILDCARD_DB   1

Definition at line 103 of file settings.c.

◆ SETTING_WILDCARD_NO

#define SETTING_WILDCARD_NO   0

Definition at line 102 of file settings.c.

◆ SETTING_WILDCARD_YES

#define SETTING_WILDCARD_YES   2

Definition at line 104 of file settings.c.

Function Documentation

◆ expand_settings_array()

void expand_settings_array ( struct setting ***  set_ar,
int *  num,
int  offset,
NMEM  nmem 
)

Definition at line 336 of file settings.c.

Referenced by session_apply_setting(), and update_database_fun().

◆ expand_settings_array2()

void expand_settings_array2 ( struct settings_array settings,
int  offset,
NMEM  nmem 
)

Definition at line 354 of file settings.c.

References settings_array::num_settings, and settings_array::settings.

Referenced by update_settings().

◆ init_settings()

void init_settings ( struct conf_service service)

◆ initialize_hard_settings()

static void initialize_hard_settings ( struct conf_service service)
static

◆ initialize_soft_settings()

void initialize_soft_settings ( struct conf_service service)

◆ isdir()

static int isdir ( const char *  path)
static

Definition at line 161 of file settings.c.

Referenced by read_settings().

◆ prepare_target_dictionary()

static void prepare_target_dictionary ( void *  client_data,
struct setting set 
)
static

◆ read_settings()

static int read_settings ( const char *  path,
void *  client_data,
void(*)(void *client_data, struct setting *set)  fun 
)
static

Definition at line 285 of file settings.c.

References fun, isdir(), and read_settings_file().

Referenced by settings_read_file().

◆ read_settings_file()

static int read_settings_file ( const char *  path,
void *  client_data,
void(*)(void *client_data, struct setting *set)  fun 
)
static

Definition at line 261 of file settings.c.

References fun, and settings_read_node_x().

Referenced by read_settings().

◆ settings_create_offset()

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

◆ settings_index_lookup()

static int settings_index_lookup ( struct setting_dictionary dictionary,
const char *  name,
NMEM  nmem 
)
static

◆ settings_lookup_offset()

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

◆ settings_name()

char* settings_name ( struct conf_service service,
int  offset 
)

Definition at line 155 of file settings.c.

References setting_dictionary::dict, and conf_service::dictionary.

◆ settings_num()

int settings_num ( struct conf_service service)

Definition at line 107 of file settings.c.

References conf_service::dictionary, and setting_dictionary::num.

◆ settings_read_file()

int settings_read_file ( struct conf_service service,
const char *  path,
int  pass 
)

Definition at line 563 of file settings.c.

References prepare_target_dictionary(), read_settings(), and update_databases().

Referenced by inherit_server_settings().

◆ settings_read_node()

int settings_read_node ( struct conf_service service,
xmlNode *  n,
int  pass 
)

◆ settings_read_node_x()

int settings_read_node_x ( xmlNode *  n,
void *  client_data,
void(*)(void *client_data, struct setting *set)  fun 
)

◆ update_database_fun()

static void update_database_fun ( void *  context,
struct database db 
)
static

◆ update_databases()

static void update_databases ( void *  client_data,
struct setting set 
)
static

◆ update_settings()

static void update_settings ( struct setting set,
struct settings_array settings,
int  offset,
NMEM  nmem 
)
static

◆ zurl_wildcard()

static int zurl_wildcard ( const char *  zurl)
static

Variable Documentation

◆ hard_settings

char* hard_settings[]
static

Definition at line 50 of file settings.c.

Referenced by initialize_hard_settings().