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

Diff for /src/usr.bin/make/arch.c between version 1.27 and 1.28

version 1.27, 2000/06/10 01:41:05 version 1.28, 2000/06/17 14:38:13
Line 119 
Line 119 
 #define MACHINE_ARCH TARGET_MACHINE_ARCH  #define MACHINE_ARCH TARGET_MACHINE_ARCH
 #endif  #endif
   
 static Lst        archives;   /* Lst of archives we've already examined */  static LIST       archives;   /* Lst of archives we've already examined */
   
 typedef struct Arch {  typedef struct Arch {
     char          *name;      /* Name of archive */      char          *name;      /* Name of archive */
Line 359 
Line 359 
              */               */
             free(buf);              free(buf);
         } else if (Dir_HasWildcards(memName)) {          } else if (Dir_HasWildcards(memName)) {
             Lst   members = Lst_Init();              LIST members;
             char  *member;              char  *member;
   
             Dir_Expand(memName, dirSearchPath, members);              Lst_Init(&members);
             while ((member = (char *)Lst_DeQueue(members)) != NULL) {              Dir_Expand(memName, &dirSearchPath, &members);
               while ((member = (char *)Lst_DeQueue(&members)) != NULL) {
   
                 sprintf(nameBuf, "%s(%s)", libName, member);                  sprintf(nameBuf, "%s(%s)", libName, member);
                 free(member);                  free(member);
                 gn = Targ_FindNode (nameBuf, TARG_CREATE);                  gn = Targ_FindNode(nameBuf, TARG_CREATE);
                 if (gn == NULL) {                  if (gn == NULL)
                     return (FAILURE);                      return (FAILURE);
                 } else {                  else {
                     /*                      /*
                      * We've found the node, but have to make sure the rest of                       * We've found the node, but have to make sure the rest of
                      * the world knows it's an archive member, without having                       * the world knows it's an archive member, without having
Line 382 
Line 383 
                     Lst_AtEnd(nodeLst, gn);                      Lst_AtEnd(nodeLst, gn);
                 }                  }
             }              }
             Lst_Destroy(members, NOFREE);              Lst_Destroy(&members, NOFREE);
         } else {          } else {
             sprintf(nameBuf, "%s(%s)", libName, memName);              sprintf(nameBuf, "%s(%s)", libName, memName);
             gn = Targ_FindNode (nameBuf, TARG_CREATE);              gn = Targ_FindNode (nameBuf, TARG_CREATE);
Line 496 
Line 497 
     if (cp != NULL)      if (cp != NULL)
         member = cp + 1;          member = cp + 1;
   
     ln = Lst_Find(archives, ArchFindArchive, archive);      ln = Lst_Find(&archives, ArchFindArchive, archive);
     if (ln != NULL) {      if (ln != NULL) {
         ar = (Arch *) Lst_Datum (ln);          ar = (Arch *) Lst_Datum (ln);
   
Line 643 
Line 644 
   
     fclose (arch);      fclose (arch);
   
     Lst_AtEnd(archives, ar);      Lst_AtEnd(&archives, ar);
   
     /*      /*
      * Now that the archive has been read and cached, we can look into       * Now that the archive has been read and cached, we can look into
Line 1044 
Line 1045 
     char          *nameStart,      char          *nameStart,
                   *nameEnd;                    *nameEnd;
   
     if (Lst_Open (gn->parents) != SUCCESS) {      if (Lst_Open(&gn->parents) != SUCCESS) {
         gn->mtime = OUT_OF_DATE;          gn->mtime = OUT_OF_DATE;
         return FALSE;          return FALSE;
     }      }
     while ((ln = Lst_Next (gn->parents)) != NULL) {      while ((ln = Lst_Next(&gn->parents)) != NULL) {
         pgn = (GNode *) Lst_Datum (ln);          pgn = (GNode *) Lst_Datum (ln);
   
         if (pgn->type & OP_ARCHV) {          if (pgn->type & OP_ARCHV) {
Line 1083 
Line 1084 
         }          }
     }      }
   
     Lst_Close (gn->parents);      Lst_Close(&gn->parents);
   
     return gn->mtime == OUT_OF_DATE;      return gn->mtime == OUT_OF_DATE;
 }  }
Line 1171 
Line 1172 
 {  {
     Boolean       oodate;      Boolean       oodate;
   
     if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) {      if (OP_NOP(gn->type) && Lst_IsEmpty(&gn->children)) {
         oodate = FALSE;          oodate = FALSE;
     } else if (gn->mtime > now || gn->mtime < gn->cmtime ||      } else if (gn->mtime > now || gn->mtime < gn->cmtime ||
         gn->mtime == OUT_OF_DATE) {          gn->mtime == OUT_OF_DATE) {
Line 1220 
Line 1221 
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
  */   */
 void  void
 Arch_Init ()  Arch_Init()
 {  {
     archives = Lst_Init();      Lst_Init(&archives);
 }  }
   
   
Line 1244 
Line 1245 
 Arch_End ()  Arch_End ()
 {  {
 #ifdef CLEANUP  #ifdef CLEANUP
     Lst_Destroy(archives, ArchFree);      Lst_Destroy(&archives, ArchFree);
 #endif  #endif
 }  }
   

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28