ack.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. #ifndef UTILS_ACK_ACK_H
  6. #define UTILS_ACK_ACK_H
  7. #include "trans.h"
  8. #include "grows.h"
  9. #ifndef NORCSID
  10. #define RCS_ACK "$Id$"
  11. #endif
  12. /****************************************************************************/
  13. /* User settable options */
  14. /****************************************************************************/
  15. #define FRONTENDS "fe" /* The front-end definitions */
  16. #define TMPNAME "Ack_%x" /* Naming of temp. files */
  17. /****************************************************************************/
  18. /* Internal mnemonics, should not be tinkered with */
  19. /****************************************************************************/
  20. /* The names of some string variables */
  21. #define HOME "EM"
  22. #define RTS "RTS"
  23. #define HEAD "HEAD"
  24. #define TAIL "TAIL"
  25. #define SRC "SOURCE"
  26. #define LIBVAR "LNAME"
  27. #define SUFFIX "SUFFIX"
  28. /* Intended for flags, possibly in bit fields */
  29. #define YES (1)
  30. #define NO (0)
  31. #define MAYBE (2)
  32. #define EXTERN extern
  33. #define SUFCHAR '.' /* Start of SUFFIX in file name */
  34. #define SPACE ' '
  35. #define TAB '\t'
  36. #define EQUAL '='
  37. #define S_VAR '{' /* Start of variable */
  38. #define C_VAR '}' /* End of variable */
  39. #define A_VAR '?' /* Variable alternative */
  40. #define BSLASH '\\' /* Backslash */
  41. #define STAR '*' /* STAR */
  42. #define C_IN '<' /* Token specifying input */
  43. #define C_OUT '>' /* Token specifying output */
  44. #define S_EXPR '(' /* Start of expression */
  45. #define C_EXPR ')' /* End of expression */
  46. #define M_EXPR ':' /* Middle of two suffix lists */
  47. #define T_EXPR '=' /* Start of tail */
  48. #define NO_SCAN 0200 /* Bit set in character to defeat recogn. */
  49. typedef struct {
  50. char *p_path; /* points to the full pathname */
  51. int p_keeps:1; /* The string should be thrown when unused */
  52. int p_keep:1; /* The file should be thrown away after use */
  53. } path ;
  54. #define p_cont(elem) ((path *)l_content(elem))
  55. /* Return values of setpath() */
  56. enum f_path { F_OK, F_NOMATCH, F_NOPATH } ;
  57. /* Own routines */
  58. enum f_path getpath(trf **first);
  59. enum f_path scan_end(trf **first);
  60. void noodstop();
  61. char *getvar(char *name);
  62. char *keeps(char *str);
  63. char *basename(char *string);
  64. char *skipblank(char *str);
  65. char *firstblank(char *str);
  66. char *getcore(unsigned size);
  67. char *changecore(char *ptr, unsigned int size);
  68. #define freecore(area) free(area)
  69. growstring scanb(char *line);
  70. growstring scanvars(char *line);
  71. #define DEBUG 1 /* Allow debugging of Ack */
  72. #ifndef DEBUG
  73. # define debug 0 /* To surprise all these 'if ( debug ) 's */
  74. #else
  75. extern int debug ;
  76. #endif
  77. #endif /* UTILS_ACK_ACK_H */