home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
200-299
/
ff227.lzh
/
PickPacket
/
src
/
stfib.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-25
|
4KB
|
130 lines
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* |_o_o|\\ Copyright (c) 1989 The Software Distillery. *
* |. o.| || All Rights Reserved *
* | . | || Written by John Toebes and Doug Walker *
* | o | || The Software Distillery *
* | . |// 235 Trillingham Lane *
* ====== Cary, NC 27513 *
* BBS:(919)-471-6436 *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "pickpack.h"
#include "struct.h"
#include "fibgen.h"
static struct IntuiText IText =
{
1,0,JAM2, /* front and back text pens, drawmode and fill byte */
0,0, /* XY origin relative to container TopLeft */
&TOPAZ80, /* font pointer or NULL for default */
NULL, /* pointer to text */
NULL /* next IntuiText structure */
};
void stfibnew(nw, it, stnode)
struct NewWindow **nw;
struct IntuiText **it;
struct STNODE *stnode;
{
*nw = &NewWindowStructure1;
*it = NULL;
return;
}
/* Display the struct FileInfoBlock */
int stfibdisp(n)
struct STNODE *n;
{
char data[100];
char date[20];
int len;
char *p, *targ;
struct FileInfoBlock *fib;
INITTEXT(14)
BUG(1, ("stfibdisp: Entry, stnode 0x%08x window 0x%08x\n", n, n->w))
fib = n->d.fib;
sprintf(data, " fib_DiskKey: 0x%08x (Handler-Dependant)" , fib->fib_DiskKey);
SHOWTEXT
if (fib->fib_DirEntryType < 0) p = "(PLAIN FILE)";
else p = "(DIRECTORY) ";
sprintf(data, "fib_DirEntryType: %10d %s", fib->fib_DirEntryType, p);
SHOWTEXT
p = fib->fib_FileName;
len = *p++;
if (len > 32 | len < 0) len = 32;
strcpy(data, " fib_FileName: ");
targ = data+strlen(data);
memset(targ, ' ', 32);
memcpy(targ, p, len);
targ[32] = 0;
SHOWTEXT
sprintf(data, " fib_Protection: 0x%08x (Protect: --------)", fib->fib_Protection);
/* 01234567890123456789012345678901234567890123"
/* We probably want to interpret the protection bits too */
if (fib->fib_Protection & FIBF_SCRIPT) data[36] = 'S';
if (fib->fib_Protection & FIBF_PURE) data[37] = 'P';
if (fib->fib_Protection & FIBF_ARCHIVE) data[38] = 'A';
if (!(fib->fib_Protection & FIBF_READ)) data[39] = 'R';
if (!(fib->fib_Protection & FIBF_WRITE)) data[40] = 'W';
if (!(fib->fib_Protection & FIBF_EXECUTE)) data[41] = 'E';
if (!(fib->fib_Protection & FIBF_DELETE)) data[42] = 'D';
SHOWTEXT
if (fib->fib_EntryType < 0) p = "(PLAIN FILE)";
else p = "(DIRECTORY) ";
sprintf(data, " fib_EntryType: %10d %s", fib->fib_EntryType, p);
SHOWTEXT
sprintf(data, " fib_Size: %10d (File size in bytes)", fib->fib_Size);
SHOWTEXT
sprintf(data, " fib_NumBlocks: %10d (File size in blks)", fib->fib_NumBlocks);
SHOWTEXT
FormatDate(&fib->fib_Date, date);
sprintf(data, " fib_DateStamp: %s (See below)", date);
SHOWTEXT
sprintf(data, " ds_Days: %10d (Days since 1978)", fib->fib_Date.ds_Days);
SHOWTEXT
sprintf(data, "ds_Minute: %10d (Min since midnight)", fib->fib_Date.ds_Minute);
SHOWTEXT
sprintf(data, " ds_Tick: %10d (50 ticks/sec)", fib->fib_Date.ds_Tick);
SHOWTEXT
p = fib->fib_Comment;
len = *p++;
if (len > 30) len = 30;
sprintf(data, " fib_Comment: ");
targ = data+strlen(data);
memset(targ, ' ', 30);
memcpy(targ, p, len);
targ[30] = 0;
SHOWTEXT
memset(data, ' ', 50);
p = fib->fib_Comment;
len = *p++ - 30;
if (len > 0)
memcpy(data+5, p, len);
data[50] = 0;
SHOWTEXT
BUG(1, ("stfibdisp: Exit\n"))
return(RC_OK);
}