paul@181 | 1 | /* |
paul@181 | 2 | * profile.h |
paul@181 | 3 | * |
paul@181 | 4 | * Copyright (C) 2005 by Theodore Ts'o. |
paul@181 | 5 | * |
paul@181 | 6 | * %Begin-Header% |
paul@181 | 7 | * This file may be redistributed under the terms of the GNU Public |
paul@181 | 8 | * License. |
paul@181 | 9 | * %End-Header% |
paul@181 | 10 | * |
paul@181 | 11 | * Copyright (C) 1985-2005 by the Massachusetts Institute of Technology. |
paul@181 | 12 | * |
paul@181 | 13 | * All rights reserved. |
paul@181 | 14 | * |
paul@181 | 15 | * Export of this software from the United States of America may require |
paul@181 | 16 | * a specific license from the United States Government. It is the |
paul@181 | 17 | * responsibility of any person or organization contemplating export to |
paul@181 | 18 | * obtain such a license before exporting. |
paul@181 | 19 | * |
paul@181 | 20 | * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and |
paul@181 | 21 | * distribute this software and its documentation for any purpose and |
paul@181 | 22 | * without fee is hereby granted, provided that the above copyright |
paul@181 | 23 | * notice appear in all copies and that both that copyright notice and |
paul@181 | 24 | * this permission notice appear in supporting documentation, and that |
paul@181 | 25 | * the name of M.I.T. not be used in advertising or publicity pertaining |
paul@181 | 26 | * to distribution of the software without specific, written prior |
paul@181 | 27 | * permission. Furthermore if you modify this software you must label |
paul@181 | 28 | * your software as modified software and not distribute it in such a |
paul@181 | 29 | * fashion that it might be confused with the original MIT software. |
paul@181 | 30 | * M.I.T. makes no representations about the suitability of this software |
paul@181 | 31 | * for any purpose. It is provided "as is" without express or implied |
paul@181 | 32 | * warranty. |
paul@181 | 33 | * |
paul@181 | 34 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
paul@181 | 35 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
paul@181 | 36 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
paul@181 | 37 | */ |
paul@181 | 38 | |
paul@181 | 39 | #ifndef _PROFILE_H |
paul@181 | 40 | #define _PROFILE_H |
paul@181 | 41 | |
paul@181 | 42 | typedef struct _profile_t *profile_t; |
paul@181 | 43 | |
paul@181 | 44 | typedef void (*profile_syntax_err_cb_t)(const char *file, long err, |
paul@181 | 45 | int line_num); |
paul@181 | 46 | |
paul@181 | 47 | /* |
paul@181 | 48 | * Used by the profile iterator in prof_get.c |
paul@181 | 49 | */ |
paul@181 | 50 | #define PROFILE_ITER_LIST_SECTION 0x0001 |
paul@181 | 51 | #define PROFILE_ITER_SECTIONS_ONLY 0x0002 |
paul@181 | 52 | #define PROFILE_ITER_RELATIONS_ONLY 0x0004 |
paul@181 | 53 | |
paul@181 | 54 | #ifdef __cplusplus |
paul@181 | 55 | extern "C" { |
paul@181 | 56 | #endif /* __cplusplus */ |
paul@181 | 57 | |
paul@181 | 58 | long profile_init |
paul@181 | 59 | (const char * const *files, profile_t *ret_profile); |
paul@181 | 60 | |
paul@181 | 61 | void profile_release |
paul@181 | 62 | (profile_t profile); |
paul@181 | 63 | |
paul@181 | 64 | long profile_set_default |
paul@181 | 65 | (profile_t profile, const char *def_string); |
paul@181 | 66 | |
paul@181 | 67 | long profile_get_string |
paul@181 | 68 | (profile_t profile, const char *name, const char *subname, |
paul@181 | 69 | const char *subsubname, const char *def_val, |
paul@181 | 70 | char **ret_string); |
paul@181 | 71 | long profile_get_integer |
paul@181 | 72 | (profile_t profile, const char *name, const char *subname, |
paul@181 | 73 | const char *subsubname, int def_val, |
paul@181 | 74 | int *ret_default); |
paul@181 | 75 | |
paul@181 | 76 | long profile_get_uint |
paul@181 | 77 | (profile_t profile, const char *name, const char *subname, |
paul@181 | 78 | const char *subsubname, unsigned int def_val, |
paul@181 | 79 | unsigned int *ret_int); |
paul@181 | 80 | |
paul@181 | 81 | long profile_get_double |
paul@181 | 82 | (profile_t profile, const char *name, const char *subname, |
paul@181 | 83 | const char *subsubname, double def_val, |
paul@181 | 84 | double *ret_float); |
paul@181 | 85 | |
paul@181 | 86 | long profile_get_boolean |
paul@181 | 87 | (profile_t profile, const char *name, const char *subname, |
paul@181 | 88 | const char *subsubname, int def_val, |
paul@181 | 89 | int *ret_default); |
paul@181 | 90 | |
paul@181 | 91 | long profile_iterator_create |
paul@181 | 92 | (profile_t profile, const char *const *names, |
paul@181 | 93 | int flags, void **ret_iter); |
paul@181 | 94 | |
paul@181 | 95 | void profile_iterator_free |
paul@181 | 96 | (void **iter_p); |
paul@181 | 97 | |
paul@181 | 98 | long profile_iterator |
paul@181 | 99 | (void **iter_p, char **ret_name, char **ret_value); |
paul@181 | 100 | |
paul@181 | 101 | profile_syntax_err_cb_t profile_set_syntax_err_cb(profile_syntax_err_cb_t hook); |
paul@181 | 102 | |
paul@181 | 103 | #ifdef __cplusplus |
paul@181 | 104 | } |
paul@181 | 105 | #endif /* __cplusplus */ |
paul@181 | 106 | |
paul@181 | 107 | #endif /* _KRB5_H */ |