/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* prof_set.c --- routines that expose the public interfaces for
* inserting, updating and deleting items from the profile.
*
* WARNING: These routines only look at the first file opened in the
* profile. It's not clear how to handle multiple files, actually.
* In the future it may be necessary to modify this public interface,
* or possibly add higher level functions to support this correctly.
*
* WARNING: We're not yet doing locking yet, either.
*
*/
#include "prof_int.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <errno.h>
{
if (!profile)
return PROF_NO_PROFILE;
return PROF_MAGIC_PROFILE;
if (retval)
return retval;
/* Don't update the file if we've already made modifications */
return 0;
}
} else {
if (retval == 0) {
}
}
if (retval != 0) {
return retval;
}
}
return retval;
}
/*
* Delete or update a particular child node
*
* ADL - 2/23/99, rewritten TYT 2/25/99
*/
{
void *state;
const char **cpp;
if (retval)
return retval;
return PROF_BAD_NAMESET;
return PROF_EINVAL;
if (retval)
return retval;
state = 0;
if (retval) {
return retval;
}
}
state = 0;
if (retval == 0) {
if (new_value)
else
}
if (retval == 0)
return retval;
}
/*
* Clear a particular all of the relations with a specific name.
*
* TYT - 2/25/99
*/
{
void *state;
const char **cpp;
if (retval)
return retval;
return PROF_BAD_NAMESET;
state = 0;
if (retval)
return retval;
}
state = 0;
do {
if (retval)
return retval;
if (retval)
return retval;
} while (state);
return 0;
}
/*
* Rename a particular section; if the new_section name is NULL,
* delete it.
*
* ADL - 2/23/99, rewritten TYT 2/25/99
*/
const char *new_name)
{
void *state;
const char **cpp;
if (retval)
return retval;
return PROF_BAD_NAMESET;
if (retval)
return retval;
state = 0;
if (retval) {
return retval;
}
}
state = 0;
if (retval == 0) {
if (new_name)
else
}
if (retval == 0)
return retval;
}
/*
* Insert a new relation. If the new_value argument is NULL, then
* create a new section instead.
*
* Note: if the intermediate sections do not exist, this function will
* automatically create them.
*
* ADL - 2/23/99, rewritten TYT 2/25/99
*/
const char *new_value)
{
const char **cpp;
void *state;
if (retval)
return retval;
return PROF_BAD_NAMESET;
if (retval)
return retval;
state = 0;
if (retval == PROF_NO_SECTION)
if (retval) {
return retval;
}
}
if (new_value == 0) {
if (retval == 0) {
return PROF_EXISTS;
} else if (retval != PROF_NO_SECTION) {
return retval;
}
}
if (retval) {
return retval;
}
return 0;
}