Initialize and Finalize¶
Set up internal memory for iZ-C.
iZ-C library has a variable to hold error status. Library user can check error by reading this variable. (This varibale is called err in this manual.)
Internal err variable is initialized by calling cs_initErr(). (the value of err is set to CS_ERR_NONE).
cs_initErr() is called implicitely by
err can be set following values:
No error has been occured.
Overflow has been occured.
Cannot allocate memory.
Set value of err to code.
Function can be registed to handle error. Registered function will be called after err is set when error has occured.
cs_setErrHandler(int code, void (*func)(void* data, void* ext), void* ext)¶
Register function func as error handler of code. Parameter data will have diffrent value as code (see following table) and parameter ext is same value as cs_setErrHandler is called.
|CS_ERR_GETVALUE||Pointer to CSint||Print message and process is continued.|
|CS_ERR_OVERFLOW||NULL||Do nohitng and process is continued.|
|CS_ERR_NO_MEMORY||NULL||Call abort() (process will be terminated)|
Output of Statistics Information¶
Print statistcs values:
- Nb Fails (the number of fails that occurred during the generation process)
- Nb Choice Points (the number of instantiations on which it is possible to backtrack)
- Heap Size (the size of the heap which saves the context to enable backtrack).
It is similar to cs_printStats() except that it takes a pointer to FILE as an argument, and writes to the indicated file when the function is invoked.