STk_add_new_primitive tells the interpreter that the Scheme symbol posix-time must be bound to the (C written) primitive posix_time. The constant tc_subr_0 used as the second argument indicates the arity of this primitive. In this case, the arity of the primitive is 0.
Let's now have a look at the primitive posix-ctime. A first
writing of this primitive could be
This functions uses another interpreter routine (STk_makestring) which takes as parameter a null terminated string and returns a Scheme string.
Binding of the scheme symbol time-string to the C function
get_time is done by the call
A complete listing of this code is given in Figure .
Provided that we have done a shared object of this file, and that its
name is posix.so, our two new primitives can be loaded
dynamically by: