Next Previous Contents

6. Library Initialization Functions

6.1 SLang_init_slang

Synopsis

Initialize the interpreter

Usage

int SLang_init_slang (void)

Description

The SLang_init_slang function must be called by all applications that use the S-Lang interpreter. It initializes the interpreter, defines the built-in data types, and adds a set of core intrinsic functions.

The function returns 0 upon success, or -1 upon failure.

See Also

SLang_init_slfile, SLang_init_slmath, SLang_init_slunix

6.2 SLang_init_slfile

Synopsis

Initialize the interpreter file I/O intrinsics

Usage

int SLang_init_slfile (void)

Description

This function initializes the interpreters file I/O intrinsic functions. This function adds intrinsic functions such as fopen, fclose, and fputs to the interpreter. It returns 0 if successful, or -1 upon error.

Notes

Before this function can be called, it is first necessary to call SLang_init_slang. It also adds the preprocessor symbol __SLFILE__ to the interpreter.

See Also

SLang_init_slang, SLang_init_slunix, SLang_init_slmath

6.3 SLang_init_slmath

Synopsis

Initialize the interpreter math intrinsics

Usage

int SLang_init_slmath (void)

Description

The SLang_init_slmath function initializes the interpreter's mathematical intrinsic functions and makes them available to the language. The intrinsic functions include sin, cos, tan, etc... It returns 0 if successful, or -1 upon failure.

Notes

This function must be called after SLang_init_slang. It adds the preprocessor symbol __SLMATH__ to the interpreter.

See Also

SLang_init_slang, SLang_init_slfile, SLang_init_slunix

6.4 SLang_init_slunix

Synopsis

Make available some unix system calls to the interpreter

Usage

int SLang_init_slunix (void)

Description

The SLang_init_slunix function initializes the interpreter's unix system call intrinsic functions and makes them available to the language. Examples of functions made available by SLang_init_slunix include chmod, chown, and stat_file. It returns 0 if successful, or -1 upon failure.

Notes

This function must be called after SLang_init_slang. It adds the preprocessor symbol __SLUNIX__ to the interpreter.

See Also

SLang_init_slang, SLang_init_slfile, SLang_init_slmath


Next Previous Contents