home *** CD-ROM | disk | FTP | other *** search
- #ifndef osargs_H
- #define osargs_H
-
- /* C header file for OSArgs
- * written by DefMod (Sep 7 1994) on Wed Sep 7 21:21:34 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_Args
- #define OS_Args 0x9
- #undef XOS_Args
- #define XOS_Args 0x20009
- #undef OSArgs_ReadPtr
- #define OSArgs_ReadPtr 0x0
- #undef OSArgs_ReadTemporaryFS
- #define OSArgs_ReadTemporaryFS 0x0
- #undef OSArgs_SetPtr
- #define OSArgs_SetPtr 0x1
- #undef OSArgs_ReadExt
- #define OSArgs_ReadExt 0x2
- #undef OSArgs_SetExt
- #define OSArgs_SetExt 0x3
- #undef OSArgs_ReadAllocation
- #define OSArgs_ReadAllocation 0x4
- #undef OSArgs_ReadEOFStatus
- #define OSArgs_ReadEOFStatus 0x5
- #undef OSArgs_SetAllocation
- #define OSArgs_SetAllocation 0x6
- #undef OSArgs_ReadPath
- #define OSArgs_ReadPath 0x7
- #undef OSArgs_ImageStamped
- #define OSArgs_ImageStamped 0x8
- #undef OSArgs_ReadInfo
- #define OSArgs_ReadInfo 0xFE
- #undef OSArgs_Ensure
- #define OSArgs_Ensure 0xFF
- #undef ArgsV
- #define ArgsV 0x9
-
- /************************
- * Constant definitions *
- ************************/
- #define osargs_STREAM_INTERACTIVE 0x8u
- #define osargs_STREAM_SUPPORTS_GBPB 0x10u
- #define osargs_STREAM_DIR 0x20u
- #define osargs_STREAM_READABLE 0x40u
- #define osargs_STREAM_WRITABLE 0x80u
- #define osargs_STREAM_WRITTEN 0x100u
- #define osargs_STREAM_EOF_ERROR_ON_NEXT_READ 0x200u
- #define osargs_STREAM_UNBUFFERED 0x400u
- #define osargs_STREAM_UNALLOCATED 0x800u
- #define osargs_STREAM_CRITICAL 0x1000u
- #define osargs_STREAM_DATA_LOST 0x2000u
- #define osargs_STREAM_IMAGE_FILE_BUSY 0x4000u
-
- /*************************
- * 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: osargs_read_ptr()
- *
- * Description: Reads a file's sequential file pointer
- *
- * Input: file - value of R1 on entry
- *
- * Output: ptr - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x0.
- */
-
- extern os_error *xosargs_read_ptr (os_f file,
- int *ptr);
- extern int osargs_read_ptr (os_f file);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_read_temporary_fs()
- *
- * Description: Reads the temporary filing system number
- *
- * Output: temp_fs - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x0, R1 = 0x0.
- */
-
- extern os_error *xosargs_read_temporary_fs (int *temp_fs);
- extern int osargs_read_temporary_fs (void);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_set_ptr()
- *
- * Description: Writes an open file's sequential file pointer
- *
- * Input: file - value of R1 on entry
- * ptr - value of R2 on entry
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x1.
- */
-
- extern os_error *xosargs_set_ptr (os_f file,
- int ptr);
- extern void osargs_set_ptr (os_f file,
- int ptr);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_read_ext()
- *
- * Description: Reads an open file's extent
- *
- * Input: file - value of R1 on entry
- *
- * Output: ext - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x2.
- */
-
- extern os_error *xosargs_read_ext (os_f file,
- int *ext);
- extern int osargs_read_ext (os_f file);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_set_ext()
- *
- * Description: Writes an open file's extent
- *
- * Input: file - value of R1 on entry
- * ext - value of R2 on entry
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x3.
- */
-
- extern os_error *xosargs_set_ext (os_f file,
- int ext);
- extern void osargs_set_ext (os_f file,
- int ext);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_read_allocation()
- *
- * Description: Reads an open file's allocated size
- *
- * Input: file - value of R1 on entry
- *
- * Output: allocation - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x4.
- */
-
- extern os_error *xosargs_read_allocation (os_f file,
- int *allocation);
- extern int osargs_read_allocation (os_f file);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_read_eof_status()
- *
- * Description: Reads an open file's end-of-file (EOF) status
- *
- * Input: file - value of R1 on entry
- *
- * Output: eof_status - value of R2 on exit (X version only)
- *
- * Returns: R2 (non-X version only)
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x5.
- */
-
- extern os_error *xosargs_read_eof_status (os_f file,
- bool *eof_status);
- extern bool osargs_read_eof_status (os_f file);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_set_allocation()
- *
- * Description: Ensures an open file's size
- *
- * Input: file - value of R1 on entry
- * allocation - value of R2 on entry
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x6.
- */
-
- extern os_error *xosargs_set_allocation (os_f file,
- bool allocation);
- extern void osargs_set_allocation (os_f file,
- bool allocation);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_read_path()
- *
- * Description: Converts a file handle to a canonical name
- *
- * Input: file - value of R1 on entry
- * buffer - value of R2 on entry
- * size - value of R5 on entry
- *
- * Output: spare - value of R5 on exit
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x7.
- */
-
- extern os_error *xosargs_read_path (os_f file,
- char *buffer,
- int size,
- int *spare);
- extern void osargs_read_path (os_f file,
- char *buffer,
- int size,
- int *spare);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_image_stamped()
- *
- * Description: Used by an image filing system to inform of a change to
- * an image stamp
- *
- * Input: file - value of R1 on entry
- * image_stamp - value of R2 on entry
- *
- * Other notes: Calls SWI 0x9 with R0 = 0x8.
- */
-
- extern os_error *xosargs_image_stamped (os_f file,
- int image_stamp);
- extern void osargs_image_stamped (os_f file,
- int image_stamp);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_read_info()
- *
- * Description: Reads information on a file handle
- *
- * Input: file - value of R1 on entry
- *
- * Output: stream_status - value of R0 on exit
- * fs_status - value of R2 on exit
- *
- * Other notes: Calls SWI 0x9 with R0 = 0xFE.
- */
-
- extern os_error *xosargs_read_info (os_f file,
- bits *stream_status,
- bits *fs_status);
- extern void osargs_read_info (os_f file,
- bits *stream_status,
- bits *fs_status);
-
- /* ------------------------------------------------------------------------
- * Function: osargs_ensure()
- *
- * Description: Ensures data has been written to a file, or to all files
- * on the temporary filing system
- *
- * Input: file - value of R1 on entry
- *
- * Other notes: Calls SWI 0x9 with R0 = 0xFF.
- */
-
- extern os_error *xosargs_ensure (os_f file);
- extern void osargs_ensure (os_f file);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-