home *** CD-ROM | disk | FTP | other *** search
- #ifndef resourcefs_H
- #define resourcefs_H
-
- /* C header file for ResourceFS
- * written by DefMod (Sep 7 1994) on Wed Sep 14 13:18:01 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 ResourceFS_RegisterFiles
- #define ResourceFS_RegisterFiles 0x41B40
- #undef XResourceFS_RegisterFiles
- #define XResourceFS_RegisterFiles 0x61B40
- #undef ResourceFS_DeregisterFiles
- #define ResourceFS_DeregisterFiles 0x41B41
- #undef XResourceFS_DeregisterFiles
- #define XResourceFS_DeregisterFiles 0x61B41
- #undef Service_ResourceFSStarted
- #define Service_ResourceFSStarted 0x59
- #undef Service_ResourceFSDying
- #define Service_ResourceFSDying 0x5A
- #undef Service_ResourceFSStarting
- #define Service_ResourceFSStarting 0x60
-
- /************************************
- * Structure and union declarations *
- ************************************/
- typedef struct resourcefs_file_header resourcefs_file_header;
- typedef struct resourcefs_file_data resourcefs_file_data;
- typedef struct resourcefs_file resourcefs_file;
- typedef struct resourcefs_file_list resourcefs_file_list;
-
- /********************
- * Type definitions *
- ********************/
- struct resourcefs_file_header
- { int data_size;
- bits load_addr;
- bits exec_addr;
- int size;
- bits attr;
- char name [UNKNOWN];
- };
-
- #define resourcefs_FILE_HEADER(N) \
- struct \
- { int data_size; \
- bits load_addr; \
- bits exec_addr; \
- int size; \
- bits attr; \
- char name [N]; \
- }
-
- #define resourcefs_SIZEOF_FILE_HEADER(N) \
- (offsetof (resourcefs_file_header, name) + \
- (N)*sizeof ((resourcefs_file_header *) NULL)->name)
-
- struct resourcefs_file_data
- { int size;
- byte data [UNKNOWN];
- };
-
- #define resourcefs_FILE_DATA(N) \
- struct \
- { int size; \
- byte data [N]; \
- }
-
- #define resourcefs_SIZEOF_FILE_DATA(N) \
- (offsetof (resourcefs_file_data, data) + \
- (N)*sizeof ((resourcefs_file_data *) NULL)->data)
-
- struct resourcefs_file
- { resourcefs_file_header header;
- resourcefs_file_data data;
- };
-
- struct resourcefs_file_list
- { resourcefs_file file [UNKNOWN];
- };
-
- /*************************
- * 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: resourcefs_register_files()
- *
- * Description: Add file(s) to the ResourceFS structure
- *
- * Input: file_list - value of R0 on entry
- *
- * Other notes: Calls SWI 0x41B40.
- */
-
- extern os_error *xresourcefs_register_files (resourcefs_file_list *file_list);
- extern void resourcefs_register_files (resourcefs_file_list *file_list);
-
- /* ------------------------------------------------------------------------
- * Function: resourcefs_deregister_files()
- *
- * Description: Remove file(s) from the ResourceFS structure
- *
- * Input: file_list - value of R0 on entry
- *
- * Other notes: Calls SWI 0x41B41.
- */
-
- extern os_error *xresourcefs_deregister_files (resourcefs_file_list *file_list);
- extern void resourcefs_deregister_files (resourcefs_file_list *file_list);
-
- /* ------------------------------------------------------------------------
- * Function: service_resource_fs_started()
- *
- * Description: The file structure inside ResourceFS has changed
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x59.
- */
-
- extern os_error *xservice_resource_fs_started (void);
- extern void service_resource_fs_started (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_resource_fs_dying()
- *
- * Description: ResourceFS is killed
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x5A.
- */
-
- extern os_error *xservice_resource_fs_dying (void);
- extern void service_resource_fs_dying (void);
-
- /* ------------------------------------------------------------------------
- * Function: service_resource_fs_starting()
- *
- * Description: ResourceFS module is reloaded or reinitialised
- *
- * Input: register_files - value of R2 on entry
- * workspace - value of R3 on entry
- *
- * Other notes: Calls SWI 0x30 with R1 = 0x60.
- */
-
- extern os_error *xservice_resource_fs_starting (void *register_files,
- void *workspace);
- extern void service_resource_fs_starting (void *register_files,
- void *workspace);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-