Next: , Previous: , Up: CCL   [Contents][Index]


66.7.4 Calling CCL

CCL programs are called automatically during SXEmacs buffer I/O when the external representation has a coding system type of shift-jis, big5, or ccl. The program is specified by the coding system (see Coding Systems). You can also call CCL programs from other CCL programs, and from Lisp using these functions:

Function: ccl-execute ccl-program status

Execute ccl-program with registers initialized by status. ccl-program is a vector of compiled CCL code created by ccl-compile. It is an error for the program to try to execute a CCL I/O command. status must be a vector of nine values, specifying the initial value for the R0, R1 .. R7 registers and for the instruction counter IC. A nil value for a register initializer causes the register to be set to 0. A nil value for the IC initializer causes execution to start at the beginning of the program. When the program is done, status is modified (by side-effect) to contain the ending values for the corresponding registers and IC.

Function: ccl-execute-on-string ccl-program status string &optional continue

Execute ccl-program with initial status on string. ccl-program is a vector of compiled CCL code created by ccl-compile. status must be a vector of nine values, specifying the initial value for the R0, R1 .. R7 registers and for the instruction counter IC. A nil value for a register initializer causes the register to be set to 0. A nil value for the IC initializer causes execution to start at the beginning of the program. An optional fourth argument continue, if non-nil, causes the IC to remain on the unsatisfied read operation if the program terminates due to exhaustion of the input buffer. Otherwise the IC is set to the end of the program. When the program is done, status is modified (by side-effect) to contain the ending values for the corresponding registers and IC. Returns the resulting string.

To call a CCL program from another CCL program, it must first be registered:

Function: register-ccl-program name ccl-program

Register name for CCL program ccl-program in ccl-program-table. ccl-program should be the compiled form of a CCL program, or nil. Return index number of the registered CCL program.

Information about the processor time used by the CCL interpreter can be obtained using these functions:

Function: ccl-elapsed-time

Returns the elapsed processor time of the CCL interpreter as cons of user and system time, as floating point numbers measured in seconds. If only one overall value can be determined, the return value will be a cons of that value and 0.

Function: ccl-reset-elapsed-time

Resets the CCL interpreter’s internal elapsed time registers.


Next: , Previous: , Up: CCL   [Contents][Index]