MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Platform_GetCommandLineArgs

Function Platform_GetCommandLineArgs

src/Platform_WinCE.c:742–760  ·  view source on GitHub ↗

#######################################################################################################################* *-----------------------------------------------------Configuration-------------------------------------------------------* *#########################################################################################################################*/

Source from the content-addressed store, hash-verified

740*-----------------------------------------------------Configuration-------------------------------------------------------*
741*#########################################################################################################################*/
742int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, cc_string* args) {
743 LPWSTR cmdLine = GetCommandLineW();
744 char cmdLineUtf8[1024];
745 cc_string cmdArgs;
746 int i;
747
748 if (gameHasArgs) return GetGameArgs(args);
749
750 WideCharToMultiByte(CP_UTF8, 0, cmdLine, -1, cmdLineUtf8, 1024, NULL, NULL);
751 cmdArgs = String_FromReadonly(cmdLineUtf8);
752
753 Platform_NextArg(&cmdArgs);
754
755 for (i = 0; i < GAME_MAX_CMDARGS; i++) {
756 args[i] = Platform_NextArg(&cmdArgs);
757 if (!args[i].length) break;
758 }
759 return i;
760}
761
762static cc_string Platform_NextArg(STRING_REF cc_string* args) {
763 cc_string arg;

Callers

nothing calls this directly

Calls 3

GetGameArgsFunction · 0.85
String_FromReadonlyFunction · 0.85
Platform_NextArgFunction · 0.70

Tested by

no test coverage detected