Removed command.c (telnet-style interface)
[pazpar2-moved-to-github.git] / src / config.h
1 #ifndef CONFIG_H
2 #define CONFIG_H
3
4 #include <libxslt/xslt.h>
5 #include <libxslt/transform.h>
6 #include <libxslt/xsltutils.h>
7
8 struct conf_termlist
9 {
10     char *name;
11     struct conf_termlist *next;
12 };
13
14 // Describes known metadata elements and how they are to be manipulated
15 struct conf_metadata 
16 {
17     char *name;  // The name of this element. Output by normalization stylesheet
18     int brief;   // Is this element to be returned in the brief format?
19     enum
20     {
21         Metadata_type_generic,          // Generic text field
22         Metadata_type_integer,          // Integer type
23         Metadata_type_year              // A year
24     } type;
25     enum
26     {
27         Metadata_sortkey_no,            // This is not to be used as a sortkey
28         Metadata_sortkey_numeric,       // Standard numerical sorting
29         Metadata_sortkey_range,         // Range sorting (pick lowest or highest)
30         Metadata_sortkey_skiparticle    // Skip leading article when sorting
31     } sortkey;
32     enum
33     {
34         Metadata_merge_no,              // Don't merge
35         Metadata_merge_unique,          // Include unique elements in merged block
36         Metadata_merge_longest,         // Include the longest (strlen) value
37         Metadata_merge_range            // Store value as a range of lowest-highest
38     } merge;
39 };
40
41 struct conf_service
42 {
43     struct conf_termlist *termlists;
44     struct conf_metadata *metadata;
45 };
46
47 struct conf_server
48 {
49     char *host;
50     int port;
51     char *proxy_host;
52     int proxy_port;
53     struct conf_service *service;
54     struct conf_server *next;
55 };
56
57 struct conf_queryprofile
58 {
59 };
60
61 struct conf_retrievalmap
62 {
63     enum {
64         Map_xslt
65     } type;
66     char *charset;
67     char *format;
68     xsltStylesheet *stylesheet;
69     struct conf_retrievalmap *next;
70 };
71
72 struct conf_retrievalprofile
73 {
74     char *requestsyntax;
75     enum {
76         Nativesyn_xml,
77         Nativesyn_iso2709
78     } native_syntax;
79     enum {
80         Nativeform_na,
81         Nativeform_marc21,
82     } native_format;
83     char *native_encoding;
84     enum {
85         Nativemapto_na,
86         Nativemapto_marcxml,
87         Nativemapto_marcxchange
88     } native_mapto;
89     yaz_marc_t yaz_marc;
90     struct conf_retrievalmap *maplist;
91     struct conf_retrievalprofile *next;
92 };
93
94 struct conf_config
95 {
96     struct conf_server *servers;
97     struct conf_queryprofile *queryprofiles;
98     struct conf_retrievalprofile *retrievalprofiles;
99 };
100
101 #ifndef CONFIG_NOEXTERNS
102
103 extern struct conf_config *config;
104
105 #endif
106
107 int read_config(const char *fname);
108
109 #endif
110
111 /*
112  * Local variables:
113  * c-basic-offset: 4
114  * indent-tabs-mode: nil
115  * End:
116  * vim: shiftwidth=4 tabstop=8 expandtab
117  */