BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
testlib.c File Reference
#include "blitzlib.h"
#include "blitzexec.h"
#include <exec/execbase.h>
#include <dos/dos.h>
#include <dos/dostags.h>
#include <utility/tagitem.h>
#include <proto/dos.h>
#include "tlcore.h"

Macros

#define __NOLIBBASE__
#define DOS_BASE_NAME   tl_dosbase
#define TL_CMD   512 /* the longest command line, its 0 behind */
#define TL_SAVE

Functions

void TLBegin (void)
void TLInit (void)
void TLFinal (void)
void TLCase (void)
void TLBlockEnd (void)
void TLCheck (void)
void TLCheckStr (void)
void TLRequire (void)
void TLExpectError (void)
void TLCheckQ (void)
void TLCheckFlt (void)
void TLRunProgram (void)
static void codefinit (void)
static int file_ok (void)
void tl_os_write (const uint8_t *data, size_t length)
int tl_os_can_write (void)
int tl_os_fltnear (uint32_t expected, uint32_t actual, uint32_t delta)
static void tlbegin_c (const UBYTE *path, const ULONG *lens)
 TLBegin path$: opens dos.library, mathffp.library and the result file path$ (MODE_NEWFILE), writes begin. A second TLBegin writes broken and changes nothing.
 BLITZ_ALIAS (TLBegin, tlbegin_c)
ULONG tl_init_c (void)
ULONG tl_final_c (void)
ULONG tl_case_c (const UBYTE *name, const ULONG *lens)
static void tlblockend_c (void)
 BLITZ_ALIAS (TLBlockEnd, tlblockend_c)
static void tlcheck_c (ULONG k, ULONG expected, ULONG actual)
 BLITZ_ALIAS (TLCheck, tlcheck_c)
static void tlcheckq_c (ULONG k, ULONG expected, ULONG actual)
 BLITZ_ALIAS (TLCheckQ, tlcheckq_c)
static void tlcheckflt_c (ULONG k, ULONG expected, ULONG actual, ULONG delta)
 BLITZ_ALIAS (TLCheckFlt, tlcheckflt_c)
static void tlcheckstr_c (ULONG k, const UBYTE *expected, const UBYTE *actual, const ULONG *lens)
 TLCheckStr K,expected$,actual$.
 BLITZ_ALIAS (TLCheckStr, tlcheckstr_c)
void tl_resume (void)
static void tlrequire_c (ULONG k, ULONG condition)
 BLITZ_ALIAS (TLRequire, tlrequire_c)
static void tlexpecterror_c (ULONG k)
 BLITZ_ALIAS (TLExpectError, tlexpecterror_c)
static ULONG tlrunprogram_c (ULONG k, const UBYTE *cmd, const ULONG *lens)
 r=TLRunProgram(K,command$): runs the command line (dos SystemTagList from Kickstart 2.0 with the input NIL: and the output CORPUS:out/run-K.out, its return code; on 1.x Execute, which gives none) and gives the address of the result. run K before the start, runend K after it (tlcore.c); refused outside a block and in Blitz mode (no start, the result empty).
 BLITZ_ALIAS (TLRunProgram, tlrunprogram_c)

Variables

ULONG tl_ctx [13]
static struct tl_state tl_st
static struct Library * tl_dosbase
static struct Library * tl_ffpbase
static BPTR tl_fh
static BPTR tl_fhcheck
static struct tl_run tl_run
static struct tl_run_text tl_run_text
static UBYTE tl_cmd [TL_CMD+1]
static UBYTE tl_outname [32]

Macro Definition Documentation

◆ __NOLIBBASE__

#define __NOLIBBASE__

◆ DOS_BASE_NAME

#define DOS_BASE_NAME   tl_dosbase

◆ TL_CMD

#define TL_CMD   512 /* the longest command line, its 0 behind */

◆ TL_SAVE

#define TL_SAVE
Value:
" movem.l d2-d7/a2-a6,_tl_ctx\n" \
" move.l (sp),_tl_ctx+44\n" \
" lea 4(sp),a0\n" \
" move.l a0,_tl_ctx+48\n"

Function Documentation

◆ BLITZ_ALIAS() [1/9]

BLITZ_ALIAS ( TLBegin ,
tlbegin_c  )

◆ BLITZ_ALIAS() [2/9]

BLITZ_ALIAS ( TLBlockEnd ,
tlblockend_c  )

◆ BLITZ_ALIAS() [3/9]

BLITZ_ALIAS ( TLCheck ,
tlcheck_c  )

◆ BLITZ_ALIAS() [4/9]

BLITZ_ALIAS ( TLCheckFlt ,
tlcheckflt_c  )

◆ BLITZ_ALIAS() [5/9]

BLITZ_ALIAS ( TLCheckQ ,
tlcheckq_c  )

◆ BLITZ_ALIAS() [6/9]

BLITZ_ALIAS ( TLCheckStr ,
tlcheckstr_c  )

◆ BLITZ_ALIAS() [7/9]

BLITZ_ALIAS ( TLExpectError ,
tlexpecterror_c  )

◆ BLITZ_ALIAS() [8/9]

BLITZ_ALIAS ( TLRequire ,
tlrequire_c  )

◆ BLITZ_ALIAS() [9/9]

BLITZ_ALIAS ( TLRunProgram ,
tlrunprogram_c  )

◆ codefinit()

void codefinit ( void )
static

◆ file_ok()

int file_ok ( void )
static

◆ tl_case_c()

ULONG tl_case_c ( const UBYTE * name,
const ULONG * lens )

◆ tl_final_c()

ULONG tl_final_c ( void )

◆ tl_init_c()

ULONG tl_init_c ( void )

◆ tl_os_can_write()

int tl_os_can_write ( void )

◆ tl_os_fltnear()

int tl_os_fltnear ( uint32_t expected,
uint32_t actual,
uint32_t delta )

◆ tl_os_write()

void tl_os_write ( const uint8_t * data,
size_t length )

◆ tl_resume()

void tl_resume ( void )

◆ TLBegin()

void TLBegin ( void )

◆ tlbegin_c()

void tlbegin_c ( const UBYTE * path,
const ULONG * lens )
static

TLBegin path$: opens dos.library, mathffp.library and the result file path$ (MODE_NEWFILE), writes begin. A second TLBegin writes broken and changes nothing.

Parameters
pathd0: the path's characters
lensa2: the compiler's string stack, -4(a2) = its length

◆ TLBlockEnd()

void TLBlockEnd ( void )

◆ tlblockend_c()

void tlblockend_c ( void )
static

◆ TLCase()

void TLCase ( void )

◆ TLCheck()

void TLCheck ( void )

◆ tlcheck_c()

void tlcheck_c ( ULONG k,
ULONG expected,
ULONG actual )
static

◆ TLCheckFlt()

void TLCheckFlt ( void )

◆ tlcheckflt_c()

void tlcheckflt_c ( ULONG k,
ULONG expected,
ULONG actual,
ULONG delta )
static

◆ TLCheckQ()

void TLCheckQ ( void )

◆ tlcheckq_c()

void tlcheckq_c ( ULONG k,
ULONG expected,
ULONG actual )
static

◆ TLCheckStr()

void TLCheckStr ( void )

◆ tlcheckstr_c()

void tlcheckstr_c ( ULONG k,
const UBYTE * expected,
const UBYTE * actual,
const ULONG * lens )
static

TLCheckStr K,expected$,actual$.

Parameters
lensa2: -4(a2) = the length of expected$, -8(a2) = of actual$

◆ TLExpectError()

void TLExpectError ( void )

◆ tlexpecterror_c()

void tlexpecterror_c ( ULONG k)
static

◆ TLFinal()

void TLFinal ( void )

◆ TLInit()

void TLInit ( void )

◆ TLRequire()

void TLRequire ( void )

◆ tlrequire_c()

void tlrequire_c ( ULONG k,
ULONG condition )
static

◆ TLRunProgram()

void TLRunProgram ( void )

◆ tlrunprogram_c()

ULONG tlrunprogram_c ( ULONG k,
const UBYTE * cmd,
const ULONG * lens )
static

r=TLRunProgram(K,command$): runs the command line (dos SystemTagList from Kickstart 2.0 with the input NIL: and the output CORPUS:out/run-K.out, its return code; on 1.x Execute, which gives none) and gives the address of the result. run K before the start, runend K after it (tlcore.c); refused outside a block and in Blitz mode (no start, the result empty).

Parameters
kd0: the number of the run
cmdd1: the command line's characters
lensa2: -4(a2) = its length

Variable Documentation

◆ tl_cmd

UBYTE tl_cmd[TL_CMD+1]
static

◆ tl_ctx

ULONG tl_ctx[13]

◆ tl_dosbase

struct Library* tl_dosbase
static

◆ tl_ffpbase

struct Library* tl_ffpbase
static

◆ tl_fh

BPTR tl_fh
static

◆ tl_fhcheck

BPTR tl_fhcheck
static

◆ tl_outname

UBYTE tl_outname[32]
static

◆ tl_run

struct tl_run tl_run
static

◆ tl_run_text

struct tl_run_text tl_run_text
static

◆ tl_st

struct tl_state tl_st
static