xref: /illumos-gate/usr/src/lib/gss_mechs/mech_krb5/include/profile.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
1 /*
2  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 /*
9  * profile.h
10  */
11 
12 #ifndef _KRB5_PROFILE_H
13 #define _KRB5_PROFILE_H
14 
15 #if defined(_WIN32)
16 #include <win-mac.h>
17 #endif
18 
19 #if defined(__MACH__) && defined(__APPLE__)
20 #    include <TargetConditionals.h>
21 #    if TARGET_RT_MAC_CFM
22 #        error "Use KfM 4.0 SDK headers for CFM compilation."
23 #    endif
24 #endif
25 
26 #ifndef KRB5_CALLCONV
27 #define KRB5_CALLCONV
28 #define KRB5_CALLCONV_C
29 #endif
30 
31 typedef struct _profile_t *profile_t;
32 
33 /*
34  * Used by the profile iterator in prof_get.c
35  */
36 #define PROFILE_ITER_LIST_SECTION	0x0001
37 #define PROFILE_ITER_SECTIONS_ONLY	0x0002
38 #define PROFILE_ITER_RELATIONS_ONLY	0x0004
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43 
44 typedef char* profile_filespec_t;	/* path as C string */
45 typedef char* profile_filespec_list_t;	/* list of : separated paths, C string */
46 typedef const char * const_profile_filespec_t;	/* path as C string */
47 typedef const char * const_profile_filespec_list_t;	/* list of : separated paths, C string */
48 
49 long KRB5_CALLCONV profile_init
50 	(const_profile_filespec_t *files, profile_t *ret_profile);
51 
52 long KRB5_CALLCONV profile_init_path
53 	(const_profile_filespec_list_t filelist, profile_t *ret_profile);
54 
55 long KRB5_CALLCONV profile_flush
56 	(profile_t profile);
57 long KRB5_CALLCONV profile_flush_to_file
58 	(profile_t profile, const_profile_filespec_t outfile);
59 long KRB5_CALLCONV profile_flush_to_buffer
60 	(profile_t profile, char **bufp);
61 void KRB5_CALLCONV profile_free_buffer
62 	(profile_t profile, char *buf);
63 
64 long KRB5_CALLCONV profile_is_writable
65 	(profile_t profile, int *writable);
66 long KRB5_CALLCONV profile_is_modified
67 	(profile_t profile, int *modified);
68 
69 void KRB5_CALLCONV profile_abandon
70 	(profile_t profile);
71 
72 void KRB5_CALLCONV profile_release
73 	(profile_t profile);
74 
75 long KRB5_CALLCONV profile_get_values
76 	(profile_t profile, const char *const *names, char ***ret_values);
77 
78 void KRB5_CALLCONV profile_free_list
79 	(char **list);
80 
81 long KRB5_CALLCONV profile_get_string
82 	(profile_t profile, const char *name, const char *subname,
83 			const char *subsubname, const char *def_val,
84 			char **ret_string);
85 long KRB5_CALLCONV profile_get_integer
86 	(profile_t profile, const char *name, const char *subname,
87 			const char *subsubname, int def_val,
88 			int *ret_default);
89 
90 long KRB5_CALLCONV profile_get_boolean
91 	(profile_t profile, const char *name, const char *subname,
92 			const char *subsubname, int def_val,
93 			int *ret_default);
94 
95 long KRB5_CALLCONV profile_get_relation_names
96 	(profile_t profile, const char **names, char ***ret_names);
97 
98 long KRB5_CALLCONV profile_get_subsection_names
99 	(profile_t profile, const char **names, char ***ret_names);
100 
101 long KRB5_CALLCONV profile_iterator_create
102 	(profile_t profile, const char *const *names,
103 		   int flags, void **ret_iter);
104 
105 void KRB5_CALLCONV profile_iterator_free
106 	(void **iter_p);
107 
108 long KRB5_CALLCONV profile_iterator
109 	(void	**iter_p, char **ret_name, char **ret_value);
110 
111 void KRB5_CALLCONV profile_release_string (char *str);
112 
113 long KRB5_CALLCONV profile_update_relation
114 	(profile_t profile, const char **names,
115 		   const char *old_value, const char *new_value);
116 
117 long KRB5_CALLCONV profile_clear_relation
118 	(profile_t profile, const char **names);
119 
120 long KRB5_CALLCONV profile_rename_section
121 	(profile_t profile, const char **names,
122 		   const char *new_name);
123 
124 long KRB5_CALLCONV profile_add_relation
125 	(profile_t profile, const char **names,
126 		   const char *new_value);
127 
128 #ifdef __cplusplus
129 }
130 #endif /* __cplusplus */
131 
132 #endif /* _KRB5_PROFILE_H */
133 
134 /*
135  * ettmp22072.h:
136  * This file is automatically generated; please do not edit it.
137  */
138 
139 #include <com_err.h>
140 
141 #define PROF_VERSION                             (-1429577728L)
142 #define PROF_MAGIC_NODE                          (-1429577727L)
143 #define PROF_NO_SECTION                          (-1429577726L)
144 #define PROF_NO_RELATION                         (-1429577725L)
145 #define PROF_ADD_NOT_SECTION                     (-1429577724L)
146 #define PROF_SECTION_WITH_VALUE                  (-1429577723L)
147 #define PROF_BAD_LINK_LIST                       (-1429577722L)
148 #define PROF_BAD_GROUP_LVL                       (-1429577721L)
149 #define PROF_BAD_PARENT_PTR                      (-1429577720L)
150 #define PROF_MAGIC_ITERATOR                      (-1429577719L)
151 #define PROF_SET_SECTION_VALUE                   (-1429577718L)
152 #define PROF_EINVAL                              (-1429577717L)
153 #define PROF_READ_ONLY                           (-1429577716L)
154 #define PROF_SECTION_NOTOP                       (-1429577715L)
155 #define PROF_SECTION_SYNTAX                      (-1429577714L)
156 #define PROF_RELATION_SYNTAX                     (-1429577713L)
157 #define PROF_EXTRA_CBRACE                        (-1429577712L)
158 #define PROF_MISSING_OBRACE                      (-1429577711L)
159 #define PROF_MAGIC_PROFILE                       (-1429577710L)
160 #define PROF_MAGIC_SECTION                       (-1429577709L)
161 #define PROF_TOPSECTION_ITER_NOSUPP              (-1429577708L)
162 #define PROF_INVALID_SECTION                     (-1429577707L)
163 #define PROF_END_OF_SECTIONS                     (-1429577706L)
164 #define PROF_BAD_NAMESET                         (-1429577705L)
165 #define PROF_NO_PROFILE                          (-1429577704L)
166 #define PROF_MAGIC_FILE                          (-1429577703L)
167 #define PROF_FAIL_OPEN                           (-1429577702L)
168 #define PROF_EXISTS                              (-1429577701L)
169 #define PROF_BAD_BOOLEAN                         (-1429577700L)
170 #define PROF_BAD_INTEGER                         (-1429577699L)
171 #define PROF_MAGIC_FILE_DATA                     (-1429577698L)
172 
173 #define ERROR_TABLE_BASE_prof (-1429577728L)
174 
175 /* for compatibility with older versions... */
176 #define prof_err_base ERROR_TABLE_BASE_prof
177