1list_config_entries(3)          Allegro manual          list_config_entries(3)
2
3
4

NAME

6       list_config_entries  -  Lists the names of all entries in a config sec‐
7       tion Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       int list_config_entries(const char *section, const char ***names);
14

DESCRIPTION

16       This function can be used to get a list of all  entries  in  the  given
17       config  section.  The  names  parameter  is  a  pointer  to an array of
18       strings. If it points to a NULL pointer, the list  will  be  allocated,
19       else  it  will  be  re-allocated.  You  should free the list again with
20       free_config_entries if you don't need it anymore, or you  can  pass  it
21       again  to  list_config_entries  and the memory will be re-used. See the
22       following example for how you can use it, it will print  out  the  com‐
23       plete contents of the current configuration:
24
25          int i, n;
26          char const **sections = NULL;
27          char const **entries = NULL;
28
29          /* List all entries not in any section. */
30          n = list_config_entries(NULL, &entries);
31          for (i = 0; i
32             printf(" %s=\"%s\"\n", entries[i], get_config_string(
33                    NULL, entries[i], "-"));
34
35          /* List all sections (and entries in them). */
36          n = list_config_sections(&sections);
37          /* loop through all section names */
38          for (i = 0; i
39          {
40             int j, m;
41             printf("%s\n", sections[i]);
42             m = list_config_entries(sections[i], &entries);
43             /* loop through all entries in the section */
44             for (j = 0; j
45             {
46                 printf(" %s=\"%s\"\n", entries[j], get_config_string(
47                    sections[i], entries[j], "-"));
48             }
49          }
50          /* It is enough to free the arrays once at the end. */
51          free_config_entries(&sections);
52          free_config_entries(&entries);
53

RETURN VALUE

55       Returns the number of valid strings in the names array.
56
57

SEE ALSO

59       set_config_file(3),    get_config_string(3),   list_config_sections(3),
60       free_config_entries(3)
61
62
63
64Allegro                          version 4.4.2          list_config_entries(3)
Impressum