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

#define SETTING_WILDCARD_DB   1

Definition at line 103 of file settings.c.

Referenced by zurl_wildcard().

#define SETTING_WILDCARD_NO   0

Definition at line 102 of file settings.c.

Referenced by zurl_wildcard().

#define SETTING_WILDCARD_YES   2

Definition at line 104 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 336 of file settings.c.

References setting_dictionary::num.

Referenced by session_apply_setting(), and update_database_fun().

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

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 161 of file settings.c.

Referenced by read_settings().

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

Definition at line 541 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 285 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 261 of file settings.c.

References fun, and settings_read_node_x().

Referenced by read_settings().

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 155 of file settings.c.

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

int settings_num ( struct conf_service service)

Definition at line 107 of file settings.c.

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 
)
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 371 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 50 of file settings.c.

Referenced by initialize_hard_settings().