3. Embedding Squirrel
This section describes how to embed Squirrel in a host application, C language knowledge is required to understand this part of the manual.
Because of his nature of extension language, Squirrel’s compiler and virtual machine are implemented as C library. The library exposes a set of functions to compile scripts, call functions, manipulate data and extend the virtual machine. All declarations needed for embedding the language in an application are in the header file ‘squirrel.h’.
- 3.1. Memory Management
- 3.2. Build Configuration
- 3.3. Error Conventions
- 3.4. Virtual Machine Initialization
- 3.5. The Stack
- 3.6. Runtime error handling
- 3.7. Compiling a script
- 3.8. Calling a function
- 3.9. Create a C function
- 3.10. Tables and arrays manipulation
- 3.11. Userdata and UserPointers
- 3.12. The registry table
- 3.13. Mantaining references to Squirrel values from the C API
- 3.14. Debug Interface