MCPcopy Create free account
hub / github.com/devkitPro/3ds-hbmenu / launchAddArgsFromString

Function launchAddArgsFromString

source/launch.c:48–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void launchAddArgsFromString(argData_s* ad, char* arg)
49{
50 char c, *pstr, *str=arg, *endarg = arg+strlen(arg);
51
52 do
53 {
54 do
55 {
56 c = *str++;
57 } while ((c == ' ' || c == '\t') && str < endarg);
58
59 pstr = str-1;
60
61 if (c == '\"')
62 {
63 pstr++;
64 while(*str++ != '\"' && str < endarg);
65 }
66 else
67 if (c == '\'')
68 {
69 pstr++;
70 while(*str++ != '\'' && str < endarg);
71 }
72 else
73 {
74 do
75 {
76 c = *str++;
77 } while (c != ' ' && c != '\t' && str < endarg);
78 }
79
80 str--;
81
82 if (str == (endarg - 1))
83 {
84 if(*str == '\"' || *str == '\'')
85 *(str++) = 0;
86 else
87 str++;
88 }
89 else
90 {
91 *(str++) = '\0';
92 }
93
94 launchAddArg(ad, pstr);
95
96 } while(str<endarg);
97}
98
99void launchMenuEntry(menuEntry_s* me)
100{

Callers 1

menuEntryLoadFunction · 0.85

Calls 1

launchAddArgFunction · 0.85

Tested by

no test coverage detected