src/ui-prefs.c
bool prefs_save(const char *path, void (*dump)(ang_file *), const char *title)
{
	ang_file *fff;

	safe_setuid_grab();

	/* Remove old keymaps */
	remove_old_dump(path, title);

	fff = file_open(path, MODE_APPEND, FTYPE_TEXT);
	if (!fff) {
		safe_setuid_drop();
		return FALSE;
	}

	/* Append the header */
	pref_header(fff, title);
	file_putf(fff, "\n");

	dump(fff);

	file_putf(fff, "\n");
	pref_footer(fff, title);
	file_close(fff);

	safe_setuid_drop();

	return TRUE;
}
/**
 * Save a set of preferences to file, overwriting any old preferences with the
 * same title.
 *
 * \param path is the filename to dump to
 * \param dump is a pointer to the function that does the writing to file
 * \param title is the name of this set of preferences
 *
 * \returns TRUE on success, FALSE otherwise.
 */
Save a set of preferences to file, overwriting any old preferences with the
same title.

\param path is the filename to dump to
\param dump is a pointer to the function that does the writing to file
\param title is the name of this set of preferences

\returns TRUE on success, FALSE otherwise.
Save a set of preferences to file overwriting any old preferences with the same title . \ param path is the filename to dump to \ param dump is a pointer to the function that does the writing to file \ param title is the name of this set of preferences \ returns TRUE on success FALSE otherwise .
bool prefs_save(const char *path, void (*dump)(ang_file *), const char *title)
{
	ang_file *fff;
	safe_setuid_grab();
	remove_old_dump(path, title);
	fff = file_open(path, MODE_APPEND, FTYPE_TEXT);
	if (!fff) {
		safe_setuid_drop();
		return FALSE;
	}
	pref_header(fff, title);
	file_putf(fff, "\n");
	dump(fff);
	file_putf(fff, "\n");
	pref_footer(fff, title);
	file_close(fff);
	safe_setuid_drop();
	return TRUE;
}
bool prefs_save ( const char * path , void ( * dump ) ( ang_file * ) , const char * title ) { ang_file * fff ; safe_setuid_grab ( ) ; remove_old_dump ( path , title ) ; fff = file_open ( path , MODE_APPEND , FTYPE_TEXT ) ; if ( ! fff ) { safe_setuid_drop ( ) ; return FALSE ; } pref_header ( fff , title ) ; file_putf ( fff , " \n " ) ; dump ( fff ) ; file_putf ( fff , " \n " ) ; pref_footer ( fff , title ) ; file_close ( fff ) ; safe_setuid_drop ( ) ; return TRUE ; }
Save a set of preferences to file, overwriting any old preferences with the
 same title.
Save a set of preferences to file overwriting any old preferences with the same title .
/* Remove old keymaps */ /* Append the header */