=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/arch.c,v retrieving revision 1.27 retrieving revision 1.28 diff -c -r1.27 -r1.28 *** src/usr.bin/make/arch.c 2000/06/10 01:41:05 1.27 --- src/usr.bin/make/arch.c 2000/06/17 14:38:13 1.28 *************** *** 1,4 **** ! /* $OpenBSD: arch.c,v 1.27 2000/06/10 01:41:05 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: arch.c,v 1.28 2000/06/17 14:38:13 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* *************** *** 43,49 **** #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else ! static char rcsid[] = "$OpenBSD: arch.c,v 1.27 2000/06/10 01:41:05 espie Exp $"; #endif #endif /* not lint */ --- 43,49 ---- #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else ! static char rcsid[] = "$OpenBSD: arch.c,v 1.28 2000/06/17 14:38:13 espie Exp $"; #endif #endif /* not lint */ *************** *** 119,125 **** #define MACHINE_ARCH TARGET_MACHINE_ARCH #endif ! static Lst archives; /* Lst of archives we've already examined */ typedef struct Arch { char *name; /* Name of archive */ --- 119,125 ---- #define MACHINE_ARCH TARGET_MACHINE_ARCH #endif ! static LIST archives; /* Lst of archives we've already examined */ typedef struct Arch { char *name; /* Name of archive */ *************** *** 359,376 **** */ free(buf); } else if (Dir_HasWildcards(memName)) { ! Lst members = Lst_Init(); char *member; ! Dir_Expand(memName, dirSearchPath, members); ! while ((member = (char *)Lst_DeQueue(members)) != NULL) { sprintf(nameBuf, "%s(%s)", libName, member); free(member); ! gn = Targ_FindNode (nameBuf, TARG_CREATE); ! if (gn == NULL) { return (FAILURE); ! } else { /* * We've found the node, but have to make sure the rest of * the world knows it's an archive member, without having --- 359,377 ---- */ free(buf); } else if (Dir_HasWildcards(memName)) { ! LIST members; char *member; ! Lst_Init(&members); ! Dir_Expand(memName, &dirSearchPath, &members); ! while ((member = (char *)Lst_DeQueue(&members)) != NULL) { sprintf(nameBuf, "%s(%s)", libName, member); free(member); ! gn = Targ_FindNode(nameBuf, TARG_CREATE); ! if (gn == NULL) return (FAILURE); ! else { /* * We've found the node, but have to make sure the rest of * the world knows it's an archive member, without having *************** *** 382,388 **** Lst_AtEnd(nodeLst, gn); } } ! Lst_Destroy(members, NOFREE); } else { sprintf(nameBuf, "%s(%s)", libName, memName); gn = Targ_FindNode (nameBuf, TARG_CREATE); --- 383,389 ---- Lst_AtEnd(nodeLst, gn); } } ! Lst_Destroy(&members, NOFREE); } else { sprintf(nameBuf, "%s(%s)", libName, memName); gn = Targ_FindNode (nameBuf, TARG_CREATE); *************** *** 496,502 **** if (cp != NULL) member = cp + 1; ! ln = Lst_Find(archives, ArchFindArchive, archive); if (ln != NULL) { ar = (Arch *) Lst_Datum (ln); --- 497,503 ---- if (cp != NULL) member = cp + 1; ! ln = Lst_Find(&archives, ArchFindArchive, archive); if (ln != NULL) { ar = (Arch *) Lst_Datum (ln); *************** *** 643,649 **** fclose (arch); ! Lst_AtEnd(archives, ar); /* * Now that the archive has been read and cached, we can look into --- 644,650 ---- fclose (arch); ! Lst_AtEnd(&archives, ar); /* * Now that the archive has been read and cached, we can look into *************** *** 1044,1054 **** char *nameStart, *nameEnd; ! if (Lst_Open (gn->parents) != SUCCESS) { gn->mtime = OUT_OF_DATE; return FALSE; } ! while ((ln = Lst_Next (gn->parents)) != NULL) { pgn = (GNode *) Lst_Datum (ln); if (pgn->type & OP_ARCHV) { --- 1045,1055 ---- char *nameStart, *nameEnd; ! if (Lst_Open(&gn->parents) != SUCCESS) { gn->mtime = OUT_OF_DATE; return FALSE; } ! while ((ln = Lst_Next(&gn->parents)) != NULL) { pgn = (GNode *) Lst_Datum (ln); if (pgn->type & OP_ARCHV) { *************** *** 1083,1089 **** } } ! Lst_Close (gn->parents); return gn->mtime == OUT_OF_DATE; } --- 1084,1090 ---- } } ! Lst_Close(&gn->parents); return gn->mtime == OUT_OF_DATE; } *************** *** 1171,1177 **** { Boolean oodate; ! if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) { oodate = FALSE; } else if (gn->mtime > now || gn->mtime < gn->cmtime || gn->mtime == OUT_OF_DATE) { --- 1172,1178 ---- { Boolean oodate; ! if (OP_NOP(gn->type) && Lst_IsEmpty(&gn->children)) { oodate = FALSE; } else if (gn->mtime > now || gn->mtime < gn->cmtime || gn->mtime == OUT_OF_DATE) { *************** *** 1220,1228 **** *----------------------------------------------------------------------- */ void ! Arch_Init () { ! archives = Lst_Init(); } --- 1221,1229 ---- *----------------------------------------------------------------------- */ void ! Arch_Init() { ! Lst_Init(&archives); } *************** *** 1244,1250 **** Arch_End () { #ifdef CLEANUP ! Lst_Destroy(archives, ArchFree); #endif } --- 1245,1251 ---- Arch_End () { #ifdef CLEANUP ! Lst_Destroy(&archives, ArchFree); #endif }