*** empty log message ***
[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.5  1995-10-02 14:55:52  quinn
8  * *** empty log message ***
9  *
10  * Revision 1.4  1995/09/27  16:17:29  adam
11  * More work on retrieve.
12  *
13  * Revision 1.3  1995/09/27  12:21:25  adam
14  * New function: recType_byName.
15  *
16  * Revision 1.2  1995/09/15  14:45:03  adam
17  * Retrieve control.
18  *
19  * Revision 1.1  1995/09/14  07:48:13  adam
20  * Record control management.
21  *
22  */
23
24 #ifndef RECCTRL_H
25 #define RECCTRL_H
26
27 #include <oid.h>
28 #include <odr.h>
29
30 /* single word entity */
31 typedef struct {
32     int  attrSet;
33     int  attrUse;
34     enum {
35         Word_String,
36         Word_Numeric
37     } which;
38     union {
39         char *string;
40         int  numeric;
41     } u;
42     int seqno;
43 } RecWord;
44
45 /* Extract record control */
46 struct recExtractCtrl {
47 <<<<<<< recctrl.h
48     int inf;
49     char *subType;
50     void (*init)(RecWord *p);
51     void (*add)(const RecWord *p);
52 ||||||| 1.4
53     FILE *inf;
54     char *subType;
55     void (*init)(RecWord *p);
56     void (*add)(const RecWord *p);
57 =======
58     /* input parameters ... */
59     FILE *inf;                         /* Extract from this file */
60     char *subType;                     /* Sub type - may be NULL */
61     void (*init)(RecWord *p);          /* Init of word spec */
62     void (*add)(const RecWord *p);     /* Addition of a single word */
63 >>>>>>> /tmp/T4a00136
64 };
65
66 /* Retrieve record control */
67 struct recRetrieveCtrl {
68     /* Input parameters ... */
69     ODR        odr;                    /* ODR used to create response */
70     int        fd;                     /* File descriptor and read function */
71     int       (*readf)(int fd, char *buf, size_t count);
72     oid_value  input_format;           /* Preferred record syntax */
73     
74 <<<<<<< recctrl.h
75     /* response */
76     oid_value  output_format;
77     void       *rec_buf;
78     size_t     rec_len;
79     int diagnostic;
80     char *message;
81 ||||||| 1.4
82     /* response */
83     oid_value  output_format;
84     void       *rec_buf;
85     size_t     rec_len;
86 =======
87     /* output parameters ... */
88     oid_value  output_format;          /* Record syntax of returned record */
89     void       *rec_buf;               /* Record buffer */
90     size_t     rec_len;                /* Length of record */
91 >>>>>>> /tmp/T4a00136
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);
103
104 #endif