|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
#include "filereq_env.h"#include "filereq_core.h"#include <dos/dos.h>#include <dos/dosextens.h>#include <intuition/intuition.h>#include <intuition/screens.h>#include <proto/dos.h>#include <proto/intuition.h>#include <proto/graphics.h>Data Structures | |
| struct | fq_params |
| struct | fq_border |
| struct | fq_line |
| struct | fq_data |
Macros | |
| #define | FQ_SWAP(r) |
| #define | FQ_LINES 64 |
| #define | FQ_MAXHEIGHT (FQ_LINES * 8 + 85) |
| #define | FQ_LDFLAGS (LDF_READ | LDF_VOLUMES | LDF_ASSIGNS | LDF_DEVICES) |
| #define | FQ_PATHMAX 159 |
| #define | FQ_FILEMAX 63 |
| #define | __NOLIBBASE__ |
| #define | DOS_BASE_NAME fq.dosbase |
| #define | INTUITION_BASE_NAME fq.intbase |
| #define | GRAPHICS_BASE_NAME fq.gfxbase |
| #define | W(p, o) |
| #define | L(p, o) |
| #define | B(p, o) |
| #define | P(p, o) |
| #define | FQ_BUTTON(next, x, w, flags, frame, text, id) |
| #define | FQ_BORDER(f, n, l, t, fp, bp, next, ...) |
| #define | FQ_BUTTONFRAME(f, w) |
| #define | FQ_SPC10 " " |
| #define | FQ_SPC80 |
| #define | FQ_LINE(n) |
| #define | FQ_LINES8(n) |
Functions | |
| static void | refresh (struct Gadget *gad, LONG n) |
| static ULONG | length (const UBYTE *s) |
| static ULONG | nodesize (const UBYTE *name) |
| static void | say (const UBYTE *msg) |
| static int | take (UBYTE *dst, const UBYTE *src, ULONG max) |
| static void | freelist (void) |
| static UWORD | addentry (UBYTE type, const UBYTE *name) |
| static void | fill (void) |
| static void | refreshlist (void) |
| static void | refreshprop (void) |
| static void | setpot (void) |
| static void | propbody (void) |
| static void | listrefresh (void) |
| static void | addvisible (UBYTE type, const UBYTE *name) |
| static void | redraw2 (void) |
| static ULONG | calctop (void) |
| static void | scrollpot (void) |
| static void | layout (UWORD d1, UWORD d2) |
| static void | redraw (void) |
| static ULONG | takemsg (struct IntuiMessage *m) |
| static ULONG | waitmsg (void) |
| static ULONG | pollmsg (void) |
| static int | currentpath (struct FileInfoBlock *fib) |
| static void | setheight (void) |
| static void | closelibs (void) |
| 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 | |
| static struct fq_data | fq |
| ULONG | fq_args [4] |
| The parameters of fq_request(), set before the call. | |
| static APTR | oldwinptr |
| static struct Process * | task |
| static UBYTE * | firstvis |
| static UWORD | code |
| static BPTR | startdir |
| static BPTR | cdlock |
| ULONG | fq_maxlen [2] = { 0xffffffffUL, 0xffffffffUL } |
| The most characters (without the 0) the caller's path and file buffers take, set before the call (fixed #1042). | |
| static ULONG | pathmax |
| static ULONG | filemax |
| static const UBYTE * | notice |
| static UBYTE * | stitle |
| static const UBYTE | msg_path [] = "Path too long" |
| static const UBYTE | msg_name [] = "Name too long" |
| #define __NOLIBBASE__ |
| #define B | ( | p, | |
| o ) |
| #define DOS_BASE_NAME fq.dosbase |
| #define FQ_BUTTONFRAME | ( | f, | |
| w ) |
| #define FQ_FILEMAX 63 |
| #define FQ_LDFLAGS (LDF_READ | LDF_VOLUMES | LDF_ASSIGNS | LDF_DEVICES) |
| #define FQ_LINE | ( | n | ) |
| #define FQ_LINES 64 |
| #define FQ_LINES8 | ( | n | ) |
| #define FQ_MAXHEIGHT (FQ_LINES * 8 + 85) |
| #define FQ_PATHMAX 159 |
| #define FQ_SPC10 " " |
| #define FQ_SPC80 |
| #define FQ_SWAP | ( | r | ) |
| #define GRAPHICS_BASE_NAME fq.gfxbase |
| #define INTUITION_BASE_NAME fq.intbase |
| #define L | ( | p, | |
| o ) |
| #define P | ( | p, | |
| o ) |
| #define W | ( | p, | |
| o ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| 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.
| 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.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| ULONG fq_args[4] |
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:
| ULONG fq_maxlen[2] = { 0xffffffffUL, 0xffffffffUL } |
The most characters (without the 0) the caller's path and file buffers take, set before the call (fixed #1042).
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.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |