MCPcopy Create free account
hub / github.com/kiibohd/controller / CLI_argumentIsolation

Function CLI_argumentIsolation

Debug/cli/cli.c:363–381  ·  view source on GitHub ↗

Takes a string, returns two pointers One to the first non-space character The second to the next argument (first NULL if there isn't an argument). delimited by a space Places a NULL at the first space after the first argument

Source from the content-addressed store, hash-verified

361// The second to the next argument (first NULL if there isn't an argument). delimited by a space
362// Places a NULL at the first space after the first argument
363void CLI_argumentIsolation( char* string, char** first, char** second )
364{
365 // Mark out the first argument
366 // This is done by finding the first space after a list of non-spaces and setting it NULL
367 char* cmdPtr = string - 1;
368 while ( *++cmdPtr == ' ' ); // Skips leading spaces, and points to first character of cmd
369
370 // Locates first space delimiter
371 char* argPtr = cmdPtr + 1;
372 while ( *argPtr != ' ' && *argPtr != '\0' )
373 argPtr++;
374
375 // Point to the first character of args or a NULL (no args) and set the space delimiter as a NULL
376 (++argPtr)[-1] = '\0';
377
378 // Set return variables
379 *first = cmdPtr;
380 *second = argPtr;
381}
382
383// Scans the CLILineBuffer for any valid commands
384void CLI_commandLookup()

Callers 15

cliFunc_capSelectFunction · 0.85
cliFunc_keyHoldFunction · 0.85
cliFunc_keyPressFunction · 0.85
cliFunc_keyReleaseFunction · 0.85
cliFunc_layerStateFunction · 0.85
cliFunc_macroDebugFunction · 0.85
cliFunc_macroShowFunction · 0.85
cliFunc_macroStepFunction · 0.85
cliFunc_voteDebugFunction · 0.85
cliFunc_pixelListFunction · 0.85
cliFunc_pixelTestFunction · 0.85
cliFunc_chanTestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…