Work on idAuthentication, protocolVersion and options.
[ir-tcl-moved-to-github.git] / ir-tclp.h
1 /*
2  * IR toolkit for tcl/tk
3  * (c) Index Data 1995
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: ir-tclp.h,v $
7  * Revision 1.2  1995-05-24 14:10:23  adam
8  * Work on idAuthentication, protocolVersion and options.
9  *
10  * Revision 1.1  1995/05/23  15:34:49  adam
11  * Many new settings, userInformationField, smallSetUpperBound, etc.
12  * A number of settings are inherited when ir-set is executed.
13  * This version is incompatible with the graphical test client (client.tcl).
14  *
15  */
16
17 #ifndef IR_TCLP_H
18 #define IR_TCLP_H
19
20 #include <tcl.h>
21
22 #include <yaz-ccl.h>
23 #include <iso2709.h>
24 #include <comstack.h>
25 #include <tcpip.h>
26
27 #if MOSI
28 #include <xmosi.h>
29 #endif
30
31 #include <odr.h>
32 #include <proto.h>
33 #include <oid.h>
34 #include <diagbib1.h>
35
36 #include "ir-tcl.h"
37
38 typedef struct {
39     char      **databaseNames;
40     int         num_databaseNames;
41
42     char       *queryType;
43     int         replaceIndicator;
44
45     int         smallSetUpperBound;
46     int         largeSetLowerBound;
47     int         mediumSetPresentNumber;
48 } IRSetCObj;
49     
50 typedef struct {
51     char       *cs_type;
52     char       *protocol_type;
53     int         connectFlag;
54     COMSTACK    cs_link;
55
56     int         preferredMessageSize;
57     int         maximumRecordSize;
58     Odr_bitmask options;
59     Odr_bitmask protocolVersion;
60
61     char       *idAuthenticationOpen;
62     char       *idAuthenticationGroupId;
63     char       *idAuthenticationUserId;
64     char       *idAuthenticationPassword;
65
66     char       *implementationName;
67     char       *implementationId;
68     int        initResult;
69     char       *targetImplementationName;
70     char       *targetImplementationId;
71     char       *targetImplementationVersion;
72     char       *userInformationField;
73
74     char       *hostname;
75    
76     char       *buf_out;
77     int         len_out;
78     char       *buf_in;
79     int         len_in;
80     char       *sbuf;
81     int         slen;
82     ODR         odr_in;
83     ODR         odr_out;
84     ODR         odr_pr;
85
86     Tcl_Interp *interp;
87     char       *callback;
88     char       *failback;
89
90     CCL_bibset  bibset;
91     oident      bib1;
92
93     struct IRSetObj_ *set_child;
94     struct IRScanObj_ *scan_child;
95
96     IRSetCObj   set_inher;
97 } IRObj;
98
99 typedef struct IRRecordList_ {
100     int no;
101     int which;
102     union {
103         struct {
104             Iso2709Rec rec;
105         } marc;
106         struct {
107             int  condition;
108             char *addinfo;
109         } diag;
110     } u;
111     struct IRRecordList_ *next;
112 } IRRecordList;
113
114 typedef struct IRSetObj_ {
115     IRObj      *parent;
116     int         searchStatus;
117     int         resultCount;
118     int         start;
119     int         number;
120     int         numberOfRecordsReturned;
121     char       *setName;
122     int         recordFlag;
123     int         which;
124     int         condition;
125     char       *addinfo;
126     IRRecordList *record_list;
127     IRSetCObj   set_inher;
128 } IRSetObj;
129
130 typedef struct IRScanEntry_ {
131     int         which;
132     union {
133         struct {
134             char *buf;
135             int  globalOccurrences;
136         } term;
137         struct {
138             int  condition;
139             char *addinfo;
140         } diag;
141     } u;
142 } IRScanEntry;
143
144 typedef struct IRScanDiag_ {
145     int         dummy;
146 } IRScanDiag;
147
148 typedef struct IRScanObj_ {
149     IRObj      *parent;
150     int         stepSize;
151     int         numberOfTermsRequested;
152     int         preferredPositionInResponse;
153
154     int         scanStatus;
155     int         numberOfEntriesReturned;
156     int         positionOfTerm;
157
158     int         entries_flag;
159     int         which;
160
161     int         num_entries;
162     int         num_diagRecs;
163
164     IRScanEntry *entries;
165     IRScanDiag  *nonSurrogateDiagnostics;
166 } IRScanObj;
167
168 struct ir_named_entry {
169     char *name;
170     int  pos;
171 };
172 #endif