BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
filereq_core.h
Go to the documentation of this file.
1/*
2 * filereq_core.h - the file requester of Blitz Basic 2 (filereq_core.c),
3 * shared by freqlib (libs-c/libs/freqlib.c) and TED (ted-c/src/filereq.c).
4 * Each program compiles filereq_core.c itself and provides filereq_env.h.
5 */
6#ifndef FILEREQ_CORE_H
7#define FILEREQ_CORE_H
8
9#include <exec/types.h>
10
11/**
12 * @brief The parameters of fq_request(), set before the call.
13 *
14 * The same order as the 4-long `reqstruct` of TED and the parameter block
15 * of freqlib:
16 * - [0] path buffer (160 bytes, in/out: the start path; on OK the path
17 * chosen; see fq_maxlen)
18 * - [1] file buffer (64 bytes, in/out: the start file; on OK the file
19 * chosen; see fq_maxlen)
20 * - [2] window title
21 * - [3] screen (0 = Workbench)
22 */
23extern ULONG fq_args[4];
24
25/**
26 * @brief The most characters (without the 0) the caller's path and file
27 * buffers take, set before the call (fixed #1042).
28 *
29 * - [0] path buffer
30 * - [1] file buffer
31 *
32 * The requester takes the smaller of this and its own limit (159 for the
33 * path, 63 for the file: its buffers of 160 and 64 bytes). A start
34 * string, a click or a path that does not fit is refused with a notice in
35 * the screen title of the window. Initially no limit of the caller
36 * (0xFFFFFFFF): TED's buffers (192 and 64 bytes) hold what the
37 * requester's own do. freqlib sets the MaxLen of Pathname$ and Filename$
38 * at every call.
39 */
40extern ULONG fq_maxlen[2];
41
42/**
43 * @brief Run the file requester with the parameters in fq_args.
44 *
45 * Original entry: code+4 ($CA in freqlib), the parameter block in a0.
46 * Opens dos, intuition and graphics at every call and closes them at its
47 * end (fixed #154); the other fixed original bugs are listed in
48 * filereq_core.c.
49 *
50 * @return the address of the result "path/file" (inside the data block),
51 * or 0 (cancel, close gadget, no memory/window; DIFF: the original
52 * returns an uninitialized long when memory, a library or the
53 * window cannot be opened)
54 */
55ULONG fq_request(void);
56
57/**
58 * @brief The end of the program: undo the requester's CD (fixed #157).
59 *
60 * The gadget "CD" makes the path the current directory of the process and
61 * keeps the directory before the first CD. fq_finit makes that directory
62 * current again and unlocks the requester's own lock (not a lock the
63 * program made current itself since); nothing when CD was not used.
64 * Called once at the end: freqlib's finit, the end of TED. Opens and
65 * closes dos.library itself.
66 */
67void fq_finit(void);
68
69#endif
ULONG fq_maxlen[2]
The most characters (without the 0) the caller's path and file buffers take, set before the call (fix...
Definition filereq_core.c:266
ULONG fq_args[4]
The parameters of fq_request(), set before the call.
Definition filereq_core.c:254
void fq_finit(void)
The end of the program: undo the requester's CD (fixed #157).
Definition filereq_core.c:1105
ULONG fq_request(void)
Run the file requester with the parameters in fq_args.
Definition filereq_core.c:716