blob: a4b237c343dea4106f7dcacb2adb9d57823e1511 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#include <stdlib.h> // EXIT_SUCCESS
#include <stdio.h> // printf
#include <string.h> // memset
/**
* Preprocess:
* uscxml-transform -tc -i ./test-c-inline.c -o ./test-c-inline.c.scxml.c
*/
/** INLINE SCXML BEGIN
<scxml name="test-inline" datamodel="native">
<state id="foo">
<onentry>
enteredFoo();
</onentry>
</state>
</scxml>
INLINE SCXML END */
/**
* These function can be called from within executable content
*/
void enteredFoo() {
printf("Entered Foo!\n");
}
#include "test-c-inline.c.scxml.c"
int main(int argc, char** argv) {
uscxml_ctx ctx;
int err = USCXML_ERR_OK;
memset(&ctx, 0, sizeof(uscxml_ctx));
ctx.machine = &USCXML_MACHINE_TEST_INLINE;
while(err != USCXML_ERR_DONE) {
err = uscxml_step(&ctx);
}
return EXIT_SUCCESS;
}
|