7 * @brief A simple and fast INI parser
8 * @addtogroup Efreet_Ini Efreet_Ini: An INI parser
16 typedef struct Efreet_Ini Efreet_Ini;
20 * @brief Contains all the information about an ini file.
24 Eina_Hash *data; /**< Hash of string => (Hash of string => string) */
25 Eina_Hash *section; /**< currently selected section */
30 * @param file The file to parse
31 * @return Returns a new Efreet_Ini structure initialized with the contents
32 * of @a file, or NULL on memory allocation failure
33 * @brief Creates and initializes a new Ini structure with the contents of
34 * @a file, or NULL on failure
36 EAPI Efreet_Ini *efreet_ini_new(const char *file);
39 * @param ini The Efreet_Ini to work with
40 * @return Returns no value
41 * @brief Frees the given Efree_Ini structure.
43 EAPI void efreet_ini_free(Efreet_Ini *ini);
46 * @param ini The Efreet_Ini to work with
47 * @param file The file to load
48 * @return Returns no value
49 * @brief Saves the given Efree_Ini structure.
51 EAPI int efreet_ini_save(Efreet_Ini *ini, const char *path);
55 * @param ini The Efreet_Ini to work with
56 * @param section The section of the ini file we want to get values from
57 * @return Returns 1 if the section exists, otherwise 0
58 * @brief Sets the current working section of the ini file to @a section
60 EAPI int efreet_ini_section_set(Efreet_Ini *ini, const char *section);
63 * @param ini The Efreet_Ini to work with
64 * @param section The section of the ini file we want to add
65 * @return Returns no value
66 * @brief Adds a new working section of the ini file to @a section
68 EAPI void efreet_ini_section_add(Efreet_Ini *ini, const char *section);
72 * @param ini The Efree_Ini to work with
73 * @param key The key to lookup
74 * @return Returns the string associated with the given key or NULL if not
76 * @brief Retrieves the value for the given key or NULL if none found.
78 EAPI const char *efreet_ini_string_get(Efreet_Ini *ini, const char *key);
81 * @param ini The Efree_Ini to work with
82 * @param key The key to use
83 * @param value The value to set
84 * @return Returns no value
85 * @brief Sets the value for the given key
87 EAPI void efreet_ini_string_set(Efreet_Ini *ini, const char *key,
92 * @param ini The ini struct to work with
93 * @param key The key to search for
94 * @return Returns the utf8 encoded string associated with @a key, or NULL
96 * @brief Retrieves the utf8 encoded string associated with @a key in the current locale or NULL if none found
98 EAPI const char *efreet_ini_localestring_get(Efreet_Ini *ini, const char *key);
101 * @param ini The ini struct to work with
102 * @param key The key to use
103 * @param value The value to set
104 * @return Returns no value
105 * @brief Sets the value for the given key
107 EAPI void efreet_ini_localestring_set(Efreet_Ini *ini, const char *key,
112 * @param ini The ini struct to work with
113 * @param key The key to search for
114 * @return Returns 1 if the boolean is true, 0 otherwise
115 * @brief Retrieves the boolean value at key @a key from the ini @a ini
117 EAPI unsigned int efreet_ini_boolean_get(Efreet_Ini *ini, const char *key);
120 * @param ini The ini struct to work with
121 * @param key The key to use
122 * @param value The value to set
123 * @return Returns no value
124 * @brief Sets the value for the given key
126 EAPI void efreet_ini_boolean_set(Efreet_Ini *ini, const char *key,
131 * @param ini The Efree_Ini to work with
132 * @param key The key to lookup
133 * @return Returns the integer associated with the given key or -1 if not
135 * @brief Retrieves the value for the given key or -1 if none found.
137 EAPI int efreet_ini_int_get(Efreet_Ini *ini, const char *key);
140 * @param ini The Efree_Ini to work with
141 * @param key The key to use
142 * @param value The value to set
143 * @return Returns no value
144 * @brief Sets the value for the given key
146 EAPI void efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value);
150 * @param ini The Efree_Ini to work with
151 * @param key The key to lookup
152 * @return Returns the double associated with the given key or -1 if not
154 * @brief Retrieves the value for the given key or -1 if none found.
156 EAPI double efreet_ini_double_get(Efreet_Ini *ini, const char *key);
159 * @param ini The Efree_Ini to work with
160 * @param key The key to use
161 * @param value The value to set
162 * @return Returns no value
163 * @brief Sets the value for the given key
165 EAPI void efreet_ini_double_set(Efreet_Ini *ini, const char *key,
170 * @param ini The ini struct to work with
171 * @param key The key to remove
172 * @return Returns no value
173 * @brief Remove the given key from the ini struct
175 EAPI void efreet_ini_key_unset(Efreet_Ini *ini, const char *key);