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