| 1003 | } |
| 1004 | |
| 1005 | void fxPrintSlot(txMachine* the, FILE* file, txSlot* slot, txFlag flag) |
| 1006 | { |
| 1007 | txLinker* linker = (txLinker*)(the->context); |
| 1008 | fprintf(file, "\t{ "); |
| 1009 | if (flag & XS_DEBUG_FLAG) { |
| 1010 | flag &= ~XS_DEBUG_FLAG; |
| 1011 | fprintf(file, "(txSlot*)%d", *((txInteger*)slot)); |
| 1012 | } |
| 1013 | else |
| 1014 | fxPrintAddress(the, file, slot->next); |
| 1015 | fprintf(file, ", {.ID = "); |
| 1016 | if (slot->kind == XS_INSTANCE_KIND) { |
| 1017 | if (slot->ID) |
| 1018 | fprintf(file, "%d /* ALIAS */", slot->ID); |
| 1019 | else |
| 1020 | fprintf(file, "XS_NO_ID"); |
| 1021 | } |
| 1022 | else if ((slot->kind == XS_CODE_KIND) || (slot->kind == XS_CODE_X_KIND) || (slot->kind == XS_CALLBACK_KIND) || (slot->kind == XS_CALLBACK_X_KIND)) |
| 1023 | fxPrintID(the, file, slot->ID); |
| 1024 | else if (slot->flag & XS_INTERNAL_FLAG) |
| 1025 | fprintf(file, "%d", slot->ID); |
| 1026 | else |
| 1027 | fxPrintID(the, file, slot->ID); |
| 1028 | fprintf(file, ", "); |
| 1029 | if (slot->kind == XS_INSTANCE_KIND) |
| 1030 | fprintf(file, ".flag = 0x%x, ", slot->flag | flag | XS_DONT_MARSHALL_FLAG); |
| 1031 | else |
| 1032 | fprintf(file, ".flag = 0x%x, ", slot->flag | flag); |
| 1033 | switch (slot->kind) { |
| 1034 | case XS_UNINITIALIZED_KIND: { |
| 1035 | fprintf(file, ".kind = XS_UNINITIALIZED_KIND}, "); |
| 1036 | fprintf(file, ".value = { .number = 0 } "); |
| 1037 | } break; |
| 1038 | case XS_UNDEFINED_KIND: { |
| 1039 | fprintf(file, ".kind = XS_UNDEFINED_KIND}, "); |
| 1040 | fprintf(file, ".value = { .number = 0 } "); |
| 1041 | } break; |
| 1042 | case XS_NULL_KIND: { |
| 1043 | fprintf(file, ".kind = XS_NULL_KIND}, "); |
| 1044 | fprintf(file, ".value = { .number = 0 } "); |
| 1045 | } break; |
| 1046 | case XS_BOOLEAN_KIND: { |
| 1047 | fprintf(file, ".kind = XS_BOOLEAN_KIND}, "); |
| 1048 | fprintf(file, ".value = { .boolean = %d } ", slot->value.boolean); |
| 1049 | } break; |
| 1050 | case XS_INTEGER_KIND: { |
| 1051 | fprintf(file, ".kind = XS_INTEGER_KIND}, "); |
| 1052 | fprintf(file, ".value = { .integer = %d } ", slot->value.integer); |
| 1053 | } break; |
| 1054 | case XS_NUMBER_KIND: { |
| 1055 | fprintf(file, ".kind = XS_NUMBER_KIND}, "); |
| 1056 | fprintf(file, ".value = { .number = "); |
| 1057 | fxPrintNumber(the, file, slot->value.number); |
| 1058 | fprintf(file, " } "); |
| 1059 | } break; |
| 1060 | case XS_STRING_KIND: |
| 1061 | case XS_STRING_X_KIND: { |
| 1062 | fprintf(file, ".kind = XS_STRING_X_KIND}, "); |
no test coverage detected