MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xStrTok

Function xStrTok

src/SB/Core/x/xString.cpp:51–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51char* xStrTok(char* string, const char* control, char** nextoken)
52{
53 U8* str;
54 U8* ctrl;
55 U8 map[32];
56 S32 count;
57
58 for (S32 i = 0; i < 32; i++)
59 {
60 map[i] = 0;
61 }
62
63 ctrl = (U8*)control;
64
65 do
66 {
67 map[*ctrl >> 3] |= 1 << (*ctrl & 0x7);
68 } while (*ctrl++ != '\0');
69
70 str = (string) ? (U8*)string : (U8*)*nextoken;
71
72 while (map[(*str >> 3) & 0x1F] & (1 << (*str & 0x7)) && *str != '\0')
73 {
74 str++;
75 }
76
77 string = (char*)str;
78
79 while (*str != '\0')
80 {
81 if (map[(*str >> 3) & 0x1F] & (1 << (*str & 0x7)))
82 {
83 *str = '\0';
84 str++;
85 break;
86 }
87
88 str++;
89 }
90
91 *nextoken = (char*)str;
92
93 if (string == (char*)str)
94 {
95 string = NULL;
96 }
97
98 return string;
99}
100
101S32 xStricmp(const char* string1, const char* string2) {
102 S8 flag1;

Callers 2

xIniParseFunction · 0.70
zUI_ParseINIFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected