| 523 | |
| 524 | #ifdef mxUseFreeRTOSTasks |
| 525 | void _262_agent_start_aux(void *it) |
| 526 | #elif mxWindows |
| 527 | unsigned int __stdcall _262_agent_start_aux(void* it) |
| 528 | #else |
| 529 | void* _262_agent_start_aux(void* it) |
| 530 | #endif |
| 531 | { |
| 532 | xsCreation creation = { |
| 533 | 1536, /* initialChunkSize */ |
| 534 | 512, /* incrementalChunkSize */ |
| 535 | 512, /* initialHeapCount */ |
| 536 | 64, /* incrementalHeapCount */ |
| 537 | 256, /* stackCount */ |
| 538 | 1024, /* initialKeyCount */ |
| 539 | 0, /* incrementalKeyCount */ |
| 540 | 127, /* nameModulo */ |
| 541 | 127, /* symbolModulo */ |
| 542 | 2048, /* parserBufferSize */ |
| 543 | 127, /* parserTableModulo */ |
| 544 | }; |
| 545 | txAgent* agent = it; |
| 546 | txMachine* machine = fxCloneMachine(&creation, &(gxAgentCluster.root), "agent", NULL); |
| 547 | xsBeginHost(machine); |
| 548 | { |
| 549 | xsTry { |
| 550 | txSlot* slot; |
| 551 | txStringCStream stream; |
| 552 | |
| 553 | slot = fxLastProperty(the, fxNewHostObject(the, NULL)); |
| 554 | slot = fxNextHostFunctionProperty(the, slot, _262_agent_leaving, 0, xsID("leaving"), XS_GET_ONLY); |
| 555 | slot = fxNextHostFunctionProperty(the, slot, _262_agent_monotonicNow, 0, xsID("monotonicNow"), XS_GET_ONLY); |
| 556 | slot = fxNextHostFunctionProperty(the, slot, _262_agent_receiveBroadcast, 1, xsID("receiveBroadcast"), XS_GET_ONLY); |
| 557 | slot = fxNextHostFunctionProperty(the, slot, _262_agent_report, 1, xsID("report"), XS_GET_ONLY); |
| 558 | slot = fxNextHostFunctionProperty(the, slot, _262_agent_sleep, 1, xsID("sleep"), XS_GET_ONLY); |
| 559 | fxSetHostData(the, the->stack, agent); |
| 560 | |
| 561 | mxPush(mxObjectPrototype); |
| 562 | slot = fxLastProperty(the, fxNewObjectInstance(the)); |
| 563 | slot = fxNextSlotProperty(the, slot, the->stack + 1, xsID("agent"), XS_GET_ONLY); |
| 564 | slot = fxGlobalSetProperty(the, mxGlobal.value.reference, xsID("$262"), XS_NO_ID, XS_OWN); |
| 565 | slot->flag = XS_GET_ONLY; |
| 566 | slot->kind = the->stack->kind; |
| 567 | slot->value = the->stack->value; |
| 568 | mxPop(); |
| 569 | |
| 570 | mxPop(); |
| 571 | |
| 572 | stream.buffer = agent->script; |
| 573 | stream.offset = 0; |
| 574 | stream.size = agent->scriptLength; |
| 575 | fxRunScript(the, fxParseScript(the, &stream, fxStringCGetter, mxProgramFlag), mxThis, C_NULL, C_NULL, C_NULL, mxProgram.value.reference); |
| 576 | } |
| 577 | xsCatch { |
| 578 | } |
| 579 | } |
| 580 | xsEndHost(machine); |
| 581 | xsDeleteMachine(machine); |
| 582 | #ifdef mxUseFreeRTOSTasks |
no test coverage detected