+1998-12-04 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * prof_get.c: Add new public profile_iterator functions for
+ iterating over values found in the profile file.
+
1998-11-17 Theodore Ts'o <tytso@rsts-11.mit.edu>
* prof_get.c (profile_get_values): If there are no relations
end_list(&values, 0);
return retval;
}
+
+errcode_t profile_iterator_create(profile, names, flags, ret_iter)
+ profile_t profile;
+ const char **names;
+ int flags;
+ void **ret_iter;
+{
+ return profile_node_iterator_create(profile, names, flags, ret_iter);
+}
+
+void profile_iterator_free(iter_p)
+ void **iter_p;
+{
+ profile_node_iterator_free(iter_p);
+}
+
+errcode_t profile_iterator(iter_p, ret_name, ret_value)
+ void **iter_p;
+ char **ret_name, **ret_value;
+{
+ return profile_node_iterator(iter_p, 0, ret_name, ret_value);
+}
+
+void profile_release_string(str)
+ char *str;
+{
+ free(str);
+}
typedef struct _profile_t *profile_t;
/*
- * Used by the profile node iterator in prof_tre.c
+ * Used by the profile iterator in prof_get.c
*/
#define PROFILE_ITER_LIST_SECTION 0x0001
#define PROFILE_ITER_SECTIONS_ONLY 0x0002
#define PROFILE_ITER_FINAL_SEEN 0x0100
-
/* profile_parse.c */
errcode_t profile_parse_file
errcode_t profile_get_subsection_names
PROTOTYPE((profile_t profile, const char **names, char ***ret_names));
+errcode_t profile_iterator_create
+ PROTOTYPE((profile_t profile, const char **names,
+ int flags, void **ret_iter));
+
+void profile_iterator_free PROTOTYPE((void **iter_p));
+
+errcode_t profile_iterator
+ PROTOTYPE((void **iter_p, char **ret_name, char **ret_value));
+
+void profile_release_string PROTOTYPE((char *str));
*ret_value = p->value;
return 0;
};
-
-
#define NEAR
#endif
-
typedef struct _profile_t *profile_t;
#if !defined(PROTOTYPE)
#endif
#endif
+/*
+ * Used by the profile iterator in prof_get.c
+ */
+#define PROFILE_ITER_LIST_SECTION 0x0001
+#define PROFILE_ITER_SECTIONS_ONLY 0x0002
+#define PROFILE_ITER_RELATIONS_ONLY 0x0004
+
long profile_init
PROTOTYPE ((const char **filenames, profile_t *ret_profile));
long profile_get_subsection_names
PROTOTYPE((profile_t profile, const char **names, char ***ret_names));
+long profile_iterator_create
+ PROTOTYPE((profile_t profile, const char **names,
+ int flags, void **ret_iter));
+
+void profile_iterator_free PROTOTYPE((void **iter_p));
+
+long profile_iterator
+ PROTOTYPE((void **iter_p, char **ret_name, char **ret_value));
+
+void profile_release_string PROTOTYPE((char *str));
+
#endif /* _KRB5_PROFILE_H */