Home | History | Annotate | Download | only in e2fsck

Lines Matching full:profile

2  * profile.c -- A simple configuration file parsing "library in a file"
4 * The profile library was originally written by Theodore Ts'o in 1995
72 #include "profile.h"
85 * This is the structure which stores the profile information for a
104 * The profile flags
121 * Used by the profile iterator in prof_get.c
151 /* profile parser declarations */
209 (prf_file_t profile);
211 static errcode_t profile_get_value(profile_t profile, const char *name,
302 profile_t profile;
307 profile = malloc(sizeof(struct _profile_t));
308 if (!profile)
310 memset(profile, 0, sizeof(struct _profile_t));
311 profile->magic = PROF_MAGIC_PROFILE;
312 last = &profile->first_file;
314 /* if the filenames list is not specified return an empty profile */
347 if (!profile->first_file) {
348 profile_release(profile);
354 *ret_profile = profile;
358 profile_release(profile);
363 profile_release(profile_t profile)
367 if (!profile || profile->magic != PROF_MAGIC_PROFILE)
370 for (p = profile->first_file; p; p = next) {
374 profile->magic = 0;
375 free(profile);
381 * then def_string parameter will be parsed and used as the profile
384 errcode_t profile_set_default(profile_t profile, const char *def_string)
393 if (!def_string || !profile || profile->magic != PROF_MAGIC_PROFILE)
396 for (prf = profile->first_file; prf; prf = prf->next) {
452 * prof_file.c ---- routines that manipulate an individual profile file.
561 * profile file if it changes.
610 /* Begin the profile parser */
1028 * this file; all of the other profile routines build, access, and
1108 * the profile are true. If not, we have a programming bug somewhere,
1264 profile_t profile;
1276 profile_iterator_create(profile_t profile, const char *const *names, int flags,
1282 if (profile == 0)
1284 if (profile->magic != PROF_MAGIC_PROFILE)
1298 iter->profile = profile;
1301 iter->file = profile->first_file;
1449 * querying items from the profile.
1457 errcode_t profile_get_value(profile_t profile, const char *name,
1471 if ((retval = profile_iterator_create(profile, names,
1490 profile_get_string(profile_t profile, const char *name, const char *subname,
1497 if (profile) {
1498 retval = profile_get_value(profile, name, subname,
1518 profile_get_integer(profile_t profile, const char *name, const char *subname,
1527 if (profile == 0)
1530 retval = profile_get_value(profile, name, subname, subsubname, &value);
1559 profile_get_uint(profile_t profile, const char *name, const char *subname,
1569 if (profile == 0)
1572 retval = profile_get_value(profile, name, subname, subsubname, &value);
1635 profile_get_boolean(profile_t profile, const char *name, const char *subname,
1641 if (profile == 0) {
1646 retval = profile_get_value(profile, name, subname, subsubname, &value);
1695 * test_profile.c --- testing program for the profile routine
1706 static void do_cmd(profile_t profile, char **argv)
1721 retval = profile_get_values(profile, names, &values);
1738 retval = profile_get_value(profile, name, subname,
1742 retval = profile_get_subsection_names(profile, names,
1746 retval = profile_get_relation_names(profile, names,
1751 (profile->first_file->root, stdout);
1754 retval = profile_clear_relation(profile, names);
1756 retval = profile_update_relation(profile, names+2,
1761 (profile->first_file->root);
1764 retval = profile_rename_section(profile, names+1, *names);
1769 retval = profile_add_relation(profile, names+1, value);
1771 retval = profile_flush(profile);
1792 static void do_batchmode(profile_t profile)
1807 do_cmd(profile, argv);
1811 profile_release(profile);
1827 profile_t profile;
1840 retval = profile_init_path(argv[1], &profile);
1842 com_err(program_name, retval, "while initializing profile");
1845 retval = profile_set_default(profile, default_str);
1853 do_batchmode(profile);
1855 do_cmd(profile, argv+2);
1856 profile_release(profile);