home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 502b.lha / cc / src / op.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-07  |  992 b   |  31 lines

  1. /*
  2.  * file operands
  3.  * March 1989, Miles Bader (orig from cc.c by fred fish)
  4.  */
  5.  
  6. /*
  7.  *    Command line arguments that represent files to be compiled, assembled,
  8.  *    or linked, are kept track of as "ops".  If, for example,
  9.  *    the file name is "df0:mydir/junk.c", then the rootname is
  10.  *    "df0:mydir/junk", the basename is "junk", and the suffix is "c".
  11.  *    String suffixes are used, rather than single character suffixes, to
  12.  *    allow use of names with multicharacter suffixes.
  13.  */
  14.  
  15. struct op{        /* Info about each operand (non option) */
  16.     char *rootname;        /* Name minus any suffix */
  17.     char *basename;        /* Name minus any prefix or suffix */
  18.     char *suffix;        /* suffix of operand */
  19. };
  20.  
  21. /*
  22.  *    macros to determine the suffix type of a file given a pointer to
  23.  *    its operand structure.
  24.  */
  25. #define op_IsC(op) (strcmp(op->suffix,"c")==0)
  26. #define op_IsS(op) (strcmp(op->suffix,"s")==0)
  27. #define op_IsO(op) (strcmp(op->suffix,"o")==0)
  28.  
  29. struct op *op_Create(char *name);
  30. void op_Free(struct op *op);
  31.