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