MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxIsLinkerSymbolStringUsed

Function fxIsLinkerSymbolStringUsed

xs/tools/xslStrip.c:174–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174txFlag fxIsLinkerSymbolStringUsed(txLinker* linker, txString theString)
175{
176 txString aString;
177 txSize aLength;
178 txSize aSum;
179 txSize aModulo;
180 txLinkerSymbol* aSymbol;
181 txID anID;
182
183 aString = theString;
184 aLength = 0;
185 aSum = 0;
186 while(*aString != 0) {
187 aLength++;
188 aSum = (aSum << 1) + *aString++;
189 }
190 aSum &= 0x7FFFFFFF;
191 aModulo = aSum % linker->symbolModulo;
192 aSymbol = linker->symbolTable[aModulo];
193 while (aSymbol != C_NULL) {
194 if (aSymbol->sum == aSum)
195 if (c_strcmp(aSymbol->string, theString) == 0)
196 return aSymbol->flag;
197 aSymbol = aSymbol->next;
198 }
199 return 0;
200}
201
202txFlag fxIsCallbackStripped(txLinker* linker, txCallback which)
203{

Callers 1

fxCheckModGlobalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected