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