MCPcopy Create free account
hub / github.com/JACoders/OpenJK / PC_Script_Parse

Function PC_Script_Parse

code/ui/ui_shared.cpp:288–333  ·  view source on GitHub ↗

================= PC_Script_Parse ================= */

Source from the content-addressed store, hash-verified

286=================
287*/
288qboolean PC_Script_Parse(const char **out)
289{
290 char script[4096];
291// pc_token_t token;
292 char *token2;
293
294 script[0]=0;
295 // scripts start with { and have ; separated command lists.. commands are command, arg..
296 // basically we want everything between the { } as it will be interpreted at run time
297
298 token2 = PC_ParseExt();
299 if (!token2)
300 {
301 return qfalse;
302 }
303
304 if (*token2 !='{')
305 {
306 return qfalse;
307 }
308
309 while ( 1 )
310 {
311 token2 = PC_ParseExt();
312 if (!token2)
313 {
314 return qfalse;
315 }
316
317 if (*token2 =='}') // End of the script?
318 {
319 *out = String_Alloc(script);
320 return qtrue;
321 }
322
323 if (*(token2 +1) != '\0')
324 {
325 Q_strcat(script, sizeof(script), va("\"%s\"", token2));
326 }
327 else
328 {
329 Q_strcat(script, sizeof(script), token2);
330 }
331 Q_strcat(script, sizeof(script), " ");
332 }
333}
334
335//--------------------------------------------------------------------------------------------
336// Menu Keyword Parse functions

Callers 15

Asset_ParseFunction · 0.70
MenuParse_onOpenFunction · 0.70
MenuParse_onCloseFunction · 0.70
MenuParse_onAcceptFunction · 0.70
MenuParse_onESCFunction · 0.70
ItemParse_doubleClickFunction · 0.70
ItemParse_onFocusFunction · 0.70
ItemParse_leaveFocusFunction · 0.70
ItemParse_mouseEnterFunction · 0.70
ItemParse_mouseExitFunction · 0.70
ItemParse_mouseEnterTextFunction · 0.70
ItemParse_mouseExitTextFunction · 0.70

Calls 4

PC_ParseExtFunction · 0.85
Q_strcatFunction · 0.85
String_AllocFunction · 0.70
vaFunction · 0.50

Tested by

no test coverage detected