Changes to support element set names and espec1
[idzebra-moved-to-github.git] / include / recctrl.h
1 /*
2  * Copyright (C) 1994-1995, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: recctrl.h,v $
7  * Revision 1.10  1995-10-16 14:03:06  quinn
8  * Changes to support element set names and espec1
9  *
10  * Revision 1.9  1995/10/06  14:37:53  adam
11  * New result set method: r_score.
12  * Local no (sysno) and score is transferred to retrieveCtrl.
13  *
14  * Revision 1.8  1995/10/02  15:43:35  adam
15  * Extract uses file descriptors instead of FILE pointers.
16  *
17  * Revision 1.7  1995/10/02  15:18:09  adam
18  * Minor changes.
19  *
20  * Revision 1.6  1995/10/02  15:05:26  quinn
21  * Added a few fields.
22  *
23  * Revision 1.5  1995/10/02  14:55:52  quinn
24  * *** empty log message ***
25  *
26  * Revision 1.4  1995/09/27  16:17:29  adam
27  * More work on retrieve.
28  *
29  * Revision 1.3  1995/09/27  12:21:25  adam
30  * New function: recType_byName.
31  *
32  * Revision 1.2  1995/09/15  14:45:03  adam
33  * Retrieve control.
34  *
35  * Revision 1.1  1995/09/14  07:48:13  adam
36  * Record control management.
37  *
38  */
39
40 #ifndef RECCTRL_H
41 #define RECCTRL_H
42
43 #include <proto.h>
44 #include <oid.h>
45 #include <odr.h>
46
47 /* single word entity */
48 typedef struct {
49     int  attrSet;
50     int  attrUse;
51     enum {
52         Word_String,
53         Word_Numeric
54     } which;
55     union {
56         char *string;
57         int  numeric;
58     } u;
59     int seqno;
60 } RecWord;
61
62 /* Extract record control */
63 struct recExtractCtrl {
64     int        fd;                     /* File descriptor and read function */
65     int       (*readf)(int fd, char *buf, size_t count);
66     char *subType;
67     void (*init)(RecWord *p);
68     void (*add)(const RecWord *p);
69 };
70
71 /* Retrieve record control */
72 struct recRetrieveCtrl {
73     /* Input parameters ... */
74     ODR        odr;                    /* ODR used to create response */
75     int        fd;                     /* File descriptor and read function */
76     int       (*readf)(int fd, char *buf, size_t count);
77     oid_value  input_format;           /* Preferred record syntax */
78     Z_RecordComposition *comp;         /* formatting instructions */
79     int        localno;                /* local id of record */
80     int        score;                  /* score 0-1000 or -1 if none */
81     
82     /* response */
83     oid_value  output_format;
84     void       *rec_buf;
85     size_t     rec_len;
86     int        diagnostic;
87     char *message;
88 };
89
90 typedef struct recType
91 {
92     char *name;                        /* Name of record type */
93     void (*init)(void);                /* Init function - called once */
94     int  (*extract)(struct recExtractCtrl *ctrl);     /* Extract proc */
95     int  (*retrieve)(struct recRetrieveCtrl *ctrl);   /* Retrieve proc */
96 } *RecType;
97
98 RecType recType_byName (const char *name);
99
100 #endif