*** empty log message ***
[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.8  1997-09-01 08:49:51  adam
28  * New windows NT/95 port using MSV5.0. To export DLL functions the
29  * YAZ_EXPORT modifier was added. Defined in yconfig.h.
30  *
31  * Revision 1.7  1997/05/14 06:53:46  adam
32  * C++ support.
33  *
34  * Revision 1.6  1996/01/02 08:57:35  quinn
35  * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
36  *
37  * Revision 1.5  1995/09/29  17:12:09  quinn
38  * Smallish
39  *
40  * Revision 1.4  1995/09/27  15:02:49  quinn
41  * Modified function heads & prototypes.
42  *
43  * Revision 1.3  1995/08/17  12:45:16  quinn
44  * Fixed minor problems with GRS-1. Added support in c&s.
45  *
46  * Revision 1.2  1995/08/15  12:00:13  quinn
47  * Updated External
48  *
49  * Revision 1.1  1995/06/02  09:49:49  quinn
50  * Add access control
51  *
52  *
53  */
54
55 #ifndef PRT_ACC_H
56 #define PRT_ACC_H
57
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61
62 typedef struct Z_Encryption1
63 {
64     Odr_oct *cryptType;       /* OPTIONAL */
65     Odr_oct *credential;      /* OPTIONAL */
66     Odr_oct *data;
67 } Z_Encryption1;
68
69 typedef struct Z_EnumeratedPrompt1
70 {
71     int *type;
72 #define Z_Prompt1_groupId        0
73 #define Z_Prompt1_userId         1
74 #define Z_Prompt1_password       2
75 #define Z_Prompt1_newPassword    3
76 #define Z_Prompt1_copyright      4
77     char *suggestedString;       /* OPTIONAL */
78 } Z_EnumeratedPrompt1;
79
80 typedef struct Z_PromptId1
81 {
82     int which;
83 #define Z_PromptId1_enumeratedPrompt 0
84 #define Z_PromptId1_nonEnumeratedPrompt 1
85     union
86     {
87         Z_EnumeratedPrompt1 *enumeratedPrompt;
88         char *nonEnumeratedPrompt;
89     } u;
90 } Z_PromptId1;
91
92 typedef struct Z_PromptInfo1
93 {
94     int which;
95 #define Z_Challenge1_character 0
96 #define Z_Challenge1_encrypted 1
97     union
98     {
99         char *character;
100         Z_Encryption1 *encrypted;
101     } u;
102 } Z_PromptInfo1;
103
104 typedef struct Z_ChallengeUnit1
105 {
106     Z_PromptId1 *promptId;
107     char *defaultResponse;           /* OPTIONAL */
108     Z_PromptInfo1 *promptInfo;       /* OPTIONAL */
109     char *regExpr;                   /* OPTIONAL */
110     Odr_null *responseRequired;      /* OPTIONAL */
111     int num_values;
112     char **allowedValues;            /* OPTIONAL */
113     Odr_null *shouldSave;            /* OPTIONAL */
114     int *dataType;                   /* OPTIONAL */
115 #define Z_ChalDataType_integer       1
116 #define Z_ChalDataType_date          2
117 #define Z_ChalDataType_float         3
118 #define Z_ChalDataType_alphaNumeric  4
119 #define Z_ChalDataType_urlUrn        5
120 #define Z_ChalDataType_boolean       6
121     Z_External *diagnostic;        /* OPTIONAL */
122 } Z_ChallengeUnit1;
123
124 typedef struct Z_Challenge1
125 {
126     int num_challenges;
127     Z_ChallengeUnit1 **list;
128 } Z_Challenge1;
129
130 typedef struct Z_ResponseUnit1
131 {
132     Z_PromptId1 *promptId;
133     int which;
134 #define Z_Response1_string 0
135 #define Z_Response1_accept 1
136 #define Z_Response1_acknowledge 2
137 #define Z_Response1_diagnostic 3
138 #define Z_Response1_encrypted 4
139     union
140     {
141         char *string;
142         bool_t *accept;
143         Odr_null *acknowledge;
144         Z_DiagRec *diagnostic;
145         Z_Encryption1 *encrypted;
146     } u;
147 } Z_ResponseUnit1;
148
149 typedef struct Z_Response1
150 {
151     int num_responses;
152     Z_ResponseUnit1 **list;
153 } Z_Response1;
154
155 typedef struct Z_PromptObject1
156 {
157     int which;
158 #define Z_PromptObject1_challenge 0
159 #define Z_PromptObject1_response 1
160     union
161     {
162         Z_Challenge1 *challenge;
163         Z_Response1 *response;
164     } u;
165 } Z_PromptObject1;
166
167 YAZ_EXPORT int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt);
168
169 #ifdef __cplusplus
170 }
171 #endif
172
173 #endif