Fixed problem with proto.h.
[yaz-moved-to-github.git] / include / prt-acc.h
1 /*
2  * Copyright (c) 1995, Index Data.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation, in whole or in part, for any purpose, is hereby granted,
6  * provided that:
7  *
8  * 1. This copyright and permission notice appear in all copies of the
9  * software and its documentation. Notices of copyright or attribution
10  * which appear at the beginning of any file must remain unchanged.
11  *
12  * 2. The name of Index Data or the individual authors may not be used to
13  * endorse or promote products derived from this software without specific
14  * prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19  * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22  * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24  * OF THIS SOFTWARE.
25  *
26  * $Log: prt-acc.h,v $
27  * Revision 1.9  1999-04-20 09:56:48  adam
28  * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
29  * Modified all encoders/decoders to reflect this change.
30  *
31  * Revision 1.8  1997/09/01 08:49:51  adam
32  * New windows NT/95 port using MSV5.0. To export DLL functions the
33  * YAZ_EXPORT modifier was added. Defined in yconfig.h.
34  *
35  * Revision 1.7  1997/05/14 06:53:46  adam
36  * C++ support.
37  *
38  * Revision 1.6  1996/01/02 08:57:35  quinn
39  * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
40  *
41  * Revision 1.5  1995/09/29  17:12:09  quinn
42  * Smallish
43  *
44  * Revision 1.4  1995/09/27  15:02:49  quinn
45  * Modified function heads & prototypes.
46  *
47  * Revision 1.3  1995/08/17  12:45:16  quinn
48  * Fixed minor problems with GRS-1. Added support in c&s.
49  *
50  * Revision 1.2  1995/08/15  12:00:13  quinn
51  * Updated External
52  *
53  * Revision 1.1  1995/06/02  09:49:49  quinn
54  * Add access control
55  *
56  *
57  */
58
59 #ifndef PRT_ACC_H
60 #define PRT_ACC_H
61
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65
66 typedef struct Z_Encryption1
67 {
68     Odr_oct *cryptType;       /* OPTIONAL */
69     Odr_oct *credential;      /* OPTIONAL */
70     Odr_oct *data;
71 } Z_Encryption1;
72
73 typedef struct Z_EnumeratedPrompt1
74 {
75     int *type;
76 #define Z_Prompt1_groupId        0
77 #define Z_Prompt1_userId         1
78 #define Z_Prompt1_password       2
79 #define Z_Prompt1_newPassword    3
80 #define Z_Prompt1_copyright      4
81     char *suggestedString;       /* OPTIONAL */
82 } Z_EnumeratedPrompt1;
83
84 typedef struct Z_PromptId1
85 {
86     int which;
87 #define Z_PromptId1_enumeratedPrompt 0
88 #define Z_PromptId1_nonEnumeratedPrompt 1
89     union
90     {
91         Z_EnumeratedPrompt1 *enumeratedPrompt;
92         char *nonEnumeratedPrompt;
93     } u;
94 } Z_PromptId1;
95
96 typedef struct Z_PromptInfo1
97 {
98     int which;
99 #define Z_Challenge1_character 0
100 #define Z_Challenge1_encrypted 1
101     union
102     {
103         char *character;
104         Z_Encryption1 *encrypted;
105     } u;
106 } Z_PromptInfo1;
107
108 typedef struct Z_ChallengeUnit1
109 {
110     Z_PromptId1 *promptId;
111     char *defaultResponse;           /* OPTIONAL */
112     Z_PromptInfo1 *promptInfo;       /* OPTIONAL */
113     char *regExpr;                   /* OPTIONAL */
114     Odr_null *responseRequired;      /* OPTIONAL */
115     int num_values;
116     char **allowedValues;            /* OPTIONAL */
117     Odr_null *shouldSave;            /* OPTIONAL */
118     int *dataType;                   /* OPTIONAL */
119 #define Z_ChalDataType_integer       1
120 #define Z_ChalDataType_date          2
121 #define Z_ChalDataType_float         3
122 #define Z_ChalDataType_alphaNumeric  4
123 #define Z_ChalDataType_urlUrn        5
124 #define Z_ChalDataType_boolean       6
125     Z_External *diagnostic;        /* OPTIONAL */
126 } Z_ChallengeUnit1;
127
128 typedef struct Z_Challenge1
129 {
130     int num_challenges;
131     Z_ChallengeUnit1 **list;
132 } Z_Challenge1;
133
134 typedef struct Z_ResponseUnit1
135 {
136     Z_PromptId1 *promptId;
137     int which;
138 #define Z_Response1_string 0
139 #define Z_Response1_accept 1
140 #define Z_Response1_acknowledge 2
141 #define Z_Response1_diagnostic 3
142 #define Z_Response1_encrypted 4
143     union
144     {
145         char *string;
146         bool_t *accept;
147         Odr_null *acknowledge;
148         Z_DiagRec *diagnostic;
149         Z_Encryption1 *encrypted;
150     } u;
151 } Z_ResponseUnit1;
152
153 typedef struct Z_Response1
154 {
155     int num_responses;
156     Z_ResponseUnit1 **list;
157 } Z_Response1;
158
159 typedef struct Z_PromptObject1
160 {
161     int which;
162 #define Z_PromptObject1_challenge 0
163 #define Z_PromptObject1_response 1
164     union
165     {
166         Z_Challenge1 *challenge;
167         Z_Response1 *response;
168     } u;
169 } Z_PromptObject1;
170
171 YAZ_EXPORT int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt,
172                                const char *name);
173
174 #ifdef __cplusplus
175 }
176 #endif
177
178 #endif