home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 5 / QRZ Ham Radio Callsign Database - Volume 5.iso / files / amiga / csrc720j.lzh / lock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-11  |  1.3 KB  |  51 lines

  1. /* lock.h header */
  2. #include <exec/ports.h>
  3. #include <exec/semaphores.h>
  4.  
  5. struct lock_msg {
  6.    struct Message cm;      /* This must be first */
  7.    short channel;          /* Command to locker. Now only accepts the
  8.                               shutdown message. If it can't shutdown
  9.                               or the command is incorrect it will return
  10.                               a -1 in this field. Otherwise it will
  11.                               shutdown.
  12.                            */
  13. };
  14.  
  15. /* Port names. In wa8ded only the ctl-name is used. */
  16. #define LOCK_NAME (UBYTE *)"VE5VA-LOCK"
  17.  
  18. /*
  19.    Definition of command to tell the locker to shutdown.
  20.    The command is an almost arbitrary number.
  21. */
  22. #define L_SHUTDOWN   73
  23.  
  24.  
  25. /* Semaphore names */
  26. #define SEM_LOCK  (UBYTE *)"VE5VA-LOCK-SEM"
  27. #define SEM_BUSY  (UBYTE *)"VE5VA-BUSY-SEM"
  28. #define SEM_MAIL  (UBYTE *)"VE5VA-MAIL-SEM"
  29. #define SEM_USER  (UBYTE *)"VE5VA-USER-SEM"
  30. #define SEM_BID   (UBYTE *)"VE5VA-BID-SEM"
  31.  
  32. /* Semaphore structure required to implement the set/clr/getbusy.
  33.    It consists of a semaphore, which must be first, and then an
  34.    integer used to count the number of active processes.
  35. */
  36. struct user_sem {
  37.    struct Semaphore US;
  38.    short count;
  39. };
  40.  
  41. /* structure for the semaphores that control
  42.    mail.dat
  43.    user.dat
  44.    bid.mb
  45. */
  46. struct file_sem {
  47.    struct Semaphore US;
  48.    long filesize;
  49. };
  50.  
  51.