home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-16 | 36.8 KB | 1,192 lines |
- #ifndef osfile_H
- #define osfile_H
-
- /* C header file for OSFile
- * written by DefMod (Sep 7 1994) on Fri Sep 16 13:26:28 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef OS_File
- #define OS_File 0x8
- #undef XOS_File
- #define XOS_File 0x20008
- #undef OSFile_SaveStamped
- #define OSFile_SaveStamped 0xA
- #undef OSFile_Write
- #define OSFile_Write 0x1
- #undef OSFile_WriteLoad
- #define OSFile_WriteLoad 0x2
- #undef OSFile_WriteExec
- #define OSFile_WriteExec 0x3
- #undef OSFile_WriteAttr
- #define OSFile_WriteAttr 0x4
- #undef OSFile_Stamp
- #define OSFile_Stamp 0x9
- #undef OSFile_SetType
- #define OSFile_SetType 0x12
- #undef OSFile_Delete
- #define OSFile_Delete 0x6
- #undef OSFile_CreateStamped
- #define OSFile_CreateStamped 0xB
- #undef OSFile_CreateDir
- #define OSFile_CreateDir 0x8
- #undef OSFile_LoadStamped
- #define OSFile_LoadStamped 0xFF
- #undef OSFile_LoadStampedPath
- #define OSFile_LoadStampedPath 0xC
- #undef OSFile_LoadStampedPathVar
- #define OSFile_LoadStampedPathVar 0xE
- #undef OSFile_LoadStampedNoPath
- #define OSFile_LoadStampedNoPath 0x10
- #undef OSFile_MakeError
- #define OSFile_MakeError 0x13
- #undef OSFile_ReadStamped
- #define OSFile_ReadStamped 0x14
- #undef OSFile_ReadStampedPath
- #define OSFile_ReadStampedPath 0x15
- #undef OSFile_ReadStampedPathVar
- #define OSFile_ReadStampedPathVar 0x16
- #undef OSFile_ReadStampedNoPath
- #define OSFile_ReadStampedNoPath 0x17
- #undef OSFile_ReadBlockSize
- #define OSFile_ReadBlockSize 0x18
- #undef OSFile_Save
- #define OSFile_Save 0x0
- #undef OSFile_Read
- #define OSFile_Read 0x5
- #undef OSFile_ReadPath
- #define OSFile_ReadPath 0xD
- #undef OSFile_ReadPathVar
- #define OSFile_ReadPathVar 0xF
- #undef OSFile_ReadNoPath
- #define OSFile_ReadNoPath 0x11
- #undef OSFile_Create
- #define OSFile_Create 0x7
- #undef OSFile_Load
- #define OSFile_Load 0xFF
- #undef OSFile_LoadPath
- #define OSFile_LoadPath 0xC
- #undef OSFile_LoadPathVar
- #define OSFile_LoadPathVar 0xE
- #undef OSFile_LoadNoPath
- #define OSFile_LoadNoPath 0x10
- #undef FileV
- #define FileV 0x8
- #undef UpCallFile_Save
- #define UpCallFile_Save 0x0
- #undef UpCallFile_SetArgs
- #define UpCallFile_SetArgs 0x1
- #undef UpCallFile_SetLoadAddr
- #define UpCallFile_SetLoadAddr 0x2
- #undef UpCallFile_SetExecAddr
- #define UpCallFile_SetExecAddr 0x3
- #undef UpCallFile_SetAttr
- #define UpCallFile_SetAttr 0x4
- #undef UpCallFile_Delete
- #define UpCallFile_Delete 0x6
- #undef UpCallFile_Create
- #define UpCallFile_Create 0x7
- #undef UpCallFile_CreateDir
- #define UpCallFile_CreateDir 0x8
-
- /************************
- * Constant definitions *
- ************************/
- #define osfile_NOT_FOUND 0
- #define osfile_IS_FILE 1
- #define osfile_IS_DIR 2
- #define osfile_IS_IMAGE 3
- #define osfile_FILE_TYPE 0xFFF00u
- #define osfile_FILE_TYPE_SHIFT 8
- #define osfile_TYPE_DRAW 0xAFFu
- #define osfile_TYPE_BBCROM 0xBBCu
- #define osfile_TYPE_DOS_DISC 0xFC8u
- #define osfile_TYPE_DEVICE 0xFCCu
- #define osfile_TYPE_CACHE 0xFCFu
- #define osfile_TYPE_TASK_EXEC 0xFD6u
- #define osfile_TYPE_TASK_OBEY 0xFD7u
- #define osfile_TYPE_DOS 0xFE4u
- #define osfile_TYPE_DESKTOP 0xFEAu
- #define osfile_TYPE_OBEY 0xFEBu
- #define osfile_TYPE_TEMPLATE 0xFECu
- #define osfile_TYPE_PALETTE 0xFEDu
- #define osfile_TYPE_CONFIG 0xFF2u
- #define osfile_TYPE_PRINTOUT 0xFF4u
- #define osfile_TYPE_POSTSCRIPT 0xFF5u
- #define osfile_TYPE_FONT 0xFF6u
- #define osfile_TYPE_BBC_FONT 0xFF7u
- #define osfile_TYPE_ABSOLUTE 0xFF8u
- #define osfile_TYPE_SPRITE 0xFF9u
- #define osfile_TYPE_MODULE 0xFFAu
- #define osfile_TYPE_BASIC 0xFFBu
- #define osfile_TYPE_UTILITY 0xFFCu
- #define osfile_TYPE_DATA 0xFFDu
- #define osfile_TYPE_COMMAND 0xFFEu
- #define osfile_TYPE_TEXT 0xFFFu
- #define osfile_TYPE_DIR 0x1000u
- #define osfile_TYPE_APPLICATION 0x2000u
- #define osfile_TYPE_UNTYPED 0xFFFFFFFFu
- #define osfile_ATTR_OWNER_READ 0x1u
- #define osfile_ATTR_OWNER_WRITE 0x2u
- #define osfile_ATTR_OWNER_SPECIAL 0x4u
- #define osfile_ATTR_OWNER_LOCKED 0x8u
- #define osfile_ATTR_WORLD_READ 0x10u
- #define osfile_ATTR_WORLD_WRITE 0x20u
- #define osfile_ATTR_WORLD_SPECIAL 0x40u
- #define osfile_ATTR_WORLD_LOCKED 0x80u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: osfile_save_stamped()
- *
- * Description: Saves a block of memory as a file
- *
- * Input: file_name - value of R1 on entry
- * file_type - value of R2 on entry
- * data - value of R4 on entry
- * end - value of R5 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xA.
- */
-
- extern os_error *xosfile_save_stamped (char *file_name,
- bits file_type,
- byte *data,
- byte *end);
- extern void osfile_save_stamped (char *file_name,
- bits file_type,
- byte *data,
- byte *end);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_write()
- *
- * Description: Writes the load and execution addresses and attributes
- * for an object
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- * exec_addr - value of R3 on entry
- * attr - value of R5 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x1.
- */
-
- extern os_error *xosfile_write (char *file_name,
- bits load_addr,
- bits exec_addr,
- bits attr);
- extern void osfile_write (char *file_name,
- bits load_addr,
- bits exec_addr,
- bits attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_write_load()
- *
- * Description: Writes the load address for an object
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x2.
- */
-
- extern os_error *xosfile_write_load (char *file_name,
- bits load_addr);
- extern void osfile_write_load (char *file_name,
- bits load_addr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_write_exec()
- *
- * Description: Writes the execution address for an object
- *
- * Input: file_name - value of R1 on entry
- * exec_addr - value of R3 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x3.
- */
-
- extern os_error *xosfile_write_exec (char *file_name,
- bits exec_addr);
- extern void osfile_write_exec (char *file_name,
- bits exec_addr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_write_attr()
- *
- * Description: Writes the attributes for an object
- *
- * Input: file_name - value of R1 on entry
- * attr - value of R5 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x4.
- */
-
- extern os_error *xosfile_write_attr (char *file_name,
- bits attr);
- extern void osfile_write_attr (char *file_name,
- bits attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_stamp()
- *
- * Description: Writes the date stamp for an object
- *
- * Input: file_name - value of R1 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x9.
- */
-
- extern os_error *xosfile_stamp (char *file_name);
- extern void osfile_stamp (char *file_name);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_set_type()
- *
- * Description: Writes the file type for an object
- *
- * Input: file_name - value of R1 on entry
- * file_type - value of R2 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x12.
- */
-
- extern os_error *xosfile_set_type (char *file_name,
- bits file_type);
- extern void osfile_set_type (char *file_name,
- bits file_type);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_delete()
- *
- * Description: Deletes an object
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x6.
- */
-
- extern os_error *xosfile_delete (char *file_name,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_delete (char *file_name,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_create_stamped()
- *
- * Description: Creates an empty file
- *
- * Input: file_name - value of R1 on entry
- * file_type - value of R2 on entry
- * size - value of R5 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xB, R4 = 0x0.
- */
-
- extern os_error *xosfile_create_stamped (char *file_name,
- bits file_type,
- int size);
- extern void osfile_create_stamped (char *file_name,
- bits file_type,
- int size);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_create_dir()
- *
- * Description: Creates a directory
- *
- * Input: dir_name - value of R1 on entry
- * entry_count - value of R4 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x8.
- */
-
- extern os_error *xosfile_create_dir (char *dir_name,
- int entry_count);
- extern void osfile_create_dir (char *dir_name,
- int entry_count);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_load_stamped()
- *
- * Description: Loads a file using the directory list in File$Path
- *
- * Input: file_name - value of R1 on entry
- * addr - value of R2 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xFF, R3 = 0x0.
- */
-
- extern os_error *xosfile_load_stamped (char *file_name,
- byte *addr,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_load_stamped (char *file_name,
- byte *addr,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_load_stamped_path()
- *
- * Description: Loads a file using a specified directory list
- *
- * Input: file_name - value of R1 on entry
- * addr - value of R2 on entry
- * path - value of R4 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xC, R3 = 0x0.
- */
-
- extern os_error *xosfile_load_stamped_path (char *file_name,
- byte *addr,
- char *path,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_load_stamped_path (char *file_name,
- byte *addr,
- char *path,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_load_stamped_path_var()
- *
- * Description: Loads a file using the directory list in a specified
- * variable
- *
- * Input: file_name - value of R1 on entry
- * addr - value of R2 on entry
- * var - value of R4 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xE, R3 = 0x0.
- */
-
- extern os_error *xosfile_load_stamped_path_var (char *file_name,
- byte *addr,
- char *var,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_load_stamped_path_var (char *file_name,
- byte *addr,
- char *var,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_load_stamped_no_path()
- *
- * Description: Loads a file
- *
- * Input: file_name - value of R1 on entry
- * addr - value of R2 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x10, R3 = 0x0.
- */
-
- extern os_error *xosfile_load_stamped_no_path (char *file_name,
- byte *addr,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_load_stamped_no_path (char *file_name,
- byte *addr,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_make_error()
- *
- * Description: Generates an error message
- *
- * Input: file_name - value of R1 on entry
- * obj_type - value of R2 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x13.
- */
-
- extern os_error *xosfile_make_error (char *file_name,
- int obj_type);
- extern void osfile_make_error (char *file_name,
- int obj_type);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read_stamped()
- *
- * Description: Reads catalogue information and file type for an object
- * using the directory list in File$Path
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- * file_type - value of R6 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x14.
- */
-
- extern os_error *xosfile_read_stamped (char *file_name,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr,
- bits *file_type);
- extern int osfile_read_stamped (char *file_name,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr,
- bits *file_type);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read_stamped_path()
- *
- * Description: Reads catalogue information and file type for an object
- * using a specified directory list
- *
- * Input: file_name - value of R1 on entry
- * path - value of R4 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- * file_type - value of R6 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x15.
- */
-
- extern os_error *xosfile_read_stamped_path (char *file_name,
- char *path,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr,
- bits *file_type);
- extern int osfile_read_stamped_path (char *file_name,
- char *path,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr,
- bits *file_type);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read_stamped_path_var()
- *
- * Description: Reads catalogue information and file type for an object
- * using the directory list in a specified variable
- *
- * Input: file_name - value of R1 on entry
- * var - value of R4 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- * file_type - value of R6 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x16.
- */
-
- extern os_error *xosfile_read_stamped_path_var (char *file_name,
- char *var,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr,
- bits *file_type);
- extern int osfile_read_stamped_path_var (char *file_name,
- char *var,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr,
- bits *file_type);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read_stamped_no_path()
- *
- * Description: Reads catalogue information and file type for an object
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- * file_type - value of R6 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x17.
- */
-
- extern os_error *xosfile_read_stamped_no_path (char *file_name,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr,
- bits *file_type);
- extern int osfile_read_stamped_no_path (char *file_name,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr,
- bits *file_type);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read_block_size()
- *
- * Description: Reads the natural block size of a file
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: block_size - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x18.
- */
-
- extern os_error *xosfile_read_block_size (char *file_name,
- int *block_size);
- extern int osfile_read_block_size (char *file_name);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_save()
- *
- * Description: Saves a block of memory as an untyped file (prefer
- * OSFile_SaveStamped)
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- * exec_addr - value of R3 on entry
- * data - value of R4 on entry
- * end - value of R5 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x0.
- */
-
- extern os_error *xosfile_save (char *file_name,
- bits load_addr,
- bits exec_addr,
- byte *data,
- byte *end);
- extern void osfile_save (char *file_name,
- bits load_addr,
- bits exec_addr,
- byte *data,
- byte *end);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read()
- *
- * Description: Reads catalogue information for an object using the
- * directory list in File$Path (prefer OSFile_ReadStamped)
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x5.
- */
-
- extern os_error *xosfile_read (char *file_name,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_read (char *file_name,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read_path()
- *
- * Description: Reads catalogue information for an object using a
- * specified directory list (prefer OSFile_ReadStampedPath)
- *
- * Input: file_name - value of R1 on entry
- * path - value of R4 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xD.
- */
-
- extern os_error *xosfile_read_path (char *file_name,
- char *path,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_read_path (char *file_name,
- char *path,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read_path_var()
- *
- * Description: Reads catalogue information for an object using the
- * directory list in a specified variable (prefer
- * OSFile_ReadStampedPathVar)
- *
- * Input: file_name - value of R1 on entry
- * var - value of R4 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xF.
- */
-
- extern os_error *xosfile_read_path_var (char *file_name,
- char *var,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_read_path_var (char *file_name,
- char *var,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_read_no_path()
- *
- * Description: Reads catalogue information for an object (prefer
- * OSFile_ReadStampedNoPath)
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x11.
- */
-
- extern os_error *xosfile_read_no_path (char *file_name,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_read_no_path (char *file_name,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_create()
- *
- * Description: Creates an empty untyped file (prefer
- * OSFile_CreateStamped)
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- * exec_addr - value of R3 on entry
- * size - value of R5 on entry
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x7, R4 = 0x0.
- */
-
- extern os_error *xosfile_create (char *file_name,
- bits load_addr,
- bits exec_addr,
- int size);
- extern void osfile_create (char *file_name,
- bits load_addr,
- bits exec_addr,
- int size);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_load()
- *
- * Description: Loads an untyped file using the directory list in
- * File$Path (prefer OSFile_LoadStamped)
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xFF, R3 = 0x1.
- */
-
- extern os_error *xosfile_load (char *file_name,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_load (char *file_name,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_load_path()
- *
- * Description: Loads an untyped file using a specified directory list
- * (prefer OSFile_LoadStampedPath)
- *
- * Input: file_name - value of R1 on entry
- * path - value of R4 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xC, R3 = 0x1.
- */
-
- extern os_error *xosfile_load_path (char *file_name,
- char *path,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_load_path (char *file_name,
- char *path,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_load_path_var()
- *
- * Description: Loads an untyped file using the directory list in a
- * specified variable (prefer OSFile_LoadStampedPathVar)
- *
- * Input: file_name - value of R1 on entry
- * var - value of R4 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0xE, R3 = 0x1.
- */
-
- extern os_error *xosfile_load_path_var (char *file_name,
- char *var,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_load_path_var (char *file_name,
- char *var,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: osfile_load_no_path()
- *
- * Description: Loads an untyped file (prefer OSFile_LoadStampedNoPath)
- *
- * Input: file_name - value of R1 on entry
- *
- * Output: obj_type - value of R0 on exit (X version only)
- * load_addr - value of R2 on exit
- * exec_addr - value of R3 on exit
- * size - value of R4 on exit
- * attr - value of R5 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x8 with R0 = 0x10, R3 = 0x1.
- */
-
- extern os_error *xosfile_load_no_path (char *file_name,
- int *obj_type,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
- extern int osfile_load_no_path (char *file_name,
- bits *load_addr,
- bits *exec_addr,
- int *size,
- bits *attr);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfile_save()
- *
- * Description: Warns your program that a file is being saved
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- * exec_addr - value of R3 on entry
- * data - value of R4 on entry
- * end - value of R5 on entry
- * special - value of R6 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x0.
- */
-
- extern os_error *xupcallfile_save (char *file_name,
- bits load_addr,
- bits exec_addr,
- byte *data,
- byte *end,
- char *special,
- bits fs_info);
- extern void upcallfile_save (char *file_name,
- bits load_addr,
- bits exec_addr,
- byte *data,
- byte *end,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfile_set_args()
- *
- * Description: Warns your program that a file's catalogue information is
- * being written
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- * exec_addr - value of R3 on entry
- * attr - value of R5 on entry
- * special - value of R6 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x1.
- */
-
- extern os_error *xupcallfile_set_args (char *file_name,
- bits load_addr,
- bits exec_addr,
- bits attr,
- char *special,
- bits fs_info);
- extern void upcallfile_set_args (char *file_name,
- bits load_addr,
- bits exec_addr,
- bits attr,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfile_set_load_addr()
- *
- * Description: Warns your program that a file's load address is being
- * written
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- * special - value of R6 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x2.
- */
-
- extern os_error *xupcallfile_set_load_addr (char *file_name,
- bits load_addr,
- char *special,
- bits fs_info);
- extern void upcallfile_set_load_addr (char *file_name,
- bits load_addr,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfile_set_exec_addr()
- *
- * Description: Warns your program that a file's execution address is
- * being written
- *
- * Input: file_name - value of R1 on entry
- * exec_addr - value of R3 on entry
- * special - value of R6 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x3.
- */
-
- extern os_error *xupcallfile_set_exec_addr (char *file_name,
- bits exec_addr,
- char *special,
- bits fs_info);
- extern void upcallfile_set_exec_addr (char *file_name,
- bits exec_addr,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfile_set_attr()
- *
- * Description: Warns your program that a file's attributes are being
- * written
- *
- * Input: file_name - value of R1 on entry
- * attr - value of R5 on entry
- * special - value of R6 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x4.
- */
-
- extern os_error *xupcallfile_set_attr (char *file_name,
- bits attr,
- char *special,
- bits fs_info);
- extern void upcallfile_set_attr (char *file_name,
- bits attr,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfile_delete()
- *
- * Description: Warns your program that a file is being deleted
- *
- * Input: file_name - value of R1 on entry
- * special - value of R6 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x6.
- */
-
- extern os_error *xupcallfile_delete (char *file_name,
- char *special,
- bits fs_info);
- extern void upcallfile_delete (char *file_name,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfile_create()
- *
- * Description: Warns your program that a file is being created
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- * exec_addr - value of R3 on entry
- * data - value of R4 on entry
- * end - value of R5 on entry
- * special - value of R6 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x7.
- */
-
- extern os_error *xupcallfile_create (char *file_name,
- bits load_addr,
- bits exec_addr,
- byte *data,
- byte *end,
- char *special,
- bits fs_info);
- extern void upcallfile_create (char *file_name,
- bits load_addr,
- bits exec_addr,
- byte *data,
- byte *end,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfile_create_dir()
- *
- * Description: Warns your program that a directory is being created
- *
- * Input: file_name - value of R1 on entry
- * load_addr - value of R2 on entry
- * exec_addr - value of R3 on entry
- * entry_count - value of R4 on entry
- * special - value of R6 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x8.
- */
-
- extern os_error *xupcallfile_create_dir (char *file_name,
- bits load_addr,
- bits exec_addr,
- int entry_count,
- char *special,
- bits fs_info);
- extern void upcallfile_create_dir (char *file_name,
- bits load_addr,
- bits exec_addr,
- int entry_count,
- char *special,
- bits fs_info);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-