pazpar2  1.6.30
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 <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)
void service_apply_setting (struct conf_service *service, char *setting, char *value)
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

#define SETTING_WILDCARD_DB   1

Definition at line 97 of file settings.c.

Referenced by zurl_wildcard().

#define SETTING_WILDCARD_NO   0

Definition at line 96 of file settings.c.

Referenced by zurl_wildcard().

#define SETTING_WILDCARD_YES   2

Definition at line 98 of file settings.c.

Referenced by zurl_wildcard().

Function Documentation

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

Definition at line 358 of file settings.c.

Referenced by service_apply_setting(), session_apply_setting(), and update_database_fun().

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

Definition at line 376 of file settings.c.

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

Referenced by update_settings().

void init_settings ( struct conf_service service)
static void initialize_hard_settings ( struct conf_service service)
static
void initialize_soft_settings ( struct conf_service service)
static int isdir ( const char *  path)
static

Definition at line 171 of file settings.c.

Referenced by read_settings().

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

Definition at line 563 of file settings.c.

References create_database_for_service(), and zurl_wildcard().

Referenced by settings_read_file(), and settings_read_node().

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

Definition at line 307 of file settings.c.

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

Referenced by settings_read_file().

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

Definition at line 283 of file settings.c.

References fun, and settings_read_node_x().

Referenced by read_settings().

void service_apply_setting ( struct conf_service service,
char *  setting,
char *  value 
)
int settings_create_offset ( struct conf_service service,
const char *  name 
)
static int settings_index_lookup ( struct setting_dictionary dictionary,
const char *  name,
NMEM  nmem 
)
static
int settings_lookup_offset ( struct conf_service service,
const char *  name 
)
char* settings_name ( struct conf_service service,
int  offset 
)

Definition at line 149 of file settings.c.

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

int settings_num ( struct conf_service service)

Definition at line 101 of file settings.c.

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

Definition at line 585 of file settings.c.

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

Referenced by inherit_server_settings().

int settings_read_node ( struct conf_service service,
xmlNode *  n,
int  pass 
)
int settings_read_node_x ( xmlNode *  n,
void *  client_data,
void(*)(void *client_data, struct setting *set)  fun 
)
static void update_database_fun ( void *  context,
struct database db 
)
static
static void update_databases ( void *  client_data,
struct setting set 
)
static
static void update_settings ( struct setting set,
struct settings_array settings,
int  offset,
NMEM  nmem 
)
static

Definition at line 393 of file settings.c.

References expand_settings_array2(), settings_array::settings, and zurl_wildcard().

Referenced by initialize_soft_settings().

static int zurl_wildcard ( const char *  zurl)
static

Variable Documentation

char* hard_settings[]
static

Definition at line 49 of file settings.c.

Referenced by initialize_hard_settings().