2 /* This header file transforms the Heimdal config_parse.c profile
3 * parser into an AFS profile parser, hiding the krb5-ness of the parser
15 #include <sys/types.h>
19 #define KRB5_LIB_FUNCTION static AFS_UNUSED
22 /* This value shouldn't be hard coded */
23 #define KRB5_CONFIG_BADFORMAT (-1765328248L)
27 struct krb5_config_binding {
28 enum { krb5_config_string, krb5_config_list } type;
30 struct krb5_config_binding *next;
33 struct krb5_config_binding *list;
38 typedef struct krb5_config_binding krb5_config_binding;
40 typedef krb5_config_binding krb5_config_section;
41 typedef krb5_config_section afs_config_section;
43 struct krb5_context_data {
44 krb5_config_section *cf;
47 typedef struct krb5_context_data * krb5_context;
48 typedef int krb5_error_code;
49 typedef int krb5_boolean;
50 typedef time_t krb5_deltat;
52 static const void *_krb5_config_vget(krb5_context,
53 const krb5_config_section *, int,
55 static const void *_krb5_config_vget_next(krb5_context,
56 const krb5_config_section *,
57 const krb5_config_binding **,
59 static const char *krb5_config_vget_string(krb5_context,
60 const krb5_config_section *,
62 static const krb5_config_binding * krb5_config_vget_list
63 (krb5_context, const krb5_config_section *, va_list);
64 static krb5_error_code krb5_config_parse_file_multi
65 (krb5_context, const char *, krb5_config_section **);
66 static krb5_error_code krb5_config_parse_file
67 (krb5_context, const char *, krb5_config_section **);
68 static krb5_error_code krb5_config_file_free
69 (krb5_context, krb5_config_section *);
70 static krb5_boolean krb5_config_vget_bool
71 (krb5_context, const krb5_config_section *,va_list);
72 static int krb5_config_vget_int
73 (krb5_context, const krb5_config_section *, va_list);
75 static krb5_error_code
76 krb5_string_to_deltat(const char *str, krb5_deltat *t) {
80 static void krb5_clear_error_message(krb5_context context) {
84 static void krb5_set_error_message(krb5_context context, krb5_error_code ret,
85 const char *fmt, ...) {
89 /* Play it safe, by saying we're always suid. */
90 static int issuid(void) {
94 static int _krb5_homedir_access(krb5_context context) {
98 static krb5_error_code
99 krb5_abortx(krb5_context context, const char *fmt, ...)
104 vfprintf(stderr, fmt, ap);
113 afs_config_parse_file_multi(const char *fname, afs_config_section **res) {
114 return krb5_config_parse_file_multi(NULL, fname, res);
118 afs_config_parse_file(const char *fname, afs_config_section **res) {
119 return krb5_config_parse_file(NULL, fname, res);
123 afs_config_file_free(afs_config_section *s) {
124 return krb5_config_file_free(NULL, s);
128 afs_config_get_string(const afs_config_section *c, ...)
136 ret = krb5_config_vget_string (NULL, c, args);
142 afs_config_get_bool(const afs_config_section *c, ...)
150 ret = krb5_config_vget_bool (NULL, c, ap);
156 afs_config_get_int(const krb5_config_section *c, ...)
164 ret = krb5_config_vget_int (NULL, c, ap);