Example #1
0
/* load_duh(): loads a .duh file, returning a pointer to a DUH struct.
 * When you have finished with it, you must pass the pointer to unload_duh()
 * so that the memory can be freed.
 */
DUH *DUMBEXPORT load_duh(const char *filename)
{
	DUH *duh;
	DUMBFILE *f = dumbfile_open(filename);

	if (!f)
		return NULL;

	duh = read_duh(f);

	dumbfile_close(f);

	return duh;
}
Example #2
0
/* dumb_load_mtm_quick(): loads a MTM file into a DUH struct, returning a
 * pointer to the DUH struct. When you have finished with it, you must
 * pass the pointer to unload_duh() so that the memory can be freed.
 */
DUH *dumb_load_mtm_quick(const char *filename)
{
    DUH *duh;
    DUMBFILE *f = dumbfile_open(filename);

    if (!f)
        return NULL;

    duh = dumb_read_mtm_quick(f);

    dumbfile_close(f);

    return duh;
}