if (Lst_Member(gn->children, (ClientData)mem) == NULL) { Lst_AtEnd(gn->children, (ClientData)mem); Lst_AtEnd(mem->parents, (ClientData)gn);
if (Lst_Member(gn->children, mem) == NULL) { Lst_AtEnd(gn->children, mem); Lst_AtEnd(mem->parents, gn);
SuffFindArchiveDeps(gn, slst)    GNode   	*gn;	    /* Node for which to locate dependencies */    Lst		slst;{    char    	*eoarch;    /* End of archive portion */    char    	*eoname;    /* End of member portion */    GNode   	*mem;	    /* Node for member */    static char	*copy[] = { /* Variables to be copied from the member node */	TARGET,	    	    /* Must be first */	PREFIX,	    	    /* Must be second */    };    int	    	i;  	    /* Index into copy and vals */    Suff    	*ms;	    /* Suffix descriptor for member */    char    	*name;	    /* Start of member's name */    /*     * The node is an archive(member) pair. so we must find a     * suffix for both of them.     */    eoarch = strchr (gn->name, '(');    eoname = strchr (eoarch, ')');    if (eoarch == NULL || eoname == NULL)	return;    *eoname = '\0';	  /* Nuke parentheses during suffix search */    *eoarch = '\0';	  /* So a suffix can be found */    name = eoarch + 1;    /*     * To simplify things, call Suff_FindDeps recursively on the member now,     * so we can simply compare the member's .PREFIX and .TARGET variables     * to locate its suffix. This allows us to figure out the suffix to     * use for the archive without having to do a quadratic search over the     * suffix list, backtracking for each one...     */    mem = Targ_FindNode(name, TARG_CREATE);    SuffFindDeps(mem, slst);    /*     * Create the link between the two nodes right off     */    if (Lst_Member(gn->children, (ClientData)mem) == NULL) {	Lst_AtEnd(gn->children, (ClientData)mem);	Lst_AtEnd(mem->parents, (ClientData)gn);	gn->unmade += 1;    }    /*     * Copy in the variables from the member node to this one.     */    for (i = (sizeof(copy)/sizeof(copy[0]))-1; i >= 0; i--) {	Var_Set(copy[i], Var_Value(copy[i], mem), gn);    }    ms = mem->suffix;    if (ms == NULL) {	/*	 * Didn't know what it was -- use .NULL suffix if not in make mode	 */	if (DEBUG(SUFF)) {	    printf("using null suffix\n");	}	ms = suffNull;    }    /*     * Set the other two local variables required for this target.     */    Var_Set (MEMBER, name, gn);    Var_Set (ARCHIVE, gn->name, gn);    if (ms != NULL) {	/*	 * Member has a known suffix, so look for a transformation rule from	 * it to a possible suffix of the archive. Rather than searching	 * through the entire list, we just look at suffixes to which the	 * member's suffix may be transformed...	 */	LstNode	    ln;	/*	 * Use first matching suffix...	 */	ln = Lst_Find(ms->parents, SuffSuffIsSuffixP, eoarch);	if (ln != NULL) {	    /*	     * Got one -- apply it	     */	    if (!SuffApplyTransform(gn, mem, (Suff *)Lst_Datum(ln), ms) &&		DEBUG(SUFF))	    {		printf("\tNo transformation from %s -> %s\n",		       ms->name, ((Suff *)Lst_Datum(ln))->name);	    }	}    }    /*     * Replace the opening and closing parens now we've no need of the separate     * pieces.     */    *eoarch = '('; *eoname = ')';    /*     * Pretend gn appeared to the left of a dependency operator so     * the user needn't provide a transformation from the member to the     * archive.     */    if (OP_NOP(gn->type)) {	gn->type |= OP_DEPENDS;    }    /*     * Flag the member as such so we remember to look in the archive for     * its modification time.     */    mem->type |= OP_MEMBER;}