home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Computer / h / resourcefs < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-22  |  4.8 KB  |  174 lines

  1. #ifndef resourcefs_H
  2. #define resourcefs_H
  3.  
  4. /* C header file for ResourceFS
  5.  * written by DefMod (Jun 20 1995) on Thu Jun 22 12:11:36 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef os_H
  14. #include "os.h"
  15. #endif
  16.  
  17. #ifndef fileswitch_H
  18. #include "fileswitch.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  ResourceFS_RegisterFiles
  25. #define ResourceFS_RegisterFiles                0x41B40
  26. #undef  XResourceFS_RegisterFiles
  27. #define XResourceFS_RegisterFiles               0x61B40
  28. #undef  ResourceFS_DeregisterFiles
  29. #define ResourceFS_DeregisterFiles              0x41B41
  30. #undef  XResourceFS_DeregisterFiles
  31. #define XResourceFS_DeregisterFiles             0x61B41
  32. #undef  Service_ResourceFSStarted
  33. #define Service_ResourceFSStarted               0x59
  34. #undef  Service_ResourceFSDying
  35. #define Service_ResourceFSDying                 0x5A
  36. #undef  Service_ResourceFSStarting
  37. #define Service_ResourceFSStarting              0x60
  38.  
  39. /************************************
  40.  * Structure and union declarations *
  41.  ************************************/
  42. typedef struct resourcefs_file_header           resourcefs_file_header;
  43. typedef struct resourcefs_file_data             resourcefs_file_data;
  44. typedef struct resourcefs_file                  resourcefs_file;
  45. typedef struct resourcefs_file_list             resourcefs_file_list;
  46.  
  47. /********************
  48.  * Type definitions *
  49.  ********************/
  50. struct resourcefs_file_header
  51.    {  int data_size;
  52.       bits load_addr;
  53.       bits exec_addr;
  54.       int size;
  55.       fileswitch_attr attr;
  56.       char name [UNKNOWN];
  57.    };
  58.  
  59. #define resourcefs_FILE_HEADER(N) \
  60.    struct \
  61.       {  int data_size; \
  62.          bits load_addr; \
  63.          bits exec_addr; \
  64.          int size; \
  65.          fileswitch_attr attr; \
  66.          char name [N]; \
  67.       }
  68.  
  69. #define resourcefs_SIZEOF_FILE_HEADER(N) \
  70.    (offsetof (resourcefs_file_header, name) + \
  71.          (N)*sizeof ((resourcefs_file_header *) NULL)->name)
  72.  
  73. struct resourcefs_file_data
  74.    {  int size;
  75.       byte data [UNKNOWN];
  76.    };
  77.  
  78. #define resourcefs_FILE_DATA(N) \
  79.    struct \
  80.       {  int size; \
  81.          byte data [N]; \
  82.       }
  83.  
  84. #define resourcefs_SIZEOF_FILE_DATA(N) \
  85.    (offsetof (resourcefs_file_data, data) + \
  86.          (N)*sizeof ((resourcefs_file_data *) NULL)->data)
  87.  
  88. struct resourcefs_file
  89.    {  resourcefs_file_header header;
  90.       resourcefs_file_data data;
  91.    };
  92.  
  93. struct resourcefs_file_list
  94.    {  resourcefs_file file [UNKNOWN];
  95.    };
  96.  
  97. /*************************
  98.  * Function declarations *
  99.  *************************/
  100.  
  101. #ifdef __cplusplus
  102.    extern "C" {
  103. #endif
  104.  
  105. /* ------------------------------------------------------------------------
  106.  * Function:      resourcefs_register_files()
  107.  *
  108.  * Description:   Add file(s) to the ResourceFS structure
  109.  *
  110.  * Input:         file_list - value of R0 on entry
  111.  *
  112.  * Other notes:   Calls SWI 0x41B40.
  113.  */
  114.  
  115. extern os_error *xresourcefs_register_files (resourcefs_file_list const *file_list);
  116. __swi (0x41B40) void resourcefs_register_files (resourcefs_file_list const *file_list);
  117.  
  118. /* ------------------------------------------------------------------------
  119.  * Function:      resourcefs_deregister_files()
  120.  *
  121.  * Description:   Remove file(s) from the ResourceFS structure
  122.  *
  123.  * Input:         file_list - value of R0 on entry
  124.  *
  125.  * Other notes:   Calls SWI 0x41B41.
  126.  */
  127.  
  128. extern os_error *xresourcefs_deregister_files (resourcefs_file_list const *file_list);
  129. __swi (0x41B41) void resourcefs_deregister_files (resourcefs_file_list const *file_list);
  130.  
  131. /* ------------------------------------------------------------------------
  132.  * Function:      service_resource_fs_started()
  133.  *
  134.  * Description:   The file structure inside ResourceFS has changed
  135.  *
  136.  * Other notes:   Calls SWI 0x30 with R1 = 0x59.
  137.  */
  138.  
  139. extern os_error *xservice_resource_fs_started (void);
  140. extern void service_resource_fs_started (void);
  141.  
  142. /* ------------------------------------------------------------------------
  143.  * Function:      service_resource_fs_dying()
  144.  *
  145.  * Description:   ResourceFS is killed
  146.  *
  147.  * Other notes:   Calls SWI 0x30 with R1 = 0x5A.
  148.  */
  149.  
  150. extern os_error *xservice_resource_fs_dying (void);
  151. extern void service_resource_fs_dying (void);
  152.  
  153. /* ------------------------------------------------------------------------
  154.  * Function:      service_resource_fs_starting()
  155.  *
  156.  * Description:   ResourceFS module is reloaded or reinitialised
  157.  *
  158.  * Input:         register_files - value of R2 on entry
  159.  *                workspace - value of R3 on entry
  160.  *
  161.  * Other notes:   Calls SWI 0x30 with R1 = 0x60.
  162.  */
  163.  
  164. extern os_error *xservice_resource_fs_starting (void const *register_files,
  165.       void *workspace);
  166. extern void service_resource_fs_starting (void const *register_files,
  167.       void *workspace);
  168.  
  169. #ifdef __cplusplus
  170.    }
  171. #endif
  172.  
  173. #endif
  174.