MCPcopy Create free account
hub / github.com/assaultcube/AC / autostartscripts

Function autostartscripts

source/src/main.cpp:1050–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1048#define AUTOSTARTPATH "config" PATHDIVS "autostart" PATHDIVS
1049
1050void autostartscripts(const char *prefix)
1051{
1052 static vector<char *> *files = NULL;
1053 if(!files)
1054 { // first run: fetch file names and sort them
1055 files = new vector<char *>;
1056 listfiles(AUTOSTARTPATH, "cfg", *files, stringsort);
1057 }
1058 loopv(*files)
1059 {
1060 if(*prefix && strncmp((*files)[i], prefix, strlen(prefix))) continue;
1061 defformatstring(p)(AUTOSTARTPATH "%s.cfg", (*files)[i]);
1062 execfile(p);
1063 delstring(files->remove(i--));
1064 }
1065}
1066
1067void createconfigtemplates(const char *templatezip) // create customisable config files in homedir - only if missing
1068{

Callers 1

main.cppFile · 0.85

Calls 4

listfilesFunction · 0.85
execfileFunction · 0.85
delstringFunction · 0.85
removeMethod · 0.45

Tested by

no test coverage detected