home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / program / k / make / !make_h_h < prev    next >
Encoding:
Text File  |  1994-10-12  |  4.5 KB  |  162 lines

  1. /* > h.h
  2.  *      Include header for make
  3.  * Modified M. James Aug 1989
  4.  */
  5. #include <string.h>
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. /* #include <ctype.h>  */
  9.  
  10. #ifndef uchar
  11. #ifdef os9
  12. #define uchar           char
  13. #define void            int
  14. #define fputc           putc
  15. #else
  16. #define uchar           unsigned char
  17. #endif
  18. #endif
  19.  
  20. #define bool            uchar
  21. #define time_t          long
  22. #define max(a,b)        ((a)>(b)?(a):(b))
  23. #if ! defined TRUE
  24. #define TRUE 1
  25. #define FALSE 0
  26. #endif
  27. #define DEFN1           "makefile"              /*  Default names  */
  28. #define OUTDEF          "!Make"                /* where the commands go */
  29.  
  30. #define LZ              (256)                  /*  Line size  */
  31.  
  32.  
  33.  
  34. /*
  35.  *      A name.  This represents a file, either to be made, or existant
  36.  */
  37.  
  38. struct name
  39. {
  40.         struct name *           n_next;       /* Next in the list of names */
  41.         char *                  n_name;       /* Called */
  42.         struct line *           n_line;       /* Dependencies */
  43.         time_t                  n_time;       /* Modify time of this name */
  44.         uchar                   n_flag;       /* Info about the name */
  45. };
  46. #define N_MARK          0x01                   /* For cycle check */
  47. #define N_DONE          0x02                   /* Name looked at */
  48. #define N_TARG          0x04                   /* Name is a target */
  49. #define N_PREC          0x08                   /* Target is precious */
  50. #define N_DOUBLE        0x10                   /* Double colon target */
  51.  
  52. /*
  53.  *      Definition of a target line.
  54.  */
  55. struct  line
  56. {
  57.         struct line *           l_next;        /* Next line (for ::) */
  58.         struct depend *         l_dep;         /* Dependents for this line */
  59.         struct cmd *            l_cmd;         /* Commands for this line */
  60. };
  61.  
  62. /*
  63.  *      List of dependents for a line
  64.  */
  65. struct  depend
  66. {
  67.         struct depend *         d_next;         /* Next dependent */
  68.         struct name *           d_name;         /* Name of dependent */
  69. };
  70.  
  71.  
  72. /*
  73.  *      Commands for a line 
  74.  */
  75. struct  cmd
  76. {
  77.         struct cmd *            c_next;         /* Next command line */
  78.         char *                  c_cmd;          /* Command line */
  79. };
  80.  
  81.  
  82. /*
  83.  *      Macro storage
  84.  */
  85. struct  macro
  86. {
  87.         struct macro *          m_next;         /* Next variable */
  88.         char *                  m_name;         /* Called ... */
  89.         char *                  m_val;          /* Its value */
  90.         uchar                   m_flag;         /* Infinite loop check */
  91. };
  92.  
  93. extern char *           myname;
  94. extern struct name      namehead;
  95. extern struct macro *   macrohead;
  96. extern struct name *    firstname;
  97. extern bool             silent;
  98. extern bool             ignore;
  99. extern bool             rules;
  100. extern bool             dotouch;
  101. extern bool             quest;
  102. extern bool             domake;
  103. extern char             str1[];
  104. extern char             str2[];
  105. extern int              lineno;
  106. extern char             filepath[];/* where to find all of the files MDJ */
  107. extern FILE  *          outfile;
  108.  
  109. /* extern int              errno;  */
  110.  
  111. char *                  getmacro(char * name);
  112. struct macro *          setmacro(char * name,char * value);
  113.  
  114. void                    input(FILE * fd);
  115.  
  116. #ifndef DOING_ERROR
  117. void                    report_error(char * msg , ...); 
  118. void                    fatal(char * msg,  ...);
  119. #endif
  120.  
  121. int                     make(struct name *np, int level);
  122. struct name *           newname(char * name);
  123. struct depend *         newdep(struct name * np, struct depend * dp);
  124. struct cmd *            newcmd(char * str, struct cmd * cp);
  125. void                    newline(struct name * np, struct depend * dp, struct cmd * cp, int flag);
  126. char *                  suffix(char * name);
  127. void                    touch(struct name * np);
  128. void                    makerules(void);
  129. char *                  gettok(char **ptr);
  130. void                    precious(void);
  131. bool                    getline(char *str, FILE * fd);
  132.  
  133. void                    expand(char * str);
  134.  
  135. void                    modtime(struct name * np);
  136.  
  137. void                    prt(void);
  138. bool                    dyndep(struct name * np);
  139. void                    circh(void);
  140.  
  141. /* make the functions here */
  142.  
  143. /* added file handler functions */
  144. #define NO_FILE 0
  145. #define IS_FILE 1
  146. #define IS_DIR  2
  147.  
  148.  
  149. /* added stuff in c.file */
  150. unsigned int   getstamp(char * name,int * stat);
  151. void           stamp   (char * name);
  152.  
  153. /* filename translation */
  154.  
  155. void   RISCfromUnix(char * name);
  156. void   convertLine (char * line);
  157.  
  158.  
  159. /* the odd definitions ... ANSI :-( */
  160. #define index  strchr
  161. #define rindex strrchr
  162.