Save the database to the file path, *output. If delete_unpacked is false, temporary unpacked files are not deleted. As this function doesn't return anything, there is no way to determine if the save was successful, except for testing whether the file exists after the function call is made.
char *outfile = "c:\\myidb.idb";
// There was an error if the filesize is <= 0
if (qfilesize(outfile) <= 0)