home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_03 / 9n03049b < prev    next >
Text File  |  1990-12-09  |  2KB  |  62 lines

  1. Listing 2 (lidar.h)
  2. /* --- 
  3.    Header for lidar tasks.  This header includes 
  4.    the IDs for the message queues and shared memory,
  5.    shared structures, and shared definitions.
  6. --- */
  7.  
  8. #include     <file.h>
  9. #include     <time.h>
  10. #include    <types.h>
  11. #include    <stat.h>
  12. #include    <resource.h>
  13. #include    <sys/ipc.h>
  14. #include    <sys/msg.h>
  15. #include    <sys/sem.h>
  16. #include    <sys/shm.h>
  17. #include    <sys/oscalls.h>
  18. #include    <tclock.h>
  19.  
  20. /* --- queue keys --- */
  21. #define AVAILABLE_Q     1
  22. #define GRAPHICS_Q      2
  23. #define READ_Q          3
  24. #define WRITE_Q         4
  25. /* --- shared memory key --- */
  26. #define FB_KEY          10
  27.  
  28. /* --- semaphore keys --- */
  29. #define ALIVE_KEY       "alive"
  30.  
  31. /* --- message structure containing frame buffer
  32.        index (key) for shared memory access --- */
  33. typedef struct message_rec {
  34.         long type;     /* required  */
  35.         int key;       /* index into shared memory */
  36.         } message;
  37.  
  38. /* -- defines for messages -- */
  39. #define MSG_SIZE 4
  40.  
  41. /* --- frame buffer number and size --- */
  42. #define N_FRAMES        10
  43. #define FRAME_SIZE      2560
  44. #define WRITE_SIZE      2560
  45. #define READ_SIZE       2070
  46.  
  47. /* --- number of runs to make for sample program --- */
  48. #define N_RUNS 100
  49.  
  50. /* --- priorities for each process --- */
  51. #define LIDAR_ACQ    19
  52. #define LIDAR_READ   18
  53. #define LIDAR_WRITE  17
  54. #define LIDAR_GRAPH  16
  55.  
  56. /* --- useful defines --- */
  57. #define TRUE     1
  58. #define FALSE    0
  59. #define QUIT    -1
  60. #define NOFLAGS  0
  61. #define ANYTYPE  0
  62.