+void RegisterCvars(void(string name, string def, string desc, bool archive, string file) f) {}
+
+bool cvar_value_issafe(string s)
+{
+ if (strstrofs(s, "\"", 0) >= 0) return false;
+ if (strstrofs(s, "\\", 0) >= 0) return false;
+ if (strstrofs(s, ";", 0) >= 0) return false;
+ if (strstrofs(s, "$", 0) >= 0) return false;
+ if (strstrofs(s, "\r", 0) >= 0) return false;
+ if (strstrofs(s, "\n", 0) >= 0) return false;
+ return true;
+}
+
+/** escape the string to make it safe for consoles */
+string MakeConsoleSafe(string input)
+{
+ input = strreplace("\n", "", input);
+ input = strreplace("\\", "\\\\", input);
+ input = strreplace("$", "$$", input);
+ input = strreplace("\"", "\\\"", input);
+ return input;
+}
+
+void cvar_describe(string name, string desc)
+{
+ localcmd(sprintf("\nset %1$s \"$%1$s\" \"%2$s\"\n", name, MakeConsoleSafe(desc)));
+}
+
+void cvar_archive(string name)
+{
+ localcmd(sprintf("\nseta %1$s \"$%1$s\"\n", name));
+}