home *** CD-ROM | disk | FTP | other *** search
- /* > h.h
- * Include header for make
- * Modified M. James Aug 1989
- */
- #include <string.h>
- #include <stdlib.h>
- #include <stdio.h>
- /* #include <ctype.h> */
-
- #ifndef uchar
- #ifdef os9
- #define uchar char
- #define void int
- #define fputc putc
- #else
- #define uchar unsigned char
- #endif
- #endif
-
- #define bool uchar
- #define time_t long
- #define max(a,b) ((a)>(b)?(a):(b))
- #if ! defined TRUE
- #define TRUE 1
- #define FALSE 0
- #endif
- #define DEFN1 "makefile" /* Default names */
- #define OUTDEF "!Make" /* where the commands go */
-
- #define LZ (256) /* Line size */
-
-
-
- /*
- * A name. This represents a file, either to be made, or existant
- */
-
- struct name
- {
- struct name * n_next; /* Next in the list of names */
- char * n_name; /* Called */
- struct line * n_line; /* Dependencies */
- time_t n_time; /* Modify time of this name */
- uchar n_flag; /* Info about the name */
- };
- #define N_MARK 0x01 /* For cycle check */
- #define N_DONE 0x02 /* Name looked at */
- #define N_TARG 0x04 /* Name is a target */
- #define N_PREC 0x08 /* Target is precious */
- #define N_DOUBLE 0x10 /* Double colon target */
-
- /*
- * Definition of a target line.
- */
- struct line
- {
- struct line * l_next; /* Next line (for ::) */
- struct depend * l_dep; /* Dependents for this line */
- struct cmd * l_cmd; /* Commands for this line */
- };
-
- /*
- * List of dependents for a line
- */
- struct depend
- {
- struct depend * d_next; /* Next dependent */
- struct name * d_name; /* Name of dependent */
- };
-
-
- /*
- * Commands for a line
- */
- struct cmd
- {
- struct cmd * c_next; /* Next command line */
- char * c_cmd; /* Command line */
- };
-
-
- /*
- * Macro storage
- */
- struct macro
- {
- struct macro * m_next; /* Next variable */
- char * m_name; /* Called ... */
- char * m_val; /* Its value */
- uchar m_flag; /* Infinite loop check */
- };
-
- extern char * myname;
- extern struct name namehead;
- extern struct macro * macrohead;
- extern struct name * firstname;
- extern bool silent;
- extern bool ignore;
- extern bool rules;
- extern bool dotouch;
- extern bool quest;
- extern bool domake;
- extern char str1[];
- extern char str2[];
- extern int lineno;
- extern char filepath[];/* where to find all of the files MDJ */
- extern FILE * outfile;
-
- /* extern int errno; */
-
- char * getmacro(char * name);
- struct macro * setmacro(char * name,char * value);
-
- void input(FILE * fd);
-
- #ifndef DOING_ERROR
- void report_error(char * msg , ...);
- void fatal(char * msg, ...);
- #endif
-
- int make(struct name *np, int level);
- struct name * newname(char * name);
- struct depend * newdep(struct name * np, struct depend * dp);
- struct cmd * newcmd(char * str, struct cmd * cp);
- void newline(struct name * np, struct depend * dp, struct cmd * cp, int flag);
- char * suffix(char * name);
- void touch(struct name * np);
- void makerules(void);
- char * gettok(char **ptr);
- void precious(void);
- bool getline(char *str, FILE * fd);
-
- void expand(char * str);
-
- void modtime(struct name * np);
-
- void prt(void);
- bool dyndep(struct name * np);
- void circh(void);
-
- /* make the functions here */
-
- /* added file handler functions */
- #define NO_FILE 0
- #define IS_FILE 1
- #define IS_DIR 2
-
-
- /* added stuff in c.file */
- unsigned int getstamp(char * name,int * stat);
- void stamp (char * name);
-
- /* filename translation */
-
- void RISCfromUnix(char * name);
- void convertLine (char * line);
-
-
- /* the odd definitions ... ANSI :-( */
- #define index strchr
- #define rindex strrchr
-