prof_get.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* prof_get.c --- routines that expose the public interfaces for
* querying items from the profile.
*
*/
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <errno.h>
#include "prof_int.h"
/*
* These functions --- init_list(), end_list(), and add_to_list() are
* internal functions used to build up a null-terminated char ** list
* of strings to be returned by functions like profile_get_values.
*
* The profile_string_list structure is used for internal booking
* purposes to build up the list, which is returned in *ret_list by
* the end_list() function.
*
* The publicly exported interface for freeing char** list is
* profile_free_list().
*/
struct profile_string_list {
char **list;
int num;
int max;
};
/*
* Initialize the string list abstraction.
*/
struct profile_string_list *list;
{
return ENOMEM;
return 0;
}
/*
* Free any memory left over in the string abstraction, returning the
* built up list in *ret_list if it is non-null.
*/
struct profile_string_list *list;
char ***ret_list;
{
char **cp;
if (list == 0)
return;
if (ret_list) {
return;
} else {
}
}
/*
* Add a string to the list.
*/
struct profile_string_list *list;
const char *str;
{
int newmax;
if (newlist == 0)
return ENOMEM;
}
if (newstr == 0)
return ENOMEM;
return 0;
}
/*
* Return TRUE if the string is already a member of the list.
*/
struct profile_string_list *list;
const char *str;
{
char **cpp;
return 0;
return 1;
}
return 0;
}
/*
* This function frees a null-terminated list as returned by
* profile_get_values.
*/
char **list;
{
char **cp;
if (list == 0)
return;
}
const char **names;
char ***ret_values;
{
void *state;
char *value;
struct profile_string_list values;
&state)))
return retval;
return retval;
do {
goto cleanup;
if (value)
} while (state);
goto cleanup;
}
return 0;
return retval;
}
/*
* This function only gets the first value from the file; it is a
* helper function for profile_get_string, profile_get_integer, etc.
*/
const char **names;
const char **ret_value;
{
void *state;
char *value;
&state)))
return retval;
goto cleanup;
if (value)
else
return retval;
}
const char *def_val;
char **ret_string;
{
const char *value;
const char *names[4];
if (profile) {
names[3] = 0;
else if (retval)
return retval;
} else
if (value) {
if (*ret_string == 0)
return ENOMEM;
} else
*ret_string = 0;
return 0;
}
int def_val;
int *ret_int;
{
const char *value;
const char *names[4];
if (profile == 0) {
return 0;
}
names[3] = 0;
return 0;
} else if (retval)
return retval;
return 0;
}
/*
* This function will return the list of the names of subections in the
* under the specified section name.
*/
const char **names;
char ***ret_names;
{
void *state;
char *name;
struct profile_string_list values;
&state)))
return retval;
return retval;
do {
goto cleanup;
if (name)
} while (state);
return 0;
return retval;
}
/*
* This function will return the list of the names of relations in the
* under the specified section name.
*/
const char **names;
char ***ret_names;
{
void *state;
char *name;
struct profile_string_list values;
&state)))
return retval;
return retval;
do {
goto cleanup;
} while (state);
return 0;
return retval;
}
const char **names;
int flags;
void **ret_iter;
{
}
KRB5_DLLIMP void KRB5_CALLCONV
void **iter_p;
{
}
void **iter_p;
{
if (retval)
return retval;
if (ret_name) {
if (name) {
if (!*ret_name)
return ENOMEM;
} else
*ret_name = 0;
}
if (ret_value) {
if (value) {
if (!*ret_value) {
if (ret_name) {
*ret_name = 0;
}
return ENOMEM;
}
} else
*ret_value = 0;
}
return 0;
}
KRB5_DLLIMP void KRB5_CALLCONV
char *str;
{
}