Next: ick_create, Previous: ick_forget, Up: External Calls to C [Index]
This class of four functions make it possible to get and set INTERCAL scalar variables from C code. Their prototypes are as follows:
uint16_t ick_getonespot(unsigned short varnumber); void ick_setonespot(unsigned short varnumber, uint16_t newvalue); uint32_t ick_gettwospot(unsigned short varnumber); void ick_settwospot(unsigned short varnumber, uint32_t newvalue);
The program will error out with a fatal error (see E200) if the variable you request is mentioned
nowhere in the INTERCAL program; if you attempt to
set an IGNORE
d variable, the attempt will silently fail
(just as if you assigned to it in an INTERCAL
program). The get functions are safe to use in a computed line label,
so you can use them to produce computed line labels that depend on
INTERCAL variables. (uint16_t
and
uint32_t
are standard C data types; if your system
doesn’t provide them, get better system header files.)
If you care about speed, note that .1 is the fastest variable of all to access, and otherwise variables first mentioned near the top of the INTERCAL program will be faster to access than variables mentioned lower down.