New function: 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.3  1995-09-27 12:21:25  adam
8  * New function: recType_byName.
9  *
10  * Revision 1.2  1995/09/15  14:45:03  adam
11  * Retrieve control.
12  *
13  * Revision 1.1  1995/09/14  07:48:13  adam
14  * Record control management.
15  *
16  */
17
18 #ifndef RECCTRL_H
19 #define RECCTRL_H
20
21 #include <oid.h>
22 #include <odr.h>
23
24 typedef struct {
25     int  attrSet;
26     int  attrUse;
27     enum {
28         Word_String,
29         Word_Numeric
30     } which;
31     union {
32         char *string;
33         int  numeric;
34     } u;
35     int seqno;
36 } RecWord;
37
38 struct recExtractCtrl {
39     FILE *inf;
40     char *subType;
41     void (*init)(RecWord *p);
42     void (*add)(const RecWord *p);
43 };
44
45 struct recRetrieveCtrl {
46     ODR        odr;
47     int        fd;
48     int       (*readf)(int fd, char *buf, size_t count);
49     oid_value  input_format;
50     
51     /* response */
52     oid_value  output_format;
53     void       *rec_buf;
54     size_t     rec_len;
55 };
56
57 typedef struct recType
58 {
59     char *name;
60     void (*init)(void);
61     int  (*extract)(struct recExtractCtrl *ctrl);
62     int  (*retrieve)(struct recRetrieveCtrl *ctrl);
63 } *RecType;
64
65 RecType recType_byName (const char *name);
66
67 #endif