diff --git a/second/glue.h b/second/glue.h index 07575a9..6fa46ae 100644 --- a/second/glue.h +++ b/second/glue.h @@ -18,6 +18,38 @@ struct MachineLocation }; typedef struct MachineLocation MachineLocation; +/* ParamBlockRec Structure: "Inside Macintosh: Files", p. 2-87 */ + +enum { + fsAtMark = 0, + fsFromStart = 1, + fsFromLEOF = 2, + fsFromMark = 3 +}; + +typedef struct ParamBlockRec ParamBlockRec_t; + +struct ParamBlockRec { + unsigned long qLink; /* next queue entry */ + unsigned short qType; /* queue type */ + unsigned short ioTrap; /* routine trap */ + unsigned long ioCmdAddr; /* routine address */ + unsigned long ioCompletion; /* pointer to completion routine */ + unsigned short ioResult; /* result code */ + unsigned long ioNamePtr; /* pointer to pathname */ + signed short ioVRefNum; /* volume specification */ + signed short ioRefNum; /* file reference number */ + signed char ioVersNum; /* version number */ + signed char ioPermssn; /* read/write permission */ + unsigned long ioMisc; /* miscellaneaous */ + unsigned long ioBuffer; /* data buffer */ + unsigned long ioReqCount; /* requested number of bytes */ + unsigned long ioActCount; /* actual number of bytes */ + unsigned short ioPosMode; /* positioning mode and newline char */ + signed long ioPosOffset; /* positionning offset */ +} __attribute__((packed)); + +#define ASSERT_PBR(a) if ( sizeof(ParamBlockRec_t) != 50 ) { a } extern void glue_display_properties(unsigned long *base, unsigned long *row_bytes, @@ -27,3 +59,4 @@ extern int Gestalt(unsigned long selector, long * response); extern void ReadLocation(MachineLocation * loc); extern void* NewPtr(unsigned long byteCount); extern void DisposePtr(void* ptr); +extern int PBReadSync(ParamBlockRec_t* paramBlock); diff --git a/tools/emile-first.h b/tools/emile-first.h index 30f471c..3b6f517 100644 --- a/tools/emile-first.h +++ b/tools/emile-first.h @@ -9,6 +9,8 @@ * i386 is little-endian */ +#include "../second/glue.h" + /* first level structure */ /* BootBlkHdr Structure: "Inside Macintosh: Files", p. 2-57 */ @@ -36,32 +38,6 @@ struct BootBlkHdr { #define ASSERT_BBH(a) if ( sizeof(BootBlkHdr_t) != 138 ) { a } -/* ParamBlockRec Structure: "Inside Macintosh: Files", p. 2-87 */ - -typedef struct ParamBlockRec ParamBlockRec_t; - -struct ParamBlockRec { - unsigned long qLink; /* next queue entry */ - unsigned short qType; /* queue type */ - unsigned short ioTrap; /* routine trap */ - unsigned long ioCmdAddr; /* routine address */ - unsigned long ioCompletion; /* pointer to completion routine */ - unsigned short ioResult; /* result code */ - unsigned long ioNamePtr; /* pointer to pathname */ - signed short ioVRefNum; /* volume specification */ - signed short ioRefNum; /* file reference number */ - signed char ioVersNum; /* version number */ - signed char ioPermssn; /* read/write permission */ - unsigned long ioMisc; /* miscellaneaous */ - unsigned long ioBuffer; /* data buffer */ - unsigned long ioReqCount; /* requested number of bytes */ - unsigned long ioActCount; /* actual number of bytes */ - unsigned short ioPosMode; /* positioning mode and newline char */ - signed long ioPosOffset; /* positionning offset */ -} __attribute__((packed)); - -#define ASSERT_PBR(a) if ( sizeof(ParamBlockRec_t) != 50 ) { a } - /* EMILE Boot block structure */ typedef struct eBootBlock eBootBlock_t;