blitz2 internals
blitz2 internals
This chapter is for readers who want to go further than writing programs: to write libraries of their own, to build the libraries with other numbers, or to read and change the compiler. It builds on the chapter How blitz2 works, which you should know first.
The libraries of the BB2 C port are written in C. The chapter explains how such a library is built up, the rules for writing one, and then takes you through a library of your own, from the first line to a program that calls it. The original way of writing Blitz libraries, as Blitz Basic programs with inline assembler and a set of macros, is not covered: those macros come with the original Blitz Basic 2 CD and are not part of this project.
The header, the table of commands, the code and the error check area.
Compiler options, register parameters, strings, check routines.
A tutorial: from an empty file to a program that calls your command.
The same libraries with other numbers, and how to make a variant.
The libraries of Red When Excited and Reflective Images, built as userlibs.
How the C source of blitz2 and its editor is organised.