|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Data Structures | |
| struct | arg |
| struct | argdata |
Macros | |
| #define | __NOLIBBASE__ |
| #define | DOS_BASE_NAME dosbase |
Functions | |
| void | GetNumPars (void) |
| void | GetParString (void) |
| void | FromCLI (void) |
| void | CheckParNum (void) |
| void | CheckParPath (void) |
| ULONG | GetParPath (const struct argdata *wb, ULONG n, UWORD type, struct Library *dosbase) |
| ParPath$(Par#,type): the path of a Workbench argument (V36+). | |
| static struct arg * | findarg (const struct argdata *wb, ULONG n) |
| static ULONG | movestring (const UBYTE *s) |
| static UWORD | fromcli_c (const struct argdata *wb) |
| FromCLI: whether the program was started from the CLI. | |
| BLITZ_ALIAS (FromCLI, fromcli_c) | |
| static ULONG | getnumpars_c (const struct argdata *wb) |
| NumPars: the number of arguments passed to the program. | |
| BLITZ_ALIAS (GetNumPars, getnumpars_c) | |
| static ULONG | getparstring_c (const struct argdata *wb, ULONG n) |
| Par$(Parameter#): the text of an argument. | |
| BLITZ_ALIAS (GetParString, getparstring_c) | |
| static void | checkparnum_c (const struct argdata *wb, LONG n) |
| static void | checkparpath_c (const struct argdata *wb, LONG n) |
Variables | |
| static UBYTE | pathBuffer [256] |
| #define __NOLIBBASE__ |
| #define DOS_BASE_NAME dosbase |
| BLITZ_ALIAS | ( | GetNumPars | , |
| getnumpars_c | ) |
| BLITZ_ALIAS | ( | GetParString | , |
| getparstring_c | ) |
| void CheckParNum | ( | void | ) |
|
static |
| void CheckParPath | ( | void | ) |
|
static |
| void FromCLI | ( | void | ) |
|
static |
FromCLI: whether the program was started from the CLI.
MOVE.w (a0),d0: a word function; the upper word of d0 stays in the original and is undefined here (the register rule: the compiler uses only d0.w).
| wb | a0: wbstartuplib's argument data (!libs{wbstartuplib,la0}) |
| void GetNumPars | ( | void | ) |
|
static |
NumPars: the number of arguments passed to the program.
MOVE.l numArgs(a0),d0.
| wb | a0: wbstartuplib's argument data (!libs{wbstartuplib,la0}) |
| ULONG GetParPath | ( | const struct argdata * | wb, |
| ULONG | n, | ||
| UWORD | type, | ||
| struct Library * | dosbase ) |
ParPath$(Par#,type): the path of a Workbench argument (V36+).
NameFromLock(lock, pathBuffer, 255) of the argument's lock, copied to a3; type 0 = the drawer only, otherwise drawer + "/" + name (no "/" after a ":"; the type is tested as a word). An empty path would compare the byte in front of the string (unreachable: NameFromLock succeeds only with a non-empty path). DIFF: the original branches on the CCR that dos.library leaves after NameFromLock (BEQ right after the JSR); here d0 = 0 is tested (the documented failure value). Either way nothing is written and d0 = 0. Errors (debugger only, CheckParPath): "Can only call ParPath$() when run from WB.", then those of Par$. By design (#106): no range check of the argument number (FindArg). By design (#107): without the error checks also called for CLI arguments (lock 0).
| wb | a0: wbstartuplib's argument data (!libs{wbstartuplib,la0}) |
| n | d0: the argument number (from 1) |
| type | d1.w: 0 = drawer only, otherwise drawer and name |
| dosbase | a6: dos.library |
| void GetParString | ( | void | ) |
|
static |
Par$(Parameter#): the text of an argument.
Copies the argument's text to a3. The original changes a0/a1, keeps d1. Errors (debugger only, CheckParNum): "No parameters passed.", "Non-Existent Parameter." (not 1 <= Parameter# <= NumPars, signed). By design (#106): FindArg walks the list without a check: argument numbers <= 0 or > NumPars run over the end of the list (argument 0: 2^32 steps).
| wb | a0: wbstartuplib's argument data (!libs{wbstartuplib,la0}) |
| n | d0: the argument number (from 1) |
|
static |
|
static |