Smac is a SMall Ansi C interpreter developed to extend
Xcoral editor services, but it is also possible to use Smac outside
Xcoral
(see §9 page ).
This chapter gives definitions of Smac functions independently of Xcoral, valid whether they are used within or without Xcoral. The next chapter will describe their interface with Xcoral.
Smac implements a subset of the ANSI C standard, but to be fully functional it also implements some extensions of it:
For example, you can directly write:
To manually interrupt a Smac execution, hit
Ctrl-c in the window where Xcoral or just
Smac is running (kill -2 on Xcoral pid). To stop current
execution by
program (as with exit() UNIX system function but without
Xcoral or
Smac ending) see error() §6.6.7 page .
According to the Smac compiling flags (see §9 page ) Smac
can check all your memory access/modification to avoid core dump or
other things. In this case, all allocated objects are taken from a special
memory area whose default size
is
2^18
bytes under Xcoral, and 2^15
bytes otherwise. You
can update
the SMAC_MEMORY_SIZE environment variable to increase it, its
value
must be a power of two (default 2^18
or 2^15
).
In all cases the Smac stack size is 1024 words by default. To increase it update the SMAC_STACK_SIZE environment variable; its value corresponds to the number of words it can contain (a word permits to memorize a char, an int or a pointer).