| 2759 | #endif |
| 2760 | |
| 2761 | void fxBubble(txMachine* the, txInteger flags, void* message, txInteger length, txString conversation) |
| 2762 | { |
| 2763 | #ifdef mxDebug |
| 2764 | if (fxIsConnected(the)) { |
| 2765 | txString path = C_NULL; |
| 2766 | txInteger line = 0; |
| 2767 | txSlot* frame = the->frame; |
| 2768 | while (frame && !path) { |
| 2769 | txSlot* environment = mxFrameToEnvironment(frame); |
| 2770 | if (environment->ID != XS_NO_ID) { |
| 2771 | path = fxGetKeyName(the, environment->ID); |
| 2772 | line = environment->value.environment.line; |
| 2773 | } |
| 2774 | frame = frame->next; |
| 2775 | } |
| 2776 | fxEchoStart(the); |
| 2777 | fxEcho(the, "<bubble name=\""); |
| 2778 | if (conversation) |
| 2779 | fxEchoString(the, conversation); |
| 2780 | fxEcho(the, "\" value=\""); |
| 2781 | fxEchoInteger(the, flags); |
| 2782 | fxEcho(the, "\""); |
| 2783 | fxEchoPathLine(the, path, line); |
| 2784 | fxEcho(the, ">"); |
| 2785 | if (flags & XS_BUBBLE_BINARY) { |
| 2786 | txU1* bytes = message; |
| 2787 | txInteger byteLength = length; |
| 2788 | while (byteLength) { |
| 2789 | txU1 byte = c_read8(bytes); |
| 2790 | fxEchoCharacter(the, gxHexaDigits[(byte & 0xF0) >> 4]); |
| 2791 | fxEchoCharacter(the, gxHexaDigits[(byte & 0x0F)]); |
| 2792 | bytes++; |
| 2793 | byteLength--; |
| 2794 | } |
| 2795 | } |
| 2796 | else |
| 2797 | fxEchoString(the, message); |
| 2798 | fxEcho(the, "</bubble>"); |
| 2799 | fxEchoStop(the); |
| 2800 | } |
| 2801 | #elif defined(mxInstrument) |
| 2802 | if (!(flags & XS_BUBBLE_BINARY)) { |
| 2803 | if (conversation) |
| 2804 | fxReport(the, "%s: %s\n", conversation, message); |
| 2805 | else |
| 2806 | fxReport(the, "%s\n", message); |
| 2807 | } |
| 2808 | #endif |
| 2809 | } |
| 2810 | |
| 2811 | void fxFileEvalString(txMachine* the, txString string, txString tag) |
| 2812 | { |
no test coverage detected