home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Computer / h / osfscontro < prev    next >
Encoding:
Text File  |  1995-09-05  |  46.1 KB  |  1,420 lines

  1. #ifndef osfscontrol_H
  2. #define osfscontrol_H
  3.  
  4. /* C header file for OSFSControl
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 17:26:54 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  OS_FSControl
  25. #define OS_FSControl                            0x29
  26. #undef  XOS_FSControl
  27. #define XOS_FSControl                           0x20029
  28. #undef  OSFSControl_Dir
  29. #define OSFSControl_Dir                         0x0
  30. #undef  OSFSControl_Lib
  31. #define OSFSControl_Lib                         0x1
  32. #undef  OSFSControl_StartApplication
  33. #define OSFSControl_StartApplication            0x2
  34. #undef  OSFSControl_Run
  35. #define OSFSControl_Run                         0x4
  36. #undef  OSFSControl_Cat
  37. #define OSFSControl_Cat                         0x5
  38. #undef  OSFSControl_Ex
  39. #define OSFSControl_Ex                          0x6
  40. #undef  OSFSControl_LCat
  41. #define OSFSControl_LCat                        0x7
  42. #undef  OSFSControl_LEx
  43. #define OSFSControl_LEx                         0x8
  44. #undef  OSFSControl_Info
  45. #define OSFSControl_Info                        0x9
  46. #undef  OSFSControl_Opt
  47. #define OSFSControl_Opt                         0xA
  48. #undef  OSFSControl_SetTemporaryFS
  49. #define OSFSControl_SetTemporaryFS              0xB
  50. #undef  OSFSControl_AddFS
  51. #define OSFSControl_AddFS                       0xC
  52. #undef  OSFSControl_LookupFS
  53. #define OSFSControl_LookupFS                    0xD
  54. #undef  OSFSControl_SelectFS
  55. #define OSFSControl_SelectFS                    0xE
  56. #undef  OSFSControl_BootFromFS
  57. #define OSFSControl_BootFromFS                  0xF
  58. #undef  OSFSControl_RemoveFS
  59. #define OSFSControl_RemoveFS                    0x10
  60. #undef  OSFSControl_AddSecondaryFS
  61. #define OSFSControl_AddSecondaryFS              0x11
  62. #undef  OSFSControl_ReadFileType
  63. #define OSFSControl_ReadFileType                0x12
  64. #undef  OSFSControl_RestoreCurrent
  65. #define OSFSControl_RestoreCurrent              0x13
  66. #undef  OSFSControl_ReadModuleBase
  67. #define OSFSControl_ReadModuleBase              0x14
  68. #undef  OSFSControl_ReadFSHandle
  69. #define OSFSControl_ReadFSHandle                0x15
  70. #undef  OSFSControl_Shut
  71. #define OSFSControl_Shut                        0x16
  72. #undef  OSFSControl_Shutdown
  73. #define OSFSControl_Shutdown                    0x17
  74. #undef  OSFSControl_Access
  75. #define OSFSControl_Access                      0x18
  76. #undef  OSFSControl_Rename
  77. #define OSFSControl_Rename                      0x19
  78. #undef  OSFSControl_Copy
  79. #define OSFSControl_Copy                        0x1A
  80. #undef  OSFSControl_Wipe
  81. #define OSFSControl_Wipe                        0x1B
  82. #undef  OSFSControl_Count
  83. #define OSFSControl_Count                       0x1C
  84. #undef  OSFSControl_ReadSecondaryFS
  85. #define OSFSControl_ReadSecondaryFS             0x1E
  86. #undef  OSFSControl_FileTypeFromString
  87. #define OSFSControl_FileTypeFromString          0x1F
  88. #undef  OSFSControl_FileInfo
  89. #define OSFSControl_FileInfo                    0x20
  90. #undef  OSFSControl_ReadFSName
  91. #define OSFSControl_ReadFSName                  0x21
  92. #undef  OSFSControl_RegisterImageFS
  93. #define OSFSControl_RegisterImageFS             0x23
  94. #undef  OSFSControl_DeregisterImageFS
  95. #define OSFSControl_DeregisterImageFS           0x24
  96. #undef  OSFSControl_CanonicalisePath
  97. #define OSFSControl_CanonicalisePath            0x25
  98. #undef  OSFSControl_InfoToFileType
  99. #define OSFSControl_InfoToFileType              0x26
  100. #undef  OSFSControl_URD
  101. #define OSFSControl_URD                         0x27
  102. #undef  OSFSControl_Back
  103. #define OSFSControl_Back                        0x28
  104. #undef  OSFSControl_DefectList
  105. #define OSFSControl_DefectList                  0x29
  106. #undef  OSFSControl_AddDefect
  107. #define OSFSControl_AddDefect                   0x2A
  108. #undef  OSFSControl_NoDir
  109. #define OSFSControl_NoDir                       0x2B
  110. #undef  OSFSControl_NoURD
  111. #define OSFSControl_NoURD                       0x2C
  112. #undef  OSFSControl_NoLib
  113. #define OSFSControl_NoLib                       0x2D
  114. #undef  OSFSControl_UsedSpaceMap
  115. #define OSFSControl_UsedSpaceMap                0x2E
  116. #undef  OSFSControl_ReadBootOption
  117. #define OSFSControl_ReadBootOption              0x2F
  118. #undef  OSFSControl_WriteBootOption
  119. #define OSFSControl_WriteBootOption             0x30
  120. #undef  OSFSControl_FreeSpace
  121. #define OSFSControl_FreeSpace                   0x31
  122. #undef  OSFSControl_NameDisc
  123. #define OSFSControl_NameDisc                    0x32
  124. #undef  OSFSControl_StampImage
  125. #define OSFSControl_StampImage                  0x33
  126. #undef  OSFSControl_ObjectAtOffset
  127. #define OSFSControl_ObjectAtOffset              0x34
  128. #undef  OSFSControl_SetDir
  129. #define OSFSControl_SetDir                      0x35
  130. #undef  OSFSControl_ReadDir
  131. #define OSFSControl_ReadDir                     0x36
  132. #undef  OSFSControl_FreeSpace64
  133. #define OSFSControl_FreeSpace64                 0x37
  134. #undef  OSFSControl_DefectList64
  135. #define OSFSControl_DefectList64                0x38
  136. #undef  OSFSControl_AddDefect64
  137. #define OSFSControl_AddDefect64                 0x39
  138. #undef  FSCV
  139. #define FSCV                                    0xF
  140. #undef  UpCall_MediaNotPresent
  141. #define UpCall_MediaNotPresent                  0x1
  142. #undef  UpCall_MediaNotKnown
  143. #define UpCall_MediaNotKnown                    0x2
  144. #undef  UpCallFSControl_SetArgsSize
  145. #define UpCallFSControl_SetArgsSize             0x200
  146. #undef  UpCallFSControl_Rename
  147. #define UpCallFSControl_Rename                  0x208
  148. #undef  UpCallFSControl_SetAttrString
  149. #define UpCallFSControl_SetAttrString           0x209
  150. #undef  UpCall_MediaSearchEnd
  151. #define UpCall_MediaSearchEnd                   0x4
  152. #undef  UpCall_NewApplication
  153. #define UpCall_NewApplication                   0x100
  154.  
  155. /************************************
  156.  * Structure and union declarations *
  157.  ************************************/
  158. typedef struct osfscontrol_id_                  *osfscontrol_id;
  159.       /*Should be union of fs_no and string, but that's inconvenient since you can't project into unions by cast*/
  160. typedef struct osfscontrol_fs_info_block        osfscontrol_fs_info_block;
  161. typedef struct osfscontrol_descriptor           osfscontrol_descriptor;
  162.  
  163. /********************
  164.  * Type definitions *
  165.  ********************/
  166. struct osfscontrol_fs_info_block
  167.    {  int name_offset;
  168.       int banner_offset;
  169.       int open_offset;
  170.       int get_bytes;
  171.       int put_bytes;
  172.       int args_offset;
  173.       int close_offset;
  174.       int file_offset;
  175.       fileswitch_fs_info info;
  176.       int func_offset;
  177.       int gbpb_offset;
  178.       fileswitch_fs_extra_info extra_info;
  179.    };
  180.  
  181. typedef bits osfscontrol_copy_flags;
  182.  
  183. struct osfscontrol_descriptor
  184.    {  byte *addr;
  185.       int size;
  186.    };
  187.  
  188. typedef bits osfscontrol_wipe_flags;
  189.  
  190. typedef bits osfscontrol_count_flags;
  191.  
  192. typedef int osfscontrol_object_kind;
  193.  
  194. typedef int osfscontrol_special_dir;
  195.  
  196. /************************
  197.  * Constant definitions *
  198.  ************************/
  199. #define osfscontrol_OPT_RESTORE_DEFAULT         0
  200. #define osfscontrol_OPT_MESSAGE_LEVEL           1
  201. #define osfscontrol_OPT_BOOT_ACTION             4
  202. #define osfscontrol_COPY_RECURSE                ((osfscontrol_copy_flags) 0x1u)
  203. #define osfscontrol_COPY_FORCE                  ((osfscontrol_copy_flags) 0x2u)
  204. #define osfscontrol_COPY_GIVEN_TIMES            ((osfscontrol_copy_flags) 0x4u)
  205. #define osfscontrol_COPY_CONFIRM                ((osfscontrol_copy_flags) 0x8u)
  206. #define osfscontrol_COPY_VERBOSE                ((osfscontrol_copy_flags) 0x10u)
  207. #define osfscontrol_COPY_QUICK                  ((osfscontrol_copy_flags) 0x20u)
  208. #define osfscontrol_COPY_PROMPT                 ((osfscontrol_copy_flags) 0x40u)
  209. #define osfscontrol_COPY_DELETE                 ((osfscontrol_copy_flags) 0x80u)
  210. #define osfscontrol_COPY_ALLOW_PRINT            ((osfscontrol_copy_flags) 0x100u)
  211. #define osfscontrol_COPY_NO_ATTRIBUTES          ((osfscontrol_copy_flags) 0x200u)
  212. #define osfscontrol_COPY_STAMP                  ((osfscontrol_copy_flags) 0x400u)
  213. #define osfscontrol_COPY_STRUCTURE              ((osfscontrol_copy_flags) 0x800u)
  214. #define osfscontrol_COPY_NEWER                  ((osfscontrol_copy_flags) 0x1000u)
  215. #define osfscontrol_COPY_GIVEN_DESCRIPTOR       ((osfscontrol_copy_flags) 0x2000u)
  216. #define osfscontrol_COPY_LOOK                   ((osfscontrol_copy_flags) 0x4000u)
  217. #define osfscontrol_WIPE_RECURSE                ((osfscontrol_wipe_flags) 0x1u)
  218. #define osfscontrol_WIPE_FORCE                  ((osfscontrol_wipe_flags) 0x2u)
  219. #define osfscontrol_WIPE_GIVEN_TIMES            ((osfscontrol_wipe_flags) 0x4u)
  220. #define osfscontrol_WIPE_CONFIRM                ((osfscontrol_wipe_flags) 0x8u)
  221. #define osfscontrol_WIPE_VERBOSE                ((osfscontrol_wipe_flags) 0x10u)
  222. #define osfscontrol_WIPE_ALLOW_PRINT            ((osfscontrol_wipe_flags) 0x100u)
  223. #define osfscontrol_COUNT_RECURSE               ((osfscontrol_count_flags) 0x1u)
  224. #define osfscontrol_COUNT_GIVEN_TIMES           ((osfscontrol_count_flags) 0x4u)
  225. #define osfscontrol_COUNT_CONFIRM               ((osfscontrol_count_flags) 0x8u)
  226. #define osfscontrol_COUNT_VERBOSE               ((osfscontrol_count_flags) 0x10u)
  227. #define osfscontrol_COUNT_ALLOW_PRINT           ((osfscontrol_count_flags) 0x100u)
  228. #define osfscontrol_KIND_FREE                   ((osfscontrol_object_kind) 0x0u)
  229. #define osfscontrol_KIND_ALLOCATED              ((osfscontrol_object_kind) 0x1u)
  230. #define osfscontrol_KIND_FOUND                  ((osfscontrol_object_kind) 0x2u)
  231. #define osfscontrol_KIND_SHARABLE               ((osfscontrol_object_kind) 0x3u)
  232. #define osfscontrol_DIR_CSD                     ((osfscontrol_special_dir) 0x0u)
  233. #define osfscontrol_DIR_PSD                     ((osfscontrol_special_dir) 0x1u)
  234. #define osfscontrol_DIR_URD                     ((osfscontrol_special_dir) 0x2u)
  235. #define osfscontrol_DIR_LIB                     ((osfscontrol_special_dir) 0x3u)
  236.  
  237. /*************************
  238.  * Function declarations *
  239.  *************************/
  240.  
  241. #ifdef __cplusplus
  242.    extern "C" {
  243. #endif
  244.  
  245. /* ------------------------------------------------------------------------
  246.  * Function:      osfscontrol_dir()
  247.  *
  248.  * Description:   Sets the current directory (CSD) and (optionally) filing
  249.  *                system
  250.  *
  251.  * Input:         dir_names - value of R1 on entry
  252.  *
  253.  * Other notes:   Calls SWI 0x29 with R0 = 0x0.
  254.  */
  255.  
  256. extern os_error *xosfscontrol_dir (char const *dir_names);
  257. extern void osfscontrol_dir (char const *dir_names);
  258.  
  259. /* ------------------------------------------------------------------------
  260.  * Function:      osfscontrol_lib()
  261.  *
  262.  * Description:   Sets the library directory (Lib)
  263.  *
  264.  * Input:         dir_names - value of R1 on entry
  265.  *
  266.  * Other notes:   Calls SWI 0x29 with R0 = 0x1.
  267.  */
  268.  
  269. extern os_error *xosfscontrol_lib (char const *dir_names);
  270. extern void osfscontrol_lib (char const *dir_names);
  271.  
  272. /* ------------------------------------------------------------------------
  273.  * Function:      osfscontrol_start_application()
  274.  *
  275.  * Description:   Informs RISC OS and the current application that a new
  276.  *                application is starting
  277.  *
  278.  * Input:         tail - value of R1 on entry
  279.  *                cao - value of R2 on entry
  280.  *                command - value of R3 on entry
  281.  *
  282.  * Other notes:   Calls SWI 0x29 with R0 = 0x2.
  283.  */
  284.  
  285. extern os_error *xosfscontrol_start_application (char const *tail,
  286.       byte *cao,
  287.       char const *command);
  288. extern void osfscontrol_start_application (char const *tail,
  289.       byte *cao,
  290.       char const *command);
  291.  
  292. /* ------------------------------------------------------------------------
  293.  * Function:      osfscontrol_run()
  294.  *
  295.  * Description:   Runs a file
  296.  *
  297.  * Input:         file_names - value of R1 on entry
  298.  *
  299.  * Other notes:   Calls SWI 0x29 with R0 = 0x4.
  300.  */
  301.  
  302. extern os_error *xosfscontrol_run (char const *file_names);
  303. extern void osfscontrol_run (char const *file_names);
  304.  
  305. /* ------------------------------------------------------------------------
  306.  * Function:      osfscontrol_cat()
  307.  *
  308.  * Description:   Catalogues a directory
  309.  *
  310.  * Input:         dir_names - value of R1 on entry
  311.  *
  312.  * Other notes:   Calls SWI 0x29 with R0 = 0x5.
  313.  */
  314.  
  315. extern os_error *xosfscontrol_cat (char const *dir_names);
  316. extern void osfscontrol_cat (char const *dir_names);
  317.  
  318. /* ------------------------------------------------------------------------
  319.  * Function:      osfscontrol_ex()
  320.  *
  321.  * Description:   Examines a directory
  322.  *
  323.  * Input:         dir_names - value of R1 on entry
  324.  *
  325.  * Other notes:   Calls SWI 0x29 with R0 = 0x6.
  326.  */
  327.  
  328. extern os_error *xosfscontrol_ex (char const *dir_names);
  329. extern void osfscontrol_ex (char const *dir_names);
  330.  
  331. /* ------------------------------------------------------------------------
  332.  * Function:      osfscontrol_lcat()
  333.  *
  334.  * Description:   Catalogues the library directory
  335.  *
  336.  * Input:         dir_names - value of R1 on entry
  337.  *
  338.  * Other notes:   Calls SWI 0x29 with R0 = 0x7.
  339.  */
  340.  
  341. extern os_error *xosfscontrol_lcat (char const *dir_names);
  342. extern void osfscontrol_lcat (char const *dir_names);
  343.  
  344. /* ------------------------------------------------------------------------
  345.  * Function:      osfscontrol_lex()
  346.  *
  347.  * Description:   Examines the library directory
  348.  *
  349.  * Input:         dir_names - value of R1 on entry
  350.  *
  351.  * Other notes:   Calls SWI 0x29 with R0 = 0x8.
  352.  */
  353.  
  354. extern os_error *xosfscontrol_lex (char const *dir_names);
  355. extern void osfscontrol_lex (char const *dir_names);
  356.  
  357. /* ------------------------------------------------------------------------
  358.  * Function:      osfscontrol_info()
  359.  *
  360.  * Description:   Examines objects
  361.  *
  362.  * Input:         file_names - value of R1 on entry
  363.  *
  364.  * Other notes:   Calls SWI 0x29 with R0 = 0x9.
  365.  */
  366.  
  367. extern os_error *xosfscontrol_info (char const *file_names);
  368. extern void osfscontrol_info (char const *file_names);
  369.  
  370. /* ------------------------------------------------------------------------
  371.  * Function:      osfscontrol_opt()
  372.  *
  373.  * Description:   Sets filing system options - prefer
  374.  *                OSFSControl_WriteBootOption
  375.  *
  376.  * Input:         opt - value of R1 on entry
  377.  *                value - value of R2 on entry
  378.  *
  379.  * Other notes:   Calls SWI 0x29 with R0 = 0xA.
  380.  */
  381.  
  382. extern os_error *xosfscontrol_opt (int opt,
  383.       int value);
  384. extern void osfscontrol_opt (int opt,
  385.       int value);
  386.  
  387. /* ------------------------------------------------------------------------
  388.  * Function:      osfscontrol_set_temporary_fs()
  389.  *
  390.  * Description:   Sets the temporary filing system from a named prefix
  391.  *
  392.  * Input:         file_name - value of R1 on entry
  393.  *
  394.  * Output:        file_name_out - value of R1 on exit
  395.  *                old_fs_no - value of R2 on exit (X version only)
  396.  *                special - value of R3 on exit
  397.  *
  398.  * Returns:       R2 (non-X version only)
  399.  *
  400.  * Other notes:   Calls SWI 0x29 with R0 = 0xB.
  401.  */
  402.  
  403. extern os_error *xosfscontrol_set_temporary_fs (char const *file_name,
  404.       char **file_name_out,
  405.       fileswitch_fs_no *old_fs_no,
  406.       char **special);
  407. extern fileswitch_fs_no osfscontrol_set_temporary_fs (char const *file_name,
  408.       char **file_name_out,
  409.       char **special);
  410.  
  411. /* ------------------------------------------------------------------------
  412.  * Function:      osfscontrol_add_fs()
  413.  *
  414.  * Description:   Adds a filing system
  415.  *
  416.  * Input:         module - value of R1 on entry
  417.  *                fs_info_offset - value of R2 on entry
  418.  *                workspace - value of R3 on entry
  419.  *
  420.  * Other notes:   Calls SWI 0x29 with R0 = 0xC.
  421.  */
  422.  
  423. extern os_error *xosfscontrol_add_fs (byte const *module,
  424.       int fs_info_offset,
  425.       void *workspace);
  426. extern void osfscontrol_add_fs (byte const *module,
  427.       int fs_info_offset,
  428.       void *workspace);
  429.  
  430. /* ------------------------------------------------------------------------
  431.  * Function:      osfscontrol_lookup_fs()
  432.  *
  433.  * Description:   Checks for the presence of a filing system
  434.  *
  435.  * Input:         fs_no_or_name - value of R1 on entry
  436.  *                control_terminated - value of R2 on entry
  437.  *
  438.  * Output:        fs_no_out - value of R1 on exit
  439.  *                fs_found - value of R2 on exit (X version only)
  440.  *
  441.  * Returns:       R2 (non-X version only)
  442.  *
  443.  * Other notes:   Calls SWI 0x29 with R0 = 0xD.
  444.  */
  445.  
  446. extern os_error *xosfscontrol_lookup_fs (osfscontrol_id fs_no_or_name,
  447.       bool control_terminated,
  448.       fileswitch_fs_no *fs_no_out,
  449.       bool *fs_found);
  450. extern bool osfscontrol_lookup_fs (osfscontrol_id fs_no_or_name,
  451.       bool control_terminated,
  452.       fileswitch_fs_no *fs_no_out);
  453.  
  454. /* ------------------------------------------------------------------------
  455.  * Function:      osfscontrol_select_fs()
  456.  *
  457.  * Description:   Switches the current and temporary filing systems to the
  458.  *                one specified
  459.  *
  460.  * Input:         fs_no_or_name - value of R1 on entry
  461.  *
  462.  * Other notes:   Calls SWI 0x29 with R0 = 0xE.
  463.  */
  464.  
  465. extern os_error *xosfscontrol_select_fs (osfscontrol_id fs_no_or_name);
  466. extern void osfscontrol_select_fs (osfscontrol_id fs_no_or_name);
  467.  
  468. /* ------------------------------------------------------------------------
  469.  * Function:      osfscontrol_boot_from_fs()
  470.  *
  471.  * Description:   Boots off the currently selected filing system
  472.  *
  473.  * Other notes:   Calls SWI 0x29 with R0 = 0xF.
  474.  */
  475.  
  476. extern os_error *xosfscontrol_boot_from_fs (void);
  477. extern void osfscontrol_boot_from_fs (void);
  478.  
  479. /* ------------------------------------------------------------------------
  480.  * Function:      osfscontrol_remove_fs()
  481.  *
  482.  * Description:   Removes a filing system
  483.  *
  484.  * Input:         fs_name - value of R1 on entry
  485.  *
  486.  * Other notes:   Calls SWI 0x29 with R0 = 0x10.
  487.  */
  488.  
  489. extern os_error *xosfscontrol_remove_fs (char const *fs_name);
  490. extern void osfscontrol_remove_fs (char const *fs_name);
  491.  
  492. /* ------------------------------------------------------------------------
  493.  * Function:      osfscontrol_add_secondary_fs()
  494.  *
  495.  * Description:   Adds a secondary module
  496.  *
  497.  * Input:         fs_name - value of R1 on entry
  498.  *                secondary_name - value of R2 on entry
  499.  *                workspace - value of R3 on entry
  500.  *
  501.  * Other notes:   Calls SWI 0x29 with R0 = 0x11.
  502.  */
  503.  
  504. extern os_error *xosfscontrol_add_secondary_fs (char const *fs_name,
  505.       char const *secondary_name,
  506.       void *workspace);
  507. extern void osfscontrol_add_secondary_fs (char const *fs_name,
  508.       char const *secondary_name,
  509.       void *workspace);
  510.  
  511. /* ------------------------------------------------------------------------
  512.  * Function:      osfscontrol_read_file_type()
  513.  *
  514.  * Description:   Decodes a file type into text
  515.  *
  516.  * Input:         file_type - value of R2 on entry
  517.  *
  518.  * Output:        name1 - value of R2 on exit
  519.  *                name2 - value of R3 on exit
  520.  *
  521.  * Other notes:   Calls SWI 0x29 with R0 = 0x12.
  522.  */
  523.  
  524. extern os_error *xosfscontrol_read_file_type (bits file_type,
  525.       bits *name1,
  526.       bits *name2);
  527. extern void osfscontrol_read_file_type (bits file_type,
  528.       bits *name1,
  529.       bits *name2);
  530.  
  531. /* ------------------------------------------------------------------------
  532.  * Function:      osfscontrol_restore_current()
  533.  *
  534.  * Description:   Restore the current filing system after
  535.  *                OSFSControl_SetTemporaryFS
  536.  *
  537.  * Other notes:   Calls SWI 0x29 with R0 = 0x13.
  538.  */
  539.  
  540. extern os_error *xosfscontrol_restore_current (void);
  541. extern void osfscontrol_restore_current (void);
  542.  
  543. /* ------------------------------------------------------------------------
  544.  * Function:      osfscontrol_read_module_base()
  545.  *
  546.  * Description:   Reads location of primary module for temporary filing
  547.  *                system
  548.  *
  549.  * Output:        module - value of R1 on exit
  550.  *                workspace - value of R2 on exit
  551.  *
  552.  * Other notes:   Calls SWI 0x29 with R0 = 0x14.
  553.  */
  554.  
  555. extern os_error *xosfscontrol_read_module_base (byte **module,
  556.       void **workspace);
  557. extern void osfscontrol_read_module_base (byte **module,
  558.       void **workspace);
  559.  
  560. /* ------------------------------------------------------------------------
  561.  * Function:      osfscontrol_read_fs_handle()
  562.  *
  563.  * Description:   Returns a fiing system file handle
  564.  *
  565.  * Input:         file - value of R1 on entry
  566.  *
  567.  * Output:        fs_handle - value of R1 on exit (X version only)
  568.  *                info_word - value of R2 on exit
  569.  *
  570.  * Returns:       R1 (non-X version only)
  571.  *
  572.  * Other notes:   Calls SWI 0x29 with R0 = 0x15.
  573.  */
  574.  
  575. extern os_error *xosfscontrol_read_fs_handle (os_f file,
  576.       int *fs_handle,
  577.       int *info_word);
  578. extern int osfscontrol_read_fs_handle (os_f file,
  579.       int *info_word);
  580.  
  581. /* ------------------------------------------------------------------------
  582.  * Function:      osfscontrol_shut()
  583.  *
  584.  * Description:   Closes all open files on all filing systems
  585.  *
  586.  * Other notes:   Calls SWI 0x29 with R0 = 0x16.
  587.  */
  588.  
  589. extern os_error *xosfscontrol_shut (void);
  590. extern void osfscontrol_shut (void);
  591.  
  592. /* ------------------------------------------------------------------------
  593.  * Function:      osfscontrol_shutdown()
  594.  *
  595.  * Description:   Shuts down all filing systems
  596.  *
  597.  * Other notes:   Calls SWI 0x29 with R0 = 0x17.
  598.  */
  599.  
  600. extern os_error *xosfscontrol_shutdown (void);
  601. extern void osfscontrol_shutdown (void);
  602.  
  603. /* ------------------------------------------------------------------------
  604.  * Function:      osfscontrol_access()
  605.  *
  606.  * Description:   Sets the attributes of objects
  607.  *
  608.  * Input:         file_names - value of R1 on entry
  609.  *                access - value of R2 on entry
  610.  *
  611.  * Other notes:   Calls SWI 0x29 with R0 = 0x18.
  612.  */
  613.  
  614. extern os_error *xosfscontrol_access (char const *file_names,
  615.       char const *access);
  616. extern void osfscontrol_access (char const *file_names,
  617.       char const *access);
  618.  
  619. /* ------------------------------------------------------------------------
  620.  * Function:      osfscontrol_rename()
  621.  *
  622.  * Description:   Renames objects
  623.  *
  624.  * Input:         file_name - value of R1 on entry
  625.  *                new_file_name - value of R2 on entry
  626.  *
  627.  * Other notes:   Calls SWI 0x29 with R0 = 0x19.
  628.  */
  629.  
  630. extern os_error *xosfscontrol_rename (char const *file_name,
  631.       char const *new_file_name);
  632. extern void osfscontrol_rename (char const *file_name,
  633.       char const *new_file_name);
  634.  
  635. /* ------------------------------------------------------------------------
  636.  * Function:      osfscontrol_copy()
  637.  *
  638.  * Description:   Copies objects
  639.  *
  640.  * Input:         from - value of R1 on entry
  641.  *                to - value of R2 on entry
  642.  *                flags - value of R3 on entry
  643.  *                start_load - value of R4 on entry
  644.  *                start_exec - value of R5 on entry
  645.  *                end_load - value of R6 on entry
  646.  *                end_exec - value of R7 on entry
  647.  *                descriptor - value of R8 on entry
  648.  *
  649.  * Other notes:   Calls SWI 0x29 with R0 = 0x1A.
  650.  */
  651.  
  652. extern os_error *xosfscontrol_copy (char const *from,
  653.       char const *to,
  654.       osfscontrol_copy_flags flags,
  655.       bits start_load,
  656.       bits start_exec,
  657.       bits end_load,
  658.       bits end_exec,
  659.       osfscontrol_descriptor const *descriptor);
  660. extern void osfscontrol_copy (char const *from,
  661.       char const *to,
  662.       osfscontrol_copy_flags flags,
  663.       bits start_load,
  664.       bits start_exec,
  665.       bits end_load,
  666.       bits end_exec,
  667.       osfscontrol_descriptor const *descriptor);
  668.  
  669. /* ------------------------------------------------------------------------
  670.  * Function:      osfscontrol_wipe()
  671.  *
  672.  * Description:   Wipes objects
  673.  *
  674.  * Input:         file_names - value of R1 on entry
  675.  *                flags - value of R3 on entry
  676.  *                start_load - value of R4 on entry
  677.  *                start_exec - value of R5 on entry
  678.  *                end_load - value of R6 on entry
  679.  *                end_exec - value of R7 on entry
  680.  *
  681.  * Other notes:   Calls SWI 0x29 with R0 = 0x1B.
  682.  */
  683.  
  684. extern os_error *xosfscontrol_wipe (char const *file_names,
  685.       osfscontrol_wipe_flags flags,
  686.       bits start_load,
  687.       bits start_exec,
  688.       bits end_load,
  689.       bits end_exec);
  690. extern void osfscontrol_wipe (char const *file_names,
  691.       osfscontrol_wipe_flags flags,
  692.       bits start_load,
  693.       bits start_exec,
  694.       bits end_load,
  695.       bits end_exec);
  696.  
  697. /* ------------------------------------------------------------------------
  698.  * Function:      osfscontrol_count()
  699.  *
  700.  * Description:   Counts objects
  701.  *
  702.  * Input:         file_names - value of R1 on entry
  703.  *                flags - value of R3 on entry
  704.  *                start_load - value of R4 on entry
  705.  *                start_exec - value of R5 on entry
  706.  *                end_load - value of R6 on entry
  707.  *                end_exec - value of R7 on entry
  708.  *
  709.  * Output:        byte_count - value of R2 on exit (X version only)
  710.  *                file_count - value of R3 on exit
  711.  *
  712.  * Returns:       R2 (non-X version only)
  713.  *
  714.  * Other notes:   Calls SWI 0x29 with R0 = 0x1C.
  715.  */
  716.  
  717. extern os_error *xosfscontrol_count (char const *file_names,
  718.       osfscontrol_count_flags flags,
  719.       bits start_load,
  720.       bits start_exec,
  721.       bits end_load,
  722.       bits end_exec,
  723.       int *byte_count,
  724.       int *file_count);
  725. extern int osfscontrol_count (char const *file_names,
  726.       osfscontrol_count_flags flags,
  727.       bits start_load,
  728.       bits start_exec,
  729.       bits end_load,
  730.       bits end_exec,
  731.       int *file_count);
  732.  
  733. /* ------------------------------------------------------------------------
  734.  * Function:      osfscontrol_read_secondary_fs()
  735.  *
  736.  * Description:   Reads location of secondary module for temporary filing
  737.  *                system
  738.  *
  739.  * Output:        module - value of R1 on exit
  740.  *                workspace - value of R2 on exit
  741.  *
  742.  * Other notes:   Calls SWI 0x29 with R0 = 0x1E.
  743.  */
  744.  
  745. extern os_error *xosfscontrol_read_secondary_fs (byte **module,
  746.       void **workspace);
  747. extern void osfscontrol_read_secondary_fs (byte **module,
  748.       void **workspace);
  749.  
  750. /* ------------------------------------------------------------------------
  751.  * Function:      osfscontrol_file_type_from_string()
  752.  *
  753.  * Description:   Converts a string giving a file type to a number
  754.  *
  755.  * Input:         file_type_name - value of R1 on entry
  756.  *
  757.  * Output:        file_type - value of R2 on exit (X version only)
  758.  *
  759.  * Returns:       R2 (non-X version only)
  760.  *
  761.  * Other notes:   Calls SWI 0x29 with R0 = 0x1F.
  762.  */
  763.  
  764. extern os_error *xosfscontrol_file_type_from_string (char const *file_type_name,
  765.       bits *file_type);
  766. extern bits osfscontrol_file_type_from_string (char const *file_type_name);
  767.  
  768. /* ------------------------------------------------------------------------
  769.  * Function:      osfscontrol_file_info()
  770.  *
  771.  * Description:   Outputs a list of object names and information
  772.  *
  773.  * Input:         file_names - value of R1 on entry
  774.  *
  775.  * Other notes:   Calls SWI 0x29 with R0 = 0x20.
  776.  */
  777.  
  778. extern os_error *xosfscontrol_file_info (char const *file_names);
  779. extern void osfscontrol_file_info (char const *file_names);
  780.  
  781. /* ------------------------------------------------------------------------
  782.  * Function:      osfscontrol_read_fs_name()
  783.  *
  784.  * Description:   Converts a filing system number to a filing system name
  785.  *
  786.  * Input:         fs_no - value of R1 on entry
  787.  *                buffer - value of R2 on entry
  788.  *                size - value of R3 on entry
  789.  *
  790.  * Other notes:   Calls SWI 0x29 with R0 = 0x21.
  791.  */
  792.  
  793. extern os_error *xosfscontrol_read_fs_name (fileswitch_fs_no fs_no,
  794.       char *buffer,
  795.       int size);
  796. extern void osfscontrol_read_fs_name (fileswitch_fs_no fs_no,
  797.       char *buffer,
  798.       int size);
  799.  
  800. /* ------------------------------------------------------------------------
  801.  * Function:      osfscontrol_register_image_fs()
  802.  *
  803.  * Description:   Adds an image filing system
  804.  *
  805.  * Input:         module - value of R1 on entry
  806.  *                fs_info_offset - value of R2 on entry
  807.  *                workspace - value of R3 on entry
  808.  *
  809.  * Other notes:   Calls SWI 0x29 with R0 = 0x23.
  810.  */
  811.  
  812. extern os_error *xosfscontrol_register_image_fs (byte const *module,
  813.       int fs_info_offset,
  814.       void *workspace);
  815. extern void osfscontrol_register_image_fs (byte const *module,
  816.       int fs_info_offset,
  817.       void *workspace);
  818.  
  819. /* ------------------------------------------------------------------------
  820.  * Function:      osfscontrol_deregister_image_fs()
  821.  *
  822.  * Description:   Removes an image filing system
  823.  *
  824.  * Input:         file_type - value of R1 on entry
  825.  *
  826.  * Other notes:   Calls SWI 0x29 with R0 = 0x24.
  827.  */
  828.  
  829. extern os_error *xosfscontrol_deregister_image_fs (bits file_type);
  830. extern void osfscontrol_deregister_image_fs (bits file_type);
  831.  
  832. /* ------------------------------------------------------------------------
  833.  * Function:      osfscontrol_canonicalise_path()
  834.  *
  835.  * Description:   Converts a path name to a canonical form
  836.  *
  837.  * Input:         path_name - value of R1 on entry
  838.  *                buffer - value of R2 on entry
  839.  *                var - value of R3 on entry
  840.  *                path - value of R4 on entry
  841.  *                size - value of R5 on entry
  842.  *
  843.  * Output:        spare - value of R5 on exit (X version only)
  844.  *
  845.  * Returns:       R5 (non-X version only)
  846.  *
  847.  * Other notes:   Calls SWI 0x29 with R0 = 0x25.
  848.  */
  849.  
  850. extern os_error *xosfscontrol_canonicalise_path (char const *path_name,
  851.       char *buffer,
  852.       char const *var,
  853.       char const *path,
  854.       int size,
  855.       int *spare);
  856. extern int osfscontrol_canonicalise_path (char const *path_name,
  857.       char *buffer,
  858.       char const *var,
  859.       char const *path,
  860.       int size);
  861.  
  862. /* ------------------------------------------------------------------------
  863.  * Function:      osfscontrol_info_to_file_type()
  864.  *
  865.  * Description:   Converts file information to an object's file type
  866.  *
  867.  * Input:         file_name - value of R1 on entry
  868.  *                load_addr - value of R2 on entry
  869.  *                exec_addr - value of R3 on entry
  870.  *                size - value of R4 on entry
  871.  *                attr - value of R5 on entry
  872.  *                obj_type - value of R6 on entry
  873.  *
  874.  * Output:        file_type - value of R2 on exit (X version only)
  875.  *
  876.  * Returns:       R2 (non-X version only)
  877.  *
  878.  * Other notes:   Calls SWI 0x29 with R0 = 0x26.
  879.  */
  880.  
  881. extern os_error *xosfscontrol_info_to_file_type (char const *file_name,
  882.       bits load_addr,
  883.       bits exec_addr,
  884.       int size,
  885.       fileswitch_attr attr,
  886.       fileswitch_object_type obj_type,
  887.       bits *file_type);
  888. extern bits osfscontrol_info_to_file_type (char const *file_name,
  889.       bits load_addr,
  890.       bits exec_addr,
  891.       int size,
  892.       fileswitch_attr attr,
  893.       fileswitch_object_type obj_type);
  894.  
  895. /* ------------------------------------------------------------------------
  896.  * Function:      osfscontrol_urd()
  897.  *
  898.  * Description:   Sets the user root directory (URD)
  899.  *
  900.  * Input:         dir_name - value of R1 on entry
  901.  *
  902.  * Other notes:   Calls SWI 0x29 with R0 = 0x27.
  903.  */
  904.  
  905. extern os_error *xosfscontrol_urd (char const *dir_name);
  906. extern void osfscontrol_urd (char const *dir_name);
  907.  
  908. /* ------------------------------------------------------------------------
  909.  * Function:      osfscontrol_back()
  910.  *
  911.  * Description:   Exchanges the current and previous (PSD) directories
  912.  *
  913.  * Other notes:   Calls SWI 0x29 with R0 = 0x28.
  914.  */
  915.  
  916. extern os_error *xosfscontrol_back (void);
  917. extern void osfscontrol_back (void);
  918.  
  919. /* ------------------------------------------------------------------------
  920.  * Function:      osfscontrol_defect_list()
  921.  *
  922.  * Description:   Returns the defect list for an image
  923.  *
  924.  * Input:         image_name - value of R1 on entry
  925.  *                buffer - value of R2 on entry
  926.  *                size - value of R3 on entry
  927.  *
  928.  * Other notes:   Calls SWI 0x29 with R0 = 0x29.
  929.  */
  930.  
  931. extern os_error *xosfscontrol_defect_list (char const *image_name,
  932.       byte *buffer,
  933.       int size);
  934. extern void osfscontrol_defect_list (char const *image_name,
  935.       byte *buffer,
  936.       int size);
  937.  
  938. /* ------------------------------------------------------------------------
  939.  * Function:      osfscontrol_add_defect()
  940.  *
  941.  * Description:   Maps out a defect from an image
  942.  *
  943.  * Input:         image_name - value of R1 on entry
  944.  *                offset - value of R2 on entry
  945.  *
  946.  * Other notes:   Calls SWI 0x29 with R0 = 0x2A.
  947.  */
  948.  
  949. extern os_error *xosfscontrol_add_defect (char const *image_name,
  950.       int offset);
  951. extern void osfscontrol_add_defect (char const *image_name,
  952.       int offset);
  953.  
  954. /* ------------------------------------------------------------------------
  955.  * Function:      osfscontrol_no_dir()
  956.  *
  957.  * Description:   Unsets the current directory (CSD)
  958.  *
  959.  * Other notes:   Calls SWI 0x29 with R0 = 0x2B.
  960.  */
  961.  
  962. extern os_error *xosfscontrol_no_dir (void);
  963. extern void osfscontrol_no_dir (void);
  964.  
  965. /* ------------------------------------------------------------------------
  966.  * Function:      osfscontrol_no_urd()
  967.  *
  968.  * Description:   Unsets the user root directory (URD)
  969.  *
  970.  * Other notes:   Calls SWI 0x29 with R0 = 0x2C.
  971.  */
  972.  
  973. extern os_error *xosfscontrol_no_urd (void);
  974. extern void osfscontrol_no_urd (void);
  975.  
  976. /* ------------------------------------------------------------------------
  977.  * Function:      osfscontrol_no_lib()
  978.  *
  979.  * Description:   Unsets the library directory (Lib)
  980.  *
  981.  * Other notes:   Calls SWI 0x29 with R0 = 0x2D.
  982.  */
  983.  
  984. extern os_error *xosfscontrol_no_lib (void);
  985. extern void osfscontrol_no_lib (void);
  986.  
  987. /* ------------------------------------------------------------------------
  988.  * Function:      osfscontrol_used_space_map()
  989.  *
  990.  * Description:   Returns an image file's used space map
  991.  *
  992.  * Input:         image_name - value of R1 on entry
  993.  *                buffer - value of R2 on entry
  994.  *                size - value of R3 on entry
  995.  *
  996.  * Other notes:   Calls SWI 0x29 with R0 = 0x2E.
  997.  */
  998.  
  999. extern os_error *xosfscontrol_used_space_map (char const *image_name,
  1000.       byte *buffer,
  1001.       int size);
  1002. extern void osfscontrol_used_space_map (char const *image_name,
  1003.       byte *buffer,
  1004.       int size);
  1005.  
  1006. /* ------------------------------------------------------------------------
  1007.  * Function:      osfscontrol_read_boot_option()
  1008.  *
  1009.  * Description:   Reads the boot option of the disc or image file that
  1010.  *                holds a specified object
  1011.  *
  1012.  * Input:         file_name - value of R1 on entry
  1013.  *
  1014.  * Output:        boot_option - value of R2 on exit (X version only)
  1015.  *
  1016.  * Returns:       R2 (non-X version only)
  1017.  *
  1018.  * Other notes:   Calls SWI 0x29 with R0 = 0x2F.
  1019.  */
  1020.  
  1021. extern os_error *xosfscontrol_read_boot_option (char const *file_name,
  1022.       int *boot_option);
  1023. extern int osfscontrol_read_boot_option (char const *file_name);
  1024.  
  1025. /* ------------------------------------------------------------------------
  1026.  * Function:      osfscontrol_write_boot_option()
  1027.  *
  1028.  * Description:   Writes the boot option of the disc or image file that
  1029.  *                holds a specified object
  1030.  *
  1031.  * Input:         file_name - value of R1 on entry
  1032.  *                boot_option - value of R2 on entry
  1033.  *
  1034.  * Other notes:   Calls SWI 0x29 with R0 = 0x30.
  1035.  */
  1036.  
  1037. extern os_error *xosfscontrol_write_boot_option (char const *file_name,
  1038.       int boot_option);
  1039. extern void osfscontrol_write_boot_option (char const *file_name,
  1040.       int boot_option);
  1041.  
  1042. /* ------------------------------------------------------------------------
  1043.  * Function:      osfscontrol_free_space()
  1044.  *
  1045.  * Description:   Reads the free space on the disc or image file that holds
  1046.  *                a specified object
  1047.  *
  1048.  * Input:         file_name - value of R1 on entry
  1049.  *
  1050.  * Output:        free - value of R0 on exit (X version only)
  1051.  *                max - value of R1 on exit
  1052.  *                size - value of R2 on exit
  1053.  *
  1054.  * Returns:       R0 (non-X version only)
  1055.  *
  1056.  * Other notes:   Calls SWI 0x29 with R0 = 0x31.
  1057.  */
  1058.  
  1059. extern os_error *xosfscontrol_free_space (char const *file_name,
  1060.       int *free,
  1061.       int *max,
  1062.       int *size);
  1063. extern int osfscontrol_free_space (char const *file_name,
  1064.       int *max,
  1065.       int *size);
  1066.  
  1067. /* ------------------------------------------------------------------------
  1068.  * Function:      osfscontrol_name_disc()
  1069.  *
  1070.  * Description:   Names the disc or image file that holds a specified
  1071.  *                object
  1072.  *
  1073.  * Input:         file_name - value of R1 on entry
  1074.  *                disc_name - value of R2 on entry
  1075.  *
  1076.  * Other notes:   Calls SWI 0x29 with R0 = 0x32.
  1077.  */
  1078.  
  1079. extern os_error *xosfscontrol_name_disc (char const *file_name,
  1080.       char const *disc_name);
  1081. extern void osfscontrol_name_disc (char const *file_name,
  1082.       char const *disc_name);
  1083.  
  1084. /* ------------------------------------------------------------------------
  1085.  * Function:      osfscontrol_stamp_image()
  1086.  *
  1087.  * Description:   Used by a handler of discs to request that an image stamp
  1088.  *                be updated
  1089.  *
  1090.  * Input:         file_name - value of R1 on entry
  1091.  *                stamp_now - value of R2 on entry
  1092.  *
  1093.  * Other notes:   Calls SWI 0x29 with R0 = 0x33.
  1094.  */
  1095.  
  1096. extern os_error *xosfscontrol_stamp_image (char const *file_name,
  1097.       bool stamp_now);
  1098. extern void osfscontrol_stamp_image (char const *file_name,
  1099.       bool stamp_now);
  1100.  
  1101. /* ------------------------------------------------------------------------
  1102.  * Function:      osfscontrol_object_at_offset()
  1103.  *
  1104.  * Description:   Finds the name and kind of an object that uses a
  1105.  *                particular offset within an image
  1106.  *
  1107.  * Input:         file_name - value of R1 on entry
  1108.  *                offset - value of R2 on entry
  1109.  *                buffer - value of R3 on entry
  1110.  *                size - value of R4 on entry
  1111.  *
  1112.  * Output:        obj_kind - value of R2 on exit (X version only)
  1113.  *
  1114.  * Returns:       R2 (non-X version only)
  1115.  *
  1116.  * Other notes:   Calls SWI 0x29 with R0 = 0x34.
  1117.  */
  1118.  
  1119. extern os_error *xosfscontrol_object_at_offset (char const *file_name,
  1120.       int offset,
  1121.       char *buffer,
  1122.       int size,
  1123.       osfscontrol_object_kind *obj_kind);
  1124. extern osfscontrol_object_kind osfscontrol_object_at_offset (char const *file_name,
  1125.       int offset,
  1126.       char *buffer,
  1127.       int size);
  1128.  
  1129. /* ------------------------------------------------------------------------
  1130.  * Function:      osfscontrol_set_dir()
  1131.  *
  1132.  * Description:   Sets a specified directory to a given path without
  1133.  *                verification
  1134.  *
  1135.  * Input:         path - value of R1 on entry
  1136.  *                dir - value of R2 on entry
  1137.  *                fs_name - value of R3 on entry
  1138.  *                special - value of R6 on entry
  1139.  *
  1140.  * Other notes:   Calls SWI 0x29 with R0 = 0x35.
  1141.  */
  1142.  
  1143. extern os_error *xosfscontrol_set_dir (char const *path,
  1144.       osfscontrol_special_dir dir,
  1145.       char const *fs_name,
  1146.       char const *special);
  1147. extern void osfscontrol_set_dir (char const *path,
  1148.       osfscontrol_special_dir dir,
  1149.       char const *fs_name,
  1150.       char const *special);
  1151.  
  1152. /* ------------------------------------------------------------------------
  1153.  * Function:      osfscontrol_read_dir()
  1154.  *
  1155.  * Description:   Reads the path of a specified directory
  1156.  *
  1157.  * Input:         buffer - value of R1 on entry
  1158.  *                dir - value of R2 on entry
  1159.  *                fs_name - value of R3 on entry
  1160.  *                size - value of R5 on entry
  1161.  *
  1162.  * Output:        spare - value of R5 on exit (X version only)
  1163.  *                special - value of R6 on exit
  1164.  *
  1165.  * Returns:       R5 (non-X version only)
  1166.  *
  1167.  * Other notes:   Calls SWI 0x29 with R0 = 0x36.
  1168.  */
  1169.  
  1170. extern os_error *xosfscontrol_read_dir (char *buffer,
  1171.       osfscontrol_special_dir dir,
  1172.       char const *fs_name,
  1173.       int size,
  1174.       int *spare,
  1175.       char **special);
  1176. extern int osfscontrol_read_dir (char *buffer,
  1177.       osfscontrol_special_dir dir,
  1178.       char const *fs_name,
  1179.       int size,
  1180.       char **special);
  1181.  
  1182. /* ------------------------------------------------------------------------
  1183.  * Function:      osfscontrol_free_space64()
  1184.  *
  1185.  * Description:   Reads the 64-bit free space on the disc or image file
  1186.  *                that holds a specified object - RISC O S 3.6+
  1187.  *
  1188.  * Input:         file_name - value of R1 on entry
  1189.  *
  1190.  * Output:        free_lo - value of R0 on exit
  1191.  *                free_hi - value of R1 on exit
  1192.  *                max - value of R2 on exit
  1193.  *                disc_size_lo - value of R3 on exit
  1194.  *                disc_size_hi - value of R4 on exit
  1195.  *
  1196.  * Other notes:   Calls SWI 0x29 with R0 = 0x37.
  1197.  */
  1198.  
  1199. extern os_error *xosfscontrol_free_space64 (char const *file_name,
  1200.       bits *free_lo,
  1201.       int *free_hi,
  1202.       int *max,
  1203.       bits *disc_size_lo,
  1204.       bits *disc_size_hi);
  1205. extern void osfscontrol_free_space64 (char const *file_name,
  1206.       bits *free_lo,
  1207.       int *free_hi,
  1208.       int *max,
  1209.       bits *disc_size_lo,
  1210.       bits *disc_size_hi);
  1211.  
  1212. /* ------------------------------------------------------------------------
  1213.  * Function:      osfscontrol_defect_list64()
  1214.  *
  1215.  * Description:   Returns the 64-bit defect list for an image - RISC O S
  1216.  *                3.6+
  1217.  *
  1218.  * Input:         image_name - value of R1 on entry
  1219.  *                buffer - value of R2 on entry
  1220.  *                size - value of R3 on entry
  1221.  *
  1222.  * Other notes:   Calls SWI 0x29 with R0 = 0x38.
  1223.  */
  1224.  
  1225. extern os_error *xosfscontrol_defect_list64 (char const *image_name,
  1226.       byte *buffer,
  1227.       int size);
  1228. extern void osfscontrol_defect_list64 (char const *image_name,
  1229.       byte *buffer,
  1230.       int size);
  1231.  
  1232. /* ------------------------------------------------------------------------
  1233.  * Function:      osfscontrol_add_defect64()
  1234.  *
  1235.  * Description:   Maps out a 64-bit defect from an image - RISC O S 3.6+
  1236.  *
  1237.  * Input:         image_name - value of R1 on entry
  1238.  *                offset_lo - value of R2 on entry
  1239.  *                offset_hi - value of R3 on entry
  1240.  *
  1241.  * Other notes:   Calls SWI 0x29 with R0 = 0x39.
  1242.  */
  1243.  
  1244. extern os_error *xosfscontrol_add_defect64 (char const *image_name,
  1245.       bits offset_lo,
  1246.       int offset_hi);
  1247. extern void osfscontrol_add_defect64 (char const *image_name,
  1248.       bits offset_lo,
  1249.       int offset_hi);
  1250.  
  1251. /* ------------------------------------------------------------------------
  1252.  * Function:      upcall_media_not_present()
  1253.  *
  1254.  * Description:   Warns your program that a filing medium is not present
  1255.  *
  1256.  * Input:         fs_no - value of R1 on entry
  1257.  *                media_name - value of R2 on entry
  1258.  *                device_no - value of R3 on entry
  1259.  *                iteration_count - value of R4 on entry
  1260.  *                timeout - value of R5 on entry
  1261.  *                media_type - value of R6 on entry
  1262.  *
  1263.  * Output:        changed - value of R0 on exit (X version only)
  1264.  *
  1265.  * Returns:       R0 (non-X version only)
  1266.  *
  1267.  * Other notes:   Calls SWI 0x33 with R0 = 0x1.
  1268.  */
  1269.  
  1270. extern os_error *xupcall_media_not_present (fileswitch_fs_no fs_no,
  1271.       char const *media_name,
  1272.       int device_no,
  1273.       int iteration_count,
  1274.       int timeout,
  1275.       char const *media_type,
  1276.       int *changed);
  1277. extern int upcall_media_not_present (fileswitch_fs_no fs_no,
  1278.       char const *media_name,
  1279.       int device_no,
  1280.       int iteration_count,
  1281.       int timeout,
  1282.       char const *media_type);
  1283.  
  1284. /* ------------------------------------------------------------------------
  1285.  * Function:      upcall_media_not_known()
  1286.  *
  1287.  * Description:   Warns your program that a filing medium is not known
  1288.  *
  1289.  * Input:         fs_no - value of R1 on entry
  1290.  *                media_name - value of R2 on entry
  1291.  *                device_no - value of R3 on entry
  1292.  *                iteration_count - value of R4 on entry
  1293.  *                timeout - value of R5 on entry
  1294.  *                media_type - value of R6 on entry
  1295.  *
  1296.  * Output:        changed - value of R0 on exit (X version only)
  1297.  *
  1298.  * Returns:       R0 (non-X version only)
  1299.  *
  1300.  * Other notes:   Calls SWI 0x33 with R0 = 0x2.
  1301.  */
  1302.  
  1303. extern os_error *xupcall_media_not_known (fileswitch_fs_no fs_no,
  1304.       char const *media_name,
  1305.       int device_no,
  1306.       int iteration_count,
  1307.       int timeout,
  1308.       char const *media_type,
  1309.       int *changed);
  1310. extern int upcall_media_not_known (fileswitch_fs_no fs_no,
  1311.       char const *media_name,
  1312.       int device_no,
  1313.       int iteration_count,
  1314.       int timeout,
  1315.       char const *media_type);
  1316.  
  1317. /* ------------------------------------------------------------------------
  1318.  * Function:      upcallfscontrol_set_args_size()
  1319.  *
  1320.  * Description:   Warns your program that a file's size is being ensured
  1321.  *
  1322.  * Input:         f - value of R1 on entry
  1323.  *                size - value of R2 on entry
  1324.  *                fs_info - value of R8 on entry
  1325.  *
  1326.  * Other notes:   Calls SWI 0x33 with R0 = 0x3, R9 = 0x200.
  1327.  */
  1328.  
  1329. extern os_error *xupcallfscontrol_set_args_size (os_f f,
  1330.       int size,
  1331.       fileswitch_fs_info fs_info);
  1332. extern void upcallfscontrol_set_args_size (os_f f,
  1333.       int size,
  1334.       fileswitch_fs_info fs_info);
  1335.  
  1336. /* ------------------------------------------------------------------------
  1337.  * Function:      upcallfscontrol_rename()
  1338.  *
  1339.  * Description:   Warns your program that a file is being renamed
  1340.  *
  1341.  * Input:         file_name - value of R1 on entry
  1342.  *                new_file_name - value of R2 on entry
  1343.  *                special - value of R6 on entry
  1344.  *                new_special - value of R7 on entry
  1345.  *                fs_info - value of R8 on entry
  1346.  *
  1347.  * Other notes:   Calls SWI 0x33 with R0 = 0x3, R9 = 0x208.
  1348.  */
  1349.  
  1350. extern os_error *xupcallfscontrol_rename (char const *file_name,
  1351.       char const *new_file_name,
  1352.       char const *special,
  1353.       char const *new_special,
  1354.       fileswitch_fs_info fs_info);
  1355. extern void upcallfscontrol_rename (char const *file_name,
  1356.       char const *new_file_name,
  1357.       char const *special,
  1358.       char const *new_special,
  1359.       fileswitch_fs_info fs_info);
  1360.  
  1361. /* ------------------------------------------------------------------------
  1362.  * Function:      upcallfscontrol_set_attr_string()
  1363.  *
  1364.  * Description:   Warns your program that a file's attributes are being set
  1365.  *
  1366.  * Input:         file_name - value of R1 on entry
  1367.  *                attr - value of R2 on entry
  1368.  *                special - value of R6 on entry
  1369.  *                fs_info - value of R8 on entry
  1370.  *
  1371.  * Other notes:   Calls SWI 0x33 with R0 = 0x3, R9 = 0x209.
  1372.  */
  1373.  
  1374. extern os_error *xupcallfscontrol_set_attr_string (char const *file_name,
  1375.       char const *attr,
  1376.       char const *special,
  1377.       fileswitch_fs_info fs_info);
  1378. extern void upcallfscontrol_set_attr_string (char const *file_name,
  1379.       char const *attr,
  1380.       char const *special,
  1381.       fileswitch_fs_info fs_info);
  1382.  
  1383. /* ------------------------------------------------------------------------
  1384.  * Function:      upcall_media_search_end()
  1385.  *
  1386.  * Description:   Informs your program that a missing filing medium has
  1387.  *                been supplied, or that an operation involving one has
  1388.  *                been cancelled
  1389.  *
  1390.  * Other notes:   Calls SWI 0x33 with R0 = 0x4.
  1391.  */
  1392.  
  1393. extern os_error *xupcall_media_search_end (void);
  1394. extern void upcall_media_search_end (void);
  1395.  
  1396. /* ------------------------------------------------------------------------
  1397.  * Function:      upcall_new_application()
  1398.  *
  1399.  * Description:   Warns your program that a new application is going to be
  1400.  *                started
  1401.  *
  1402.  * Input:         cao - value of R2 on entry
  1403.  *
  1404.  * Output:        started - value of R0 on exit (X version only)
  1405.  *
  1406.  * Returns:       R0 (non-X version only)
  1407.  *
  1408.  * Other notes:   Calls SWI 0x33 with R0 = 0x100.
  1409.  */
  1410.  
  1411. extern os_error *xupcall_new_application (byte *cao,
  1412.       bool *started);
  1413. extern bool upcall_new_application (byte *cao);
  1414.  
  1415. #ifdef __cplusplus
  1416.    }
  1417. #endif
  1418.  
  1419. #endif
  1420.