summaryrefslogtreecommitdiffstats
path: root/src/util/profile/prof_set.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2002-12-07 03:37:24 +0000
committerKen Raeburn <raeburn@mit.edu>2002-12-07 03:37:24 +0000
commit34da169bae1a1ae416c73a6318298ffc30c65ebb (patch)
treefa2517d67cf509eb449a88bba5f7193cd16d7015 /src/util/profile/prof_set.c
parentaae8df84aade9b538efc6ac2db392b884cec9d1a (diff)
downloadkrb5-34da169bae1a1ae416c73a6318298ffc30c65ebb.tar.gz
krb5-34da169bae1a1ae416c73a6318298ffc30c65ebb.tar.xz
krb5-34da169bae1a1ae416c73a6318298ffc30c65ebb.zip
Checkpoint first step of merge.
Moved per-file data into a separate object from the profile handle. Dropped some old MacOS 9 code. * prof_int.h: Include Mac OS X versions of header files if appropriate. Only include prof_err.h if profile.h doesn't define ERROR_TABLE_BASE_prof. (struct _prf_data_t): Move most of contents of _prf_file_t here. Add reference count. (prf_data_t): New typedef. (struct _prf_file_t): Include an array of one _prf_data_t structure. * prof_file.c (profile_open_file): Fill in "data" field. Drop some old Mac specific code. (profile_flush_file_data): Renamed from profile_flush_file, now takes prf_data_t argument. (profile_flush_file_data): Likewise. (profile_free_file): Now calls profile_free_file_data. (profile_free_file_data): New function, with most of old profile_free_file code. * prof_init.c (profile_init_path): Removed old Mac version. (profile_ser_size, profile_ser_externalize): Get file data from new "data" field. * prof_set.c (rw_setup, profile_update_relation, profile_clear_relation, profile_rename_section, profile_add_relation): Likewise. * prof_tree.c (profile_node_iterator): Likewise. * test_profile.c (do_batchmode): Likewise. * prof_int.h (profile_flush_file): Now a macro. * prof_err.et (PROF_MAGIC_FILE_DATA): New error code value. ticket: 1237 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15037 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/profile/prof_set.c')
-rw-r--r--src/util/profile/prof_set.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/util/profile/prof_set.c b/src/util/profile/prof_set.c
index 1f2b16d810..4c6ccb29d5 100644
--- a/src/util/profile/prof_set.c
+++ b/src/util/profile/prof_set.c
@@ -33,11 +33,11 @@ static errcode_t rw_setup(profile)
return PROF_MAGIC_PROFILE;
file = profile->first_file;
- if (!(file->flags & PROFILE_FILE_RW))
+ if (!(file->data->flags & PROFILE_FILE_RW))
return PROF_READ_ONLY;
/* Don't update the file if we've already made modifications */
- if (file->flags & PROFILE_FILE_DIRTY)
+ if (file->data->flags & PROFILE_FILE_DIRTY)
return 0;
retval = profile_update_file(file);
@@ -73,7 +73,7 @@ profile_update_relation(profile, names, old_value, new_value)
if (!old_value || !*old_value)
return PROF_EINVAL;
- section = profile->first_file->root;
+ section = profile->first_file->data->root;
for (cpp = names; cpp[1]; cpp++) {
state = 0;
retval = profile_find_node(section, *cpp, 0, 1,
@@ -94,7 +94,7 @@ profile_update_relation(profile, names, old_value, new_value)
if (retval)
return retval;
- profile->first_file->flags |= PROFILE_FILE_DIRTY;
+ profile->first_file->data->flags |= PROFILE_FILE_DIRTY;
return 0;
}
@@ -121,7 +121,7 @@ profile_clear_relation(profile, names)
if (names == 0 || names[0] == 0 || names[1] == 0)
return PROF_BAD_NAMESET;
- section = profile->first_file->root;
+ section = profile->first_file->data->root;
for (cpp = names; cpp[1]; cpp++) {
state = 0;
retval = profile_find_node(section, *cpp, 0, 1,
@@ -140,7 +140,7 @@ profile_clear_relation(profile, names)
return retval;
} while (state);
- profile->first_file->flags |= PROFILE_FILE_DIRTY;
+ profile->first_file->data->flags |= PROFILE_FILE_DIRTY;
return 0;
}
@@ -169,7 +169,7 @@ profile_rename_section(profile, names, new_name)
if (names == 0 || names[0] == 0 || names[1] == 0)
return PROF_BAD_NAMESET;
- section = profile->first_file->root;
+ section = profile->first_file->data->root;
for (cpp = names; cpp[1]; cpp++) {
state = 0;
retval = profile_find_node(section, *cpp, 0, 1,
@@ -190,7 +190,7 @@ profile_rename_section(profile, names, new_name)
if (retval)
return retval;
- profile->first_file->flags |= PROFILE_FILE_DIRTY;
+ profile->first_file->data->flags |= PROFILE_FILE_DIRTY;
return 0;
}
@@ -222,7 +222,7 @@ profile_add_relation(profile, names, new_value)
if (names == 0 || names[0] == 0 || names[1] == 0)
return PROF_BAD_NAMESET;
- section = profile->first_file->root;
+ section = profile->first_file->data->root;
for (cpp = names; cpp[1]; cpp++) {
state = 0;
retval = profile_find_node(section, *cpp, 0, 1,
@@ -245,7 +245,7 @@ profile_add_relation(profile, names, new_value)
if (retval)
return retval;
- profile->first_file->flags |= PROFILE_FILE_DIRTY;
+ profile->first_file->data->flags |= PROFILE_FILE_DIRTY;
return 0;
}