import cyrus-sasl-2.1.23
[cyrus-sasl.git] / mac / CommonKClient / mac_kclient3 / Headers / KerberosProfile / profile.h
1 /*
2  * profile.h
3  */
4
5 #ifndef _KRB5_PROFILE_H
6 #define _KRB5_PROFILE_H
7
8 #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
9         #include <KerberosSupport/KerberosSupport.h>
10         
11         #if TARGET_API_MAC_OS8 || (TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX)
12                 #include <Kerberos5/win-mac.h>
13         #endif
14 #endif
15
16 #if TARGET_API_MAC_OSX && TARGET_API_MAC_CARBON
17         #include <CoreServices/CoreServices.h>
18 #elif TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON
19         #include <Files.h>
20 #else
21         #error "Unknown OS"
22 #endif
23
24 #if defined(_MSDOS) || defined(_WIN32)
25 #include <win-mac.h>
26 #endif
27
28 #ifndef KRB5_CALLCONV
29 #define KRB5_CALLCONV
30 #define KRB5_CALLCONV_C
31 #define KRB5_DLLIMP
32 #define GSS_DLLIMP
33 #define KRB5_EXPORTVAR
34 #define FAR
35 #define NEAR
36 #endif
37
38 typedef struct _profile_t *profile_t;
39
40 #if !defined(PROTOTYPE)
41 #if defined(__STDC__) || defined(__cplusplus) || defined(_MSDOS) || defined(_WIN32)
42 #define PROTOTYPE(x) x
43 #else
44 #define PROTOTYPE(x) ()
45 #endif
46 #endif
47
48 /*
49  * Used by the profile iterator in prof_get.c
50  */
51 #define PROFILE_ITER_LIST_SECTION       0x0001
52 #define PROFILE_ITER_SECTIONS_ONLY      0x0002
53 #define PROFILE_ITER_RELATIONS_ONLY     0x0004
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif /* __cplusplus */
58
59 /* Macintoh CFM-68K magic incantation */
60 #if PRAGMA_IMPORT
61 #pragma import on
62 #endif
63
64 #if PRAGMA_STRUCT_ALIGN
65         #pragma options align=mac68k
66 #elif PRAGMA_STRUCT_PACKPUSH
67         #pragma pack(push, 2)
68 #elif PRAGMA_STRUCT_PACK
69         #pragma pack(2)
70 #endif
71
72 /* We use file paths as unique file identifiers except Mac OS 8 and 9*/
73 #if TARGET_API_MAC_OS8 || (TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX)
74     /* On CFM MacOS, we use native file specifiers as unique file identifiers */
75     typedef FSSpec profile_filespec_t;
76     typedef FSSpec* profile_filespec_list_t;
77     /* array should be terminated with {0, 0, ""} */
78     typedef FSSpec const_profile_filespec_t;
79     typedef FSSpec* const_profile_filespec_list_t;      
80 #else
81     #define PROFILE_USES_PATHS
82
83     typedef char* profile_filespec_t;   /* path as C string */
84     typedef char* profile_filespec_list_t;      /* list of : separated paths, C string */
85     typedef const char* const_profile_filespec_t;       /* path as C string */
86     typedef const char* const_profile_filespec_list_t;  /* list of : separated paths, C string */
87 #endif
88
89 KRB5_DLLIMP long KRB5_CALLCONV profile_init
90         PROTOTYPE ((const_profile_filespec_t *files, profile_t *ret_profile));
91
92 KRB5_DLLIMP long KRB5_CALLCONV profile_init_path
93         PROTOTYPE ((const_profile_filespec_list_t filelist, profile_t *ret_profile));
94
95 /* On Mac Carbon, also provide FSSpec variants */
96 #if TARGET_OS_MAC
97 KRB5_DLLIMP long KRB5_CALLCONV FSp_profile_init
98         PROTOTYPE ((const FSSpec* files, profile_t *ret_profile));
99
100 KRB5_DLLIMP long KRB5_CALLCONV FSp_profile_init_path
101         PROTOTYPE ((const FSSpec* files, profile_t *ret_profile));
102 #endif
103
104 KRB5_DLLIMP long KRB5_CALLCONV profile_flush
105         PROTOTYPE ((profile_t profile));
106
107 KRB5_DLLIMP void KRB5_CALLCONV profile_abandon
108         PROTOTYPE ((profile_t profile));
109
110 KRB5_DLLIMP void KRB5_CALLCONV profile_release
111         PROTOTYPE ((profile_t profile));
112
113 KRB5_DLLIMP long KRB5_CALLCONV profile_get_values
114         PROTOTYPE ((profile_t profile, const char **names, char ***ret_values));
115
116 KRB5_DLLIMP void KRB5_CALLCONV profile_free_list
117         PROTOTYPE ((char **list));
118
119 KRB5_DLLIMP long KRB5_CALLCONV profile_get_string
120         PROTOTYPE((profile_t profile, const char *name, const char *subname, 
121                         const char *subsubname, const char *def_val,
122                         char **ret_string));
123 KRB5_DLLIMP long KRB5_CALLCONV profile_get_integer
124         PROTOTYPE((profile_t profile, const char *name, const char *subname,
125                         const char *subsubname, int def_val,
126                         int *ret_default));
127
128 KRB5_DLLIMP long KRB5_CALLCONV profile_get_boolean
129         PROTOTYPE((profile_t profile, const char *name, const char *subname,
130                         const char *subsubname, int def_val,
131                         int *ret_default));
132
133 KRB5_DLLIMP long KRB5_CALLCONV profile_get_relation_names
134         PROTOTYPE((profile_t profile, const char **names, char ***ret_names));
135
136 KRB5_DLLIMP long KRB5_CALLCONV profile_get_subsection_names
137         PROTOTYPE((profile_t profile, const char **names, char ***ret_names));
138
139 KRB5_DLLIMP long KRB5_CALLCONV profile_iterator_create
140         PROTOTYPE((profile_t profile, const char **names,
141                    int flags, void **ret_iter));
142
143 KRB5_DLLIMP void KRB5_CALLCONV profile_iterator_free
144         PROTOTYPE((void **iter_p));
145         
146 KRB5_DLLIMP long KRB5_CALLCONV profile_iterator
147         PROTOTYPE((void **iter_p, char **ret_name, char **ret_value));
148
149 KRB5_DLLIMP void KRB5_CALLCONV profile_release_string PROTOTYPE((char *str));
150
151 KRB5_DLLIMP long KRB5_CALLCONV profile_update_relation
152         PROTOTYPE((profile_t profile, const char **names, 
153                    const char *old_value, const char *new_value));
154
155 KRB5_DLLIMP long KRB5_CALLCONV profile_clear_relation
156         PROTOTYPE((profile_t profile, const char **names));
157
158 KRB5_DLLIMP long KRB5_CALLCONV profile_rename_section
159         PROTOTYPE((profile_t profile, const char **names, 
160                    const char *new_name));
161
162 KRB5_DLLIMP long KRB5_CALLCONV profile_add_relation
163         PROTOTYPE((profile_t profile, const char **names, 
164                    const char *new_value));
165
166 /* Macintosh CFM-68K magic incantation */
167 #if PRAGMA_STRUCT_ALIGN
168         #pragma options align=reset
169 #elif PRAGMA_STRUCT_PACKPUSH
170         #pragma pack(pop)
171 #elif PRAGMA_STRUCT_PACK
172         #pragma pack()
173 #endif
174
175 #ifdef PRAGMA_IMPORT_OFF
176 #pragma import off
177 #elif PRAGMA_IMPORT
178 #pragma import reset
179 #endif
180
181 #ifdef __cplusplus
182 }
183 #endif /* __cplusplus */
184
185 #endif /* _KRB5_PROFILE_H */
186 /*
187  * :::MITKerberosLib:GSSKerberos5Sources_9:util:profile:prof_err.h:
188  * This file is automatically generated; please do not edit it.
189  */
190
191 #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
192 #include <KerberosComErr/KerberosComErr.h>
193 #else
194 #include <com_err.h>
195 #endif
196
197 #define PROF_VERSION                             (-1429577728L)
198 #define PROF_MAGIC_NODE                          (-1429577727L)
199 #define PROF_NO_SECTION                          (-1429577726L)
200 #define PROF_NO_RELATION                         (-1429577725L)
201 #define PROF_ADD_NOT_SECTION                     (-1429577724L)
202 #define PROF_SECTION_WITH_VALUE                  (-1429577723L)
203 #define PROF_BAD_LINK_LIST                       (-1429577722L)
204 #define PROF_BAD_GROUP_LVL                       (-1429577721L)
205 #define PROF_BAD_PARENT_PTR                      (-1429577720L)
206 #define PROF_MAGIC_ITERATOR                      (-1429577719L)
207 #define PROF_SET_SECTION_VALUE                   (-1429577718L)
208 #define PROF_EINVAL                              (-1429577717L)
209 #define PROF_READ_ONLY                           (-1429577716L)
210 #define PROF_SECTION_NOTOP                       (-1429577715L)
211 #define PROF_SECTION_SYNTAX                      (-1429577714L)
212 #define PROF_RELATION_SYNTAX                     (-1429577713L)
213 #define PROF_EXTRA_CBRACE                        (-1429577712L)
214 #define PROF_MISSING_OBRACE                      (-1429577711L)
215 #define PROF_MAGIC_PROFILE                       (-1429577710L)
216 #define PROF_MAGIC_SECTION                       (-1429577709L)
217 #define PROF_TOPSECTION_ITER_NOSUPP              (-1429577708L)
218 #define PROF_INVALID_SECTION                     (-1429577707L)
219 #define PROF_END_OF_SECTIONS                     (-1429577706L)
220 #define PROF_BAD_NAMESET                         (-1429577705L)
221 #define PROF_NO_PROFILE                          (-1429577704L)
222 #define PROF_MAGIC_FILE                          (-1429577703L)
223 #define PROF_MAGIC_FILE_DATA                     (-1429577702L)
224 #define PROF_FAIL_OPEN                           (-1429577701L)
225 #define PROF_EXISTS                              (-1429577700L)
226 #define PROF_BAD_BOOLEAN                         (-1429577699L)
227 #define PROF_BAD_INTEGER                         (-1429577698L)
228 #define ERROR_TABLE_BASE_prof (-1429577728L)
229
230 extern struct error_table et_prof_error_table;
231
232 #if (defined(unix) || defined(_AIX)) && !(defined(__MACH__) && defined(__APPLE__))
233 /* for compatibility with older versions... */
234 extern void initialize_prof_error_table ();
235 #define init_prof_err_tbl initialize_prof_error_table
236 #define prof_err_base ERROR_TABLE_BASE_prof
237 #else
238 #define initialize_prof_error_table()
239 #endif