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

Function fxBufferFunctionNameAddress

xs/sources/xsAll.c:146–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void fxBufferFunctionNameAddress(txMachine* the, txString buffer, txSize size, txID id, txCallback address, txID profileID)
147{
148 txInteger length;
149 if (id != XS_NO_ID) {
150 txBoolean adorn;
151 txString string = fxGetKeyString(the, id, &adorn);
152 if (adorn)
153 c_strncat(buffer, "[", size - mxStringLength(buffer) - 1);
154 fxBufferName(buffer, string, size - mxStringLength(buffer) - 1);
155 if (adorn)
156 c_strncat(buffer, "]", size - mxStringLength(buffer) - 1);
157 return;
158 }
159 if (address) {
160 c_strncat(buffer, "@", size - mxStringLength(buffer) - 1);
161#if mxMacOSX || mxLinux
162 Dl_info info;
163 if (dladdr(address, &info) && info.dli_sname)
164 c_strncat(buffer, info.dli_sname, size - mxStringLength(buffer) - 1);
165 else
166#endif
167 {
168 c_strncat(buffer, "anonymous-", size - mxStringLength(buffer) - 1);
169 length = mxStringLength(buffer);
170 fxIntegerToString(the, profileID, buffer + length, size - length - 1);
171 }
172 }
173 else {
174 c_strncat(buffer, "(anonymous-", size - mxStringLength(buffer) - 1);
175 length = mxStringLength(buffer);
176 fxIntegerToString(the, profileID, buffer + length, size - length - 1);
177 c_strncat(buffer, ")", size - mxStringLength(buffer) - 1);
178 }
179}
180
181void fxBufferObjectName(txMachine* the, txString buffer, txSize size, txSlot* object, txString suffix)
182{

Callers 2

ifFunction · 0.85
fxBufferFunctionNameFunction · 0.85

Calls 3

fxGetKeyStringFunction · 0.85
fxBufferNameFunction · 0.85
fxIntegerToStringFunction · 0.85

Tested by

no test coverage detected