Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-05-18 08:30:11

0001 /*
0002  * profile.h
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 /* Used by profile_init_flags(). */
0027 #define PROFILE_INIT_ALLOW_MODULE       0x0001  /* Allow module declaration */
0028 
0029 /*
0030  * Used by the profile iterator in prof_get.c
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 /* __cplusplus */
0039 
0040 typedef char* profile_filespec_t;   /* path as C string */
0041 typedef char* profile_filespec_list_t;  /* list of : separated paths, C string */
0042 typedef const char * const_profile_filespec_t;  /* path as C string */
0043 typedef const char * const_profile_filespec_list_t; /* list of : separated paths, C string */
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  * profile_init_vtable allows a caller to create a profile-compatible object
0129  * with a different back end.
0130  */
0131 
0132 /*
0133  * Mandatory: Look up all of the relations for names, placing the resulting
0134  * values in *ret_values.  If no relations exist, return PROF_NO_RELATION, or
0135  * PROF_NO_SECTION to indicate that one of the intermediate names does not
0136  * exist as a section.  The list will be freed with free_values.
0137  */
0138 typedef long
0139 (*profile_get_values_fn)(void *cbdata, const char *const *names,
0140              char ***ret_values);
0141 
0142 /* Mandatory: Free a list of strings returned by get_values. */
0143 typedef void
0144 (*profile_free_values_fn)(void *cbdata, char **values);
0145 
0146 /* Optional: Release any data associated with the profile. */
0147 typedef void
0148 (*profile_cleanup_fn)(void *cbdata);
0149 
0150 /*
0151  * Optional (mandatory if cleanup is defined): Generate a new cbdata pointer
0152  * for a copy of the profile.  If not implemented, the new profile will receive
0153  * the same cbdata pointer as the old one.
0154  */
0155 typedef long
0156 (*profile_copy_fn)(void *cbdata, void **ret_cbdata);
0157 
0158 /*
0159  * Optional: Create an iterator handle.
0160  *
0161  * If flags contains PROFILE_ITER_LIST_SECTION, iterate over all of the
0162  * relations and sections within names.  Otherwise, iterate over the relation
0163  * values for names, or produce a single section result if names is a section.
0164  *
0165  * If flags contains PROFILE_ITER_SECTIONS_ONLY, produce only sections.
0166  *
0167  * If flags contains PROFILE_ITER_RELATIONS_ONLY, produce only relations.
0168  */
0169 typedef long
0170 (*profile_iterator_create_fn)(void *cbdata, const char *const *names,
0171                   int flags, void **ret_iter);
0172 
0173 /*
0174  * Optional (mandatory if iterator_create is defined): Produce the next
0175  * relation or section in an iteration.  If producing a section result, set
0176  * *ret_value to NULL.  The returned strings will be freed with free_string.
0177  */
0178 typedef long
0179 (*profile_iterator_fn)(void *cbdata, void *iter, char **ret_name,
0180                char **ret_value);
0181 
0182 /*
0183  * Optional (mandatory if iterator_create is defined): Free the memory for an
0184  * iterator.
0185  */
0186 typedef void
0187 (*profile_iterator_free_fn)(void *cbdata, void *iter);
0188 
0189 /* Optional (mandatory if iterator is defined): Free a string value. */
0190 typedef void
0191 (*profile_free_string_fn)(void *cbdata, char *string);
0192 
0193 /*
0194  * Optional: Determine if a profile is writable.  If not implemented, the
0195  * profile is never writable.
0196  */
0197 typedef long
0198 (*profile_writable_fn)(void *cbdata, int *writable);
0199 
0200 /*
0201  * Optional: Determine if a profile is modified in memory relative to the
0202  * persistent store.  If not implemented, the profile is assumed to never be
0203  * modified.
0204  */
0205 typedef long
0206 (*profile_modified_fn)(void *cbdata, int *modified);
0207 
0208 /*
0209  * Optional: Change the value of a relation, or remove it if new_value is NULL.
0210  * If old_value is set and the relation does not have that value, return
0211  * PROF_NO_RELATION.
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  * Optional: Rename a section to new_name, or remove the section if new_name is
0219  * NULL.
0220  */
0221 typedef long
0222 (*profile_rename_section_fn)(void *cbdata, const char **names,
0223                  const char *new_name);
0224 
0225 /*
0226  * Optional: Add a new relation, or a new section if new_value is NULL.  Add
0227  * any intermediate sections as necessary.
0228  */
0229 typedef long
0230 (*profile_add_relation_fn)(void *cbdata, const char **names,
0231                const char *new_value);
0232 
0233 /*
0234  * Optional: Flush any pending memory updates to the persistent store.  If
0235  * implemented, this function will be called by profile_release as well as
0236  * profile_flush, so make sure it's not inefficient to flush an unmodified
0237  * profile.
0238  */
0239 typedef long
0240 (*profile_flush_fn)(void *cbdata);
0241 
0242 struct profile_vtable {
0243     int minor_ver;              /* Set to structure minor version (currently 1)
0244                  * if calling profile_init_vtable. */
0245 
0246     /* Methods needed for a basic read-only non-iterable profile (cleanup is
0247      * optional). */
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     /* Methods for iterable profiles. */
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     /* Methods for writable profiles. */
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     /* End of minor version 1. */
0268 };
0269 
0270 /*
0271  * Create a profile object whose operations will be performed using the
0272  * function pointers in vtable.  cbdata will be supplied to each vtable
0273  * function as the first argument.
0274  */
0275 long KRB5_CALLCONV profile_init_vtable
0276     (struct profile_vtable *vtable, void *cbdata, profile_t *ret_profile);
0277 
0278 /*
0279  * Dynamically loadable profile modules should define a function named
0280  * "profile_module_init" matching the following signature.  The function should
0281  * initialize the methods of the provided vtable structure, stopping at the
0282  * field corresponding to vtable->minor_ver.  Do not change the value of
0283  * vtable->minor_ver.  Unimplemented methods can be left uninitialized.  The
0284  * function should supply a callback data pointer in *cb_ret; this pointer can
0285  * be cleaned up via the vtable cleanup method.
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 /* __cplusplus */
0294 
0295 #endif /* _KRB5_PROFILE_H */
0296 /*
0297  * et-h-prof_err.h:
0298  * This file is automatically generated; please do not edit it.
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 /* for compatibility with older versions... */
0347 extern void initialize_prof_error_table (void) /*@modifies internalState@*/;
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