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