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