New log level in use: GW_LOG_ERRNO.
[egate.git] / kernel / kernel.h
1 /* Gateway kernel
2  * Europagate, 1995
3  *
4  * $Log: kernel.h,v $
5  * Revision 1.10  1995/03/27 08:24:01  adam
6  * First use of gip interface and gw-db.
7  * First work on eti program.
8  *
9  * Revision 1.9  1995/03/03  17:19:13  adam
10  * Smarter presentation. Bug fix in email header interpretation.
11  *
12  * Revision 1.8  1995/03/01  14:32:24  adam
13  * Better diagnostics. Default is, that only one database selected when
14  * several are known.
15  *
16  * Revision 1.7  1995/02/23  08:32:16  adam
17  * Changed header.
18  *
19  * Revision 1.5  1995/02/22  15:22:32  adam
20  * Much more checking of run-time state. Show command never retrieves
21  * more records than indicated by the previous search request. Help
22  * command available. The maximum number of records retrieved can be
23  * controlled now.
24  *
25  * Revision 1.4  1995/02/20  21:16:18  adam
26  * FML support. Bug fixes. Profile for drewdb.
27  *
28  * Revision 1.3  1995/02/16  18:35:08  adam
29  * First use of Zdist library. Search requests are supported.
30  * Present requests are not supported yet.
31  *
32  * Revision 1.2  1995/02/16  13:20:59  adam
33  * Organization of resource files for targets and conversion
34  * language implemented.
35  *
36  * Revision 1.1  1995/02/15  17:45:29  adam
37  * First version of email gateway kernel. Email requests are read
38  * from stdin. The output is transferred to an MTA if 'From' is
39  * found in the header - or stdout if absent. No Z39.50 client is used.
40  *
41  */
42
43 #include <gw-res.h>
44 #include <gw-log.h>
45 #include <ccl.h>
46 #include <zaccess.h>
47
48 #include <iso2709.h>
49 #if USE_FML
50 #include <fmlmarc.h>
51 #endif
52
53 int urp (int fd);
54
55 struct gw_user_set {
56     char *name;        /* name of result set */
57     int hits;          /* -1 on error */
58     struct gw_user_set *prev;
59 };
60
61 struct gw_kernel_info {
62     CCL_bibset bibset;
63     GwRes kernel_res;
64     const char *default_res; 
65     const char *override_res;
66     char target[128];
67     char hostname[128];
68     int  port;
69     const char *lang;
70     const char *override_portno;
71     const char *override_hostname;
72     char *databases;
73     char *database;
74     ZASS  zass;
75 #if USE_FML
76     Fml   fml;
77 #endif
78     struct gw_user_set *sets;
79 };
80
81 extern struct gw_kernel_info info;
82
83 extern FILE *reply_fd;
84
85 void read_kernel_res (void);
86
87 struct gw_user_set *user_set_add (const char *name, int hits);
88 struct gw_user_set *user_set_search (const char *name);
89 void user_set_init (void);
90 void tty_emit (int ch);
91 void tty_init (FILE *out, int min, int max);
92
93 int lgets (char *buf, int max, int fd);
94
95 #define KERNEL_LOG "kernel"