EAPI Efreet_Ini * efreet_ini_new(const char *file) { Efreet_Ini *ini; ini = NEW(Efreet_Ini, 1); if (!ini) return NULL; if (file) ini->data = efreet_ini_parse(file); return ini; }
/** * @param file The file to parse * @return Returns a new Efreet_Ini structure initialized with the contents * of @a file, or NULL on memory allocation failure * @brief Creates and initializes a new Ini structure with the contents of * @a file, or NULL on failure */ EAPI Efreet_Ini * efreet_ini_new(const char *file) { Efreet_Ini *ini; ini = NEW(Efreet_Ini, 1); if (!ini) return NULL; /* This can validly be NULL at the moment as _parse() will return NULL * if the input file doesn't exist. Should we change _parse() to create * the hash and only return NULL on failed parse? */ ini->data = efreet_ini_parse(file); return ini; }