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

Function fxEchoFormat

xs/sources/xsDebug.c:1457–1497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1455}
1456
1457void fxEchoFormat(txMachine* the, txString theFormat, c_va_list theArguments)
1458{
1459 char *p, c;
1460
1461 p = theFormat;
1462 while ((c = c_read8(p++))) {
1463 if (c != '%')
1464 fxEchoCharacter(the, c);
1465 else {
1466 if (c_strncmp(p, "c", 1) == 0) {
1467 fxEchoCharacter(the, c_va_arg(theArguments, int));
1468 p++;
1469 }
1470 else if (c_strncmp(p, "hd", 2) == 0) {
1471 fxEchoInteger(the, c_va_arg(theArguments, int));
1472 p += 2;
1473 }
1474 else if (c_strncmp(p, "d", 1) == 0) {
1475 fxEchoInteger(the, c_va_arg(theArguments, int));
1476 p++;
1477 }
1478 else if (c_strncmp(p, "ld", 2) == 0) {
1479 fxEchoInteger(the, c_va_arg(theArguments, long));
1480 p += 2;
1481 }
1482 else if (c_strncmp(p, "g", 1) == 0) {
1483 fxEchoNumber(the, c_va_arg(theArguments, double));
1484 p++;
1485 }
1486 else if (c_strncmp(p, "s", 1) == 0) {
1487 char *s = c_va_arg(theArguments, char *);
1488 fxEchoString(the, s);
1489 p++;
1490 }
1491 else {
1492 fxEchoCharacter(the, c);
1493 p++;
1494 }
1495 }
1496 }
1497}
1498
1499void fxEchoFrameName(txMachine* the, txSlot* theFrame)
1500{

Callers 4

fxVReportFunction · 0.85
fxVReportExceptionFunction · 0.85
fxVReportErrorFunction · 0.85
fxVReportWarningFunction · 0.85

Calls 4

fxEchoCharacterFunction · 0.85
fxEchoIntegerFunction · 0.85
fxEchoNumberFunction · 0.85
fxEchoStringFunction · 0.85

Tested by

no test coverage detected