|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Data Structures | |
| struct | channel |
Macros | |
| #define | __NOLIBBASE__ |
| #define | DOSBase dosbase /* for proto/dos.h */ |
| #define | DISPATCH(entry, code, off) |
Functions | |
| void | dodefin (void) |
| void | dodefout (void) |
| void | dosetin (void) |
| void | dosetout (void) |
| void | dogetsingle (void) |
| void | dogetstring (void) |
| void | dooutsingle (void) |
| void | dooutstring1 (void) |
| void | dooutstring2 (void) |
| void | dopopinput (void) |
| void | dopopoutput (void) |
| void | inputoutputlib_codeinit (void) |
| void | popinputcheck (void) |
| void | popoutputcheck (void) |
| void | ctrlcout (void) |
| void | ctrlcin (void) |
| static ULONG | setchannel (struct channel *c, void *handler) |
| static void | popchannel (struct channel *c) |
| static ULONG | dosetin_c (void *handler) |
| dosetin (+3): make a handler the current input channel. | |
| static ULONG | dosetout_c (void *handler) |
| dosetout (+4): make a handler the current output channel, as dosetin. | |
| static void | dopopinput_c (void) |
| PopInput: go back to the previous input channel. | |
| BLITZ_ALIAS (dopopinput, dopopinput_c) | |
| static void | dopopoutput_c (void) |
| PopOutput: go back to the previous output channel, as PopInput. | |
| BLITZ_ALIAS (dopopoutput, dopopoutput_c) | |
| static LONG | defout_c (ULONG c) |
| static LONG | defout2_c (ULONG len, const UBYTE *s) |
| static void | defout3_c (const UBYTE *s) |
| void | defout (void) |
| static LONG | defin2_c (ULONG len, UBYTE *buf) |
| void | defin (void) |
| static ULONG | dodefin_c (void) |
| DefaultInput: make the default input (dos Input(), handler defin) the current input channel; the previous one is pushed. | |
| BLITZ_ALIAS (dodefin, dodefin_c) | |
| static ULONG | dodefout_c (void) |
| DefaultOutput: make the default output (dos Output(), handler defout) the current output channel; the previous one is pushed. | |
| BLITZ_ALIAS (dodefout, dodefout_c) | |
| static void | codeinit_c (struct DosLibrary *dos) |
| The library's init: remember the dos base and Input()/Output(), empty stacks, then DefaultInput and DefaultOutput (each pushes the handler 0). | |
| DISPATCH (dogetsingle, "_iochan_in", "0") | |
| The channel dispatchers for other libraries: dogetsingle (+5, JSR (incode)), dogetstring (+6, JSR -4(incode)), dooutsingle (+7, JSR (outcode)), dooutstring1 (+8, JSR -4(outcode)), dooutstring2 (+9, JSR -8(outcode)). | |
| DISPATCH (dogetstring, "_iochan_in", "-4") | |
| DISPATCH (dooutsingle, "_iochan_out", "0") | |
| DISPATCH (dooutstring1, "_iochan_out", "-4") | |
| DISPATCH (dooutstring2, "_iochan_out", "-8") | |
| static void | popinputcheck_c (void) |
| static void | popoutputcheck_c (void) |
| BLITZ_ERRCHK_ASM (breaktext, "_breaktext:\n" " .ascii \"***Break\"\n" " .byte 10\n" " .even") | |
| static void | ctrlc_c (const void *code, void(*def)(void)) |
| static void | ctrlcout_c (void) |
| static void | ctrlcin_c (void) |
Variables | |
| struct channel iochan_in | iochan_out |
| static struct DosLibrary * | dosbase |
| static BPTR | inputh |
| static BPTR | outputh |
| static UBYTE | outchar |
| const char | mess1 [] = "Can't Input Character from Default Input" |
| #define __NOLIBBASE__ |
| BLITZ_ALIAS | ( | dodefout | , |
| dodefout_c | ) |
| BLITZ_ALIAS | ( | dopopinput | , |
| dopopinput_c | ) |
| BLITZ_ALIAS | ( | dopopoutput | , |
| dopopoutput_c | ) |
| BLITZ_ERRCHK_ASM | ( | breaktext | , |
| "_breaktext:\n" " .ascii \"***Break\"\n" " .byte 10\n" " .even" | ) |
|
static |
The library's init: remember the dos base and Input()/Output(), empty stacks, then DefaultInput and DefaultOutput (each pushes the handler 0).
| dos | a6: dos.library (!libs doslib,la6) |
|
static |
| void ctrlcin | ( | void | ) |
|
static |
| void ctrlcout | ( | void | ) |
|
static |
| void defin | ( | void | ) |
|
static |
| void defout | ( | void | ) |
|
static |
|
static |
|
static |
| DISPATCH | ( | dogetsingle | , |
| "_iochan_in" | , | ||
| "0" | ) |
The channel dispatchers for other libraries: dogetsingle (+5, JSR (incode)), dogetstring (+6, JSR -4(incode)), dooutsingle (+7, JSR (outcode)), dooutstring1 (+8, JSR -4(outcode)), dooutstring2 (+9, JSR -8(outcode)).
All registers go unchanged to the handler, with a6 = the handler address; d0 and the rest come back as the handler leaves them, only a6 is restored. The parameters and results are the handler's (head comment).
| DISPATCH | ( | dogetstring | , |
| "_iochan_in" | , | ||
| "-4" | ) |
| DISPATCH | ( | dooutsingle | , |
| "_iochan_out" | , | ||
| "0" | ) |
| DISPATCH | ( | dooutstring1 | , |
| "_iochan_out" | , | ||
| "-4" | ) |
| DISPATCH | ( | dooutstring2 | , |
| "_iochan_out" | , | ||
| "-8" | ) |
| void dodefin | ( | void | ) |
|
static |
DefaultInput: make the default input (dos Input(), handler defin) the current input channel; the previous one is pushed.
| void dodefout | ( | void | ) |
|
static |
DefaultOutput: make the default output (dos Output(), handler defout) the current output channel; the previous one is pushed.
| void dogetsingle | ( | void | ) |
| void dogetstring | ( | void | ) |
| void dooutsingle | ( | void | ) |
| void dooutstring1 | ( | void | ) |
| void dooutstring2 | ( | void | ) |
| void dopopinput | ( | void | ) |
|
static |
PopInput: go back to the previous input channel.
Errors (debugger only): "No Input channel to pop!" (count <= 1, the initial push of init does not count; fixed, #1032). Without the debugger popping more than was pushed takes old ring entries, By design (#194).
| void dopopoutput | ( | void | ) |
|
static |
PopOutput: go back to the previous output channel, as PopInput.
Errors (debugger only): "No Output channel to pop!". By design (#194) as PopInput; after one PopOutput at the start the handler is 0.
| void dosetin | ( | void | ) |
|
static |
dosetin (+3): make a handler the current input channel.
The previous handler is pushed on the input stack (a ring of 16).
| handler | a0: the handler (entries at -4 and 0, see the head comment) |
| void dosetout | ( | void | ) |
|
static |
dosetout (+4): make a handler the current output channel, as dosetin.
| handler | a0: the handler (entries at -8, -4 and 0) |
| void inputoutputlib_codeinit | ( | void | ) |
|
static |
| void popinputcheck | ( | void | ) |
|
static |
| void popoutputcheck | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
| struct channel iochan_in iochan_out |
| const char mess1[] = "Can't Input Character from Default Input" |
|
static |
|
static |