[BACK]Return to parse.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/parse.c between version 1.68 and 1.69

version 1.68, 2003/06/03 02:56:12 version 1.69, 2004/04/07 13:11:36
Line 233 
Line 233 
  *----------------------------------------------------------------------   *----------------------------------------------------------------------
  */   */
 static int  static int
 ParseFindKeyword(str)  ParseFindKeyword(const char *str)       /* keyword to look up */
     const char      *str;               /* String to find */  
 {  {
     int             start,      int             start,
                     end,                      end,
Line 272 
Line 271 
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  */   */
 static void  static void
 ParseLinkSrc(pgn, cgn)  ParseLinkSrc(
     GNode               *pgn;   /* The parent node */      GNode               *pgn,   /* The parent node */
     GNode               *cgn;   /* The child node */      GNode               *cgn)   /* The child node */
 {  {
     if (Lst_AddNew(&pgn->children, cgn)) {      if (Lst_AddNew(&pgn->children, cgn)) {
         if (specType == Not)          if (specType == Not)
Line 297 
Line 296 
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  */   */
 static int  static int
 ParseDoOp(gn, op)  ParseDoOp(
     GNode          *gn; /* The node to which the operator is to be      GNode          *gn, /* The node to which the operator is to be applied */
                                  * applied */      int            op)  /* The operator to apply */
     int            op;  /* The operator to apply */  
 {  {
     /*      /*
      * If the dependency mask of the operator and the node don't match and       * If the dependency mask of the operator and the node don't match and
Line 367 
Line 365 
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  */   */
 static int  static int
 ParseAddDep(p, s)  ParseAddDep(GNode *p, GNode *s)
     GNode *p;  
     GNode *s;  
 {  {
     if (p->order < s->order) {      if (p->order < s->order) {
         /* XXX: This can cause loops, and loops can cause unmade targets,          /* XXX: This can cause loops, and loops can cause unmade targets,
Line 399 
Line 395 
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  */   */
 static void  static void
 ParseDoSrc(tOp, src)  ParseDoSrc(
     int         tOp;    /* operator (if any) from special targets */      int         tOp,    /* operator (if any) from special targets */
     const char  *src;   /* name of the source to handle */      const char  *src)   /* name of the source to handle */
   
 {  {
     GNode       *gn = NULL;      GNode       *gn = NULL;
   
Line 511 
Line 506 
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
  */   */
 static int  static int
 ParseFindMain(gnp, dummy)  ParseFindMain(
     void *gnp;      /* Node to examine */      void *gnp,      /* Node to examine */
     void *dummy         UNUSED;      void *dummy         UNUSED)
 {  {
     GNode         *gn = (GNode *)gnp;      GNode         *gn = (GNode *)gnp;
     if ((gn->type & OP_NOTARGET) == 0) {      if ((gn->type & OP_NOTARGET) == 0) {
Line 535 
Line 530 
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
  */   */
 static void  static void
 ParseAddDir(path, name)  ParseAddDir(void *path, void *name)
     void *path;  
     void *name;  
 {  {
     Dir_AddDir((Lst)path, (char *)name);      Dir_AddDir((Lst)path, (char *)name);
 }  }
Line 549 
Line 542 
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
  */   */
 static void  static void
 ParseClearPath(p)  ParseClearPath(void *p)
     void        *p;  
 {  {
     Lst         path = (Lst)p;      Lst         path = (Lst)p;
   
Line 590 
Line 582 
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  */   */
 static void  static void
 ParseDoDependency(line)  ParseDoDependency(char *line)   /* the line to parse */
     char           *line;       /* the line to parse */  
 {  {
     char           *cp;         /* our current position */      char           *cp;         /* our current position */
     GNode          *gn;         /* a general purpose temporary node */      GNode          *gn;         /* a general purpose temporary node */
Line 1081 
Line 1072 
  *      A new element is added to the commands list of the node.   *      A new element is added to the commands list of the node.
  */   */
 static void  static void
 ParseAddCmd(gnp, cmd)  ParseAddCmd(
     void *gnp;  /* the node to which the command is to be added */      void *gnp,  /* the node to which the command is to be added */
     void *cmd;  /* the command to add */      void *cmd)  /* the command to add */
 {  {
     GNode *gn = (GNode *)gnp;      GNode *gn = (GNode *)gnp;
     /* if target already supplied, ignore commands */      /* if target already supplied, ignore commands */
Line 1109 
Line 1100 
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
  */   */
 static void  static void
 ParseHasCommands(gnp)  ParseHasCommands(void *gnp)         /* Node to examine */
     void *gnp;      /* Node to examine */  
 {  {
     GNode *gn = (GNode *)gnp;      GNode *gn = (GNode *)gnp;
     if (!Lst_IsEmpty(&gn->commands)) {      if (!Lst_IsEmpty(&gn->commands)) {
Line 1126 
Line 1116 
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
  */   */
 void  void
 Parse_AddIncludeDir(dir)  Parse_AddIncludeDir(const char  *dir)   /* The name of the directory to add */
     const char  *dir;   /* The name of the directory to add */  
 {  {
     Dir_AddDir(parseIncPath, dir);      Dir_AddDir(parseIncPath, dir);
 }  }
Line 1148 
Line 1137 
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  */   */
 static void  static void
 ParseDoInclude(file)  ParseDoInclude(char       *file)/* file specification */
     char          *file;        /* file specification */  
 {  {
     char          endc;         /* the character which ends the file spec */      char          endc;         /* the character which ends the file spec */
     char          *cp;          /* current position in file spec */      char          *cp;          /* current position in file spec */
Line 1204 
Line 1192 
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  */   */
 static void  static void
 ParseTraditionalInclude(file)  ParseTraditionalInclude(char *file)     /* file specification */
     char          *file;        /* file specification */  
 {  {
     char          *cp;          /* current position in file spec */      char          *cp;          /* current position in file spec */
   
Line 1234 
Line 1221 
  *---------------------------------------------------------------------   *---------------------------------------------------------------------
  */   */
 static void  static void
 ParseConditionalInclude(file)  ParseConditionalInclude(char *file)/* file specification */
     char          *file;        /* file specification */  
 {  {
     char          *cp;          /* current position in file spec */      char          *cp;          /* current position in file spec */
   
Line 1256 
Line 1242 
   
 /* Common part to lookup and read an include file.  */  /* Common part to lookup and read an include file.  */
 static void  static void
 ParseLookupIncludeFile(spec, endSpec, isSystem, errIfNotFound)  ParseLookupIncludeFile(char *spec, char *endSpec, bool isSystem,
     char *spec;      bool errIfNotFound)
     char *endSpec;  
     bool isSystem;  
     bool errIfNotFound;  
 {  {
     char *file;      char *file;
     char *fullname;      char *fullname;
Line 1342 
Line 1325 
 /* Strip comments from the line. May return either a copy of the line, or  /* Strip comments from the line. May return either a copy of the line, or
  * the line itself.  */   * the line itself.  */
 static char *  static char *
 strip_comments(copy, line)  strip_comments(Buffer copy, const char *line)
     Buffer copy;  
     const char *line;  
 {  {
     const char *comment;      const char *comment;
     const char *p;      const char *p;
Line 1375 
Line 1356 
 }  }
   
 static bool  static bool
 ParseIsCond(linebuf, copy, line)  ParseIsCond(Buffer linebuf, Buffer copy, char *line)
     Buffer      linebuf;  
     Buffer      copy;  
     char        *line;  
 {  {
   
     char        *stripped;      char        *stripped;
Line 1456 
Line 1434 
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
  */   */
 static void  static void
 ParseFinishDependency()  ParseFinishDependency(void)
 {  {
     Array_Every(&gtargets, Suff_EndTransform);      Array_Every(&gtargets, Suff_EndTransform);
     Array_Every(&gtargets, ParseHasCommands);      Array_Every(&gtargets, ParseHasCommands);
Line 1464 
Line 1442 
 }  }
   
 static void  static void
 ParseDoCommands(line)  ParseDoCommands(const char *line)
     const char *line;  
 {  {
     /* add the command to the list of      /* add the command to the list of
      * commands of all targets in the dependency spec */       * commands of all targets in the dependency spec */
Line 1478 
Line 1455 
 }  }
   
 void  void
 Parse_File(name, stream)  Parse_File(
     const char    *name;        /* the name of the file being read */      const char    *name,        /* the name of the file being read */
     FILE          *stream;      /* Stream open to makefile to parse */      FILE          *stream)      /* Stream open to makefile to parse */
 {  {
     char          *cp,          /* pointer into the line */      char          *cp,          /* pointer into the line */
                   *line;        /* the line we're working on */                    *line;        /* the line we're working on */
Line 1584 
Line 1561 
 }  }
   
 void  void
 Parse_Init()  Parse_Init(void)
 {  {
     mainNode = NULL;      mainNode = NULL;
     Static_Lst_Init(parseIncPath);      Static_Lst_Init(parseIncPath);
Line 1600 
Line 1577 
   
 #ifdef CLEANUP  #ifdef CLEANUP
 void  void
 Parse_End()  Parse_End(void)
 {  {
     Lst_Destroy(&targCmds, (SimpleProc)free);      Lst_Destroy(&targCmds, (SimpleProc)free);
     Lst_Destroy(sysIncPath, Dir_Destroy);      Lst_Destroy(sysIncPath, Dir_Destroy);
Line 1611 
Line 1588 
   
   
 void  void
 Parse_MainName(listmain)  Parse_MainName(Lst listmain)    /* result list */
     Lst           listmain;     /* result list */  
 {  {
   
     if (mainNode == NULL) {      if (mainNode == NULL) {

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.69