home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_04 / v7n4046a.txt < prev    next >
Text File  |  1989-02-08  |  1KB  |  83 lines

  1.  
  2.  
  3.  
  4. #define FALSE 0 
  5. #define TRUE 1
  6.  
  7. /* possible values for color */
  8.  
  9. #define BLACK 0 
  10. #define BLUE 1 
  11. #define GREEN 2 
  12. #define CYAN 3 
  13. #define RED 4 
  14. #define MAGENTA 5 
  15. #define BROWN 6 
  16. #define WHITE 7
  17.  
  18. struct attributes {
  19.      unsigned bordash : 1;    /* solid or dashed */
  20.      unsigned bcolor  : 3;/* border foreground color */
  21.      unsigned fill    : 1;/* fill/nofill with fcolor */
  22.      unsigned fcolor  : 3;/* fill color */
  23. };
  24.  
  25. main() 
  26. {
  27.         static struct attributes atr;
  28.         atr.bordash = FALSE;
  29.      atr.bcolor = RED;
  30.      atr.fill = TRUE;
  31.      atr.fcolor = WHITE;
  32.      /* ... */ 
  33. };
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. #include "atr.h"
  41.  
  42. struct boxatr1 {
  43.      int xpos;
  44.      int ypos;
  45.      unsigned xlen;
  46.      unsigned ylen;
  47.      unsigned bordash : 1;
  48.      unsigned bcolor  : 3;
  49.      unsigned fill    : 1;
  50.      unsigned fcolor  : 3;
  51. };
  52.  
  53. struct boxatr1 b1 = {1, 1, 2, 3, FALSE, GREEN, TRUE, RED};
  54.  
  55.  
  56.  
  57.  
  58. #include "atr.h"
  59.  
  60. struct box {
  61.      int xpos;
  62.      int ypos;
  63.      unsigned xlen;
  64.      unsigned ylen;
  65. };
  66.  
  67. struct attributes {
  68.      unsigned bordash : 1;
  69.      unsigned bcolor  : 3;
  70.      unsigned fill    : 1;
  71.      unsigned fcolor  : 3;
  72. };
  73.  
  74. struct boxatr2 {
  75.      struct box abox;
  76.      struct attributes atr;
  77. };
  78.  
  79. struct boxatr2 b2 = {
  80.      {1, 1, 2, 3},
  81.      {FALSE, GREEN, TRUE, RED} 
  82. };
  83.