aboutsummaryrefslogtreecommitdiff
path: root/src/util/profile/prof_parse.c
diff options
context:
space:
mode:
authorKeith Vetter <keithv@fusion.com>1995-09-11 19:06:45 +0000
committerKeith Vetter <keithv@fusion.com>1995-09-11 19:06:45 +0000
commitcdd6c33b9ae48076999e33ffa70e2365ecc5eb8c (patch)
tree84682f14e77a844dfab2174318ebccb9067c829f /src/util/profile/prof_parse.c
parenta66029e852781fa0333dc92bd88bd8184f6feeb1 (diff)
downloadkrb5-cdd6c33b9ae48076999e33ffa70e2365ecc5eb8c.zip
krb5-cdd6c33b9ae48076999e33ffa70e2365ecc5eb8c.tar.gz
krb5-cdd6c33b9ae48076999e33ffa70e2365ecc5eb8c.tar.bz2
Mac Beta 1 submission
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6749 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/profile/prof_parse.c')
-rw-r--r--src/util/profile/prof_parse.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c
index fde563f..6927321 100644
--- a/src/util/profile/prof_parse.c
+++ b/src/util/profile/prof_parse.c
@@ -230,3 +230,58 @@ void dump_profile(root, level)
} while (iter != 0);
}
#endif /* ! _WINDOWS */
+
+
+void dump_profile_to_file(root, level, dstfile)
+ struct profile_node *root;
+ int level;
+ FILE *dstfile;
+{
+ int i;
+ struct profile_node *p;
+ void *iter;
+ long retval;
+ char *name, *value;
+
+ iter = 0;
+ do {
+ retval = profile_find_node_relation(root, 0, &iter,
+ &name, &value);
+ if (retval)
+ break;
+ for (i=0; i < level; i++)
+ fprintf(dstfile, "\t");
+ fprintf(dstfile, "%s = %s\r", name, value);
+ } while (iter != 0);
+
+ iter = 0;
+ do {
+ retval = profile_find_node_subsection(root, 0, &iter,
+ &name, &p);
+ if (retval)
+ break;
+ if (level == 0) /* [xxx] */
+ {
+ for (i=0; i < level; i++)
+ fprintf(dstfile, "\t");
+ fprintf(dstfile, "[%s]\r", name);
+ dump_profile_to_file(p, level+1, dstfile);
+ fprintf(dstfile, "\r");
+ }
+ else if (level == 1) /* xxx = { ... } */
+ {
+ for (i=0; i < level; i++)
+ fprintf(dstfile, "\t");
+ fprintf(dstfile, "%s = {\r", name);
+ dump_profile_to_file(p, level+1, dstfile);
+ for (i=0; i < level; i++)
+ fprintf(dstfile, "\t");
+ fprintf(dstfile, "}\r");
+ }
+ else /* +xxx+ */
+ {
+ // don't know what comes next, this should get someones attention
+ fprintf(dstfile, "+%s+");
+ }
+ } while (iter != 0);
+}