home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / fslock < prev    next >
Encoding:
Text File  |  1994-09-30  |  4.1 KB  |  131 lines

  1. #ifndef fslock_H
  2. #define fslock_H
  3.  
  4. /* C header file for FSLock
  5.  * written by DefMod (Sep 16 1994) on Fri Sep 30 15:17:57 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. /**********************************
  24.  * SWI names and SWI reason codes *
  25.  **********************************/
  26. #undef  FSLock_Version
  27. #define FSLock_Version                          0x44780
  28. #undef  XFSLock_Version
  29. #define XFSLock_Version                         0x64780
  30. #undef  FSLock_Status
  31. #define FSLock_Status                           0x44781
  32. #undef  XFSLock_Status
  33. #define XFSLock_Status                          0x64781
  34. #undef  FSLock_ChangeStatus
  35. #define FSLock_ChangeStatus                     0x44782
  36. #undef  XFSLock_ChangeStatus
  37. #define XFSLock_ChangeStatus                    0x64782
  38.  
  39. /************************
  40.  * Constant definitions *
  41.  ************************/
  42. #define fslock_STATUS_UNLOCKED                  0
  43. #define fslock_STATUS_PROTECTED                 1
  44. #define fslock_STATUS_LOCKED                    2
  45. #define error_FS_LOCK_UNKNOWN_SWI               0x806500u
  46. #define error_FS_LOCK_LOCKED                    0x806501u
  47. #define error_FS_LOCK_UNKNOWN_FS                0x806502u
  48. #define error_FS_LOCK_FS_NOT_LOCKABLE           0x806503u
  49. #define error_FS_LOCK_NO_LOCKED_FS              0x806504u
  50. #define error_FS_LOCK_PROTECTED_DISC            0x806505u
  51. #define error_FS_LOCK_KILLED                    0x806506u
  52.  
  53. /*************************
  54.  * Function declarations *
  55.  *************************/
  56.  
  57. #ifdef __cplusplus
  58.    extern "C" {
  59. #endif
  60.  
  61. /*************************************************************
  62.  * NOTE: The following functions provide direct access to    *
  63.  *       the SWI's noted in the function description.        *
  64.  *       Please read the relevant PRM section for more       *
  65.  *       information on their input/output parameters.       *
  66.  *************************************************************/
  67.  
  68. /* ------------------------------------------------------------------------
  69.  * Function:      fslock_version()
  70.  *
  71.  * Description:   Returns information describing the FSLock module
  72.  *
  73.  * Output:        version - value of R0 on exit (X version only)
  74.  *                workspace - value of R1 on exit
  75.  *
  76.  * Returns:       R0 (non-X version only)
  77.  *
  78.  * Other notes:   Calls SWI 0x44780.
  79.  */
  80.  
  81. extern os_error *xfslock_version (int *version,
  82.       void **workspace);
  83. extern int fslock_version (void **workspace);
  84.  
  85. /* ------------------------------------------------------------------------
  86.  * Function:      fslock_status()
  87.  *
  88.  * Description:   Returns the current lock status, and the locked filing
  89.  *                system's number
  90.  *
  91.  * Output:        lock_status - value of R0 on exit (X version only)
  92.  *                fs_no - value of R1 on exit
  93.  *
  94.  * Returns:       R0 (non-X version only)
  95.  *
  96.  * Other notes:   Calls SWI 0x44781.
  97.  */
  98.  
  99. extern os_error *xfslock_status (int *lock_status,
  100.       int *fs_no);
  101. extern int fslock_status (int *fs_no);
  102.  
  103. /* ------------------------------------------------------------------------
  104.  * Function:      fslock_change_status()
  105.  *
  106.  * Description:   Changes one or more of the lock status, the password and
  107.  *                the locked filing system
  108.  *
  109.  * Input:         new_lock_status - value of R0 on entry
  110.  *                password - value of R1 on entry
  111.  *                new_password - value of R2 on entry
  112.  *                new_fs_no - value of R3 on entry
  113.  *
  114.  * Other notes:   Calls SWI 0x44782.
  115.  */
  116.  
  117. extern os_error *xfslock_change_status (int new_lock_status,
  118.       char *password,
  119.       char *new_password,
  120.       int new_fs_no);
  121. extern void fslock_change_status (int new_lock_status,
  122.       char *password,
  123.       char *new_password,
  124.       int new_fs_no);
  125.  
  126. #ifdef __cplusplus
  127.    }
  128. #endif
  129.  
  130. #endif
  131.