home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume11 / watcher / part01 / pp_out.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-09-27  |  696 b   |  40 lines

  1. /*
  2.    pp_out: pretty print the output of command structure.
  3.  
  4.    Kenneth Ingham
  5.  
  6.    Copyright (C) 1987 The University of New Mexico
  7. */
  8.  
  9. #include "defs.h"
  10.  
  11. pp_out(type,of)
  12. int type;
  13. union out_fmt_u of;
  14. {
  15.     struct rel_out_st *rp;
  16.     struct col_out_st *cp;
  17.  
  18.     switch(type) {
  19.         case RELATIVE:
  20.             rp = of.rel_fmt;
  21.             while (rp != NULL) {
  22.                 printf(" %d %s %% %c", rp->field, rp->name,
  23.                     TCHAR(rp->type));
  24.                 rp = rp->next;
  25.             }
  26.             break;
  27.         case COLUMN:
  28.             cp = of.col_fmt;
  29.             while (cp != NULL) {
  30.                 printf(" %d - %d %s %% %c", cp->start,
  31.                     cp->end, cp->name, TCHAR(cp->type));
  32.                 cp = cp->next;
  33.             }
  34.             break;
  35.         default:
  36.             printf("Impossible value for outfmt type: %d\n", type);
  37.             break;
  38.     }
  39. }
  40.