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

  1. #ifndef cdfs_H
  2. #define cdfs_H
  3.  
  4. /* C header file for CDFS
  5.  * written by DefMod (Jun 20 1995) on Thu Jun 22 12:13:22 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 filecore_H
  18. #include "filecore.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  CDFS_ConvertDriveToDevice
  25. #define CDFS_ConvertDriveToDevice               0x41E80
  26. #undef  XCDFS_ConvertDriveToDevice
  27. #define XCDFS_ConvertDriveToDevice              0x61E80
  28. #undef  CDFS_SetBufferSize
  29. #define CDFS_SetBufferSize                      0x41E81
  30. #undef  XCDFS_SetBufferSize
  31. #define XCDFS_SetBufferSize                     0x61E81
  32. #undef  CDFS_GetBufferSize
  33. #define CDFS_GetBufferSize                      0x41E82
  34. #undef  XCDFS_GetBufferSize
  35. #define XCDFS_GetBufferSize                     0x61E82
  36. #undef  CDFS_SetNumberOfDrives
  37. #define CDFS_SetNumberOfDrives                  0x41E83
  38. #undef  XCDFS_SetNumberOfDrives
  39. #define XCDFS_SetNumberOfDrives                 0x61E83
  40. #undef  CDFS_GetNumberOfDrives
  41. #define CDFS_GetNumberOfDrives                  0x41E84
  42. #undef  XCDFS_GetNumberOfDrives
  43. #define XCDFS_GetNumberOfDrives                 0x61E84
  44. #undef  CDFS_GiveFileType
  45. #define CDFS_GiveFileType                       0x41E85
  46. #undef  XCDFS_GiveFileType
  47. #define XCDFS_GiveFileType                      0x61E85
  48. #undef  CDFS_DescribeDisc
  49. #define CDFS_DescribeDisc                       0x41E86
  50. #undef  XCDFS_DescribeDisc
  51. #define XCDFS_DescribeDisc                      0x61E86
  52. #undef  CDFS_WhereIsFile
  53. #define CDFS_WhereIsFile                        0x41E87
  54. #undef  XCDFS_WhereIsFile
  55. #define XCDFS_WhereIsFile                       0x61E87
  56. #undef  CDFS_Truncation
  57. #define CDFS_Truncation                         0x41E88
  58. #undef  XCDFS_Truncation
  59. #define XCDFS_Truncation                        0x61E88
  60. #undef  CDFSTruncation_Read
  61. #define CDFSTruncation_Read                     0x0
  62. #undef  CDFSTruncation_Write
  63. #define CDFSTruncation_Write                    0x1
  64.  
  65. /********************
  66.  * Type definitions *
  67.  ********************/
  68. typedef int cdfs_truncation_type;
  69.  
  70. /************************
  71.  * Constant definitions *
  72.  ************************/
  73. #define cdfs_TRUNCATION_FROM_RIGHT              ((cdfs_truncation_type) 0x0u)
  74. #define cdfs_TRUNCATION_FROM_LEFT               ((cdfs_truncation_type) 0x1u)
  75. #define cdfs_TRUNCATION_NONE                    ((cdfs_truncation_type) 0x2u)
  76. #define cdfs_TRUNCATION_DEFAULT                 ((cdfs_truncation_type) 0xFFFFFFFFu)
  77.  
  78. /*************************
  79.  * Function declarations *
  80.  *************************/
  81.  
  82. #ifdef __cplusplus
  83.    extern "C" {
  84. #endif
  85.  
  86. /* ------------------------------------------------------------------------
  87.  * Function:      cdfs_convert_drive_to_device()
  88.  *
  89.  * Description:   Converts a logical drive number to a physical drive
  90.  *                number
  91.  *
  92.  * Input:         log_no - value of R0 on entry
  93.  *
  94.  * Output:        phys_no - value of R1 on exit (X version only)
  95.  *
  96.  * Returns:       R1 (non-X version only)
  97.  *
  98.  * Other notes:   Calls SWI 0x41E80.
  99.  */
  100.  
  101. extern os_error *xcdfs_convert_drive_to_device (int log_no,
  102.       int *phys_no);
  103. extern int cdfs_convert_drive_to_device (int log_no);
  104.  
  105. /* ------------------------------------------------------------------------
  106.  * Function:      cdfs_set_buffer_size()
  107.  *
  108.  * Description:   Calls SWI 0x41E81
  109.  *
  110.  * Input:         buffer_size_exp - value of R0 on entry
  111.  */
  112.  
  113. extern os_error *xcdfs_set_buffer_size (int buffer_size_exp);
  114. __swi (0x41E81) void cdfs_set_buffer_size (int buffer_size_exp);
  115.  
  116. /* ------------------------------------------------------------------------
  117.  * Function:      cdfs_get_buffer_size()
  118.  *
  119.  * Description:   Calls SWI 0x41E82
  120.  *
  121.  * Output:        buffer_size_exp - value of R0 on exit (X version only)
  122.  *
  123.  * Returns:       R0 (non-X version only)
  124.  */
  125.  
  126. extern os_error *xcdfs_get_buffer_size (int *buffer_size_exp);
  127. __swi (0x41E82) int cdfs_get_buffer_size (void);
  128.  
  129. /* ------------------------------------------------------------------------
  130.  * Function:      cdfs_set_number_of_drives()
  131.  *
  132.  * Description:   Calls SWI 0x41E83
  133.  *
  134.  * Input:         drive_count - value of R0 on entry
  135.  */
  136.  
  137. extern os_error *xcdfs_set_number_of_drives (int drive_count);
  138. __swi (0x41E83) void cdfs_set_number_of_drives (int drive_count);
  139.  
  140. /* ------------------------------------------------------------------------
  141.  * Function:      cdfs_get_number_of_drives()
  142.  *
  143.  * Description:   Calls SWI 0x41E84
  144.  *
  145.  * Output:        drive_count - value of R0 on exit (X version only)
  146.  *
  147.  * Returns:       R0 (non-X version only)
  148.  */
  149.  
  150. extern os_error *xcdfs_get_number_of_drives (int *drive_count);
  151. __swi (0x41E84) int cdfs_get_number_of_drives (void);
  152.  
  153. /* ------------------------------------------------------------------------
  154.  * Function:      cdfs_give_file_type()
  155.  *
  156.  * Description:   Do not use
  157.  *
  158.  * Input:         file_name - value of R0 on entry
  159.  *
  160.  * Output:        file_type - value of R1 on exit (X version only)
  161.  *
  162.  * Returns:       R1 (non-X version only)
  163.  *
  164.  * Other notes:   Calls SWI 0x41E85.
  165.  */
  166.  
  167. extern os_error *xcdfs_give_file_type (char const *file_name,
  168.       bits *file_type);
  169. extern bits cdfs_give_file_type (char const *file_name);
  170.  
  171. /* ------------------------------------------------------------------------
  172.  * Function:      cdfs_describe_disc()
  173.  *
  174.  * Description:   Do not use
  175.  *
  176.  * Input:         log_no - value of R0 on entry
  177.  *                disc - value of R1 on entry
  178.  *
  179.  * Other notes:   Calls SWI 0x41E86.
  180.  */
  181.  
  182. extern os_error *xcdfs_describe_disc (int log_no,
  183.       filecore_disc *disc);
  184. __swi (0x41E86) void cdfs_describe_disc (int log_no,
  185.       filecore_disc *disc);
  186.  
  187. /* ------------------------------------------------------------------------
  188.  * Function:      cdfs_where_is_file()
  189.  *
  190.  * Description:   Calls SWI 0x41E87
  191.  *
  192.  * Input:         file_name - value of R0 on entry
  193.  *
  194.  * Output:        block_no - value of R1 on exit
  195.  *                size - value of R2 on exit
  196.  */
  197.  
  198. extern os_error *xcdfs_where_is_file (char const *file_name,
  199.       int *block_no,
  200.       int *size);
  201. extern void cdfs_where_is_file (char const *file_name,
  202.       int *block_no,
  203.       int *size);
  204.  
  205. /* ------------------------------------------------------------------------
  206.  * Function:      cdfstruncation_read()
  207.  *
  208.  * Description:   Calls reason code 0 of SWI 0x41E88
  209.  *
  210.  * Output:        type - value of R1 on exit (X version only)
  211.  *
  212.  * Returns:       R1 (non-X version only)
  213.  *
  214.  * Other notes:   Before entry, R0 = 0x0.
  215.  */
  216.  
  217. extern os_error *xcdfstruncation_read (cdfs_truncation_type *type);
  218. extern cdfs_truncation_type cdfstruncation_read (void);
  219.  
  220. /* ------------------------------------------------------------------------
  221.  * Function:      cdfstruncation_write()
  222.  *
  223.  * Description:   Calls reason code 1 of SWI 0x41E88
  224.  *
  225.  * Input:         type - value of R1 on entry
  226.  *
  227.  * Other notes:   Before entry, R0 = 0x1.
  228.  */
  229.  
  230. extern os_error *xcdfstruncation_write (cdfs_truncation_type type);
  231. extern void cdfstruncation_write (cdfs_truncation_type type);
  232.  
  233. #ifdef __cplusplus
  234.    }
  235. #endif
  236.  
  237. #endif
  238.