This is still totally non-functional.
[pazpar2-moved-to-github.git] / src / settings.c
1 // $Id: settings.c,v 1.1 2007-03-27 15:31:34 quinn Exp $
2 // This module implements a generic system of settings (attribute-value) that can 
3 // be associated with search targets. The system supports both default values,
4 // per-target overrides, and per-user settings.
5 //
6
7 #include <string.h>
8
9 #include <yaz/nmem.h>
10
11 static NMEM nmem = 0;
12
13 struct setting
14 {
15 };
16
17 struct setting_dictionary
18 {
19 };
20
21 // Recursively read files in a directory structure, calling 
22 static void read_settings(const char *path, void *context,
23                 void (*fun)(void *context, struct setting *set))
24 {
25 }
26
27 static void prepare_dictionary(void *context, struct setting *set)
28 {
29 }
30
31 static void update_databases(void *context, struct setting *set)
32 {
33 }
34
35 // If we ever decide we need to be able to specify multiple settings directories,
36 // the two calls to read_settings must be split -- so the dictionary is prepared
37 // for the contents of every directory before the databases are updated.
38 void settings_read(const char *path)
39 {
40     struct setting_dictionary *new;
41     if (!nmem)
42         nmem = nmem_create();
43     else
44         nmem_reset(nmem);
45     new = nmem_malloc(nmem, sizeof(*new));
46     memset(new, sizeof(*new), 0);
47     read_settings(path, new, prepare_dictionary);
48     read_settings(path, new, update_databases);
49 }
50
51 /*
52  * Local variables:
53  * c-basic-offset: 4
54  * indent-tabs-mode: nil
55  * End:
56  * vim: shiftwidth=4 tabstop=8 expandtab
57  */