MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / GetStringInList

Function GetStringInList

Descent3/pilot.cpp:2553–2572  ·  view source on GitHub ↗

GetStringInList Returns a pointer to the string in a string list ( \0 \0...). Be VERY careful that the index you pass in is a valid string index index = Index of string you want list = string list (a bunch of strings, seperated by \0) maxsize = size of string list buffer returns NULL on error (if an error can be detected)

Source from the content-addressed store, hash-verified

2551// maxsize = size of string list buffer
2552// returns NULL on error (if an error can be detected)
2553char *GetStringInList(int index, char *list, int maxsize) {
2554 int count = 0;
2555 int p = 0;
2556 char *pp;
2557 pp = list;
2558
2559 while (1) {
2560 if (count == index)
2561 return pp;
2562
2563 if (p < maxsize) {
2564 if (*pp == '\0')
2565 count++;
2566 } else
2567 return NULL;
2568 p++;
2569 pp++;
2570 }
2571 return NULL;
2572}
2573
2574// UpdateAudioTauntBoxes
2575//

Callers 8

audio1changecallbackFunction · 0.85
audio2changecallbackFunction · 0.85
audio3changecallbackFunction · 0.85
audio4changecallbackFunction · 0.85
PltSelectShipFunction · 0.85
CustomCallBackFunction · 0.85
ShipSelectDeleteLogoFunction · 0.85
ShipSelectDeleteTauntFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected