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

  1. #ifndef fslock_H
  2. #define fslock_H
  3.  
  4. /* C header file for FSLock
  5.  * written by DefMod (Jun 20 1995) on Thu Jun 29 16:57:21 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  FSLock_Version
  25. #define FSLock_Version                          0x44780
  26. #undef  XFSLock_Version
  27. #define XFSLock_Version                         0x64780
  28. #undef  FSLock_Status
  29. #define FSLock_Status                           0x44781
  30. #undef  XFSLock_Status
  31. #define XFSLock_Status                          0x64781
  32. #undef  FSLock_ChangeStatus
  33. #define FSLock_ChangeStatus                     0x44782
  34. #undef  XFSLock_ChangeStatus
  35. #define XFSLock_ChangeStatus                    0x64782
  36.  
  37. /********************
  38.  * Type definitions *
  39.  ********************/
  40. typedef int fslock_lock_status;
  41.  
  42. /************************
  43.  * Constant definitions *
  44.  ************************/
  45. #define fslock_STATUS_UNLOCKED                  ((fslock_lock_status) 0x0u)
  46. #define fslock_STATUS_PROTECTED                 ((fslock_lock_status) 0x1u)
  47. #define fslock_STATUS_LOCKED                    ((fslock_lock_status) 0x2u)
  48. #define error_FS_LOCK_UNKNOWN_SWI               0x806500u
  49. #define error_FS_LOCK_LOCKED                    0x806501u
  50. #define error_FS_LOCK_UNKNOWN_FS                0x806502u
  51. #define error_FS_LOCK_FS_NOT_LOCKABLE           0x806503u
  52. #define error_FS_LOCK_NO_LOCKED_FS              0x806504u
  53. #define error_FS_LOCK_PROTECTED_DISC            0x806505u
  54. #define error_FS_LOCK_KILLED                    0x806506u
  55.  
  56. /*************************
  57.  * Function declarations *
  58.  *************************/
  59.  
  60. #ifdef __cplusplus
  61.    extern "C" {
  62. #endif
  63.  
  64. /* ------------------------------------------------------------------------
  65.  * Function:      fslock_version()
  66.  *
  67.  * Description:   Returns information describing the FSLock module - RISC O
  68.  *                S 3.5+
  69.  *
  70.  * Output:        version - value of R0 on exit (X version only)
  71.  *                workspace - value of R1 on exit
  72.  *
  73.  * Returns:       R0 (non-X version only)
  74.  *
  75.  * Other notes:   Calls SWI 0x44780.
  76.  */
  77.  
  78. extern os_error *xfslock_version (int *version,
  79.       void **workspace);
  80. extern int fslock_version (void **workspace);
  81.  
  82. /* ------------------------------------------------------------------------
  83.  * Function:      fslock_status()
  84.  *
  85.  * Description:   Returns the current lock status, and the locked filing
  86.  *                system's number - RISC O S 3.5+
  87.  *
  88.  * Output:        lock_status - value of R0 on exit (X version only)
  89.  *                fs_no - value of R1 on exit
  90.  *
  91.  * Returns:       R0 (non-X version only)
  92.  *
  93.  * Other notes:   Calls SWI 0x44781.
  94.  */
  95.  
  96. extern os_error *xfslock_status (fslock_lock_status *lock_status,
  97.       fileswitch_fs_no *fs_no);
  98. extern fslock_lock_status fslock_status (fileswitch_fs_no *fs_no);
  99.  
  100. /* ------------------------------------------------------------------------
  101.  * Function:      fslock_change_status()
  102.  *
  103.  * Description:   Changes one or more of the lock status, the password and
  104.  *                the locked filing system - RISC O S 3.5+
  105.  *
  106.  * Input:         new_lock_status - value of R0 on entry
  107.  *                password - value of R1 on entry
  108.  *                new_password - value of R2 on entry
  109.  *                new_fs_no - value of R3 on entry
  110.  *
  111.  * Other notes:   Calls SWI 0x44782.
  112.  */
  113.  
  114. extern os_error *xfslock_change_status (fslock_lock_status new_lock_status,
  115.       char const *password,
  116.       char const *new_password,
  117.       fileswitch_fs_no new_fs_no);
  118. __swi (0x44782) void fslock_change_status (fslock_lock_status new_lock_status,
  119.       char const *password,
  120.       char const *new_password,
  121.       fileswitch_fs_no new_fs_no);
  122.  
  123. #ifdef __cplusplus
  124.    }
  125. #endif
  126.  
  127. #endif
  128.