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