home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 355_03 / slk3.exe / TEST / TST / MINMAC.TST < prev    next >
Text File  |  1989-06-27  |  1KB  |  24 lines

  1. typedef unsigned short word;
  2. typedef struct {
  3.     word st_col;    /* starting column of line.    */
  4.     word st_row;    /* starting row.        */
  5.     word end_col;    /* ending column.        */
  6.     word end_row;    /* ending row.            */
  7.     word st_arcol;    /* starting col of arrorhead.    */
  8.     word st_arrow;    /* starting row.        */
  9.     word end_arcol;    /* ending col.            */
  10.     word end_arrow;    /* ending row.            */
  11. } line;
  12.  
  13. #define min(a,b) ( ((a) < (b)) ? (a) : (b) )
  14. #define max(a,b) ( ((a) > (b)) ? (a) : (b) )
  15.  
  16. extern void generate_line(line *l)
  17. {
  18. word min_row_ext, min_col_ext, max_row_ext, max_col_ext; /* used if calculate_extent is set */
  19.  min_row_ext = min(min_row_ext, min(l->st_arrow, min(l->end_arrow, min(l->st_row, l->end_row))));
  20.  min_col_ext = min(min_col_ext, min(l->st_arcol, min(l->end_arcol, min(l->st_row, l->end_col))));
  21.  max_row_ext = max(max_row_ext, max(l->st_arrow, max(l->end_arrow, max(l->st_row, l->end_row))));
  22.  max_col_ext = max(max_col_ext, max(l->st_arcol, max(l->end_arcol, max(l->st_row, l->end_col))));
  23. }
  24.