File indexing completed on 2024-05-18 08:30:11
0001
0002
0003
0004
0005 #ifndef _KRB5_PROFILE_H
0006 #define _KRB5_PROFILE_H
0007
0008 #if defined(_WIN32)
0009 #include <win-mac.h>
0010 #endif
0011
0012 #if defined(__MACH__) && defined(__APPLE__)
0013 # include <TargetConditionals.h>
0014 # if TARGET_RT_MAC_CFM
0015 # error "Use KfM 4.0 SDK headers for CFM compilation."
0016 # endif
0017 #endif
0018
0019 #ifndef KRB5_CALLCONV
0020 #define KRB5_CALLCONV
0021 #define KRB5_CALLCONV_C
0022 #endif
0023
0024 typedef struct _profile_t *profile_t;
0025
0026
0027 #define PROFILE_INIT_ALLOW_MODULE 0x0001
0028
0029
0030
0031
0032 #define PROFILE_ITER_LIST_SECTION 0x0001
0033 #define PROFILE_ITER_SECTIONS_ONLY 0x0002
0034 #define PROFILE_ITER_RELATIONS_ONLY 0x0004
0035
0036 #ifdef __cplusplus
0037 extern "C" {
0038 #endif
0039
0040 typedef char* profile_filespec_t;
0041 typedef char* profile_filespec_list_t;
0042 typedef const char * const_profile_filespec_t;
0043 typedef const char * const_profile_filespec_list_t;
0044
0045 long KRB5_CALLCONV profile_init
0046 (const_profile_filespec_t *files, profile_t *ret_profile);
0047
0048 long KRB5_CALLCONV profile_init_flags
0049 (const_profile_filespec_t *files, int flags, profile_t *ret_profile);
0050
0051 long KRB5_CALLCONV profile_init_path
0052 (const_profile_filespec_list_t filelist, profile_t *ret_profile);
0053
0054 long KRB5_CALLCONV profile_flush
0055 (profile_t profile);
0056 long KRB5_CALLCONV profile_flush_to_file
0057 (profile_t profile, const_profile_filespec_t outfile);
0058 long KRB5_CALLCONV profile_flush_to_buffer
0059 (profile_t profile, char **bufp);
0060 void KRB5_CALLCONV profile_free_buffer
0061 (profile_t profile, char *buf);
0062
0063 long KRB5_CALLCONV profile_is_writable
0064 (profile_t profile, int *writable);
0065 long KRB5_CALLCONV profile_is_modified
0066 (profile_t profile, int *modified);
0067
0068 void KRB5_CALLCONV profile_abandon
0069 (profile_t profile);
0070
0071 void KRB5_CALLCONV profile_release
0072 (profile_t profile);
0073
0074 long KRB5_CALLCONV profile_get_values
0075 (profile_t profile, const char *const *names, char ***ret_values);
0076
0077 void KRB5_CALLCONV profile_free_list
0078 (char **list);
0079
0080 long KRB5_CALLCONV profile_get_string
0081 (profile_t profile, const char *name, const char *subname,
0082 const char *subsubname, const char *def_val,
0083 char **ret_string);
0084 long KRB5_CALLCONV profile_get_integer
0085 (profile_t profile, const char *name, const char *subname,
0086 const char *subsubname, int def_val,
0087 int *ret_default);
0088
0089 long KRB5_CALLCONV profile_get_boolean
0090 (profile_t profile, const char *name, const char *subname,
0091 const char *subsubname, int def_val,
0092 int *ret_default);
0093
0094 long KRB5_CALLCONV profile_get_relation_names
0095 (profile_t profile, const char **names, char ***ret_names);
0096
0097 long KRB5_CALLCONV profile_get_subsection_names
0098 (profile_t profile, const char **names, char ***ret_names);
0099
0100 long KRB5_CALLCONV profile_iterator_create
0101 (profile_t profile, const char *const *names,
0102 int flags, void **ret_iter);
0103
0104 void KRB5_CALLCONV profile_iterator_free
0105 (void **iter_p);
0106
0107 long KRB5_CALLCONV profile_iterator
0108 (void **iter_p, char **ret_name, char **ret_value);
0109
0110 void KRB5_CALLCONV profile_release_string (char *str);
0111
0112 long KRB5_CALLCONV profile_update_relation
0113 (profile_t profile, const char **names,
0114 const char *old_value, const char *new_value);
0115
0116 long KRB5_CALLCONV profile_clear_relation
0117 (profile_t profile, const char **names);
0118
0119 long KRB5_CALLCONV profile_rename_section
0120 (profile_t profile, const char **names,
0121 const char *new_name);
0122
0123 long KRB5_CALLCONV profile_add_relation
0124 (profile_t profile, const char **names,
0125 const char *new_value);
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138 typedef long
0139 (*profile_get_values_fn)(void *cbdata, const char *const *names,
0140 char ***ret_values);
0141
0142
0143 typedef void
0144 (*profile_free_values_fn)(void *cbdata, char **values);
0145
0146
0147 typedef void
0148 (*profile_cleanup_fn)(void *cbdata);
0149
0150
0151
0152
0153
0154
0155 typedef long
0156 (*profile_copy_fn)(void *cbdata, void **ret_cbdata);
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169 typedef long
0170 (*profile_iterator_create_fn)(void *cbdata, const char *const *names,
0171 int flags, void **ret_iter);
0172
0173
0174
0175
0176
0177
0178 typedef long
0179 (*profile_iterator_fn)(void *cbdata, void *iter, char **ret_name,
0180 char **ret_value);
0181
0182
0183
0184
0185
0186 typedef void
0187 (*profile_iterator_free_fn)(void *cbdata, void *iter);
0188
0189
0190 typedef void
0191 (*profile_free_string_fn)(void *cbdata, char *string);
0192
0193
0194
0195
0196
0197 typedef long
0198 (*profile_writable_fn)(void *cbdata, int *writable);
0199
0200
0201
0202
0203
0204
0205 typedef long
0206 (*profile_modified_fn)(void *cbdata, int *modified);
0207
0208
0209
0210
0211
0212
0213 typedef long
0214 (*profile_update_relation_fn)(void *cbdata, const char **names,
0215 const char *old_value, const char *new_value);
0216
0217
0218
0219
0220
0221 typedef long
0222 (*profile_rename_section_fn)(void *cbdata, const char **names,
0223 const char *new_name);
0224
0225
0226
0227
0228
0229 typedef long
0230 (*profile_add_relation_fn)(void *cbdata, const char **names,
0231 const char *new_value);
0232
0233
0234
0235
0236
0237
0238
0239 typedef long
0240 (*profile_flush_fn)(void *cbdata);
0241
0242 struct profile_vtable {
0243 int minor_ver;
0244
0245
0246
0247
0248 profile_get_values_fn get_values;
0249 profile_free_values_fn free_values;
0250 profile_cleanup_fn cleanup;
0251 profile_copy_fn copy;
0252
0253
0254 profile_iterator_create_fn iterator_create;
0255 profile_iterator_fn iterator;
0256 profile_iterator_free_fn iterator_free;
0257 profile_free_string_fn free_string;
0258
0259
0260 profile_writable_fn writable;
0261 profile_modified_fn modified;
0262 profile_update_relation_fn update_relation;
0263 profile_rename_section_fn rename_section;
0264 profile_add_relation_fn add_relation;
0265 profile_flush_fn flush;
0266
0267
0268 };
0269
0270
0271
0272
0273
0274
0275 long KRB5_CALLCONV profile_init_vtable
0276 (struct profile_vtable *vtable, void *cbdata, profile_t *ret_profile);
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287 typedef long
0288 (*profile_module_init_fn)(const char *residual, struct profile_vtable *vtable,
0289 void **cb_ret);
0290
0291 #ifdef __cplusplus
0292 }
0293 #endif
0294
0295 #endif
0296
0297
0298
0299
0300
0301 #include <com_err.h>
0302
0303 #define PROF_VERSION (-1429577728L)
0304 #define PROF_MAGIC_NODE (-1429577727L)
0305 #define PROF_NO_SECTION (-1429577726L)
0306 #define PROF_NO_RELATION (-1429577725L)
0307 #define PROF_ADD_NOT_SECTION (-1429577724L)
0308 #define PROF_SECTION_WITH_VALUE (-1429577723L)
0309 #define PROF_BAD_LINK_LIST (-1429577722L)
0310 #define PROF_BAD_GROUP_LVL (-1429577721L)
0311 #define PROF_BAD_PARENT_PTR (-1429577720L)
0312 #define PROF_MAGIC_ITERATOR (-1429577719L)
0313 #define PROF_SET_SECTION_VALUE (-1429577718L)
0314 #define PROF_EINVAL (-1429577717L)
0315 #define PROF_READ_ONLY (-1429577716L)
0316 #define PROF_SECTION_NOTOP (-1429577715L)
0317 #define PROF_SECTION_SYNTAX (-1429577714L)
0318 #define PROF_RELATION_SYNTAX (-1429577713L)
0319 #define PROF_EXTRA_CBRACE (-1429577712L)
0320 #define PROF_MISSING_OBRACE (-1429577711L)
0321 #define PROF_MAGIC_PROFILE (-1429577710L)
0322 #define PROF_MAGIC_SECTION (-1429577709L)
0323 #define PROF_TOPSECTION_ITER_NOSUPP (-1429577708L)
0324 #define PROF_INVALID_SECTION (-1429577707L)
0325 #define PROF_END_OF_SECTIONS (-1429577706L)
0326 #define PROF_BAD_NAMESET (-1429577705L)
0327 #define PROF_NO_PROFILE (-1429577704L)
0328 #define PROF_MAGIC_FILE (-1429577703L)
0329 #define PROF_FAIL_OPEN (-1429577702L)
0330 #define PROF_EXISTS (-1429577701L)
0331 #define PROF_BAD_BOOLEAN (-1429577700L)
0332 #define PROF_BAD_INTEGER (-1429577699L)
0333 #define PROF_MAGIC_FILE_DATA (-1429577698L)
0334 #define PROF_FAIL_INCLUDE_FILE (-1429577697L)
0335 #define PROF_FAIL_INCLUDE_DIR (-1429577696L)
0336 #define PROF_UNSUPPORTED (-1429577695L)
0337 #define PROF_MAGIC_NODE_ITERATOR (-1429577694L)
0338 #define PROF_MODULE (-1429577693L)
0339 #define PROF_MODULE_SYNTAX (-1429577692L)
0340 #define PROF_MODULE_INVALID (-1429577691L)
0341 #define ERROR_TABLE_BASE_prof (-1429577728L)
0342
0343 extern const struct error_table et_prof_error_table;
0344
0345 #if !defined(_WIN32)
0346
0347 extern void initialize_prof_error_table (void) ;
0348 #else
0349 #define initialize_prof_error_table()
0350 #endif
0351
0352 #if !defined(_WIN32)
0353 #define init_prof_err_tbl initialize_prof_error_table
0354 #define prof_err_base ERROR_TABLE_BASE_prof
0355 #endif