/** * @sa Key_WriteBindings */ void Com_WriteConfigToFile (const char* filename) { ScopedFile f; FS_OpenFile(filename, &f, FILE_WRITE); if (!f.file()) { Com_Printf("Couldn't write %s.\n", filename); return; } FS_Printf(&f, "// generated by ufo, do not modify\n"); FS_Printf(&f, "// variables\n"); Cvar_WriteVariables(&f); FS_Printf(&f, "// aliases\n"); Cmd_WriteAliases(&f); Com_Printf("Wrote %s.\n", filename); }
void CL_WriteConfig (char *name) { qfile_t *f; f = FS_Open ("config.cfg", "wb", false, false); if (!f) { Com_Printf ("Couldn't write %s.\n", name); return; } FS_Printf (f, "// Generated by " PROGRAM "\n"); FS_Printf (f, "\n// Key bindings\n"); Key_WriteBindings (f); FS_Printf (f, "\n// Variables\n"); Cvar_WriteVariables (f); FS_Printf (f, "\n// Aliases\n"); Cmd_WriteAliases (f); FS_Close (f); }