BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
filereq_core.h File Reference
#include <exec/types.h>

Go to the source code of this file.

Functions

ULONG fq_request (void)
 Run the file requester with the parameters in fq_args.
void fq_finit (void)
 The end of the program: undo the requester's CD (fixed #157).

Variables

ULONG fq_args [4]
 The parameters of fq_request(), set before the call.
ULONG fq_maxlen [2]
 The most characters (without the 0) the caller's path and file buffers take, set before the call (fixed #1042).

Function Documentation

◆ fq_finit()

void fq_finit ( void )

The end of the program: undo the requester's CD (fixed #157).

The gadget "CD" makes the path the current directory of the process and keeps the directory before the first CD. fq_finit makes that directory current again and unlocks the requester's own lock (not a lock the program made current itself since); nothing when CD was not used. Called once at the end: freqlib's finit, the end of TED. Opens and closes dos.library itself.

◆ fq_request()

ULONG fq_request ( void )

Run the file requester with the parameters in fq_args.

Original entry: code+4 ($CA in freqlib), the parameter block in a0. Opens dos, intuition and graphics at every call and closes them at its end (fixed #154); the other fixed original bugs are listed in filereq_core.c.

Returns
the address of the result "path/file" (inside the data block), or 0 (cancel, close gadget, no memory/window; DIFF: the original returns an uninitialized long when memory, a library or the window cannot be opened)

Variable Documentation

◆ fq_args

ULONG fq_args[4]
extern

The parameters of fq_request(), set before the call.

The same order as the 4-long reqstruct of TED and the parameter block of freqlib:

  • [0] path buffer (160 bytes, in/out: the start path; on OK the path chosen; see fq_maxlen)
  • [1] file buffer (64 bytes, in/out: the start file; on OK the file chosen; see fq_maxlen)
  • [2] window title
  • [3] screen (0 = Workbench)

◆ fq_maxlen

ULONG fq_maxlen[2]
extern

The most characters (without the 0) the caller's path and file buffers take, set before the call (fixed #1042).

  • [0] path buffer
  • [1] file buffer

The requester takes the smaller of this and its own limit (159 for the path, 63 for the file: its buffers of 160 and 64 bytes). A start string, a click or a path that does not fit is refused with a notice in the screen title of the window. Initially no limit of the caller (0xFFFFFFFF): TED's buffers (192 and 64 bytes) hold what the requester's own do. freqlib sets the MaxLen of Pathname$ and Filename$ at every call.