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