home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Computer / h / osargs < prev    next >
Encoding:
Text File  |  1995-06-29  |  8.9 KB  |  304 lines

  1. #ifndef osargs_H
  2. #define osargs_H
  3.  
  4. /* C header file for OSArgs
  5.  * written by DefMod (Jun 20 1995) on Thu Jun 29 16:56:57 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_Args
  25. #define OS_Args                                 0x9
  26. #undef  XOS_Args
  27. #define XOS_Args                                0x20009
  28. #undef  OSArgs_ReadPtr
  29. #define OSArgs_ReadPtr                          0x0
  30. #undef  OSArgs_ReadTemporaryFS
  31. #define OSArgs_ReadTemporaryFS                  0x0
  32. #undef  OSArgs_SetPtr
  33. #define OSArgs_SetPtr                           0x1
  34. #undef  OSArgs_ReadExt
  35. #define OSArgs_ReadExt                          0x2
  36. #undef  OSArgs_SetExt
  37. #define OSArgs_SetExt                           0x3
  38. #undef  OSArgs_ReadAllocation
  39. #define OSArgs_ReadAllocation                   0x4
  40. #undef  OSArgs_ReadEOFStatus
  41. #define OSArgs_ReadEOFStatus                    0x5
  42. #undef  OSArgs_SetAllocation
  43. #define OSArgs_SetAllocation                    0x6
  44. #undef  OSArgs_ReadPath
  45. #define OSArgs_ReadPath                         0x7
  46. #undef  OSArgs_ImageStamped
  47. #define OSArgs_ImageStamped                     0x8
  48. #undef  OSArgs_ReadInfo
  49. #define OSArgs_ReadInfo                         0xFE
  50. #undef  OSArgs_Ensure
  51. #define OSArgs_Ensure                           0xFF
  52. #undef  ArgsV
  53. #define ArgsV                                   0x9
  54.  
  55. /********************
  56.  * Type definitions *
  57.  ********************/
  58. typedef bits osargs_stream_status;
  59.  
  60. /************************
  61.  * Constant definitions *
  62.  ************************/
  63. #define osargs_STREAM_INTERACTIVE               ((osargs_stream_status) 0x8u)
  64. #define osargs_STREAM_SUPPORTS_GBPB             ((osargs_stream_status) 0x10u)
  65. #define osargs_STREAM_DIR                       ((osargs_stream_status) 0x20u)
  66. #define osargs_STREAM_READABLE                  ((osargs_stream_status) 0x40u)
  67. #define osargs_STREAM_WRITABLE                  ((osargs_stream_status) 0x80u)
  68. #define osargs_STREAM_WRITTEN                   ((osargs_stream_status) 0x100u)
  69. #define osargs_STREAM_EOF_ERROR_ON_NEXT_READ    ((osargs_stream_status) 0x200u)
  70. #define osargs_STREAM_UNBUFFERED                ((osargs_stream_status) 0x400u)
  71. #define osargs_STREAM_UNALLOCATED               ((osargs_stream_status) 0x800u)
  72. #define osargs_STREAM_CRITICAL                  ((osargs_stream_status) 0x1000u)
  73. #define osargs_STREAM_DATA_LOST                 ((osargs_stream_status) 0x2000u)
  74. #define osargs_STREAM_IMAGE_FILE_BUSY           ((osargs_stream_status) 0x4000u)
  75.  
  76. /*************************
  77.  * Function declarations *
  78.  *************************/
  79.  
  80. #ifdef __cplusplus
  81.    extern "C" {
  82. #endif
  83.  
  84. /* ------------------------------------------------------------------------
  85.  * Function:      osargs_read_ptr()
  86.  *
  87.  * Description:   Reads a file's sequential file pointer
  88.  *
  89.  * Input:         file - value of R1 on entry
  90.  *
  91.  * Output:        ptr - value of R2 on exit (X version only)
  92.  *
  93.  * Returns:       R2 (non-X version only)
  94.  *
  95.  * Other notes:   Calls SWI 0x9 with R0 = 0x0.
  96.  */
  97.  
  98. extern os_error *xosargs_read_ptr (os_f file,
  99.       int *ptr);
  100. extern int osargs_read_ptr (os_f file);
  101.  
  102. /* ------------------------------------------------------------------------
  103.  * Function:      osargs_read_temporary_fs()
  104.  *
  105.  * Description:   Reads the temporary filing system number
  106.  *
  107.  * Output:        temp_fs_no - value of R0 on exit (X version only)
  108.  *
  109.  * Returns:       R0 (non-X version only)
  110.  *
  111.  * Other notes:   Calls SWI 0x9 with R0 = 0x0, R1 = 0x0.
  112.  */
  113.  
  114. extern os_error *xosargs_read_temporary_fs (fileswitch_fs_no *temp_fs_no);
  115. extern fileswitch_fs_no osargs_read_temporary_fs (void);
  116.  
  117. /* ------------------------------------------------------------------------
  118.  * Function:      osargs_set_ptr()
  119.  *
  120.  * Description:   Writes an open file's sequential file pointer
  121.  *
  122.  * Input:         file - value of R1 on entry
  123.  *                ptr - value of R2 on entry
  124.  *
  125.  * Other notes:   Calls SWI 0x9 with R0 = 0x1.
  126.  */
  127.  
  128. extern os_error *xosargs_set_ptr (os_f file,
  129.       int ptr);
  130. extern void osargs_set_ptr (os_f file,
  131.       int ptr);
  132.  
  133. /* ------------------------------------------------------------------------
  134.  * Function:      osargs_read_ext()
  135.  *
  136.  * Description:   Reads an open file's extent
  137.  *
  138.  * Input:         file - value of R1 on entry
  139.  *
  140.  * Output:        ext - value of R2 on exit (X version only)
  141.  *
  142.  * Returns:       R2 (non-X version only)
  143.  *
  144.  * Other notes:   Calls SWI 0x9 with R0 = 0x2.
  145.  */
  146.  
  147. extern os_error *xosargs_read_ext (os_f file,
  148.       int *ext);
  149. extern int osargs_read_ext (os_f file);
  150.  
  151. /* ------------------------------------------------------------------------
  152.  * Function:      osargs_set_ext()
  153.  *
  154.  * Description:   Writes an open file's extent
  155.  *
  156.  * Input:         file - value of R1 on entry
  157.  *                ext - value of R2 on entry
  158.  *
  159.  * Other notes:   Calls SWI 0x9 with R0 = 0x3.
  160.  */
  161.  
  162. extern os_error *xosargs_set_ext (os_f file,
  163.       int ext);
  164. extern void osargs_set_ext (os_f file,
  165.       int ext);
  166.  
  167. /* ------------------------------------------------------------------------
  168.  * Function:      osargs_read_allocation()
  169.  *
  170.  * Description:   Reads an open file's allocated size
  171.  *
  172.  * Input:         file - value of R1 on entry
  173.  *
  174.  * Output:        allocation - value of R2 on exit (X version only)
  175.  *
  176.  * Returns:       R2 (non-X version only)
  177.  *
  178.  * Other notes:   Calls SWI 0x9 with R0 = 0x4.
  179.  */
  180.  
  181. extern os_error *xosargs_read_allocation (os_f file,
  182.       int *allocation);
  183. extern int osargs_read_allocation (os_f file);
  184.  
  185. /* ------------------------------------------------------------------------
  186.  * Function:      osargs_read_eof_status()
  187.  *
  188.  * Description:   Reads an open file's end-of-file (EOF) status
  189.  *
  190.  * Input:         file - value of R1 on entry
  191.  *
  192.  * Output:        eof_status - value of R2 on exit (X version only)
  193.  *
  194.  * Returns:       R2 (non-X version only)
  195.  *
  196.  * Other notes:   Calls SWI 0x9 with R0 = 0x5.
  197.  */
  198.  
  199. extern os_error *xosargs_read_eof_status (os_f file,
  200.       bool *eof_status);
  201. extern bool osargs_read_eof_status (os_f file);
  202.  
  203. /* ------------------------------------------------------------------------
  204.  * Function:      osargs_set_allocation()
  205.  *
  206.  * Description:   Ensures an open file's size
  207.  *
  208.  * Input:         file - value of R1 on entry
  209.  *                allocation - value of R2 on entry
  210.  *
  211.  * Output:        allocation_out - value of R2 on exit (X version only)
  212.  *
  213.  * Returns:       R2 (non-X version only)
  214.  *
  215.  * Other notes:   Calls SWI 0x9 with R0 = 0x6.
  216.  */
  217.  
  218. extern os_error *xosargs_set_allocation (os_f file,
  219.       int allocation,
  220.       int *allocation_out);
  221. extern int osargs_set_allocation (os_f file,
  222.       int allocation);
  223.  
  224. /* ------------------------------------------------------------------------
  225.  * Function:      osargs_read_path()
  226.  *
  227.  * Description:   Converts a file handle to a canonical name
  228.  *
  229.  * Input:         file - value of R1 on entry
  230.  *                buffer - value of R2 on entry
  231.  *                size - value of R5 on entry
  232.  *
  233.  * Output:        spare - value of R5 on exit (X version only)
  234.  *
  235.  * Returns:       R5 (non-X version only)
  236.  *
  237.  * Other notes:   Calls SWI 0x9 with R0 = 0x7.
  238.  */
  239.  
  240. extern os_error *xosargs_read_path (os_f file,
  241.       char *buffer,
  242.       int size,
  243.       int *spare);
  244. extern int osargs_read_path (os_f file,
  245.       char *buffer,
  246.       int size);
  247.  
  248. /* ------------------------------------------------------------------------
  249.  * Function:      osargs_image_stamped()
  250.  *
  251.  * Description:   Used by an image filing system to inform of a change to
  252.  *                an image stamp
  253.  *
  254.  * Input:         file - value of R1 on entry
  255.  *                image_stamp - value of R2 on entry
  256.  *
  257.  * Other notes:   Calls SWI 0x9 with R0 = 0x8.
  258.  */
  259.  
  260. extern os_error *xosargs_image_stamped (os_f file,
  261.       int image_stamp);
  262. extern void osargs_image_stamped (os_f file,
  263.       int image_stamp);
  264.  
  265. /* ------------------------------------------------------------------------
  266.  * Function:      osargs_read_info()
  267.  *
  268.  * Description:   Reads information on a file handle
  269.  *
  270.  * Input:         file - value of R1 on entry
  271.  *
  272.  * Output:        stream_status - value of R0 on exit
  273.  *                fs_info - value of R2 on exit
  274.  *
  275.  * Other notes:   Calls SWI 0x9 with R0 = 0xFE.
  276.  */
  277.  
  278. extern os_error *xosargs_read_info (os_f file,
  279.       osargs_stream_status *stream_status,
  280.       fileswitch_fs_info *fs_info);
  281. extern void osargs_read_info (os_f file,
  282.       osargs_stream_status *stream_status,
  283.       fileswitch_fs_info *fs_info);
  284.  
  285. /* ------------------------------------------------------------------------
  286.  * Function:      osargs_ensure()
  287.  *
  288.  * Description:   Ensures data has been written to a file, or to all files
  289.  *                on the temporary filing system
  290.  *
  291.  * Input:         file - value of R1 on entry
  292.  *
  293.  * Other notes:   Calls SWI 0x9 with R0 = 0xFF.
  294.  */
  295.  
  296. extern os_error *xosargs_ensure (os_f file);
  297. extern void osargs_ensure (os_f file);
  298.  
  299. #ifdef __cplusplus
  300.    }
  301. #endif
  302.  
  303. #endif
  304.