wmclockmon: update change-log
[dockapps.git] / wmradio / ini.h
blob207fca36166ad884d8fce004f380c5bb790d5d42
1 /*
2 * Copyright (C) 12 Jun 2003 Tomas Cermak
4 * This file is part of wmradio program.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef _INI_H
22 #define _INI_H
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include "lists.h"
28 #define INI_INT_UNDEFINED (-154257)
30 typedef struct {
31 char *name;
32 List *variables;
33 } IniSection;
35 typedef struct {
36 char *name;
37 char *value;
38 int value_int;
39 } IniVariable;
41 List *ini_get_section_node(List *ini, char *name);
42 IniSection *ini_get_section(List *ini, char *name);
43 List *ini_get_variable_node(List *ini, char *section, char *variable);
44 IniVariable *ini_get_variable_ini_variable(List *ini, char *section, char *variable);
45 char *ini_get_variable(List *ini, char *section, char *variable, char *dflt);
46 int ini_get_variable_as_int(List *ini, char *section, char *variable, int dflt);
47 List *ini_set_variable(List *ini, char *section, char *variable, char *value);
48 List *ini_set_variable_as_int(List *ini, char *section, char *variable, int value);
49 void ini_print(FILE *f, List *ini);
50 void ini_save_file(List *ini, char *filename);
51 List *ini_load_file(List *ini, char *default_section, char *name);
53 void ini_delete_variable_node(List *ini, List *node);
54 void ini_delete_variable(List *ini, char *section, char *variable);
55 List *ini_delete_section(List *ini, char *section);
56 List *ini_delete_section_node(List *ini, List *section);
57 void ini_free(List *ini);
59 #endif