home *** CD-ROM | disk | FTP | other *** search
- #ifndef osfind_H
- #define osfind_H
-
- /* C header file for OSFind
- * written by DefMod (Sep 7 1994) on Wed Sep 7 21:21:05 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_Find
- #define OS_Find 0xD
- #undef XOS_Find
- #define XOS_Find 0x2000D
- #undef OSFind_Openin
- #define OSFind_Openin 0x40
- #undef OSFind_Openout
- #define OSFind_Openout 0x80
- #undef OSFind_Openup
- #define OSFind_Openup 0xC0
- #undef OSFind_Close
- #define OSFind_Close 0x0
- #undef FindV
- #define FindV 0xD
- #undef UpCallFind_CreateOpenup
- #define UpCallFind_CreateOpenup 0x101
- #undef UpCallFind_Openup
- #define UpCallFind_Openup 0x102
- #undef UpCallFind_Close
- #define UpCallFind_Close 0x103
-
- /************************
- * Constant definitions *
- ************************/
- #define osfind_PATH 0x1u
- #define osfind_PATH_VAR 0x2u
- #define osfind_NO_PATH 0x3u
- #define osfind_ERROR_IF_ABSENT 0x8u
- #define osfind_ERROR_IF_DIR 0x4u
-
- /*************************
- * 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: osfind_openin()
- *
- * Description: Opens an existing file with read access only
- *
- * Input: flags - value of R0 on entry
- * file_name - value of R1 on entry
- * path - value of R2 on entry
- *
- * Output: file - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0xD with R0 |= 0x40.
- */
-
- extern os_error *xosfind_openin (bits flags,
- char *file_name,
- char *path,
- os_f *file);
- extern os_f osfind_openin (bits flags,
- char *file_name,
- char *path);
-
- /* ------------------------------------------------------------------------
- * Function: osfind_openout()
- *
- * Description: Creates a new file with read/write access
- *
- * Input: flags - value of R0 on entry
- * file_name - value of R1 on entry
- * path - value of R2 on entry
- *
- * Output: file - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0xD with R0 |= 0x80.
- */
-
- extern os_error *xosfind_openout (bits flags,
- char *file_name,
- char *path,
- os_f *file);
- extern os_f osfind_openout (bits flags,
- char *file_name,
- char *path);
-
- /* ------------------------------------------------------------------------
- * Function: osfind_openup()
- *
- * Description: Opens an existing file with read/write access
- *
- * Input: flags - value of R0 on entry
- * file_name - value of R1 on entry
- * path - value of R2 on entry
- *
- * Output: file - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0xD with R0 |= 0xC0.
- */
-
- extern os_error *xosfind_openup (bits flags,
- char *file_name,
- char *path,
- os_f *file);
- extern os_f osfind_openup (bits flags,
- char *file_name,
- char *path);
-
- /* ------------------------------------------------------------------------
- * Function: osfind_close()
- *
- * Description: Closes a file or files
- *
- * Input: file - value of R1 on entry
- *
- * Other notes: Calls SWI 0xD with R0 = 0x0.
- */
-
- extern os_error *xosfind_close (os_f file);
- extern void osfind_close (os_f file);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfind_create_openup()
- *
- * Description: Warns your program that a file is being created and
- * opened for update
- *
- * Input: file_name - value of R1 on entry
- * file - 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 = 0x101.
- */
-
- extern os_error *xupcallfind_create_openup (char *file_name,
- os_f file,
- char *special,
- bits fs_info);
- extern void upcallfind_create_openup (char *file_name,
- os_f file,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfind_openup()
- *
- * Description: Warns your program that a file is being opened for update
- *
- * Input: file_name - value of R1 on entry
- * file - 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 = 0x102.
- */
-
- extern os_error *xupcallfind_openup (char *file_name,
- os_f file,
- char *special,
- bits fs_info);
- extern void upcallfind_openup (char *file_name,
- os_f file,
- char *special,
- bits fs_info);
-
- /* ------------------------------------------------------------------------
- * Function: upcallfind_close()
- *
- * Description: Warns your program that a file is being closed
- *
- * Input: file - value of R1 on entry
- * fs_info - value of R8 on entry
- *
- * Other notes: Calls SWI 0x33 with R0 = 0x3, R9 = 0x103.
- */
-
- extern os_error *xupcallfind_close (os_f file,
- bits fs_info);
- extern void upcallfind_close (os_f file,
- bits fs_info);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-