BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
neilsreqtoolslib.c File Reference
#include "blitzlib.h"
#include "blitzexec.h"
#include <stddef.h>
#include <libraries/reqtools.h>

Data Structures

struct  lockflagstags
struct  onetag
struct  gltags
struct  rthandlerinfo

Macros

#define LVO_rtAllocRequestA   (-30)
#define LVO_rtFreeRequest   (-36)
#define LVO_rtChangeReqAttrA   (-48)
#define LVO_rtFileRequestA   (-54)
#define LVO_rtFreeFileList   (-60)
#define LVO_rtEZRequestA   (-66)
#define LVO_rtGetStringA   (-72)
#define LVO_rtGetLongA   (-78)
#define LVO_rtFontRequestA   (-96)
#define LVO_rtPaletteRequestA   (-102)
#define LVO_rtReqHandlerA   (-108)
#define LVO_rtScreenModeRequestA   (-144)
#define LVO_rtLockWindow   (-156)
#define LVO_rtUnlockWindow   (-162)
#define RTJSR_(lvo, d0v, a0v, a1v, a2v, a3v, a4v, seta4)
#define RTJSR(lvo, d0v, a0v, a1v, a2v, a3v)
#define RTJSR4(lvo, d0v, a0v, a1v, a2v, a3v, a4v)
#define RTJSR0(lvo, d0v, a0v, a1v)
#define RTCALL(cancel, call)
#define TAG_LOCKWINDOW   { RT_LockWindow, (ULONG)-1 }
#define TAG_CENTERSCR   { RT_ReqPos, REQPOS_CENTERSCR }
#define ALLOC(var, type)
#define FREEREQ(var)

Functions

void _rtrequest (void)
void _rtrequestPos (void)
void _rtrequestXtra (void)
void _rtfreq (void)
void _rtfontreq (void)
void _rtsmreq (void)
void _rtsmreqf (void)
void _rtpalreq (void)
void _rtgetlong (void)
void _rtgetlongDef (void)
void _rtgetlongrng (void)
void _rtgetlongrngDef (void)
void _rtgetstr (void)
void _rtgetstrDef (void)
void _rtsfreq (void)
void _rtsetdefdir (void)
void _rtpreq (void)
void _rtlockwin (void)
void _rtunlockwin (void)
void _rtsetpat (void)
void _rtfreepat (void)
void _rtflagsrequest (void)
void _rtflagsrequestPos (void)
void _rtTagrequest (void)
void _rtTagsfreq (void)
void _rtMfreq (void)
void _rtnxtentry (void)
void _rtasrequest (void)
void _rtcheckasreq (void)
void _rtendasreq (void)
void _rtver (void)
void _rtrev (void)
void _rtactive (void)
void _rtasPrequest (void)
void _rtcheckasPreq (void)
void _rtendasPreq (void)
void _rtreturnvalue (void)
void _initreqlib (void)
void _cleanupreqlib (void)
static ULONG copystring (const UBYTE *s, ULONG n)
static ULONG copydir (const struct rtFileRequester *req, ULONG n)
static UBYTE * allocst (const UBYTE *s, ULONG len)
static void freest (UBYTE *p)
static ULONG allocreq (ULONG type)
static void freereqs (void)
static ULONG initreqlib_c (void)
 init: opens reqtools.library V38 and allocates the seven requesters.
static void cleanupreqlib_c (void)
 finit: frees the seven requesters and the file list of the last multi-load, closes reqtools.library.
static BB_BOOL rtactive_c (void)
 IsReqToolsActive: whether init opened reqtools.library and allocated all its requesters.
static ULONG rtreturnvalue_c (void)
 RTReturnValue: the result of the last reqtools call that stores it.
static ULONG rtver_c (ULONG callerd0)
 RTVersion: reqtools.library's lib_Version.
static ULONG rtrev_c (ULONG callerd0)
 RTRevision: reqtools.library's lib_Revision.
static ULONG rtrequest_c (STRPTR title, APTR body, STRPTR gadget, const ULONG *lens)
 RTEZRequest(Title$,BodyText$,GadgetText$): an rtEZRequestA requester, centred on the screen.
static ULONG rtrequestPos_c (STRPTR title, APTR body, STRPTR gadget, ULONG pos, const ULONG *lens)
 RTEZRequest(Title$,BodyText$,GadgetText$,ReqPosition): as above at the given position (for this call).
static ULONG rtrequestXtra_c (STRPTR title, APTR body, STRPTR gadget, ULONG pos, ULONG def, ULONG flags, const ULONG *lens)
 RTEZRequest(Title$,BodyText$,GadgetText$,ReqPosition,DefaultResponse,Flags): as above with default response and EZ flags (for this call).
static ULONG rtTagrequest_c (STRPTR body, STRPTR gadget, APTR tags)
 RTRequest(BodyText$,GadgetText$,TagList): rtEZRequestA with the caller's tag list.
static ULONG rtflagsrequest_c (STRPTR title, STRPTR body, STRPTR gadget, ULONG idcmp, const ULONG *lens)
 RTEZFlagsRequest(Title$,BodyText$,GadgetText$,IDCMPFlags): an EZ requester that also ends on the given IDCMP events.
static ULONG rtflagsrequestPos_c (STRPTR title, STRPTR body, STRPTR gadget, ULONG idcmp, ULONG pos, const ULONG *lens)
 RTEZFlagsRequest(Title$,BodyText$,GadgetText$,IDCMPFlags,ReqPosition): as above at the given position (for this call).
static ULONG filerequest (struct rtFileRequester *req, STRPTR title, UBYTE *name, APTR tags)
static ULONG rtfreq_c (STRPTR title, const UBYTE *file)
 RTEZLoadFile(Title$,Filename$): the load file requester; the chosen path.
static ULONG rtTagsfreq_c (STRPTR title, const UBYTE *file, APTR tags)
 RTFileRequest(Title$,FileName$,TagList): a file requester of its own with the caller's tag list; the chosen path.
static ULONG rtsfreq_c (STRPTR title, const UBYTE *file)
 RTEZSaveFile(Title$,Filename$): the save file requester ("Save" button); the chosen path.
static ULONG rtpreq_c (STRPTR title)
 RTEZPathRequest(Title$): a directory requester (no files); the chosen directory.
static ULONG rtsetdefdir_c (ULONG n, STRPTR dir)
 RTEZSetDefaultDirectory Requester#,Directory$: sets the directory of a file requester (rtChangeReqAttrA RTFI_Dir).
static ULONG rtsetpat_c (ULONG n, STRPTR pat)
 RTEZSetPattern Requester#,Pattern$: sets the match pattern of a file requester and switches its pattern gadget on.
static ULONG rtfreepat_c (ULONG n)
 RTEZFreePattern Requester#: switches the pattern gadget of a file requester off again (its flags back to the default).
static ULONG rtMfreq_c (STRPTR title)
 RTEZMultiLoadFile(Title$): the multi-select file requester; the names then come from RTNextPathEntry.
static ULONG rtnxtentry_c (void)
 RTNextPathEntry: the next path of RTEZMultiLoadFile's list.
static ULONG rtfontreq_c (STRPTR title)
 RTEZFontRequest(Title$): the font requester (with style); the chosen font.
static ULONG rtsmreq_c (STRPTR title)
 RTEZScreenModeRequest(Title$): the screen mode requester (size and depth gadgets); the chosen mode.
static ULONG rtsmreqf_c (STRPTR title, ULONG flags)
 RTEZScreenModeRequest(Title$,DisplayFlags): as above with the given requester flags (RTSC_Flags; kept until a choice is made).
static ULONG rtpalreq_c (STRPTR title, ULONG first)
 RTEZPaletteRequest(Title$,FirstColour): the palette requester.
static ULONG rtgetlong_c (STRPTR title, STRPTR body)
 RTEZGetLong(Title$,BodyText$): asks for a number (rtGetLongA).
static ULONG rtgetlongDef_c (STRPTR title, STRPTR body, ULONG def)
 RTEZGetLong(Title$,BodyText$,DefaultValue): as above with a default value.
static ULONG rtgetlongrng_c (STRPTR title, STRPTR body, ULONG min, ULONG max)
 RTEZGetLongRange(Title$,BodyText$,Min,Max): asks for a number in a range (rtGetLongA with RTGL_Min/RTGL_Max).
static ULONG rtgetlongrngDef_c (STRPTR title, STRPTR body, ULONG min, ULONG max, ULONG def)
 RTEZGetLongRange(Title$,BodyText$,Min,Max,DefaultValue): as above with a default value.
static UBYTE * gsalloc (ULONG size)
static ULONG getstring (STRPTR title, STRPTR body, ULONG max)
static ULONG rtgetstr_c (STRPTR title, STRPTR body, ULONG max)
 RTEZGetString(Title$,BodyText$,MaxChars): asks for a string (rtGetStringA).
static ULONG rtgetstrDef_c (STRPTR title, STRPTR body, ULONG max, const UBYTE *def)
 RTEZGetString(Title$,BodyText$,MaxChars,DefaultString): as above, the default string copied into the buffer first.
static ULONG rtlockwin_c (APTR *win)
 RTLockWindow(Window#): locks a window against input (rtLockWindow).
static ULONG rtunlockwin_c (ULONG lock, APTR *win)
 RTUnlockWindow Window#,Lock: unlocks a window locked with RTLockWindow (rtUnlockWindow).
static ULONG waitmask (const APTR handler)
static ULONG rtasrequest_c (STRPTR title, STRPTR body, STRPTR gadget, const UBYTE *obj)
 RTASyncRequest(Title$,BodyText$,GadgetText$): opens an EZ requester that runs alongside the program (RT_ReqHandler).
static ULONG rtcheckasreq_c (void)
 RTCheckASyncRequest: polls the requester of RTASyncRequest (rtReqHandlerA).
static ULONG rtendasreq_c (void)
 RTEndASyncRequest: ends the requester of RTASyncRequest (rtReqHandlerA with RTRH_EndRequest, the handler's WaitMask as the signals, fixed #454).
static ULONG rtasPrequest_c (STRPTR title, ULONG first, const UBYTE *obj)
 RTASyncPaletteRequest(Title$,FirstColour): opens a palette requester that runs alongside the program (RT_ReqHandler).
static BB_BOOL rtcheckasPreq_c (void)
 RTCheckASyncPaletteRequest: polls the requester of RTASyncPaletteRequest (rtReqHandlerA).
static ULONG rtendasPreq_c (void)
 RTEndASyncPaletteRequest: ends the requester of RTASyncPaletteRequest (rtReqHandlerA with RTRH_EndRequest, the handler's WaitMask as the signals, fixed #454).

Variables

static const char version []
static struct Library * rtbase
static BB_BOOL ReqToolsActive
static ULONG returnvalue
static struct rtFileRequester * filereq
static struct rtFontRequester * fontreq
static struct rtScreenModeRequester * smreq
static struct rtFileRequester * Sfilereq
static struct rtFileRequester * preq
static struct rtFileRequester * Tfilereq
static struct rtFileRequester * Mfilereq
static const char rtName [] = "reqtools.library"
static UBYTE fname [108]
struct { 
   struct TagItem pos lockwin underscore flags defres title   end 
} RequestTagList
static STRPTR swsFreq
static UBYTE * filenamestr
static struct lockflagstags freqTagList
static struct lockflagstags fontTagList
struct { 
   APTR   name 
   UWORD   ysize 
   UWORD   styleflags 
} myfont
static struct lockflagstags smTagList
struct { 
   ULONG   DisplayID 
   UWORD   DisplayWidth 
   UWORD   DisplayHeight 
   UWORD   DisplayDepth 
   UWORD   OverscanType 
   ULONG   Autoscroll 
} smRetType
struct { 
   struct TagItem color lockwin   end 
} palreqTagList = { { RTPA_Color, 0 }, TAG_LOCKWINDOW, { TAG_END, 0 } }
static ULONG glValue
static struct gltags glTagList
static ULONG glrValue
struct { 
   struct TagItem lockwin textfmt pos flags min max   end 
} glrTagList
static UBYTE * callerstring
static UBYTE * swsPtr
static UBYTE * gsBuffer
static ULONG gsTxtSize
static ULONG gsActual
static struct gltags gsTagList
static const char SaveTxt [] = "Save"
static STRPTR swsSFreq
static UBYTE * Sfilenamestr
struct { 
   struct TagItem lockwin oktext flags   end 
} SfreqTagList
static struct onetag sddTagList = { { RTFI_Dir, 0 }, { TAG_END, 0 } }
static struct onetag spTagList = { { RTFI_MatchPat, 0 }, { TAG_END, 0 } }
static STRPTR swsPreq
struct { 
   struct TagItem flags lockwin   end 
} preqTagList = { { RTFI_Flags, FREQF_NOFILES }, TAG_LOCKWINDOW, { TAG_END, 0 } }
struct { 
   struct TagItem title pos lockwin underscore idcmp   end 
} RequestFTagList
static STRPTR swsTFreq
static UBYTE * Tfilenamestr
static struct rtFileList * Mfilelist
static struct rtFileList * CurEntry
static struct lockflagstags MfreqTagList
static APTR myhandler
static APTR myPhandler
struct { 
   struct TagItem pos lockwin title handler   end 
} asRequestTagList
struct { 
   struct TagItem title color handler   end 
} asPRequestTagList
static const struct onetag endreqTL = { { RTRH_EndRequest, 0 }, { TAG_END, 0 } }
static const struct onetag endPreqTL = { { RTRH_EndRequest, 0 }, { TAG_END, 0 } }

Macro Definition Documentation

◆ ALLOC

#define ALLOC ( var,
type )
Value:
do { \
ULONG r_ = allocreq(type); \
if (!r_) \
goto failed; \
var = (void *)r_; \
} while (0)
UWORD type
Definition editlib.c:263
static ULONG allocreq(ULONG type)
Definition neilsreqtoolslib.c:627

◆ FREEREQ

#define FREEREQ ( var)
Value:
do { \
if (var) { \
RTJSR0(LVO_rtFreeRequest, 0, 0, var); \
var = NULL; \
} \
} while (0)
#define LVO_rtFreeRequest
Definition neilsreqtoolslib.c:344

◆ LVO_rtAllocRequestA

#define LVO_rtAllocRequestA   (-30)

◆ LVO_rtChangeReqAttrA

#define LVO_rtChangeReqAttrA   (-48)

◆ LVO_rtEZRequestA

#define LVO_rtEZRequestA   (-66)

◆ LVO_rtFileRequestA

#define LVO_rtFileRequestA   (-54)

◆ LVO_rtFontRequestA

#define LVO_rtFontRequestA   (-96)

◆ LVO_rtFreeFileList

#define LVO_rtFreeFileList   (-60)

◆ LVO_rtFreeRequest

#define LVO_rtFreeRequest   (-36)

◆ LVO_rtGetLongA

#define LVO_rtGetLongA   (-78)

◆ LVO_rtGetStringA

#define LVO_rtGetStringA   (-72)

◆ LVO_rtLockWindow

#define LVO_rtLockWindow   (-156)

◆ LVO_rtPaletteRequestA

#define LVO_rtPaletteRequestA   (-102)

◆ LVO_rtReqHandlerA

#define LVO_rtReqHandlerA   (-108)

◆ LVO_rtScreenModeRequestA

#define LVO_rtScreenModeRequestA   (-144)

◆ LVO_rtUnlockWindow

#define LVO_rtUnlockWindow   (-162)

◆ RTCALL

#define RTCALL ( cancel,
call )
Value:
({ \
ULONG c_ = (ULONG)(cancel); \
c_ = (call); \
c_; })
static BB_BOOL ReqToolsActive
Definition neilsreqtoolslib.c:417

◆ RTJSR

#define RTJSR ( lvo,
d0v,
a0v,
a1v,
a2v,
a3v )
Value:
RTJSR_(lvo, d0v, a0v, a1v, a2v, a3v, 0, "")
#define RTJSR_(lvo, d0v, a0v, a1v, a2v, a3v, a4v, seta4)
Definition neilsreqtoolslib.c:372

◆ RTJSR0

#define RTJSR0 ( lvo,
d0v,
a0v,
a1v )
Value:
({ \
struct bl_regs r_ = { .d0 = (ULONG)(d0v), .a0 = (ULONG)(a0v), \
.a1 = (ULONG)(a1v) }; \
BLITZ_BASEJSR(rtbase, lvo, r_); })
static struct Library * rtbase
Definition neilsreqtoolslib.c:416
Definition blitzlib.h:537

◆ RTJSR4

#define RTJSR4 ( lvo,
d0v,
a0v,
a1v,
a2v,
a3v,
a4v )
Value:
RTJSR_(lvo, d0v, a0v, a1v, a2v, a3v, a4v, "move.l %6,a4\n\t")

◆ RTJSR_

#define RTJSR_ ( lvo,
d0v,
a0v,
a1v,
a2v,
a3v,
a4v,
seta4 )
Value:
({ \
register ULONG _d0 __asm("d0") = (ULONG)(d0v); \
register ULONG _a0 __asm("a0") = (ULONG)(a0v); \
register ULONG _a1 __asm("a1") = (ULONG)(a1v); \
register ULONG _a2 __asm("a2") = (ULONG)(a2v); \
register struct Library *_a6 __asm("a6") = rtbase; \
ULONG _a3 = (ULONG)(a3v), _a4 = (ULONG)(a4v); \
__asm volatile("movem.l a3-a4,-(sp)\n\t" \
"move.l %5,a3\n\t" \
seta4 \
"jsr %c7(a6)\n\t" \
"movem.l (sp)+,a3-a4" \
: "+d"(_d0), "+a"(_a0), "+a"(_a1), "+a"(_a2), "+a"(_a6) \
: "d"(_a3), "d"(_a4), "i"(lvo) \
: "d1", "cc", "memory"); \
_d0; })

◆ TAG_CENTERSCR

#define TAG_CENTERSCR   { RT_ReqPos, REQPOS_CENTERSCR }

◆ TAG_LOCKWINDOW

#define TAG_LOCKWINDOW   { RT_LockWindow, (ULONG)-1 }

Function Documentation

◆ _cleanupreqlib()

void _cleanupreqlib ( void )

◆ _initreqlib()

void _initreqlib ( void )

◆ _rtactive()

void _rtactive ( void )

◆ _rtasPrequest()

void _rtasPrequest ( void )

◆ _rtasrequest()

void _rtasrequest ( void )

◆ _rtcheckasPreq()

void _rtcheckasPreq ( void )

◆ _rtcheckasreq()

void _rtcheckasreq ( void )

◆ _rtendasPreq()

void _rtendasPreq ( void )

◆ _rtendasreq()

void _rtendasreq ( void )

◆ _rtflagsrequest()

void _rtflagsrequest ( void )

◆ _rtflagsrequestPos()

void _rtflagsrequestPos ( void )

◆ _rtfontreq()

void _rtfontreq ( void )

◆ _rtfreepat()

void _rtfreepat ( void )

◆ _rtfreq()

void _rtfreq ( void )

◆ _rtgetlong()

void _rtgetlong ( void )

◆ _rtgetlongDef()

void _rtgetlongDef ( void )

◆ _rtgetlongrng()

void _rtgetlongrng ( void )

◆ _rtgetlongrngDef()

void _rtgetlongrngDef ( void )

◆ _rtgetstr()

void _rtgetstr ( void )

◆ _rtgetstrDef()

void _rtgetstrDef ( void )

◆ _rtlockwin()

void _rtlockwin ( void )

◆ _rtMfreq()

void _rtMfreq ( void )

◆ _rtnxtentry()

void _rtnxtentry ( void )

◆ _rtpalreq()

void _rtpalreq ( void )

◆ _rtpreq()

void _rtpreq ( void )

◆ _rtrequest()

void _rtrequest ( void )

◆ _rtrequestPos()

void _rtrequestPos ( void )

◆ _rtrequestXtra()

void _rtrequestXtra ( void )

◆ _rtreturnvalue()

void _rtreturnvalue ( void )

◆ _rtrev()

void _rtrev ( void )

◆ _rtsetdefdir()

void _rtsetdefdir ( void )

◆ _rtsetpat()

void _rtsetpat ( void )

◆ _rtsfreq()

void _rtsfreq ( void )

◆ _rtsmreq()

void _rtsmreq ( void )

◆ _rtsmreqf()

void _rtsmreqf ( void )

◆ _rtTagrequest()

void _rtTagrequest ( void )

◆ _rtTagsfreq()

void _rtTagsfreq ( void )

◆ _rtunlockwin()

void _rtunlockwin ( void )

◆ _rtver()

void _rtver ( void )

◆ allocreq()

ULONG allocreq ( ULONG type)
static

◆ allocst()

UBYTE * allocst ( const UBYTE * s,
ULONG len )
static

◆ cleanupreqlib_c()

void cleanupreqlib_c ( void )
static

finit: frees the seven requesters and the file list of the last multi-load, closes reqtools.library.

Only if init succeeded (IsReqToolsActive). Afterwards everything is cleared, IsReqToolsActive 0 (fixed, #460: the original cleared nothing).

◆ copydir()

ULONG copydir ( const struct rtFileRequester * req,
ULONG n )
static

◆ copystring()

ULONG copystring ( const UBYTE * s,
ULONG n )
static

◆ filerequest()

ULONG filerequest ( struct rtFileRequester * req,
STRPTR title,
UBYTE * name,
APTR tags )
static

◆ freereqs()

void freereqs ( void )
static

◆ freest()

void freest ( UBYTE * p)
static

◆ getstring()

ULONG getstring ( STRPTR title,
STRPTR body,
ULONG max )
static

◆ gsalloc()

UBYTE * gsalloc ( ULONG size)
static

◆ initreqlib_c()

ULONG initreqlib_c ( void )
static

init: opens reqtools.library V38 and allocates the seven requesters.

File requesters for load, save, path, RTFileRequest and multi-load, a font and a screen mode requester; IsReqToolsActive becomes -1 if all that worked, else 0. On a failure the requesters allocated so far are freed and the library closed (fixed, #460: the original kept them, and finit did nothing then); out of memory gives 0 (D-018).

Returns
d0: the multi-load requester, 0 on a failure

◆ rtactive_c()

BB_BOOL rtactive_c ( void )
static

IsReqToolsActive: whether init opened reqtools.library and allocated all its requesters.

Without it the other routines return their cancel value and call nothing (fixed, #463).

Returns
d0: -1 if so, 0 if not

◆ rtasPrequest_c()

ULONG rtasPrequest_c ( STRPTR title,
ULONG first,
const UBYTE * obj )
static

RTASyncPaletteRequest(Title$,FirstColour): opens a palette requester that runs alongside the program (RT_ReqHandler).

RTCheckASyncPaletteRequest polls it, RTEndASyncPaletteRequest ends it. The window object is not read, as in RTASyncRequest (fixed, #454). The result is stored for RTReturnValue, unconverted, as RTASyncRequest does (fixed, #464: the original did not store it).

Parameters
titled0: Title$
firstd1: FirstColour (RTPA_Color)
obja1: the used window object (not used)
Returns
d0: -1 if the requester is up, else rtPaletteRequestA's result; 0 (not opened) without IsReqToolsActive (#463)

◆ rtasrequest_c()

ULONG rtasrequest_c ( STRPTR title,
STRPTR body,
STRPTR gadget,
const UBYTE * obj )
static

RTASyncRequest(Title$,BodyText$,GadgetText$): opens an EZ requester that runs alongside the program (RT_ReqHandler).

RTCheckASyncRequest polls it, RTEndASyncRequest ends it. The window object is not read (fixed, #454: the original read a "user port" at 86 of it, not of the Window, for a mask nobody used).

Parameters
titled0: Title$
bodyd1: BodyText$
gadgetd2: GadgetText$
obja1: the used window object (not used)
Returns
d0: -1 if the requester is up (CALL_HANDLER), else rtEZRequestA's result (also for RTReturnValue, unconverted); 0 (not opened) without IsReqToolsActive (#463)

◆ rtcheckasPreq_c()

BB_BOOL rtcheckasPreq_c ( void )
static

RTCheckASyncPaletteRequest: polls the requester of RTASyncPaletteRequest (rtReqHandlerA).

With the handler's WaitMask as the signals (fixed, #454: the original passed 0).

Returns
d0: -1 while it is up, else 0 (the colour is not returned)

◆ rtcheckasreq_c()

ULONG rtcheckasreq_c ( void )
static

RTCheckASyncRequest: polls the requester of RTASyncRequest (rtReqHandlerA).

With the handler's WaitMask as the signals (fixed, #454: the original passed 0).

Returns
d0: -1 while it is up, else the requester's result

◆ rtendasPreq_c()

ULONG rtendasPreq_c ( void )
static

RTEndASyncPaletteRequest: ends the requester of RTASyncPaletteRequest (rtReqHandlerA with RTRH_EndRequest, the handler's WaitMask as the signals, fixed #454).

Returns
d0: rtReqHandlerA's result

◆ rtendasreq_c()

ULONG rtendasreq_c ( void )
static

RTEndASyncRequest: ends the requester of RTASyncRequest (rtReqHandlerA with RTRH_EndRequest, the handler's WaitMask as the signals, fixed #454).

Returns
d0: rtReqHandlerA's result

◆ rtflagsrequest_c()

ULONG rtflagsrequest_c ( STRPTR title,
STRPTR body,
STRPTR gadget,
ULONG idcmp,
const ULONG * lens )
static

RTEZFlagsRequest(Title$,BodyText$,GadgetText$,IDCMPFlags): an EZ requester that also ends on the given IDCMP events.

An empty GadgetText$ means no gadgets. Afterwards the position is centred again. The title goes to this requester's tag list, an empty one as 0 (reqtools' default title) (fixed, #455: the original wrote it to RTEZRequest's list, so this requester always had the default title).

Parameters
titled0: Title$
bodyd1: BodyText$
gadgetd2: GadgetText$
idcmpd3: IDCMPFlags (RT_IDCMPFlags)
lensa2: the argument stack, the title's length at -4(a2), the gadget text's at -12(a2)
Returns
d0: rtEZRequestA's result (also for RTReturnValue)

◆ rtflagsrequestPos_c()

ULONG rtflagsrequestPos_c ( STRPTR title,
STRPTR body,
STRPTR gadget,
ULONG idcmp,
ULONG pos,
const ULONG * lens )
static

RTEZFlagsRequest(Title$,BodyText$,GadgetText$,IDCMPFlags,ReqPosition): as above at the given position (for this call).

Parameters
titled0: Title$
bodyd1: BodyText$
gadgetd2: GadgetText$
idcmpd3: IDCMPFlags
posd4: ReqPosition
lensa2: the argument stack
Returns
d0: rtEZRequestA's result

◆ rtfontreq_c()

ULONG rtfontreq_c ( STRPTR title)
static

RTEZFontRequest(Title$): the font requester (with style); the chosen font.

The result is a TextAttr of the library's own (name, size, style, flags copied from the requester's Attr); the font name is not copied.

Parameters
titled0: Title$
Returns
d0: the TextAttr, 0 on cancel (rtFontRequestA's result for RTReturnValue)

◆ rtfreepat_c()

ULONG rtfreepat_c ( ULONG n)
static

RTEZFreePattern Requester#: switches the pattern gadget of a file requester off again (its flags back to the default).

The numbers of RTEZSetPattern (fixed, #456: the original reset the multi-load requester for 2, the path requester's number, and did nothing for 3).

Parameters
nd0: Requester#: 0 load, 1 save, 3 multi-load (others: nothing)
Returns
d0: 0

◆ rtfreq_c()

ULONG rtfreq_c ( STRPTR title,
const UBYTE * file )
static

RTEZLoadFile(Title$,Filename$): the load file requester; the chosen path.

The file name buffer is a 108-byte copy of Filename$ (maxslib); the result, directory + "/" (unless it ends in ":") + file, is built from the start of the title string on; a3 ends on the result's 0 (fixed, #461: the original left it behind the 0); on cancel a3 = the title.

Parameters
titled0: Title$
filed1: Filename$
Returns
d0: the length of the path, 0 on cancel (also for RTReturnValue: rtFileRequestA's result)

◆ rtgetlong_c()

ULONG rtgetlong_c ( STRPTR title,
STRPTR body )
static

RTEZGetLong(Title$,BodyText$): asks for a number (rtGetLongA).

The requester starts at 0; the value is returned also on cancel (then 0; RTReturnValue tells cancel from OK: rtGetLongA's result goes there). Afterwards the value is 0 again, so it does not become the default of the next call (fixed, #457: the original kept it, so a call without a default showed and on cancel returned the previous call's number).

Parameters
titled0: Title$
bodyd1: BodyText$ (RTGL_TextFmt)
Returns
d0: the value, 0 on cancel

◆ rtgetlongDef_c()

ULONG rtgetlongDef_c ( STRPTR title,
STRPTR body,
ULONG def )
static

RTEZGetLong(Title$,BodyText$,DefaultValue): as above with a default value.

Parameters
titled0: Title$
bodyd1: BodyText$
defd2: DefaultValue
Returns
d0: the value, DefaultValue on cancel

◆ rtgetlongrng_c()

ULONG rtgetlongrng_c ( STRPTR title,
STRPTR body,
ULONG min,
ULONG max )
static

RTEZGetLongRange(Title$,BodyText$,Min,Max): asks for a number in a range (rtGetLongA with RTGL_Min/RTGL_Max).

The requester starts at 0, also when 0 is outside Min..Max (reqtools shows the start value as it is and checks the range only on OK). rtGetLongA's result goes to RTReturnValue. Afterwards the value is 0 again, so it does not become the default of the next call (fixed, #1078: the original kept it, so a call without a default showed the previous call's number).

Parameters
titled0: Title$
bodyd1: BodyText$
mind2: Min
maxd3: Max
Returns
d0: the value, 0 on cancel

◆ rtgetlongrngDef_c()

ULONG rtgetlongrngDef_c ( STRPTR title,
STRPTR body,
ULONG min,
ULONG max,
ULONG def )
static

RTEZGetLongRange(Title$,BodyText$,Min,Max,DefaultValue): as above with a default value.

Parameters
titled0: Title$
bodyd1: BodyText$
mind2: Min
maxd3: Max
defd4: DefaultValue
Returns
d0: the value, 0 on cancel

◆ rtgetstr_c()

ULONG rtgetstr_c ( STRPTR title,
STRPTR body,
ULONG max )
static

RTEZGetString(Title$,BodyText$,MaxChars): asks for a string (rtGetStringA).

The buffer is MaxChars bytes of memlib (MEMF_CLEAR), freed after the requester (fixed, #458: the original freed it only after a choice); the string goes from the start of the title on (no 0, a3 behind it). On cancel a3 is back at the caller's. rtGetStringA's result goes to RTReturnValue.

Parameters
titled0: Title$
bodyd1: BodyText$
maxd2: MaxChars
Returns
d0: the length of the string, 0 on cancel

◆ rtgetstrDef_c()

ULONG rtgetstrDef_c ( STRPTR title,
STRPTR body,
ULONG max,
const UBYTE * def )
static

RTEZGetString(Title$,BodyText$,MaxChars,DefaultString): as above, the default string copied into the buffer first.

BUG(orig) (#459): the copy has no limit (MaxChars is not checked).

Parameters
titled0: Title$
bodyd1: BodyText$
maxd2: MaxChars
defd3: DefaultString
Returns
d0: the length of the string, 0 on cancel

◆ rtlockwin_c()

ULONG rtlockwin_c ( APTR * win)
static

RTLockWindow(Window#): locks a window against input (rtLockWindow).

Parameters
wina1: the window object of Window# (d0), its first long the Window
Returns
d0: the lock for RTUnlockWindow

◆ rtMfreq_c()

ULONG rtMfreq_c ( STRPTR title)
static

RTEZMultiLoadFile(Title$): the multi-select file requester; the names then come from RTNextPathEntry.

The file list of the previous call is freed first. The whole list address is tested (fixed, #462: the original tested its low byte with CMP.b #0,d0 and returned a list at an address ending in $00 as such).

Parameters
titled0: Title$
Returns
d0: -1 if files were chosen, 0 on cancel

◆ rtnxtentry_c()

ULONG rtnxtentry_c ( void )
static

RTNextPathEntry: the next path of RTEZMultiLoadFile's list.

Directory + "/" (unless it ends in ":") + the next name, a3 behind the 0; the list position moves on.

Returns
d0: the length of the path, 0 at the end of the list

◆ rtpalreq_c()

ULONG rtpalreq_c ( STRPTR title,
ULONG first )
static

RTEZPaletteRequest(Title$,FirstColour): the palette requester.

The result is stored for RTReturnValue (fixed, #464: the original did not store it).

Parameters
titled0: Title$
firstd1: FirstColour (RTPA_Color)
Returns
d0: rtPaletteRequestA's result (-1 on cancel and without IsReqToolsActive, #463)

◆ rtpreq_c()

ULONG rtpreq_c ( STRPTR title)
static

RTEZPathRequest(Title$): a directory requester (no files); the chosen directory.

The directory from the title on, with "/" (unless it ends in ":") but no 0; a3 behind it, on cancel a3 = the title.

Parameters
titled0: Title$
Returns
d0: the length of the directory, 0 on cancel (also for RTReturnValue: rtFileRequestA's result)

◆ rtrequest_c()

ULONG rtrequest_c ( STRPTR title,
APTR body,
STRPTR gadget,
const ULONG * lens )
static

RTEZRequest(Title$,BodyText$,GadgetText$): an rtEZRequestA requester, centred on the screen.

The title tag only with a non-empty title; afterwards position (centred), flags (0), default response (1) and title are back at their defaults. The result is stored for RTReturnValue.

Parameters
titled0: Title$
bodyd1: BodyText$ (any type: the address is passed on)
gadgetd2: GadgetText$
lensa2: the argument stack, the title's length at -4(a2)
Returns
d0: rtEZRequestA's result (the gadget number)

◆ rtrequestPos_c()

ULONG rtrequestPos_c ( STRPTR title,
APTR body,
STRPTR gadget,
ULONG pos,
const ULONG * lens )
static

RTEZRequest(Title$,BodyText$,GadgetText$,ReqPosition): as above at the given position (for this call).

Parameters
titled0: Title$
bodyd1: BodyText$
gadgetd2: GadgetText$
posd3: ReqPosition (RT_ReqPos)
lensa2: the argument stack, the title's length at -4(a2)
Returns
d0: rtEZRequestA's result

◆ rtrequestXtra_c()

ULONG rtrequestXtra_c ( STRPTR title,
APTR body,
STRPTR gadget,
ULONG pos,
ULONG def,
ULONG flags,
const ULONG * lens )
static

RTEZRequest(Title$,BodyText$,GadgetText$,ReqPosition,DefaultResponse,Flags): as above with default response and EZ flags (for this call).

Parameters
titled0: Title$
bodyd1: BodyText$
gadgetd2: GadgetText$
posd3: ReqPosition (RT_ReqPos)
defd4: DefaultResponse (RTEZ_DefaultResponse)
flagsd5: Flags (RTEZ_Flags)
lensa2: the argument stack, the title's length at -4(a2)
Returns
d0: rtEZRequestA's result

◆ rtreturnvalue_c()

ULONG rtreturnvalue_c ( void )
static

RTReturnValue: the result of the last reqtools call that stores it.

Stored by the EZ, file, path, font, screen mode, palette, number and string requesters, RTRequest, RTASyncRequest and RTASyncPaletteRequest (the palette requesters: fixed, #464); not by the RTCheck.../RTEnd... and window routines.

Returns
d0: the value

◆ rtrev_c()

ULONG rtrev_c ( ULONG callerd0)
static

RTRevision: reqtools.library's lib_Revision.

Without IsReqToolsActive 0 (fixed, #463: the original read address $16).

Parameters
callerd0d0: the caller's d0 (its high word stays)
Returns
d0.w: the revision

◆ rtsetdefdir_c()

ULONG rtsetdefdir_c ( ULONG n,
STRPTR dir )
static

RTEZSetDefaultDirectory Requester#,Directory$: sets the directory of a file requester (rtChangeReqAttrA RTFI_Dir).

Parameters
nd0: Requester#: 0 load, 1 save, 2 path, 3 multi-load (others: nothing)
dird1: Directory$
Returns
d0: 0

◆ rtsetpat_c()

ULONG rtsetpat_c ( ULONG n,
STRPTR pat )
static

RTEZSetPattern Requester#,Pattern$: sets the match pattern of a file requester and switches its pattern gadget on.

Parameters
nd0: Requester#: 0 load, 1 save, 3 multi-load (others: nothing)
patd1: Pattern$ (RTFI_MatchPat)
Returns
d0: 0

◆ rtsfreq_c()

ULONG rtsfreq_c ( STRPTR title,
const UBYTE * file )
static

RTEZSaveFile(Title$,Filename$): the save file requester ("Save" button); the chosen path.

Like RTEZLoadFile, a3 included (fixed, #465: the original restored a3 with MOVEM a3-a6, so it did not point behind the result).

Parameters
titled0: Title$
filed1: Filename$
Returns
d0: the length of the path, 0 on cancel

◆ rtsmreq_c()

ULONG rtsmreq_c ( STRPTR title)
static

RTEZScreenModeRequest(Title$): the screen mode requester (size and depth gadgets); the chosen mode.

The result is a block of the library's own: DisplayID.l, DisplayWidth.w, DisplayHeight.w, DisplayDepth.w, OverscanType.w, AutoScroll.l, copied from the requester. After a choice the flags are back at size and depth gadgets. Through rtScreenModeRequestA (-144) (fixed, #466: the original called rtFontRequestA, -96, which works only because reqtools has one routine behind -54, -96 and -144 and takes the kind from the requester).

Parameters
titled0: Title$
Returns
d0: the block, 0 on cancel (also for RTReturnValue)

◆ rtsmreqf_c()

ULONG rtsmreqf_c ( STRPTR title,
ULONG flags )
static

RTEZScreenModeRequest(Title$,DisplayFlags): as above with the given requester flags (RTSC_Flags; kept until a choice is made).

Parameters
titled0: Title$
flagsd1: DisplayFlags
Returns
d0: the block, 0 on cancel

◆ rtTagrequest_c()

ULONG rtTagrequest_c ( STRPTR body,
STRPTR gadget,
APTR tags )
static

RTRequest(BodyText$,GadgetText$,TagList): rtEZRequestA with the caller's tag list.

The result is stored for RTReturnValue.

Parameters
bodyd0: BodyText$
gadgetd1: GadgetText$
tagsd2: the tag list
Returns
d0: rtEZRequestA's result

◆ rtTagsfreq_c()

ULONG rtTagsfreq_c ( STRPTR title,
const UBYTE * file,
APTR tags )
static

RTFileRequest(Title$,FileName$,TagList): a file requester of its own with the caller's tag list; the chosen path.

As RTEZLoadFile (a3 on the 0, fixed #461).

Parameters
titled0: Title$
filed1: FileName$
tagsd2: the tag list
Returns
d0: the length of the path, 0 on cancel

◆ rtunlockwin_c()

ULONG rtunlockwin_c ( ULONG lock,
APTR * win )
static

RTUnlockWindow Window#,Lock: unlocks a window locked with RTLockWindow (rtUnlockWindow).

Parameters
lockd1: the lock
wina1: the window object of Window# (d0)
Returns
d0: what reqtools leaves there

◆ rtver_c()

ULONG rtver_c ( ULONG callerd0)
static

RTVersion: reqtools.library's lib_Version.

Without IsReqToolsActive 0 (fixed, #463: the original read address $14).

Parameters
callerd0d0: the caller's d0 (its high word stays)
Returns
d0.w: the version

◆ waitmask()

ULONG waitmask ( const APTR handler)
static

Variable Documentation

◆ [struct]

struct { ... } asPRequestTagList
Initial value:
= {
{ RTEZ_ReqTitle, 0 }, { RTPA_Color, 0 }, { RT_ReqHandler, (ULONG)&myPhandler },
{ TAG_END, 0 }
}
static APTR myPhandler
Definition neilsreqtoolslib.c:561

◆ [struct]

struct { ... } asRequestTagList
Initial value:
= {
TAG_CENTERSCR, TAG_LOCKWINDOW, { RTEZ_ReqTitle, 0 },
{ RT_ReqHandler, (ULONG)&myhandler }, { TAG_END, 0 }
}
static APTR myhandler
Definition neilsreqtoolslib.c:561
#define TAG_CENTERSCR
Definition neilsreqtoolslib.c:428
#define TAG_LOCKWINDOW
Definition neilsreqtoolslib.c:427

◆ Autoscroll

ULONG Autoscroll

◆ callerstring

UBYTE* callerstring
static

◆ CurEntry

struct rtFileList * CurEntry
static

◆ DisplayDepth

UWORD DisplayDepth

◆ DisplayHeight

UWORD DisplayHeight

◆ DisplayID

ULONG DisplayID

◆ DisplayWidth

UWORD DisplayWidth

◆ end

struct TagItem title color handler end

◆ endPreqTL

const struct onetag endPreqTL = { { RTRH_EndRequest, 0 }, { TAG_END, 0 } }
static

◆ endreqTL

const struct onetag endreqTL = { { RTRH_EndRequest, 0 }, { TAG_END, 0 } }
static

◆ filenamestr

UBYTE* filenamestr
static

◆ filereq

struct rtFileRequester* filereq
static

◆ fname

UBYTE fname[108]
static

◆ fontreq

struct rtFontRequester* fontreq
static

◆ fontTagList

struct lockflagstags fontTagList
static
Initial value:
= {
TAG_LOCKWINDOW, { RTFO_Flags, FREQF_STYLE }, { TAG_END, 0 }
}

◆ freqTagList

struct lockflagstags freqTagList
static
Initial value:
= {
TAG_LOCKWINDOW, { RTFI_Flags, 0 }, { TAG_END, 0 }
}

◆ [struct]

struct { ... } glrTagList
Initial value:
= {
TAG_LOCKWINDOW, { RTGL_TextFmt, 0 }, TAG_CENTERSCR,
{ RTGL_Flags, GLREQF_CENTERTEXT }, { RTGL_Min, 0 }, { RTGL_Max, 0 }, { TAG_END, 0 }
}

◆ glrValue

ULONG glrValue
static

◆ glTagList

struct gltags glTagList
static
Initial value:
= {
TAG_LOCKWINDOW, { RTGL_TextFmt, 0 }, TAG_CENTERSCR,
{ RTGL_Flags, GLREQF_CENTERTEXT }, { TAG_END, 0 }
}

◆ glValue

ULONG glValue
static

◆ gsActual

ULONG gsActual
static

◆ gsBuffer

UBYTE * gsBuffer
static

◆ gsTagList

struct gltags gsTagList
static
Initial value:
= {
TAG_LOCKWINDOW, { RTGL_TextFmt, 0 }, TAG_CENTERSCR,
{ RTGL_Flags, GLREQF_CENTERTEXT }, { TAG_END, 0 }
}

◆ gsTxtSize

ULONG gsTxtSize
static

◆ Mfilelist

struct rtFileList* Mfilelist
static

◆ Mfilereq

struct rtFileRequester * Mfilereq
static

◆ MfreqTagList

struct lockflagstags MfreqTagList
static
Initial value:
= {
TAG_LOCKWINDOW, { RTFI_Flags, FREQF_MULTISELECT }, { TAG_END, 0 }
}

◆ [struct]

struct { ... } myfont

◆ myhandler

APTR myhandler
static

◆ myPhandler

APTR myPhandler
static

◆ name

APTR name

◆ OverscanType

UWORD OverscanType

◆ [struct]

struct { ... } palreqTagList

◆ preq

struct rtFileRequester * preq
static

◆ [struct]

struct { ... } preqTagList

◆ ReqToolsActive

BB_BOOL ReqToolsActive
static

◆ [struct]

struct { ... } RequestFTagList
Initial value:
= {
{ RTEZ_ReqTitle, 0 }, TAG_CENTERSCR, TAG_LOCKWINDOW,
{ RT_Underscore, '_' }, { RT_IDCMPFlags, 0 }, { TAG_END, 0 }
}

◆ [struct]

struct { ... } RequestTagList
Initial value:
= {
TAG_CENTERSCR, TAG_LOCKWINDOW, { RT_Underscore, '_' },
{ RTEZ_Flags, 0 }, { RTEZ_DefaultResponse, 1 }, { 0, 0 }, { TAG_END, 0 }
}

◆ returnvalue

ULONG returnvalue
static

◆ rtbase

struct Library* rtbase
static

◆ rtName

const char rtName[] = "reqtools.library"
static

◆ SaveTxt

const char SaveTxt[] = "Save"
static

◆ sddTagList

struct onetag sddTagList = { { RTFI_Dir, 0 }, { TAG_END, 0 } }
static

◆ Sfilenamestr

UBYTE* Sfilenamestr
static

◆ Sfilereq

struct rtFileRequester* Sfilereq
static

◆ [struct]

struct { ... } SfreqTagList
Initial value:
= {
TAG_LOCKWINDOW, { RTFI_OkText, (ULONG)SaveTxt }, { RTFI_Flags, FREQF_SAVE }, { TAG_END, 0 }
}
static const char SaveTxt[]
Definition neilsreqtoolslib.c:518

◆ smreq

struct rtScreenModeRequester* smreq
static

◆ [struct]

struct { ... } smRetType

◆ smTagList

struct lockflagstags smTagList
static
Initial value:
= {
TAG_LOCKWINDOW, { RTSC_Flags, SCREQF_SIZEGADS | SCREQF_DEPTHGAD }, { TAG_END, 0 }
}

◆ spTagList

struct onetag spTagList = { { RTFI_MatchPat, 0 }, { TAG_END, 0 } }
static

◆ styleflags

UWORD styleflags

◆ swsFreq

STRPTR swsFreq
static

◆ swsPreq

STRPTR swsPreq
static

◆ swsPtr

UBYTE* swsPtr
static

◆ swsSFreq

STRPTR swsSFreq
static

◆ swsTFreq

STRPTR swsTFreq
static

◆ Tfilenamestr

UBYTE* Tfilenamestr
static

◆ Tfilereq

struct rtFileRequester * Tfilereq
static

◆ version

const char version[]
static
Initial value:
=
"ReqTools V38 for Blitz Basic II V1.70b (c) Neil O'Rourke 20/07/94"

◆ ysize

UWORD ysize