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