| iMatix home page
| << | < | > | >>
Version 2.11



#include "sflini.h"
char **
ini_dyn_values (
    SYMTAB *symtab,
    const char *section,
    const char *keyword,
    const char *default_value)


Finds a section:keyword in the symbol table and returns a pointer to a string table containing the values, delimited by commas. When finished with the string table you should call tok free() to free the memory allocated for it. The default value may not be NULL. Returns a pointer to a table of string tokens (see tok split()), or NULL if there was insufficient memory. The specified section and keyword can be in any case; they are converted internally to lowercase to match the symbol table. If the keyword is empty or NULL, no ':keyword' is appended to the section name.

Source Code - (sflini.c)

    ASSERT (section);
    ASSERT (default_value);

    if (keyword && *keyword)
        snprintf (ini_keyword, sizeof (ini_keyword), "%s:%s", section, keyword);
        strncpy  (ini_keyword, section, sizeof (ini_keyword));

    strlwc (ini_keyword);
    strcpy (iniline, sym get value (symtab, ini_keyword, default_value));
    strconvch (iniline, ',', ' ');
    return (tok split (iniline));

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation