MCPcopy Index your code
hub / github.com/assaultcube/AC / explodelist

Function explodelist

source/src/command.cpp:1129–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1127#define elementskip { if(*s=='"') { do { ++s; s += strcspn(s, "\"\n\r"); } while(*s == '\"' && s[-1] == '\\'); s += *s=='"'; } else s += strcspn(s, "\n\r\t "); }
1128
1129void explodelist(const char *s, vector<char *> &elems)
1130{
1131 whitespaceskip;
1132 while(*s)
1133 {
1134 const char *elem = s;
1135 elementskip;
1136#ifdef STANDALONE
1137 char *newelem = *elem == '"' ? newstring(elem + 1, s - elem - (s[-1]=='"' ? 2 : 1)) : newstring(elem, s-elem);
1138#else
1139 size_t len = 0;
1140 char *newelem = *elem == '"' ? newstring(elem + 1, (len = s - elem - (s[-1]=='"' ? 2 : 1))) : newstring(elem, s-elem);
1141 if(*elem == '"') filterrichtext(newelem, newelem, len);
1142#endif
1143 elems.add(newelem);
1144 whitespaceskip;
1145 }
1146}
1147
1148void looplist(char *list, char *varlist, char *body, bool withi)
1149{

Callers 8

gettexturelistFunction · 0.85
mitemsliderMethod · 0.85
addcompleteFunction · 0.85
format2Function · 0.85
looplistFunction · 0.85
sortlistFunction · 0.85
enumsoundsFunction · 0.85

Calls 3

newstringFunction · 0.85
filterrichtextFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected