home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
archimedes.tar.gz
/
archimedes.tar
/
ararthur.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-01
|
2KB
|
68 lines
/* > h.arthur
** Fake arthur.h for Acorn C compilers V4 or greater
** which no longer supply it.
** Even if you have arthur.h, this must be used instead as the
** functions defined in the original are no longer present in
** the C library.
*/
#ifndef _FAKE_ARTHUR
#define _FAKE_ARTHUR
#include "swis.h"
#include "kernel.h"
#include "bbc.h" /* From RISC OS Lib */
/* Map structure names */
#define error _kernel_oserror
#define reg_set _kernel_swi_regs
/* Define structures */
/* These two conveniently map directly to _kernel_swi_regs structures
* thus simplifying osfile() and osgbpb() functions.
*/
typedef struct {
int action; /* specifies action of osgbpb */
int file_handle; /* file handle, but may be used as a char *
* pointing to wildcarded dir-name */
char *data_addr; /* memory address of data */
int number; /* number of entries to read */
int seq_point; /* starting entry number */
int buf_len; /* output buffer length */
char *wild_fld; /* points to wildcarded filename to match */
int reserved[3]; /* space to allow treatment as reg_set */
} osgbpb_block;
typedef struct
{
int action; /* action or object type if output data */
char *name; /* pointer to filename or pathname */
int loadaddr; /* load address */
int execaddr; /* exec address */
int start; /* start address/length */
int end; /* end address/attributes */
int reserved[4]; /* space to allow treatment as reg_set */
} osfile_block;
/* Map function names */
#define swix(N,R) _kernel_swi(N, R, R)
#define osbyte(X) _kernel_swi(OS_Byte, X, X)
#define osfind(X) _kernel_swi(OS_Find, X, X)
#define osfile(X) _kernel_swi(OS_File, (reg_set*)X, (reg_set*)X)
#define osgbpb(X) _kernel_swi(OS_GBPB, (reg_set*)X, (reg_set*)X)
#define vdu(X) bbc_vdu(X)
#define mode(X) bbc_mode(X)
/* Define functions */
/* old OS_Word returns error block, new OS_Word returns integer */
#define osword(N,P) \
( (_kernel_osword(N,P)<0) ? _kernel_last_oserror() : NULL )
#endif /* _FAKE_ARTHUR */