Commit 41c45883 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Rationalise some defines

Many magic numbers changed to exported defines.
Eliminated unused "BOOTblock.h" (was just nesting 1 include file).
Moved non ASCII definitions out of "ASCII.h" then found the remainder weren't used => eliminated.

Version 0.98. Tagged as 'DOSFS-0_98'
parent 82f8405a
......@@ -22,7 +22,7 @@ OBJS = DOSFS DOSFSctl DOSclusters DOSdirs DOSnaming Helpers MsgTrans \
ROM_OBJS = ${OBJS} init
ROMCDEFINES = -DROM
CMHGDEFINES = ${CDEFINES}
CMHGDEPENDS = DOSFS
CMHGDEPENDS = DOSFS MsgTrans
ASMHDRS = DOSFS
HDRS =
CINCLUDES = -IC:
......
/* (0.97)
/* (0.98)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.97
#define Module_MajorVersion_CMHG 0.98
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Dec 2012
#define Module_Date_CMHG 13 Jan 2013
#define Module_MajorVersion "0.97"
#define Module_Version 97
#define Module_MajorVersion "0.98"
#define Module_Version 98
#define Module_MinorVersion ""
#define Module_Date "07 Dec 2012"
#define Module_Date "13 Jan 2013"
#define Module_ApplicationDate "07-Dec-12"
#define Module_ApplicationDate "13-Jan-13"
#define Module_ComponentName "DOSFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/ImageFS/DOSFS"
#define Module_FullVersion "0.97"
#define Module_HelpVersion "0.97 (07 Dec 2012)"
#define Module_LibraryVersionInfo "0:97"
#define Module_FullVersion "0.98"
#define Module_HelpVersion "0.98 (13 Jan 2013)"
#define Module_LibraryVersionInfo "0:98"
......@@ -26,12 +26,12 @@
#include "swis.h"
#include "DebugLib/DebugLib.h"
#include "AsmUtils/rminfo.h"
#include "Interface/HighFSI.h"
#undef DOSFS_DiscFormat
#undef DOSFS_LayoutStructure
#include "DOSFS.h"
#include "ASCII.h"
#include "TIMEconv.h"
#include "Helpers.h"
#include "Ops.h"
......@@ -41,7 +41,6 @@
#include "DOSnaming.h"
#include "DOSshape.h"
#include "DOSdirs.h"
#include "BOOTblock.h"
#include "MultiFS.h"
#include "Statics.h"
#include "DOSFShdr.h"
......@@ -71,7 +70,6 @@ FS_datestamp tstamp ;
FS_cat_entry fcat ;
FS_dir_block dblock ;
FS_free_space fspace ;
char tline[MaxString] = {0} ; /* static filename return area */
/* These are used to create the MessageTrans tokens for the format menu
* and help text.
......@@ -791,7 +789,7 @@ static _kernel_oserror *FSSWI_LayoutStructure(_kernel_swi_regs *rset,void *priva
}
/* write the BOOT BLOCK into the image */
reglist.r[0] = osgbpb_wptr ; /* write operation */
reglist.r[0] = OSGBPB_WriteAtGiven ; /* write operation */
reglist.r[1] = rset->r[3] ; /* FileSwitch handle */
reglist.r[2] = (word)dbsector ; /* data address */
reglist.r[3] = DOSsecsize ; /* amount of data */
......@@ -816,7 +814,7 @@ static _kernel_oserror *FSSWI_LayoutStructure(_kernel_swi_regs *rset,void *priva
sector[1] = 0xFF ;
sector[2] = 0xFF ;
for (loop = 0; loop < FATsize; loop++) {
reglist.r[0] = osgbpb_wptr ; /* write operation */
reglist.r[0] = OSGBPB_WriteAtGiven ; /* write operation */
reglist.r[1] = rset->r[3] ; /* FileSwitch handle */
reglist.r[2] = (word)sector ; /* data address */
reglist.r[3] = DOSsecsize ; /* amount of data */
......@@ -851,11 +849,11 @@ static _kernel_oserror *FSSWI_LayoutStructure(_kernel_swi_regs *rset,void *priva
/* Write the root directory. */
for (loop = 0; loop < ROOTsize; loop++) {
int i;
reglist.r[0] = osgbpb_wptr ; /* write operation */
reglist.r[1] = rset->r[3] ; /* FileSwitch handle */
reglist.r[2] = (word)sector ; /* data address */
reglist.r[3] = DOSsecsize ; /* amount of data */
reglist.r[4] = offset ; /* destination image offset */
reglist.r[0] = OSGBPB_WriteAtGiven ; /* write operation */
reglist.r[1] = rset->r[3] ; /* FileSwitch handle */
reglist.r[2] = (word)sector ; /* data address */
reglist.r[3] = DOSsecsize ; /* amount of data */
reglist.r[4] = offset ; /* destination image offset */
reglist.r[5] = NULL ;
reglist.r[6] = NULL ;
if ((rerror = _kernel_swi(OS_GBPB,&reglist,&reglist)) != NULL)
......@@ -963,7 +961,7 @@ void fs_service(int service_number,_kernel_swi_regs *rset,void *privateword)
sprintf(&tbuff[strlen(tbuff)],"%c",cchr) ;
}
sprintf(&tbuff[strlen(tbuff)]," %03X\n",cptr->ROtype) ;
reglist.r[0] = osgbpb_write ; /* write operation */
reglist.r[0] = OSGBPB_WriteAtPTR ; /* write operation */
reglist.r[1] = rset->r[2] ; /* FileSwitch handle */
reglist.r[2] = (word)tbuff ; /* data address */
reglist.r[3] = strlen(tbuff) ; /* amount of data */
......
......@@ -24,7 +24,6 @@
#include "DebugLib/DebugLib.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "TIMEconv.h"
#include "Helpers.h"
#include "MsgTrans.h"
......
......@@ -21,10 +21,10 @@
#include <string.h>
#include <stddef.h>
#include "kernel.h"
#include "Interface/HighFSI.h"
#include "DebugLib/DebugLib.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "TIMEconv.h"
#include "Helpers.h"
#include "MsgTrans.h"
......@@ -1012,8 +1012,8 @@ int write_dirinfo(char *fname,word bitmap,word loadaddr,word execaddr,word attr,
/* preserve directory bit over attr change (should possibly do archive) */
if (bitmap & (1 << wdi_ATTR)) {
if ((dentry->FILE_attribute & FILE_subdir) != 0) {
if ((attr & objectlocked) == 0)
attr |= ownerwrite;
if ((attr & locked_attribute) == 0)
attr |= write_attribute;
dentry->FILE_attribute = RISCOStoDOSattributes(attr) | FILE_subdir;
} else
dentry->FILE_attribute = RISCOStoDOSattributes(attr) ;
......@@ -1180,7 +1180,7 @@ FS_dir_block *read_dir(int rtype,char *fname,word dest,word num,word off,word bl
entries->execaddr = le.lo ;
entries->flength = dentry->FILE_size ;
entries->attributes = DOStoRISCOSattributes(dentry) ;
entries->type = (((dentry->FILE_attribute & FILE_subdir) == 0) ? object_file : object_dir) ;
entries->type = (((dentry->FILE_attribute & FILE_subdir) == 0) ? object_file : object_directory) ;
}
dprintf(("","read_dir: file name = %s\n",cfile));
/* copy the filename into the destination structure */
......
......@@ -19,11 +19,11 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "kernel.h"
#include "DebugLib/DebugLib.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "TIMEconv.h"
#include "ADFSshape.h"
#include "Helpers.h"
......
......@@ -19,17 +19,21 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "kernel.h"
#include "swis.h"
#include "Global/FileTypes.h"
#include "Interface/MimeMap.h"
#include "Interface/HighFSI.h"
#include "DebugLib/DebugLib.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "TIMEconv.h"
#include "ADFSshape.h"
#include "Helpers.h"
#include "MsgTrans.h"
#include "DOSnaming.h"
#include "DOSclusters.h"
#include "DOSshape.h"
#include "debug.h"
......@@ -141,7 +145,7 @@ void map_FILE_ROStype(DOS_direntry *dentry,char* dosext,time5byte *le)
if (value == -1)
{
dprintf(("","filetype lookup -%s- not found.. default to DOS\n",dosext ));
value = DOStype;
value = FileType_MSDOS;
}
le->hi = (le->hi & ~ADFStypemask) | (value << ADFStypeshift) ;
return;
......@@ -165,7 +169,7 @@ void update_loadexec(DOS_direntry *dentry,word ld,word ex)
dprintf(("","update_loadexec: dentry = &%08X, ld = &%08X, ex = &%08X\n",(word)dentry,ld,ex));
if (cROStype == DOStype)
if (cROStype == FileType_MSDOS)
{
erase_ROStype(dentry) ; /* remove any possible RISC OS file-type */
}
......@@ -256,7 +260,7 @@ word DOStoRISCOSattributes(DOS_direntry *dentry)
/* all objects start read/write */
if ((dentry->FILE_attribute & FILE_subdir) == 0)
aval |= (ownerread | ownerwrite) ;
aval |= (read_attribute | write_attribute) ;
for (loop=0; (loop < 8); loop++)
{
......@@ -266,9 +270,9 @@ word DOStoRISCOSattributes(DOS_direntry *dentry)
{
case FILE_readonly :
#if !ReadOnlyMapsLocked /* JRS 9/3/92 map DOS ReadOnly bit to RISC OS Locked bit only */
aval &= ~ownerwrite ;
aval &= ~write_attribute ;
#endif
aval |= objectlocked ;
aval |= locked_attribute ;
break ;
/* JRS: 4/3/92 This conflicts with NetFS use of these bits */
......@@ -302,9 +306,9 @@ unsigned char RISCOStoDOSattributes(word ROSattr)
/* NOT owner write then set the readonly flag */
#if ReadOnlyMapsLocked /* JRS 9/3/92 map DOS ReadOnly bit to RISC OS Locked bit only */
if (ROSattr & objectlocked)
if (ROSattr & locked_attribute)
#else
if ((ROSattr & ownerwrite) == 0 || (ROSattr & objectlocked) != 0)
if ((ROSattr & write_attribute) == 0 || (ROSattr & locked_attribute) != 0)
#endif
aval |= FILE_readonly ;
......@@ -343,7 +347,7 @@ int DOS_image_RW(int op,word sec,int off,byte *ma,word nbytes,DOSdisc *ihand)
dprintf(("","DOS_image_RW: handle = &%08X, disc address = &%08X\n",ihand->disc_fhand,discaddress));
/* transfer the bytes */
reglist.r[0] = ((op == Rdata) ? osgbpb_rptr : osgbpb_wptr) ;
reglist.r[0] = ((op == Rdata) ? OSGBPB_ReadFromGiven : OSGBPB_WriteAtGiven) ;
reglist.r[1] = ihand->disc_fhand ; /* FileSwitch handle */
reglist.r[2] = (word)ma ;
reglist.r[3] = nbytes ;
......
......@@ -22,6 +22,7 @@
#include "kernel.h"
#include "swis.h"
#include "DOSFSHdr.h"
#include "MsgTrans.h"
#include "debug.h"
......@@ -38,7 +39,7 @@ static _kernel_oserror *msgtrans_openfile(void)
if (!file_closed)
return NULL;
r.r[0] = (int)file_data;
r.r[1] = (int)ResourceFile;
r.r[1] = (int)Module_MessagesFile;
r.r[2] = 0;
if ((err = _kernel_swi(MessageTrans_OpenFile, &r, &r)) != NULL)
return err;
......
......@@ -21,7 +21,6 @@
#include "DebugLib/DebugLib.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "DOSshape.h"
#include "Ops.h"
#include "DOSclusters.h"
......
......@@ -22,9 +22,9 @@
#include <stdlib.h>
#include "kernel.h"
#include "DebugLib/DebugLib.h"
#include "Interface/HighFSI.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "TIMEconv.h"
#include "Helpers.h"
#include "Ops.h"
......@@ -41,6 +41,7 @@ char *DOSFS_save_file(char *fn,word ld,word ex,char *bs,char *end,DOSdisc *ih)
char *DOSname ; /* full DOS pathname */
char *leafname ; /* pointer to the leafname of "DOSname" */
DOS_direntry *dentry ; /* directory entry structure pointer */
static char tline[MaxString] = "" ; /* static filename return area */
/* in:
* fn : NULL terminated ASCII pathname, relative to ROOT of image
......@@ -115,7 +116,7 @@ FS_cat_entry *DOSFS_read_cat(char *fname,DOSdisc *ihand)
dprintf(("","\n\nDOSFS_read_cat: \"%s\"\n",((fname == NULL) ? "" : fname)));
/* defaults */
fcat.type = no_object ;
fcat.type = object_nothing ;
fcat.loadaddr = 0x00000000 ;
fcat.execaddr = 0x00000000 ;
fcat.filelen = 0x00000000 ;
......@@ -159,7 +160,7 @@ FS_cat_entry *DOSFS_read_cat(char *fname,DOSdisc *ihand)
read_loadexec(dentry,dosext,&le) ; /* get the load/exec information */
fcat.type = (((dentry->FILE_attribute & FILE_subdir) == 0) ? object_file : object_dir) ;
fcat.type = (((dentry->FILE_attribute & FILE_subdir) == 0) ? object_file : object_directory) ;
/* construct suitable RISC OS fields */
fcat.loadaddr = le.hi ;
......@@ -351,7 +352,7 @@ FS_cat_entry *DOSFS_delete(char *fname,DOSdisc *ihand)
freeclusters(get_FILE_cluster(dentry,ihand), ihand);
if ((value = ensure_FATs(ihand)) == 0) {
/* construct the return information */
fcat.type = (((dentry->FILE_attribute & FILE_subdir) == 0) ? object_file : object_dir) ;
fcat.type = (((dentry->FILE_attribute & FILE_subdir) == 0) ? object_file : object_directory) ;
fcat.loadaddr = le.hi ;
fcat.execaddr = le.lo ;
fcat.filelen = dentry->FILE_size ;
......
......@@ -24,7 +24,6 @@
#include "DebugLib/DebugLib.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "TIMEconv.h"
#include "ADFSshape.h"
#include "Helpers.h"
......
......@@ -22,10 +22,10 @@
#include <string.h>
#include "kernel.h"
#include "swis.h"
#include "Interface/HighFSI.h"
#include "DebugLib/DebugLib.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "TIMEconv.h"
#include "Helpers.h"
#include "Ops.h"
......@@ -325,7 +325,7 @@ DOSdisc *DOSFS_image_open(word fshand,word buffsize)
/* read the BOOT BLOCK from the image */
/* This code RELIES on (DOS_BOOT_sector == DOS_PARTITION_sector) */
discaddress = (DOS_BOOT_sector - 1) * DOSsecsize ;
reglist.r[0] = osgbpb_rptr ; /* read operation */
reglist.r[0] = OSGBPB_ReadFromGiven ; /* read operation */
reglist.r[1] = fshand ; /* FileSwitch handle */
reglist.r[2] = (word)dboot ; /* destination address */
reglist.r[3] = DOSsecsize ; /* fixed in MS-DOS */
......@@ -397,7 +397,7 @@ DOSdisc *DOSFS_image_open(word fshand,word buffsize)
*/
discaddress = ((DOS_BOOT_sector - 1) * DOSsecsize) + winioffset ;
reglist.r[0] = osgbpb_rptr ;
reglist.r[0] = OSGBPB_ReadFromGiven ;
reglist.r[1] = fshand ;
reglist.r[2] = (word)dboot ;
reglist.r[3] = DOSsecsize ;
......
......@@ -22,7 +22,6 @@
#include "DebugLib/DebugLib.h"
#include "DOSFS.h"
#include "ASCII.h"
#include "Ops.h"
#include "DOSclusters.h"
#include "debug.h"
......
......@@ -22,12 +22,15 @@
#include <time.h>
#include "kernel.h"
#include "swis.h"
#include "Global/FileTypes.h"
#include "Global/OSWords.h"
#include "debug.h"
#include "DOSFS.h"
#include "TIMEconv.h"
#include "MsgTrans.h"
#include "DOSshape.h"
#include "ADFSshape.h"
#include "debug.h"
/*---------------------------------------------------------------------------*/
......@@ -275,7 +278,7 @@ void MSDOStoRISCOS(word MStime,word MSdate,time5byte *outtime)
outtime->hi = ((ADFStimestamp | (outtime->hi & 0xFF)) & ~ADFStypemask) ;
/* and add in the DOS file-type identifier */
outtime->hi |= (DOStype << ADFStypeshift) ;
outtime->hi |= (FileType_MSDOS << ADFStypeshift) ;
return ;
}
......@@ -354,7 +357,7 @@ time5byte *get_RISCOS_TIME(time5byte *timebuff)
/* specify the format we wish to read the clock in */
newTIME->lo = clock_5byte ;
reglist.r[0] = OSWORD_readclock ;
reglist.r[0] = OsWord_ReadRealTimeClock ;
reglist.r[1] = (word)newTIME ;
_kernel_swi(OS_Word,&reglist,&reglist) ;
......
......@@ -98,8 +98,6 @@ typedef struct {
#define oldmapsize (0x0200)
#define dirsize (0x0800)
#define ADFSderr (0x0108C7) /* general ADFS disc transfer error */
#define maxverifybad (16) /* maximum number of retries attempted */
#define oldLWM (0x0E00)
......@@ -198,11 +196,6 @@ typedef enum {
ADFSinterrupted /* ADFS operation interrupted (ESCAPE) */
} ADFSstates ;
/* Explicit error numbers returned by ADFS */
#define ADFSerr_escape (0x00010811)
#define ADFSerr_writeprotect (0x000108C9)
#define ADFSerr_nodisc (0x000108D3)
/*-------------------------------------------------------------------------*/
/* ADFS time stamping:
*
......@@ -215,108 +208,4 @@ typedef enum {
#define ADFStypemask (0x000FFF00) /* file type mask */
#define ADFStypeshift (8)
/*-------------------------------------------------------------------------*/
/* Generic IO accessing */
typedef volatile unsigned char *const port ; /* byte wide IO location */
typedef volatile unsigned int *const wport ; /* word wide IO location */
/* IOC layout */
#define IOC ((port)0x03200000)
#define IOC_ctrl (IOC[0x00])
#define IOC_ser_data (IOC[0x04])
#define IOC_irqA_stat (IOC[0x10])
#define IOC_irqA_req (IOC[0x14])
#define IOC_irqA_clr (IOC[0x14])
#define IOC_irqA_mask (IOC[0x18])
#define IOC_irqB_stat (IOC[0x20])
#define IOC_irqB_req (IOC[0x24])
#define IOC_irqB_mask (IOC[0x28])
#define IOC_fiq_stat (IOC[0x30])
#define IOC_fiq_req (IOC[0x34])
#define IOC_fiq_mask (IOC[0x38])
#define IOC_t0_clow (IOC[0x40])
#define IOC_t0_chigh (IOC[0x44])
#define IOC_t0_llow (IOC[0x40])
#define IOC_t0_lhigh (IOC[0x44])
#define IOC_t0_go (IOC[0x48])
#define IOC_t0_latch (IOC[0x4C])
#define IOC_t1_clow (IOC[0x50])
#define IOC_t1_chigh (IOC[0x54])
#define IOC_t1_llow (IOC[0x50])
#define IOC_t1_lhigh (IOC[0x54])
#define IOC_t1_go (IOC[0x58])
#define IOC_t1_latch (IOC[0x5C])
#define IOC_t2_clow (IOC[0x60])
#define IOC_t2_chigh (IOC[0x64])
#define IOC_t2_llow (IOC[0x60])
#define IOC_t2_lhigh (IOC[0x64])
#define IOC_t2_go (IOC[0x68])
#define IOC_t2_latch (IOC[0x6C])
#define IOC_t3_clow (IOC[0x70])
#define IOC_t3_chigh (IOC[0x74])
#define IOC_t3_llow (IOC[0x70])
#define IOC_t3_lhigh (IOC[0x74])
#define IOC_t3_go (IOC[0x78])
#define IOC_t3_latch (IOC[0x7C])
#define IOC_t_clow(n) (IOC[0x40+(n<<4)])
#define IOC_t_chigh(n) (IOC[0x44+(n<<4)])
#define IOC_t_llow(n) (IOC[0x40+(n<<4)])
#define IOC_t_lhigh(n) (IOC[0x44+(n<<4)])
#define IOC_t_go(n) (IOC[0x48+(n<<4)])
#define IOC_t_latch(n) (IOC[0x4C+(n<<4)])
/* floppy disc controller: */
#ifdef A500
/* A500s have 1793 */
# define FDC_latch (*(port)0x03360000)
# define FDC_base ((port)0x03290000)
#else
/* Archimedes have 1772 */
# define FDC_latch (*(port)0x03350040)
# define FDC_base ((port)0x03310000)
# define discchanged (0x10)
#endif /* A500 */
/* floppy latch bits (negated) */
#define FDC_sel_0 0xFE /* select drive 0 */
#define FDC_sel_1 0xFD /* select drive 1 */
#define FDC_sel_2 0xFB /* select drive 2 */
#define FDC_sel_3 0xF7 /* select drive 3 */
#define FDC_selside 0xEF /* select head */
#define FDC_motoron 0xDF /* motor on */
#define FDC_inuse 0xBF /* drive in use */
#define FDC_reset 0x7F /* disc changed and reset */
#define FDC_unset 0xFF /* no flags set */
/* eg FDC_latch = (FDC_inuse & FDC_motoron & FDC_reset) ; */
/* 1772 registers */
#define FDC_ctrl (FDC_base[0x00]) /* WRITE */
#define FDC_stat (FDC_base[0x00]) /* READ */
#define FDC_track (FDC_base[0x04])
#define FDC_sector (FDC_base[0x08])
#define FDC_data (FDC_base[0x0C])
#ifdef A500
# define IOC_disc_changed() (IOC_ctrl & 0x04)
#else /* A500 */
# define IOC_disc_changed() (IOC_irqB_stat & discchanged)
#endif /* A500 */
/*-------------------------------------------------------------------------*/
#endif /* __h_ADFSshape */
/*-------------------------------------------------------------------------*/
/*> EOF h.ADFSshape <*/
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*> h.ASCII <*/
/*-------------------------------------------------------------------------*/
/* Standard ASCII character definitions Copyright (c) 1989, JGSmith */
/*-------------------------------------------------------------------------*/
#ifndef __h_ASCII
#define __h_ASCII
/*-------------------------------------------------------------------------*/
/* standard types and MACROs */
typedef unsigned char byte ;
typedef unsigned int word ;
typedef void (*VoidFnPtr)() ; /* ptr to fn returning void */
typedef word (*WordFnPtr)() ; /* ptr to fn returning word */
#define wordalign(v) ((v + (sizeof(int)-1)) & -sizeof(int))
/*-------------------------------------------------------------------------*/
/* system-wide manifests */
#define Rdata (1) /* read data */
#define Wdata (2) /* write data */
#define Wzero (4) /* write zeros */
/*-------------------------------------------------------------------------*/
/* RISC OS filing system definitions */
#define open_read (0) /* open for reading only */
#define create_update (1) /* create and open for read/write */
#define open_update (2) /* open for read/write */
#define no_object (0) /* object not found */
#define object_file (1) /* object is a file */
#define object_dir (2) /* object is a directory */
/* object attributes */
#define FSdependant (0xFFFFFF00) /* filing system dependant flags */
#define FSindependant (0x000000FF) /* standard attribute flags */
/* independant flags (all unused flags should be 0) */
#define ownerread (1 << 0) /* readable by owner */
#define ownerwrite (1 << 1) /* writable by owner */
#define objectlocked (1 << 3) /* not deletable by owner */
#define publicread (1 << 4) /* readable by others */
#define publicwrite (1 << 5) /* writeable by others */
#define publiclocked (1 << 7) /* not deletable by others */
/* acceptable characters in RISC OS filenames */
#define ROvalid "*#ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~`!()_-+={}[];'<>,?//"
/* Special RISC OS (FileSwitch) characters:
* "$" ROOT directory
* "&" User Root Directory
* "%" currently selected LIBrary
* "\" previous directory
* "@" current directory
* "^" parent directory
*/
/*-------------------------------------------------------------------------*/
/* these should really be in "swi.h" in the standard library headers */
/* SERVICEs: */
#define Service_ReleaseFIQ (0x0B)
#define Service_ClaimFIQ (0x0C)
/* OSBYTEs: */
#define OSBYTE_readpos (0x86)
/* OSWORDs: */
#define OSWORD_readclock (0x0E)
#define clock_textin (0)
#define clock_BCDin (1)
#define clock_BCDout (2)
#define clock_5byte (3)
/* OSFILEs: */
/* OSGBPBs: */
#define osgbpb_wptr (0x01)
#define osgbpb_write (0x02)
#define osgbpb_rptr (0x03)
#define osgbpb_read (0x04)
/* OSFINDs: */
#define osfind_openin (0x40)
#define osfind_openout (0x80)
#define osfind_openup (0xC0)
/* FSCONTROLs: */
#define FSControl_AddFS (0x0C)