diff options
author | rgrimes <rgrimes@FreeBSD.org> | 1995-05-30 06:41:30 +0000 |
---|---|---|
committer | rgrimes <rgrimes@FreeBSD.org> | 1995-05-30 06:41:30 +0000 |
commit | a14d555c873398b14776ca4f2c33f9c69617afb9 (patch) | |
tree | 350f6f98843363254f9afe467ae0c92d5a9d7f43 /usr.bin/make | |
parent | f3a2b348daf9fa6063c38d2d69563f732a2f80e7 (diff) | |
download | FreeBSD-src-a14d555c873398b14776ca4f2c33f9c69617afb9.zip FreeBSD-src-a14d555c873398b14776ca4f2c33f9c69617afb9.tar.gz |
Remove trailing whitespace.
Diffstat (limited to 'usr.bin/make')
38 files changed, 465 insertions, 465 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 80ae82b..d5046e9 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -135,8 +135,8 @@ ArchFree(ap) Arch *a = (Arch *) ap; Hash_Search search; Hash_Entry *entry; - - /* Free memory from hash entries */ + + /* Free memory from hash entries */ for (entry = Hash_EnumFirst(&a->members, &search); entry != (Hash_Entry *)NULL; entry = Hash_EnumNext(&search)) @@ -146,7 +146,7 @@ ArchFree(ap) Hash_DeleteTable(&a->members); free((Address) a); } - + /*- @@ -182,7 +182,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) * variable substitution performed on it */ libName = *linePtr; - + subLibName = FALSE; for (cp = libName; *cp != '(' && *cp != '\0'; cp++) { @@ -194,14 +194,14 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) int length; Boolean freeIt; char *result; - + result=Var_Parse(cp, ctxt, TRUE, &length, &freeIt); if (result == var_Error) { return(FAILURE); } else { subLibName = TRUE; } - + if (freeIt) { free(result); } @@ -213,7 +213,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) if (subLibName) { libName = Var_Subst(NULL, libName, ctxt, TRUE); } - + for (;;) { /* @@ -289,7 +289,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) char *buf; char *sacrifice; char *oldMemName = memName; - + memName = Var_Subst(NULL, memName, ctxt, TRUE); /* @@ -335,7 +335,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) Dir_Expand(memName, dirSearchPath, members); while (!Lst_IsEmpty(members)) { member = (char *)Lst_DeQueue(members); - + sprintf(nameBuf, "%s(%s)", libName, member); free(member); gn = Targ_FindNode (nameBuf, TARG_CREATE); @@ -374,7 +374,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) if (doSubst) { free(memName); } - + *cp = saveChar; } @@ -520,7 +520,7 @@ ArchStatMember (archive, member, hash) if (arch == (FILE *) NULL) { return ((struct ar_hdr *) NULL); } - + /* * We use the ARMAG string to make sure this is an archive we * can handle... @@ -535,7 +535,7 @@ ArchStatMember (archive, member, hash) ar->name = strdup (archive); Hash_InitTable (&ar->members, -1); memName[AR_MAX_NAME_LEN] = '\0'; - + while (fread ((char *)&arh, sizeof (struct ar_hdr), 1, arch) == 1) { if (strncmp ( arh.ar_fmag, ARFMAG, sizeof (arh.ar_fmag)) != 0) { /* @@ -651,7 +651,7 @@ ArchFindMember (archive, member, arhPtr, mode) if (arch == (FILE *) NULL) { return ((FILE *) NULL); } - + /* * We use the ARMAG string to make sure this is an archive we * can handle... @@ -676,7 +676,7 @@ ArchFindMember (archive, member, arhPtr, mode) if (len > sizeof (arhPtr->ar_name)) { tlen = sizeof (arhPtr->ar_name); } - + while (fread ((char *)arhPtr, sizeof (struct ar_hdr), 1, arch) == 1) { if (strncmp(arhPtr->ar_fmag, ARFMAG, sizeof (arhPtr->ar_fmag) ) != 0) { /* @@ -940,7 +940,7 @@ Arch_MemMTime (gn) /*- *----------------------------------------------------------------------- * Arch_FindLib -- - * Search for a library along the given search path. + * Search for a library along the given search path. * * Results: * None. @@ -1004,7 +1004,7 @@ Arch_FindLib (gn, path) * opinion we should not bother with the TOC at all since * this is used by 'ar' rules that affect the data contents * of the archive, not by ranlib rules, which affect the - * TOC. + * TOC. * * Results: * TRUE if the library is out-of-date. FALSE otherwise. @@ -1019,7 +1019,7 @@ Arch_LibOODate (gn) GNode *gn; /* The library's graph node */ { Boolean oodate; - + if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) { oodate = FALSE; } else if ((gn->mtime > now) || (gn->mtime < gn->cmtime)) { diff --git a/usr.bin/make/bit.h b/usr.bin/make/bit.h index 85117a4..1671326 100644 --- a/usr.bin/make/bit.h +++ b/usr.bin/make/bit.h @@ -96,5 +96,5 @@ extern Boolean Bit_Intersect(); extern Boolean Bit_Union(); extern Boolean Bit_AnySet(); extern int *Bit_Expand(); - + #endif /* _BIT */ diff --git a/usr.bin/make/buf.c b/usr.bin/make/buf.c index e902f13..a4ecaf6 100644 --- a/usr.bin/make/buf.c +++ b/usr.bin/make/buf.c @@ -286,7 +286,7 @@ Buf_GetBytes (bp, numBytes, bytesPtr) int numBytes; Byte *bytesPtr; { - + if (bp->inPtr - bp->outPtr < numBytes) { numBytes = bp->inPtr - bp->outPtr; } @@ -323,7 +323,7 @@ Buf_GetAll (bp, numBytesPtr) if (numBytesPtr != (int *)NULL) { *numBytesPtr = bp->inPtr - bp->outPtr; } - + return (bp->outPtr); } @@ -336,7 +336,7 @@ Buf_GetAll (bp, numBytesPtr) * None. * * Side Effects: - * The bytes are discarded. + * The bytes are discarded. * *----------------------------------------------------------------------- */ @@ -428,7 +428,7 @@ Buf_Destroy (buf, freeData) Buffer buf; /* Buffer to destroy */ Boolean freeData; /* TRUE if the data should be destroyed as well */ { - + if (freeData) { free ((char *)buf->buffer); } diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 2ec3c7c..a9e8970 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -101,13 +101,13 @@ CompatInterrupt (signo) int signo; { GNode *gn; - + if ((curTarg != NILGNODE) && !Targ_Precious (curTarg)) { char *p1; char *file = Var_Value (TARGET, curTarg, &p1); struct stat st; - if (!noExecute && lstat(file, &st) != -1 && !S_ISDIR(st.st_mode) && + if (!noExecute && lstat(file, &st) != -1 && !S_ISDIR(st.st_mode) && unlink(file) != -1) { printf ("*** %s removed\n", file); } @@ -164,7 +164,7 @@ CompatRunCommand (cmdp, gnp) char *cmd = (char *) cmdp; GNode *gn = (GNode *) gnp; - /* + /* * Avoid clobbered variable warnings by forcing the compiler * to ``unregister'' variables */ @@ -184,7 +184,7 @@ CompatRunCommand (cmdp, gnp) * command? In any case, we warn the user that the command expanded to * nothing (is this the right thing to do?). */ - + if (*cmdStart == '\0') { free(cmdStart); Error("%s expands to empty string", cmd); @@ -213,7 +213,7 @@ CompatRunCommand (cmdp, gnp) while (isspace((unsigned char)*cmd)) cmd++; - + /* * Search for meta characters in the command. If there are no meta * characters, there's no need to execute a shell to execute the @@ -239,7 +239,7 @@ CompatRunCommand (cmdp, gnp) if (noExecute) { return (0); } - + if (*cp != '\0') { /* * If *cp isn't the null character, we hit a "meta" character and @@ -264,7 +264,7 @@ CompatRunCommand (cmdp, gnp) av = brk_string(cmd, &argc, TRUE); av += 1; } - + local = TRUE; /* @@ -286,7 +286,7 @@ CompatRunCommand (cmdp, gnp) } free(cmdStart); Lst_Replace (cmdNode, (ClientData) NULL); - + /* * The child is off and running. Now all we can do is wait... */ @@ -297,7 +297,7 @@ CompatRunCommand (cmdp, gnp) break; } } - + if (stat > -1) { if (WIFSTOPPED(reason)) { status = reason.w_stopval; /* stopped */ @@ -309,9 +309,9 @@ CompatRunCommand (cmdp, gnp) } else { status = reason.w_termsig; /* signaled */ printf ("*** Signal %d", status); - } + } + - if (!WIFEXITED(reason) || (status != 0)) { if (errCheck) { gn->made = ERROR; @@ -388,7 +388,7 @@ CompatMake (gnp, pgnp) if (p1) free(p1); } - + /* * All the children were made ok. Now cmtime contains the modification * time of the newest child, we need to find out if we exist and when @@ -422,7 +422,7 @@ CompatMake (gnp, pgnp) * Make_DoAllVar(). */ Make_DoAllVar(gn); - + /* * Alter our type to tell if errors should be ignored or things * should not be printed so CompatRunCommand knows what to do. @@ -563,7 +563,7 @@ CompatMake (gnp, pgnp) return (0); } - + /*- *----------------------------------------------------------------------- * Compat_Run -- diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index c99010d..4bf802b 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -210,7 +210,7 @@ CondGetArg (linePtr, argPtr, func, parens) * long. Why 16? Why not? */ buf = Buf_Init(16); - + while ((strchr(" \t)&|", *cp) == (char *)NULL) && (*cp != '\0')) { if (*cp == '$') { /* @@ -253,7 +253,7 @@ CondGetArg (linePtr, argPtr, func, parens) */ cp++; } - + *linePtr = cp; return (argLen); } @@ -427,7 +427,7 @@ CondDoTarget (argLen, arg) * * Side Effects: * Can change 'value' even if string is not a valid number. - * + * * *----------------------------------------------------------------------- */ @@ -617,10 +617,10 @@ do_string_compare: buf = Buf_Init(0); qt = *rhs == '"' ? 1 : 0; - - for (cp = &rhs[qt]; - ((qt && (*cp != '"')) || - (!qt && strchr(" \t)", *cp) == NULL)) && + + for (cp = &rhs[qt]; + ((qt && (*cp != '"')) || + (!qt && strchr(" \t)", *cp) == NULL)) && (*cp != '\0'); cp++) { if ((*cp == '\\') && (cp[1] != '\0')) { /* @@ -632,7 +632,7 @@ do_string_compare: } else if (*cp == '$') { int len; Boolean freeIt; - + cp2 = Var_Parse(cp, VAR_CMD, doEval,&len, &freeIt); if (cp2 != var_Error) { Buf_AddBytes(buf, strlen(cp2), (Byte *)cp2); @@ -686,7 +686,7 @@ do_string_compare: if (*rhs == '$') { int len; Boolean freeIt; - + string = Var_Parse(rhs, VAR_CMD, doEval,&len,&freeIt); if (string == var_Error) { right = 0.0; @@ -714,7 +714,7 @@ do_string_compare: } } } - + if (DEBUG(COND)) { printf("left = %f, right = %f, op = %.2s\n", left, right, op); @@ -762,7 +762,7 @@ error: Boolean invert = FALSE; char *arg; int arglen; - + if (strncmp (condExpr, "defined", 7) == 0) { /* * Use CondDoDefined to evaluate the argument and @@ -824,8 +824,8 @@ error: if (val == var_Error) { t = Err; } else { - /* - * A variable is empty when it just contains + /* + * A variable is empty when it just contains * spaces... 4/15/92, christos */ char *p; @@ -1107,7 +1107,7 @@ Cond_Eval (line) } else { isElse = FALSE; } - + /* * Figure out what sort of conditional it is -- what its default * function is, etc. -- by looking in the table of valid "ifs" @@ -1167,16 +1167,16 @@ Cond_Eval (line) */ condDefProc = ifp->defProc; condInvert = ifp->doNot; - + line += ifp->formlen; - + while (*line == ' ' || *line == '\t') { line++; } - + condExpr = line; condPushBack = None; - + switch (CondE(TRUE)) { case True: if (CondToken(TRUE) == EndOfFile) { diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 6ed3c19..70f5038 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -211,7 +211,7 @@ Dir_Init () dirSearchPath = Lst_Init (FALSE); openDirectories = Lst_Init (FALSE); Hash_InitTable(&mtimes, 0); - + /* * Since the Path structure is placed on both openDirectories and * the path we give Dir_AddDir (which in this case is openDirectories), @@ -291,7 +291,7 @@ Dir_HasWildcards (name) char *name; /* name to check */ { register char *cp; - + for (cp = name; *cp; cp++) { switch(*cp) { case '{': @@ -327,12 +327,12 @@ DirMatchFiles (pattern, p, expansions) Path *p; /* Directory to search */ Lst expansions; /* Place to store the results */ { - Hash_Search search; /* Index into the directory's table */ + Hash_Search search; /* Index into the directory's table */ Hash_Entry *entry; /* Current entry in the table */ Boolean isDot; /* TRUE if the directory being searched is . */ - + isDot = (*p->name == '.' && p->name[1] == '\0'); - + for (entry = Hash_EnumFirst(&p->files, &search); entry != (Hash_Entry *)NULL; entry = Hash_EnumNext(&search)) @@ -551,7 +551,7 @@ Dir_Expand (word, path, expansions) if (DEBUG(DIR)) { printf("expanding \"%s\"...", word); } - + cp = strchr(word, '{'); if (cp) { DirExpandCurly(word, cp, path, expansions); @@ -625,7 +625,7 @@ Dir_Expand (word, path, expansions) * First the files in dot */ DirMatchFiles(word, dot, expansions); - + /* * Then the files in every other directory on the path. */ @@ -670,7 +670,7 @@ Dir_FindFile (name, path) Boolean hasSlash; /* true if 'name' contains a / */ struct stat stb; /* Buffer for stat, if necessary */ Hash_Entry *entry; /* Entry for mtimes table */ - + /* * Find the final component of the name and note whether it has a * slash in it (the name, I mean) @@ -683,7 +683,7 @@ Dir_FindFile (name, path) hasSlash = FALSE; cp = name; } - + if (DEBUG(DIR)) { printf("Searching for %s...", name); } @@ -702,7 +702,7 @@ Dir_FindFile (name, path) dot->hits += 1; return (strdup (name)); } - + if (Lst_Open (path) == FAILURE) { if (DEBUG(DIR)) { printf("couldn't open path, file not found\n"); @@ -710,7 +710,7 @@ Dir_FindFile (name, path) misses += 1; return ((char *) NULL); } - + /* * We look through all the directories on the path seeking one which * contains the final component of the given name and whose final @@ -775,7 +775,7 @@ Dir_FindFile (name, path) } } } - + /* * We didn't find the file on any existing members of the directory. * If the name doesn't contain a slash, that means it doesn't exist. @@ -795,10 +795,10 @@ Dir_FindFile (name, path) misses += 1; return ((char *) NULL); } - + if (*name != '/') { Boolean checkedDot = FALSE; - + if (DEBUG(DIR)) { printf("failed. Trying subdirectories..."); } @@ -817,15 +817,15 @@ Dir_FindFile (name, path) if (DEBUG(DIR)) { printf("checking %s...", file); } - - + + if (stat (file, &stb) == 0) { if (DEBUG(DIR)) { printf("got it.\n"); } - + Lst_Close (path); - + /* * We've found another directory to search. We know there's * a slash in 'file' because we put one there. We nuke it after @@ -840,7 +840,7 @@ Dir_FindFile (name, path) *cp = '\0'; Dir_AddDir (path, file); *cp = '/'; - + /* * Save the modification time so if it's needed, we don't have * to fetch it again. @@ -858,7 +858,7 @@ Dir_FindFile (name, path) free (file); } } - + if (DEBUG(DIR)) { printf("failed. "); } @@ -875,7 +875,7 @@ Dir_FindFile (name, path) return(NULL); } } - + /* * Didn't find it that way, either. Sigh. Phase 3. Add its directory * onto the search path in any case, just in case, then look for the @@ -897,7 +897,7 @@ Dir_FindFile (name, path) cp[-1] = '\0'; Dir_AddDir (path, name); cp[-1] = '/'; - + bigmisses += 1; ln = Lst_Last (path); if (ln == NILLNODE) { @@ -905,7 +905,7 @@ Dir_FindFile (name, path) } else { p = (Path *) Lst_Datum (ln); } - + if (Hash_FindEntry (&p->files, cp) != (Hash_Entry *)NULL) { return (strdup (name)); } else { @@ -915,7 +915,7 @@ Dir_FindFile (name, path) if (DEBUG(DIR)) { printf("Looking for \"%s\"...", name); } - + bigmisses += 1; entry = Hash_FindEntry(&mtimes, name); if (entry != (Hash_Entry *)NULL) { @@ -945,7 +945,7 @@ Dir_FindFile (name, path) * Dir_MTime -- * Find the modification time of the file described by gn along the * search path dirSearchPath. - * + * * Results: * The modification time or 0 if it doesn't exist * @@ -963,7 +963,7 @@ Dir_MTime (gn) char *fullName; /* the full pathname of name */ struct stat stb; /* buffer for finding the mod time */ Hash_Entry *entry; - + if (gn->type & OP_ARCHV) { return Arch_MTime (gn); } else if (gn->path == (char *)NULL) { @@ -971,7 +971,7 @@ Dir_MTime (gn) } else { fullName = gn->path; } - + if (fullName == (char *)NULL) { fullName = strdup(gn->name); } @@ -1001,7 +1001,7 @@ Dir_MTime (gn) if (fullName && gn->path == (char *)NULL) { gn->path = fullName; } - + gn->mtime = stb.st_mtime; return (gn->mtime); } @@ -1017,7 +1017,7 @@ Dir_MTime (gn) * none * * Side Effects: - * A structure is added to the list and the directory is + * A structure is added to the list and the directory is * read and hashed. *----------------------------------------------------------------------- */ @@ -1031,7 +1031,7 @@ Dir_AddDir (path, name) register Path *p; /* pointer to new Path structure */ DIR *d; /* for reading directory */ register struct dirent *dp; /* entry in directory */ - + ln = Lst_Find (openDirectories, (ClientData)name, DirFindName); if (ln != NILLNODE) { p = (Path *)Lst_Datum (ln); @@ -1044,20 +1044,20 @@ Dir_AddDir (path, name) printf("Caching %s...", name); fflush(stdout); } - + if ((d = opendir (name)) != (DIR *) NULL) { p = (Path *) emalloc (sizeof (Path)); p->name = strdup (name); p->hits = 0; p->refCount = 1; Hash_InitTable (&p->files, -1); - + /* * Skip the first two entries -- these will *always* be . and .. */ (void)readdir(d); (void)readdir(d); - + while ((dp = readdir (d)) != (struct dirent *) NULL) { #ifdef sun /* @@ -1130,9 +1130,9 @@ Dir_MakeFlags (flag, path) char *tstr; /* the current directory preceded by 'flag' */ LstNode ln; /* the node of the current directory */ Path *p; /* the structure describing the current directory */ - + str = strdup (""); - + if (Lst_Open (path) == SUCCESS) { while ((ln = Lst_Next (path)) != NILLNODE) { p = (Path *) Lst_Datum (ln); @@ -1141,7 +1141,7 @@ Dir_MakeFlags (flag, path) } Lst_Close (path); } - + return (str); } @@ -1203,7 +1203,7 @@ Dir_ClearPath(path) Dir_Destroy((ClientData) p); } } - + /*- *----------------------------------------------------------------------- @@ -1242,7 +1242,7 @@ Dir_PrintDirectories() { LstNode ln; Path *p; - + printf ("#*** Directory Cache:\n"); printf ("# Stats: %d hits %d misses %d near misses %d losers (%d%%)\n", hits, misses, nearmisses, bigmisses, @@ -1261,7 +1261,7 @@ Dir_PrintDirectories() static int DirPrintDir (p, dummy) ClientData p; ClientData dummy; -{ +{ printf ("%s ", ((Path *) p)->name); return (dummy ? 0 : 0); } diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index dbefad6..c93f317 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -61,7 +61,7 @@ static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; * The trick is to look for the matching end inside for for loop * To do that, we count the current nesting level of the for loops. * and the .endfor statements, accumulating all the statements between - * the initial .for loop and the matching .endfor; + * the initial .for loop and the matching .endfor; * then we evaluate the for loop for each variable in the varlist. */ @@ -125,18 +125,18 @@ For_Eval (line) !isspace((unsigned char) ptr[3])) return FALSE; ptr += 3; - + /* * we found a for loop, and now we are going to parse it. */ while (*ptr && isspace((unsigned char) *ptr)) ptr++; - + /* * Grab the variable */ buf = Buf_Init(0); - for (wrd = ptr; *ptr && !isspace((unsigned char) *ptr); ptr++) + for (wrd = ptr; *ptr && !isspace((unsigned char) *ptr); ptr++) continue; Buf_AddBytes(buf, ptr - wrd, (Byte *) wrd); @@ -169,7 +169,7 @@ For_Eval (line) */ forLst = Lst_Init(FALSE); buf = Buf_Init(0); - sub = Var_Subst(NULL, ptr, VAR_GLOBAL, FALSE); + sub = Var_Subst(NULL, ptr, VAR_GLOBAL, FALSE); #define ADDWORD() \ Buf_AddBytes(buf, ptr - wrd, (Byte *) wrd), \ @@ -190,12 +190,12 @@ For_Eval (line) } if (DEBUG(FOR)) (void) fprintf(stderr, "For: Iterator %s List %s\n", forVar, sub); - if (ptr - wrd > 0) + if (ptr - wrd > 0) ADDWORD(); else Buf_Destroy(buf, TRUE); free((Address) sub); - + forBuf = Buf_Init(0); forLevel++; return 1; @@ -256,7 +256,7 @@ ForExec(namep, argp) Var_Set(arg->var, name, VAR_GLOBAL); if (DEBUG(FOR)) (void) fprintf(stderr, "--- %s = %s\n", arg->var, name); - Parse_FromString(Var_Subst(arg->var, (char *) Buf_GetAll(arg->buf, &len), + Parse_FromString(Var_Subst(arg->var, (char *) Buf_GetAll(arg->buf, &len), VAR_GLOBAL, FALSE)); Var_Delete(arg->var, VAR_GLOBAL); diff --git a/usr.bin/make/hash.c b/usr.bin/make/hash.c index 63e0683..026d163 100644 --- a/usr.bin/make/hash.c +++ b/usr.bin/make/hash.c @@ -58,7 +58,7 @@ static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; static void RebuildTable __P((Hash_Table *)); -/* +/* * The following defines the ratio of # entries to # buckets * at which we rebuild the table to make it larger. */ @@ -67,12 +67,12 @@ static void RebuildTable __P((Hash_Table *)); /* *--------------------------------------------------------- - * + * * Hash_InitTable -- * * This routine just sets up the hash table. * - * Results: + * Results: * None. * * Side Effects: @@ -94,7 +94,7 @@ Hash_InitTable(t, numBuckets) register struct Hash_Entry **hp; /* - * Round up the size to a power of two. + * Round up the size to a power of two. */ if (numBuckets <= 0) i = 16; @@ -119,7 +119,7 @@ Hash_InitTable(t, numBuckets) * and frees up the memory space it occupied (except for * the space in the Hash_Table structure). * - * Results: + * Results: * None. * * Side Effects: @@ -145,7 +145,7 @@ Hash_DeleteTable(t) /* * Set up the hash table to cause memory faults on any future access - * attempts until re-initialization. + * attempts until re-initialization. */ t->bucketPtr = NULL; } @@ -237,7 +237,7 @@ Hash_CreateEntry(t, key, newPtr) /* * The desired entry isn't there. Before allocating a new entry, * expand the table if necessary (and this changes the resulting - * bucket chain). + * bucket chain). */ if (t->numEntries >= rebuildLimit * t->size) RebuildTable(t); @@ -301,7 +301,7 @@ Hash_DeleteEntry(t, e) * This procedure sets things up for a complete search * of all entries recorded in the hash table. * - * Results: + * Results: * The return value is the address of the first entry in * the hash table, or NULL if the table is empty. * @@ -316,7 +316,7 @@ Hash_DeleteEntry(t, e) Hash_Entry * Hash_EnumFirst(t, searchPtr) Hash_Table *t; /* Table to be searched. */ - register Hash_Search *searchPtr;/* Area in which to keep state + register Hash_Search *searchPtr;/* Area in which to keep state * about search.*/ { searchPtr->tablePtr = t; @@ -345,7 +345,7 @@ Hash_EnumFirst(t, searchPtr) Hash_Entry * Hash_EnumNext(searchPtr) - register Hash_Search *searchPtr; /* Area used to keep state about + register Hash_Search *searchPtr; /* Area used to keep state about search. */ { register Hash_Entry *e; @@ -379,7 +379,7 @@ Hash_EnumNext(searchPtr) * This local routine makes a new hash table that * is larger than the old one. * - * Results: + * Results: * None. * * Side Effects: diff --git a/usr.bin/make/hash.h b/usr.bin/make/hash.h index 7dd310b..ebc30e1 100644 --- a/usr.bin/make/hash.h +++ b/usr.bin/make/hash.h @@ -47,7 +47,7 @@ #ifndef _HASH #define _HASH -/* +/* * The following defines one entry in the hash table. */ @@ -69,7 +69,7 @@ typedef struct Hash_Table { int mask; /* Used to select bits for hashing. */ } Hash_Table; -/* +/* * The following structure is used by the searching routines * to record where we are in the search. */ @@ -85,22 +85,22 @@ typedef struct Hash_Search { */ /* - * ClientData Hash_GetValue(h) - * Hash_Entry *h; + * ClientData Hash_GetValue(h) + * Hash_Entry *h; */ #define Hash_GetValue(h) ((h)->clientData) -/* - * Hash_SetValue(h, val); - * Hash_Entry *h; - * char *val; +/* + * Hash_SetValue(h, val); + * Hash_Entry *h; + * char *val; */ #define Hash_SetValue(h, val) ((h)->clientData = (ClientData) (val)) -/* - * Hash_Size(n) returns the number of words in an object of n bytes +/* + * Hash_Size(n) returns the number of words in an object of n bytes */ #define Hash_Size(n) (((n) + sizeof (int) - 1) / sizeof (int)) diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index f4e4ffb..ed5f2fc 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -116,7 +116,7 @@ static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; extern int errno; /* - * error handling variables + * error handling variables */ static int errors = 0; /* number of errors reported */ static int aborting = 0; /* why is the make aborting? */ @@ -149,7 +149,7 @@ static int numCommands; /* The number of commands actually printed * tfile is the name of a file into which all shell commands are put. It is * used over by removing it before the child shell is executed. The XXXXX in * the string are replaced by the pid of the make process in a 5-character - * field with leading zeroes. + * field with leading zeroes. */ static char tfile[] = TMPPAT; @@ -225,7 +225,7 @@ char *targFmt; /* Format string to use to head output from a * When JobStart attempts to run a job remotely but can't, and isn't allowed * to run the job locally, or when Job_CatchChildren detects a job that has * been migrated home, the job is placed on the stoppedJobs queue to be run - * when the next job finishes. + * when the next job finishes. */ Lst stoppedJobs; /* Lst of Job structures describing * jobs that were stopped due to concurrency @@ -304,7 +304,7 @@ JobCondPassSig(jobp, signop) * * Side Effects: * We die by the same signal. - * + * *----------------------------------------------------------------------- */ static void @@ -312,7 +312,7 @@ JobPassSig(signo) int signo; /* The signal number we've received */ { int mask; - + Lst_ForEach(jobs, JobCondPassSig, (ClientData)(long)signo); /* @@ -325,14 +325,14 @@ JobPassSig(signo) } else if ((signo == SIGHUP) || (signo == SIGTERM) || (signo == SIGQUIT)) { JobInterrupt(FALSE); } - + /* * Leave gracefully if SIGQUIT, rather than core dumping. */ if (signo == SIGQUIT) { Finish(0); } - + /* * Send ourselves the signal now we've given the message to everyone else. * Note we block everything else possible while we're getting the signal. @@ -420,12 +420,12 @@ JobPrintCommand (cmdp, jobp) char *cmdStart; /* Start of expanded command */ LstNode cmdNode; /* Node for replacing the command */ char *cmd = (char *) cmdp; - Job *job = (Job *) jobp; + Job *job = (Job *) jobp; noSpecials = (noExecute && ! (job->node->type & OP_MAKE)); if (strcmp (cmd, "...") == 0) { - job->node->type |= OP_SAVE_CMDS; + job->node->type |= OP_SAVE_CMDS; if ((job->flags & JOB_IGNDOTS) == 0) { job->tailCmds = Lst_Succ (Lst_Member (job->node->commands, (ClientData)cmd)); @@ -523,9 +523,9 @@ JobPrintCommand (cmdp, jobp) errOff = FALSE; } } - + DBPRINTF (cmdTemplate, cmd); - + if (errOff) { /* * If echoing is already off, there's no point in issuing the @@ -647,14 +647,14 @@ JobFinish (job, status) */ done = FALSE; } - + if (done || WIFSTOPPED(status) || (WIFSIGNALED(status) && (status.w_termsig == SIGCONT)) || DEBUG(JOB)) { FILE *out; - + if (!usePipes && (job->flags & JOB_IGNERR)) { /* * If output is going to a file and this job is ignoring @@ -771,7 +771,7 @@ JobFinish (job, status) } else { done = TRUE; } - + if (done && (aborting != ABORT_ERROR) && @@ -812,7 +812,7 @@ JobFinish (job, status) */ aborting = ABORT_ERROR; } - + if ((aborting == ABORT_ERROR) && Job_Empty()) { /* * If we are aborting and the job table is now empty, we finish. @@ -851,7 +851,7 @@ Job_Touch (gn, silent) */ return; } - + if (!silent) { printf ("touch %s\n", gn->name); } @@ -883,7 +883,7 @@ Job_Touch (gn, silent) lseek(streamID, 0L, L_SET); write(streamID, &c, 1); } - + (void)close (streamID); } else printf("*** couldn't touch %s: %s", file, strerror(errno)); @@ -894,7 +894,7 @@ Job_Touch (gn, silent) /*- *----------------------------------------------------------------------- * Job_CheckCommands -- - * Make sure the given node has all the commands it needs. + * Make sure the given node has all the commands it needs. * * Results: * TRUE if the commands list is/was ok. @@ -908,14 +908,14 @@ Boolean Job_CheckCommands (gn, abortProc) GNode *gn; /* The target whose commands need * verifying */ - void (*abortProc) __P((char *, ...)); + void (*abortProc) __P((char *, ...)); /* Function to abort with message */ { if (OP_NOP(gn->type) && Lst_IsEmpty (gn->commands) && (gn->type & OP_LIB) == 0) { /* * No commands. Look for .DEFAULT rule from which we might infer - * commands + * commands */ if ((DEFAULT != NILGNODE) && !Lst_IsEmpty(DEFAULT->commands)) { char *p1; @@ -938,7 +938,7 @@ Job_CheckCommands (gn, abortProc) * rule to go on and the target doesn't already exist. There's * nothing more we can do for this branch. If the -k flag wasn't * given, we stop in our tracks, otherwise we just don't update - * this node's parents so they never get examined. + * this node's parents so they never get examined. */ if (gn->type & OP_OPTIONAL) { printf ("make: don't know how to make %s (ignored)\n", @@ -967,7 +967,7 @@ Job_CheckCommands (gn, abortProc) * * Side Effects: * JobDoOutput is called. - * + * *----------------------------------------------------------------------- */ /*ARGSUSED*/ @@ -1001,10 +1001,10 @@ JobExec(job, argv) char **argv; { int cpid; /* ID of new child */ - + if (DEBUG(JOB)) { int i; - + printf("Running %s %sly\n", job->node->name, job->flags&JOB_REMOTE?"remote":"local"); printf("\tCommand: "); @@ -1013,7 +1013,7 @@ JobExec(job, argv) } printf("\n"); } - + /* * Some jobs produce no output and it's disconcerting to have * no feedback of their running (since they produce no output, the @@ -1026,7 +1026,7 @@ JobExec(job, argv) printf(targFmt, job->node->name); lastNode = job->node; } - + #ifdef RMT_NO_EXEC if (job->flags & JOB_REMOTE) { goto jobExecFinish; @@ -1045,7 +1045,7 @@ JobExec(job, argv) (void) dup2(fileno(job->cmdFILE), 0); fcntl(0, F_SETFD, 0); lseek(0, 0, L_SET); - + if (usePipes) { /* * Set up the child's output to be routed through the pipe @@ -1075,7 +1075,7 @@ JobExec(job, argv) * we can kill it and all its descendants in one fell swoop, * by killing its process family, but not commit suicide. */ - + (void) setpgrp(0, getpid()); #endif USE_PGRP @@ -1093,7 +1093,7 @@ JobExec(job, argv) * stream to watch in the outputs mask */ job->curPos = 0; - + #ifdef RMT_WILL_WATCH Rmt_Watch(job->inPipe, JobLocalInput, job); #else @@ -1116,7 +1116,7 @@ JobExec(job, argv) } #ifdef RMT_NO_EXEC -jobExecFinish: +jobExecFinish: #endif /* * Now the job is actually running, add it to the table. @@ -1132,7 +1132,7 @@ jobExecFinish: *----------------------------------------------------------------------- * JobMakeArgv -- * Create the argv needed to execute the shell for a given job. - * + * * * Results: * @@ -1147,7 +1147,7 @@ JobMakeArgv(job, argv) { int argc; static char args[10]; /* For merged arguments */ - + argv[0] = shellName; argc = 1; @@ -1186,7 +1186,7 @@ JobMakeArgv(job, argv) /*- *----------------------------------------------------------------------- * JobRestart -- - * Restart a job that stopped for some reason. + * Restart a job that stopped for some reason. * * Results: * None. @@ -1231,7 +1231,7 @@ JobRestart(job) } return; } - + (void)Lst_AtEnd(jobs, (ClientData)job); nJobs += 1; if (nJobs == maxJobs) { @@ -1247,12 +1247,12 @@ JobRestart(job) * the 'exit' flag of the commandShell is used to cause it to exit * upon receiving an error. If the JOB_SILENT flag is clear, the * 'echo' flag of the commandShell is used to get it to start echoing - * as soon as it starts processing commands. + * as soon as it starts processing commands. */ char *argv[4]; - + JobMakeArgv(job, argv); - + if (DEBUG(JOB)) { printf("Restarting %s...", job->node->name); } @@ -1304,7 +1304,7 @@ JobRestart(job) Boolean error; extern int errno; union wait status; - + #ifdef RMT_WANTS_SIGNALS if (job->flags & JOB_REMOTE) { error = !Rmt_Signal(job, SIGCONT); @@ -1320,7 +1320,7 @@ JobRestart(job) job->flags |= JOB_CONTINUING; status.w_termsig = SIGCONT; JobFinish(job, status); - + job->flags &= ~(JOB_RESUME|JOB_CONTINUING); if (DEBUG(JOB)) { printf("done\n"); @@ -1353,7 +1353,7 @@ JobRestart(job) *----------------------------------------------------------------------- * JobStart -- * Start a target-creation process going for the target described - * by the graph node gn. + * by the graph node gn. * * Results: * JOB_ERROR if there was an error in the commands, JOB_FINISHED @@ -1417,7 +1417,7 @@ JobStart (gn, flags, previous) } else { cmdsOK = TRUE; } - + /* * If the -n flag wasn't given, we open up OUR (not the child's) * temporary file to stuff commands in it. The thing is rd/wr so we don't @@ -1432,7 +1432,7 @@ JobStart (gn, flags, previous) if (!cmdsOK) { DieHorribly(); } - + job->cmdFILE = fopen (tfile, "w+"); if (job->cmdFILE == (FILE *) NULL) { Punt ("Could not open %s", tfile); @@ -1461,7 +1461,7 @@ JobStart (gn, flags, previous) cmdsOK = FALSE; } else { LstNode ln = Lst_Next (gn->commands); - + if ((ln == NILLNODE) || JobPrintCommand ((char *)Lst_Datum (ln), job)) { @@ -1503,7 +1503,7 @@ JobStart (gn, flags, previous) */ numCommands = 0; Lst_ForEach (gn->commands, JobPrintCommand, (ClientData)job); - + /* * If we didn't print out any commands to the shell script, * there's not much point in executing the shell, is there? @@ -1547,7 +1547,7 @@ JobStart (gn, flags, previous) } /* - * If we're not supposed to execute a shell, don't. + * If we're not supposed to execute a shell, don't. */ if (noExec) { /* @@ -1599,7 +1599,7 @@ JobStart (gn, flags, previous) if (job->flags & JOB_FIRST) { if (usePipes) { int fd[2]; - (void) pipe(fd); + (void) pipe(fd); job->inPipe = fd[0]; job->outPipe = fd[1]; (void)fcntl (job->inPipe, F_SETFD, 1); @@ -1626,10 +1626,10 @@ JobStart (gn, flags, previous) * finishes. Note that the special jobs (.BEGIN, .INTERRUPT and .END) * may be run locally even when the local limit has been reached * (e.g. when maxLocal == 0), though they will be exported if at - * all possible. + * all possible. */ jobFull = TRUE; - + if (DEBUG(JOB)) { printf("Can only run job locally.\n"); } @@ -1693,13 +1693,13 @@ JobDoOutput (job, finish) FILE *oFILE; /* Stream pointer to shell's output file */ char inLine[132]; - + if (usePipes) { /* * Read as many bytes as will fit in the buffer. */ end_loop: - + nRead = read (job->inPipe, &job->outBuf[job->curPos], JOB_BUFSIZE - job->curPos); if (nRead < 0) { @@ -1724,11 +1724,11 @@ end_loop: } else if (nr == 0) { finish = FALSE; } - + /* * Look for the last newline in the bytes we just got. If there is * one, break out of the loop with 'i' as its index and gotNL set - * TRUE. + * TRUE. */ max = job->curPos + nr; for (i = job->curPos + nr - 1; i >= job->curPos; i--) { @@ -1742,13 +1742,13 @@ end_loop: job->outBuf[i] = ' '; } } - + if (!gotNL) { job->curPos += nr; if (job->curPos == JOB_BUFSIZE) { /* * If we've run out of buffer space, we have no choice - * but to print the stuff. sigh. + * but to print the stuff. sigh. */ gotNL = TRUE; i = job->curPos; @@ -1763,7 +1763,7 @@ end_loop: * by a target banner if this target isn't the same as the * one for which we last printed something. * The rest of the data in the buffer are then shifted down - * to the start of the buffer and curPos is set accordingly. + * to the start of the buffer and curPos is set accordingly. */ job->outBuf[i] = '\0'; if (i >= job->curPos) { @@ -1826,7 +1826,7 @@ end_loop: /* shift the remaining characters down */ memcpy ( job->outBuf, &job->outBuf[i + 1], max - (i + 1)); job->curPos = max - (i + 1); - + } else { /* * We have written everything out, so we just start over @@ -1948,13 +1948,13 @@ Job_CatchChildren (block) if (nLocal == 0) { return; } - + while ((pid = wait3((int *)&status, (block?0:WNOHANG)|WUNTRACED, (struct rusage *)0)) > 0) { if (DEBUG(JOB)) printf("Process %d exited or stopped.\n", pid); - + jnode = Lst_Find (jobs, (ClientData)&pid, JobCmpPid); @@ -1993,10 +1993,10 @@ Job_CatchChildren (block) * pipes do so. Otherwise just block time until we get a * signal (most likely a SIGCHLD) since there's no point in * just spinning when there's nothing to do and the reaping - * of a child can wait for a while. + * of a child can wait for a while. * * Results: - * None + * None * * Side Effects: * Output is read from pipes if we're piping. @@ -2129,7 +2129,7 @@ Job_Init (maxproc, maxlocal) } else { targFmt = TARG_FMT; } - + if (shellPath == (char *) NULL) { /* * The user didn't specify a shell to use, so we are using the @@ -2185,7 +2185,7 @@ Job_Init (maxproc, maxlocal) signal (SIGWINCH, JobPassSig); } #endif - + begin = Targ_FindNode (".BEGIN", TARG_NOCREATE); if (begin != NILGNODE) { @@ -2362,7 +2362,7 @@ Job_ParseShell (line) words = brk_string (line, &wordCount, TRUE); memset ((Address)&newShell, 0, sizeof(newShell)); - + /* * Parse the specification by keyword */ @@ -2447,7 +2447,7 @@ Job_ParseShell (line) if (commandShell->echoOn && commandShell->echoOff) { commandShell->hasEchoCtl = TRUE; } - + if (!commandShell->hasErrCtl) { if (commandShell->errCheck == (char *)NULL) { commandShell->errCheck = ""; @@ -2456,7 +2456,7 @@ Job_ParseShell (line) commandShell->ignErr = "%s\n"; } } - + /* * Do not free up the words themselves, since they might be in use by the * shell specification... @@ -2486,7 +2486,7 @@ JobInterrupt (runINTERRUPT) LstNode ln; /* element in job table */ Job *job; /* job descriptor in that element */ GNode *interrupt; /* the node describing the .INTERRUPT target */ - + aborting = ABORT_INTERRUPT; (void)Lst_Open (jobs); @@ -2498,7 +2498,7 @@ JobInterrupt (runINTERRUPT) job->node->name : job->node->path); struct stat st; - if (!noExecute && lstat(file, &st) != -1 && !S_ISDIR(st.st_mode) && + if (!noExecute && lstat(file, &st) != -1 && !S_ISDIR(st.st_mode) && unlink(file) != -1) { Error ("*** %s removed", file); } @@ -2552,7 +2552,7 @@ JobInterrupt (runINTERRUPT) *----------------------------------------------------------------------- * Job_End -- * Do final processing such as the running of the commands - * attached to the .END target. + * attached to the .END target. * * Results: * Number of errors reported. @@ -2631,9 +2631,9 @@ Job_AbortAll () LstNode ln; /* element in job table */ Job *job; /* the job descriptor in that element */ int foo; - + aborting = ABORT_ERROR; - + if (nJobs) { (void)Lst_Open (jobs); @@ -2642,7 +2642,7 @@ Job_AbortAll () /* * kill the child process with increasingly drastic signals to make - * darn sure it's dead. + * darn sure it's dead. */ #ifdef RMT_WANTS_SIGNALS if (job->flags & JOB_REMOTE) { @@ -2658,7 +2658,7 @@ Job_AbortAll () #endif /* RMT_WANTS_SIGNALS */ } } - + /* * Catch as many children as want to report in at first, then give up */ diff --git a/usr.bin/make/job.h b/usr.bin/make/job.h index 998092d..d16986b 100644 --- a/usr.bin/make/job.h +++ b/usr.bin/make/job.h @@ -51,14 +51,14 @@ /* * The SEL_ constants determine the maximum amount of time spent in select * before coming out to see if a child has finished. SEL_SEC is the number of - * seconds and SEL_USEC is the number of micro-seconds + * seconds and SEL_USEC is the number of micro-seconds */ #define SEL_SEC 0 #define SEL_USEC 500000 /*- - * Job Table definitions. + * Job Table definitions. * * Each job has several things associated with it: * 1) The process id of the child shell @@ -79,11 +79,11 @@ * 6) An identifier provided by and for the exclusive use of the * Rmt module. * 7) A word of flags which determine how the module handles errors, - * echoing, etc. for the job + * echoing, etc. for the job * * The job "table" is kept as a linked Lst in 'jobs', with the number of * active jobs maintained in the 'nJobs' variable. At no time will this - * exceed the value of 'maxJobs', initialized by the Job_Init function. + * exceed the value of 'maxJobs', initialized by the Job_Init function. * * When a job is finished, the Make_Update function is called on each of the * parents of the node which was just remade. This takes care of the upward @@ -105,7 +105,7 @@ typedef struct Job { * if we can't export it and maxLocal is 0 */ #define JOB_IGNDOTS 0x008 /* Ignore "..." lines when processing * commands */ -#define JOB_REMOTE 0x010 /* Job is running remotely */ +#define JOB_REMOTE 0x010 /* Job is running remotely */ #define JOB_FIRST 0x020 /* Job is first job for the node */ #define JOB_REMIGRATE 0x040 /* Job needs to be remigrated */ #define JOB_RESTART 0x080 /* Job needs to be completely restarted */ @@ -193,7 +193,7 @@ typedef struct Shell { char *errCheck; /* string to turn error checking on */ char *ignErr; /* string to turn off error checking */ /* - * command-line flags + * command-line flags */ char *echo; /* echo commands */ char *exit; /* exit on error */ diff --git a/usr.bin/make/list.h b/usr.bin/make/list.h index 04a0b66..1b21bfe 100644 --- a/usr.bin/make/list.h +++ b/usr.bin/make/list.h @@ -60,39 +60,39 @@ * to a list as a whole, the user keeps a pointer to the header; that * header is initialized by a call to List_Init(), which creates an empty * list given a pointer to a List_Links structure (described below). - * + * * The links are contained in a two-element structure called List_Links. * A list joins List_Links records (that is, each List_Links structure * points to other List_Links structures), but if the List_Links is the * first field within a larger structure, then the larger structures are * effectively linked together as follows: - * + * * header * (List_Links) first elt. second elt. - * ----------------- ----------------- ----------------- + * ----------------- ----------------- ----------------- * ..-> | nextPtr | ----> | List_Links | ----> | List_Links |----.. - * | - - - - - - - | | | | | + * | - - - - - - - | | | | | * ..-- | prevPtr | <---- | | <---- | |<---.. * ----------------- - --- --- --- - - --- --- --- - - * | rest of | | rest of | - * | structure | | structure | + * | rest of | | rest of | + * | structure | | structure | * | | | | - * | ... | | ... | - * ----------------- ----------------- - * + * | ... | | ... | + * ----------------- ----------------- + * * It is possible to link structures through List_Links fields that are * not at the beginning of the larger structure, but it is then necessary * to perform pointer arithmetic to find the beginning of the larger * structure, given a pointer to some point within it. - * + * * A typical structure might be something like: - * + * * typedef struct { * List_Links links; * char ch; * integer flags; * } EditChar; - * + * * Before an element is inserted in a list for the first time, it must * be initialized by calling the macro List_InitElement(). */ @@ -129,7 +129,7 @@ void List_Move(); /* move an element elsewhere in a list */ #define List_InitElement(elementPtr) \ (elementPtr)->prevPtr = (List_Links *) NIL; \ (elementPtr)->nextPtr = (List_Links *) NIL; - + /* * Macros for stepping through or selecting parts of lists */ @@ -142,10 +142,10 @@ void List_Move(); /* move an element elsewhere in a list */ * Macro to loop through a list and perform an operation on each member. * * Usage: LIST_FORALL(headerPtr, itemPtr) { - * / * + * / * * * operation on itemPtr, which points to successive members * * of the list - * * + * * * * It may be appropriate to first assign * * foobarPtr = (Foobar *) itemPtr; * * to refer to the entire Foobar structure. @@ -279,7 +279,7 @@ void List_Move(); /* move an element elsewhere in a list */ * LIST_ATFRONT(headerPtr) -- insert at front of list * LIST_ATREAR(headerPtr) -- insert at end of list * - * For example, + * For example, * * List_Insert(itemPtr, LIST_AFTER(otherPtr)); * diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h index 246b7e3..6131ae3 100644 --- a/usr.bin/make/lst.h +++ b/usr.bin/make/lst.h @@ -118,12 +118,12 @@ ClientData Lst_Datum __P((LstNode)); * Functions for entire lists */ /* Find an element in a list */ -LstNode Lst_Find __P((Lst, ClientData, +LstNode Lst_Find __P((Lst, ClientData, int (*)(ClientData, ClientData))); /* Find an element starting from somewhere */ LstNode Lst_FindFrom __P((Lst, LstNode, ClientData, int (*cProc)(ClientData, ClientData))); -/* +/* * See if the given datum is on the list. Returns the LstNode containing * the datum */ diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c index 0a1d52b..16f9d87 100644 --- a/usr.bin/make/lst.lib/lstAppend.c +++ b/usr.bin/make/lst.lib/lstAppend.c @@ -70,23 +70,23 @@ Lst_Append (l, ln, d) register List list; register ListNode lNode; register ListNode nLNode; - + if (LstValid (l) && (ln == NILLNODE && LstIsEmpty (l))) { goto ok; } - + if (!LstValid (l) || LstIsEmpty (l) || ! LstNodeValid (ln, l)) { return (FAILURE); } ok: - + list = (List)l; lNode = (ListNode)ln; PAlloc (nLNode, ListNode); nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - + if (lNode == NilListNode) { if (list->isCirc) { nLNode->nextPtr = nLNode->prevPtr = nLNode; @@ -97,17 +97,17 @@ Lst_Append (l, ln, d) } else { nLNode->prevPtr = lNode; nLNode->nextPtr = lNode->nextPtr; - + lNode->nextPtr = nLNode; if (nLNode->nextPtr != NilListNode) { nLNode->nextPtr->prevPtr = nLNode; } - + if (lNode == list->lastPtr) { list->lastPtr = nLNode; } } - + return (SUCCESS); } diff --git a/usr.bin/make/lst.lib/lstAtEnd.c b/usr.bin/make/lst.lib/lstAtEnd.c index dce8a07..5513453 100644 --- a/usr.bin/make/lst.lib/lstAtEnd.c +++ b/usr.bin/make/lst.lib/lstAtEnd.c @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) 6/6/93"; */ #include "lstInt.h" - + /*- *----------------------------------------------------------------------- * Lst_AtEnd -- @@ -64,7 +64,7 @@ Lst_AtEnd (l, d) ClientData d; /* Datum to add */ { register LstNode end; - + end = Lst_Last (l); return (Lst_Append (l, end, d)); } diff --git a/usr.bin/make/lst.lib/lstAtFront.c b/usr.bin/make/lst.lib/lstAtFront.c index 58a235d..490cb9b 100644 --- a/usr.bin/make/lst.lib/lstAtFront.c +++ b/usr.bin/make/lst.lib/lstAtFront.c @@ -65,7 +65,7 @@ Lst_AtFront (l, d) ClientData d; { register LstNode front; - + front = Lst_First (l); return (Lst_Insert (l, front, d)); } diff --git a/usr.bin/make/lst.lib/lstClose.c b/usr.bin/make/lst.lib/lstClose.c index 624e6c6..19a8d2e 100644 --- a/usr.bin/make/lst.lib/lstClose.c +++ b/usr.bin/make/lst.lib/lstClose.c @@ -68,7 +68,7 @@ Lst_Close (l) Lst l; /* The list to close */ { register List list = (List) l; - + if (LstValid(l) == TRUE) { list->isOpen = FALSE; list->atEnd = Unknown; diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c index cac2d11..3c90872 100644 --- a/usr.bin/make/lst.lib/lstConcat.c +++ b/usr.bin/make/lst.lib/lstConcat.c @@ -149,7 +149,7 @@ Lst_Concat (l1, l2, flags) /* * Finish bookkeeping. The last new element becomes the last element - * of list one. + * of list one. */ list1->lastPtr = last; @@ -173,4 +173,4 @@ Lst_Concat (l1, l2, flags) return (SUCCESS); } - + diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c index 921889a..dbb4da6 100644 --- a/usr.bin/make/lst.lib/lstDeQueue.c +++ b/usr.bin/make/lst.lib/lstDeQueue.c @@ -65,12 +65,12 @@ Lst_DeQueue (l) { ClientData rd; register ListNode tln; - + tln = (ListNode) Lst_First (l); if (tln == NilListNode) { return ((ClientData) NIL); } - + rd = tln->datum; if (Lst_Remove (l, (LstNode)tln) == FAILURE) { return ((ClientData) NIL); diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c index 7b7b4b2..7891e74 100644 --- a/usr.bin/make/lst.lib/lstDestroy.c +++ b/usr.bin/make/lst.lib/lstDestroy.c @@ -68,7 +68,7 @@ Lst_Destroy (l, freeProc) register ListNode ln; register ListNode tln = NilListNode; register List list = (List)l; - + if (l == NILLST || ! l) { /* * Note the check for l == (Lst)0 to catch uninitialized static Lst's. @@ -97,6 +97,6 @@ Lst_Destroy (l, freeProc) free ((Address)ln); } } - + free ((Address)l); } diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c index 152c1d1..30124c1 100644 --- a/usr.bin/make/lst.lib/lstDupl.c +++ b/usr.bin/make/lst.lib/lstDupl.c @@ -68,7 +68,7 @@ Lst_Duplicate (l, copyProc) register Lst nl; register ListNode ln; register List list = (List)l; - + if (!LstValid (l)) { return (NILLST); } @@ -94,6 +94,6 @@ Lst_Duplicate (l, copyProc) ln = ln->nextPtr; } } - + return (nl); } diff --git a/usr.bin/make/lst.lib/lstEnQueue.c b/usr.bin/make/lst.lib/lstEnQueue.c index 14e36e3..8987adc 100644 --- a/usr.bin/make/lst.lib/lstEnQueue.c +++ b/usr.bin/make/lst.lib/lstEnQueue.c @@ -67,7 +67,7 @@ Lst_EnQueue (l, d) if (LstValid (l) == FALSE) { return (FAILURE); } - + return (Lst_Append (l, Lst_Last(l), d)); } diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c index aaa5697..530f307 100644 --- a/usr.bin/make/lst.lib/lstFindFrom.c +++ b/usr.bin/make/lst.lib/lstFindFrom.c @@ -69,13 +69,13 @@ Lst_FindFrom (l, ln, d, cProc) { register ListNode tln; Boolean found = FALSE; - + if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { return (NILLNODE); } - + tln = (ListNode)ln; - + do { if ((*cProc) (tln->datum, d) == 0) { found = TRUE; @@ -84,7 +84,7 @@ Lst_FindFrom (l, ln, d, cProc) tln = tln->nextPtr; } } while (tln != (ListNode)ln && tln != NilListNode); - + if (found) { return ((LstNode)tln); } else { diff --git a/usr.bin/make/lst.lib/lstForEachFrom.c b/usr.bin/make/lst.lib/lstForEachFrom.c index f19357f..6ae43ef 100644 --- a/usr.bin/make/lst.lib/lstForEachFrom.c +++ b/usr.bin/make/lst.lib/lstForEachFrom.c @@ -51,7 +51,7 @@ static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93"; * Lst_ForEachFrom -- * Apply the given function to each element of the given list. The * function should return 0 if traversal should continue and non- - * zero if it should abort. + * zero if it should abort. * * Results: * None. @@ -74,19 +74,19 @@ Lst_ForEachFrom (l, ln, proc, d) register ListNode next; Boolean done; int result; - + if (!LstValid (list) || LstIsEmpty (list)) { return; } - + do { /* * Take care of having the current element deleted out from under * us. */ - + next = tln->nextPtr; - + (void) tln->useCount++; result = (*proc) (tln->datum, d); (void) tln->useCount--; @@ -99,7 +99,7 @@ Lst_ForEachFrom (l, ln, proc, d) */ done = (next == tln->nextPtr && (next == NilListNode || next == list->firstPtr)); - + next = tln->nextPtr; if (tln->flags & LN_DELETED) { @@ -107,5 +107,5 @@ Lst_ForEachFrom (l, ln, proc, d) } tln = next; } while (!result && !LstIsEmpty(list) && !done); - + } diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c index c548c7f..8e696cd 100644 --- a/usr.bin/make/lst.lib/lstInit.c +++ b/usr.bin/make/lst.lib/lstInit.c @@ -63,14 +63,14 @@ Lst_Init(circ) Boolean circ; /* TRUE if the list should be made circular */ { register List nList; - + PAlloc (nList, List); - + nList->firstPtr = NilListNode; nList->lastPtr = NilListNode; nList->isOpen = FALSE; nList->isCirc = circ; nList->atEnd = Unknown; - + return ((Lst)nList); } diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c index 45577c4..e07df21 100644 --- a/usr.bin/make/lst.lib/lstInsert.c +++ b/usr.bin/make/lst.lib/lstInsert.c @@ -76,17 +76,17 @@ Lst_Insert (l, ln, d) */ if (LstValid (l) && (LstIsEmpty (l) && ln == NILLNODE)) goto ok; - + if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { return (FAILURE); } - + ok: PAlloc (nLNode, ListNode); - + nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - + if (ln == NILLNODE) { if (list->isCirc) { nLNode->prevPtr = nLNode->nextPtr = nLNode; @@ -97,17 +97,17 @@ Lst_Insert (l, ln, d) } else { nLNode->prevPtr = lNode->prevPtr; nLNode->nextPtr = lNode; - + if (nLNode->prevPtr != NilListNode) { nLNode->prevPtr->nextPtr = nLNode; } lNode->prevPtr = nLNode; - + if (lNode == list->firstPtr) { list->firstPtr = nLNode; } } - + return (SUCCESS); } - + diff --git a/usr.bin/make/lst.lib/lstMember.c b/usr.bin/make/lst.lib/lstMember.c index 23070b7..9c1aac7 100644 --- a/usr.bin/make/lst.lib/lstMember.c +++ b/usr.bin/make/lst.lib/lstMember.c @@ -57,7 +57,7 @@ Lst_Member (l, d) if (lNode == NilListNode) { return NILLNODE; } - + do { if (lNode->datum == d) { return (LstNode)lNode; diff --git a/usr.bin/make/lst.lib/lstNext.c b/usr.bin/make/lst.lib/lstNext.c index 0745b1c..b371eca 100644 --- a/usr.bin/make/lst.lib/lstNext.c +++ b/usr.bin/make/lst.lib/lstNext.c @@ -71,14 +71,14 @@ Lst_Next (l) { register ListNode tln; register List list = (List)l; - + if ((LstValid (l) == FALSE) || (list->isOpen == FALSE)) { return (NILLNODE); } - + list->prevPtr = list->curPtr; - + if (list->curPtr == NilListNode) { if (list->atEnd == Unknown) { /* @@ -108,7 +108,7 @@ Lst_Next (l) list->atEnd = Middle; } } - + return ((LstNode)tln); } diff --git a/usr.bin/make/lst.lib/lstRemove.c b/usr.bin/make/lst.lib/lstRemove.c index 48a4c00..c43e3da 100644 --- a/usr.bin/make/lst.lib/lstRemove.c +++ b/usr.bin/make/lst.lib/lstRemove.c @@ -72,7 +72,7 @@ Lst_Remove (l, ln) !LstNodeValid (ln, l)) { return (FAILURE); } - + /* * unlink it from the list */ @@ -82,7 +82,7 @@ Lst_Remove (l, ln) if (lNode->prevPtr != NilListNode) { lNode->prevPtr->nextPtr = lNode->nextPtr; } - + /* * if either the firstPtr or lastPtr of the list point to this node, * adjust them accordingly @@ -115,7 +115,7 @@ Lst_Remove (l, ln) if (list->firstPtr == lNode) { list->firstPtr = NilListNode; } - + /* * note that the datum is unmolested. The caller must free it as * necessary and as expected. @@ -125,7 +125,7 @@ Lst_Remove (l, ln) } else { lNode->flags |= LN_DELETED; } - + return (SUCCESS); } diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 50590d9..1698000 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -397,7 +397,7 @@ main(argc, argv) if ((pwd = getenv("PWD")) != NULL) { if (stat(pwd, &sb) == 0 && sa.st_ino == sb.st_ino && - sa.st_dev == sb.st_dev) + sa.st_dev == sb.st_dev) (void) strcpy(curdir, pwd); } @@ -430,7 +430,7 @@ main(argc, argv) } else (void) strncpy(mdpath, path, MAXPATHLEN + 1); - + if (stat(mdpath, &sb) == 0 && S_ISDIR(sb.st_mode)) { if (chdir(mdpath)) { @@ -492,7 +492,7 @@ main(argc, argv) #else compatMake = TRUE; /* No compat mode */ #endif - + /* * Initialize the parsing, directory and variable modules to prepare @@ -535,7 +535,7 @@ main(argc, argv) #else Main_ParseArgLine(getenv("MAKE")); #endif - + MainParseArgs(argc, argv); /* @@ -677,7 +677,7 @@ main(argc, argv) * well as initializing the module. */ Compat_Run(targs); - + Lst_Destroy(targs, NOFREE); Lst_Destroy(makefiles, NOFREE); Lst_Destroy(create, (void (*) __P((ClientData))) free); @@ -833,7 +833,7 @@ Fatal(va_alist) * a message and exits. * * Results: - * None + * None * * Side Effects: * All children are killed indiscriminately and the program Lib_Exits @@ -889,10 +889,10 @@ DieHorribly() /* * Finish -- * Called when aborting due to errors in child shell to signal - * abnormal exit. + * abnormal exit. * * Results: - * None + * None * * Side Effects: * The program exits diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 07d258c..f4c83d6 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -94,10 +94,10 @@ static int MakePrintStatus __P((ClientData, ClientData)); *----------------------------------------------------------------------- * Make_TimeStamp -- * Set the cmtime field of a parent node based on the mtime stamp in its - * child. Called from MakeOODate via Lst_ForEach. + * child. Called from MakeOODate via Lst_ForEach. * * Results: - * Always returns 0. + * Always returns 0. * * Side Effects: * The cmtime of the parent node will be changed if the mtime @@ -134,7 +134,7 @@ MakeTimeStamp (pgn, cgn) * will have been recreated. * * Results: - * TRUE if the node is out of date. FALSE otherwise. + * TRUE if the node is out of date. FALSE otherwise. * * Side Effects: * The mtime field of the node and the cmtime field of its parents @@ -330,7 +330,7 @@ Make_HandleUse (cgn, pgn) */ (void) Lst_Concat (pgn->commands, cgn->commands, LST_CONCNEW); } - + if (Lst_Open (cgn->children) == SUCCESS) { while ((ln = Lst_Next (cgn->children)) != NILLNODE) { gn = (GNode *)Lst_Datum (ln); @@ -343,7 +343,7 @@ Make_HandleUse (cgn, pgn) } Lst_Close (cgn->children); } - + pgn->type |= cgn->type & ~(OP_OPMASK|OP_USE|OP_TRANSFORM); /* @@ -372,7 +372,7 @@ MakeHandleUse (pgn, cgn) * Make_Update -- * Perform update on the parents of a node. Used by JobFinish once * a node has been dealt with and by MakeStartJobs if it finds an - * up-to-date node. + * up-to-date node. * * Results: * Always returns 0 @@ -471,7 +471,7 @@ Make_Update (cgn) } #endif } - + if (Lst_Open (cgn->parents) == SUCCESS) { while ((ln = Lst_Next (cgn->parents)) != NILLNODE) { pgn = (GNode *)Lst_Datum (ln); @@ -516,7 +516,7 @@ Make_Update (cgn) (void)Lst_EnQueue(toBeMade, (ClientData)succ); } } - + /* * Set the .PREFIX and .IMPSRC variables for all the implied parents * of this node. @@ -666,7 +666,7 @@ static Boolean MakeStartJobs () { register GNode *gn; - + while (!Job_Full() && !Lst_IsEmpty (toBeMade)) { gn = (GNode *) Lst_DeQueue (toBeMade); if (DEBUG(MAKE)) { @@ -699,7 +699,7 @@ MakeStartJobs () continue; } } - + numNodes--; if (Make_OODate (gn)) { if (DEBUG(MAKE)) { @@ -724,7 +724,7 @@ MakeStartJobs () */ Make_DoAllVar (gn); } - + Make_Update (gn); } } @@ -819,22 +819,22 @@ Make_Run (targs) examine = Lst_Duplicate(targs, NOCOPY); numNodes = 0; - + /* * Make an initial downward pass over the graph, marking nodes to be made * as we go down. We call Suff_FindDeps to find where a node is and * to get some children for it if it has none and also has no commands. * If the node is a leaf, we stick it on the toBeMade queue to * be looked at in a minute, otherwise we add its children to our queue - * and go on about our business. + * and go on about our business. */ while (!Lst_IsEmpty (examine)) { gn = (GNode *) Lst_DeQueue (examine); - + if (!gn->make) { gn->make = TRUE; numNodes++; - + /* * Apply any .USE rules before looking for implicit dependencies * to make sure everything has commands that should... @@ -849,7 +849,7 @@ Make_Run (targs) } } } - + Lst_Destroy (examine, NOFREE); if (queryFlag) { @@ -865,7 +865,7 @@ Make_Run (targs) * get started, nothing will happen since the remaining upward * traversal of the graph is performed by the routines in job.c upon * the finishing of a job. So we fill the Job table as much as we can - * before going into our loop. + * before going into our loop. */ (void) MakeStartJobs(); } @@ -894,6 +894,6 @@ Make_Run (targs) */ errors = ((errors == 0) && (numNodes != 0)); Lst_ForEach(targs, MakePrintStatus, (ClientData) &errors); - + return (TRUE); } diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index 7873ec1..cdc7950 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -56,7 +56,7 @@ #if defined(__STDC__) || defined(__cplusplus) #define __P(protos) protos /* full-blown ANSI C */ #else -#define __P(protos) () /* traditional C preprocessor */ +#define __P(protos) () /* traditional C preprocessor */ #endif #endif #if __STDC__ @@ -94,7 +94,7 @@ * 16) a Lst of ``local'' variables that are specific to this target * and this target only (qv. var.c [$@ $< $?, etc.]) * 17) a Lst of strings that are commands to be given to a shell - * to create this target. + * to create this target. */ typedef struct GNode { char *name; /* The target's name */ @@ -150,7 +150,7 @@ typedef struct GNode { } GNode; /* - * Manifest constants + * Manifest constants */ #define NILGNODE ((GNode *) NIL) @@ -161,7 +161,7 @@ typedef struct GNode { * placed in the 'type' field of each node. Any node that has * a 'type' field which satisfies the OP_NOP function was never never on * the lefthand side of an operator, though it may have been on the - * righthand side... + * righthand side... */ #define OP_DEPENDS 0x00000001 /* Execution of commands depends on * kids (:) */ @@ -215,7 +215,7 @@ typedef struct GNode { * do if the desired node(s) is (are) not found. If the TARG_CREATE constant * is given, a new, empty node will be created for the target, placed in the * table of all targets and its address returned. If TARG_NOCREATE is given, - * a NIL pointer will be returned. + * a NIL pointer will be returned. */ #define TARG_CREATE 0x01 /* create node if not found */ #define TARG_NOCREATE 0x00 /* don't create it */ @@ -227,7 +227,7 @@ typedef struct GNode { * If longer, it should be increased. Reducing it will cause more copying to * be done for longer lines, but will save space for shorter ones. In any * case, it ought to be a power of two simply because most storage allocation - * schemes allocate in powers of two. + * schemes allocate in powers of two. */ #define MAKE_BSIZE 256 /* starting size for expandable buffers */ @@ -238,7 +238,7 @@ typedef struct GNode { * be used instead of a space. If neither is given, no intervening characters * will be placed between the two strings in the final output. If the * STR_DOFREE bit is set, the two input strings will be freed before - * Str_Concat returns. + * Str_Concat returns. */ #define STR_ADDSPACE 0x01 /* add a space when Str_Concat'ing */ #define STR_DOFREE 0x02 /* free source strings after concatenation */ @@ -278,7 +278,7 @@ typedef struct GNode { #define DPREFIX "*D" /* directory part of PREFIX */ /* - * Global Variables + * Global Variables */ extern Lst create; /* The list of target names specified on the * command line. used to resolve #if diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index b1c63a6..27b3ff7 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -261,7 +261,7 @@ ParseFindKeyword (str) end, cur; register int diff; - + start = 0; end = (sizeof(parseKeywords)/sizeof(parseKeywords[0])) - 1; @@ -384,7 +384,7 @@ ParseDoOp (gnp, opp) /* * If the dependency mask of the operator and the node don't match and * the node has actually had an operator applied to it before, and - * the operator actually has some dependency information in it, complain. + * the operator actually has some dependency information in it, complain. */ if (((op & OP_OPMASK) != (gn->type & OP_OPMASK)) && !OP_NOP(gn->type) && !OP_NOP(op)) @@ -404,7 +404,7 @@ ParseDoOp (gnp, opp) */ register GNode *cohort; LstNode ln; - + cohort = Targ_NewGN(gn->name); /* * Duplicate links to parents so graph traversal is simple. Perhaps @@ -428,7 +428,7 @@ ParseDoOp (gnp, opp) } /* * We don't want to nuke any previous flags (whatever they were) so we - * just OR the new operator into the old + * just OR the new operator into the old */ gn->type |= op; @@ -661,7 +661,7 @@ ParseDoDependency (line) paths = (Lst)NULL; curTargs = Lst_Init(FALSE); - + do { for (cp = line; *cp && !isspace (*cp) && @@ -709,11 +709,11 @@ ParseDoDependency (line) } } savec = *cp; - + if (!*cp) { /* * Ending a dependency line without an operator is a Bozo - * no-no + * no-no */ Parse_Error (PARSE_FATAL, "Need an operator"); return; @@ -726,7 +726,7 @@ ParseDoDependency (line) if (*line == '.' && isupper (line[1])) { /* * See if the target is a special target that must have it - * or its sources handled specially. + * or its sources handled specially. */ int keywd = ParseFindKeyword(line); if (keywd != -1) { @@ -734,7 +734,7 @@ ParseDoDependency (line) Parse_Error(PARSE_FATAL, "Mismatched special targets"); return; } - + specType = parseKeywords[keywd].spec; tOp = parseKeywords[keywd].op; @@ -793,7 +793,7 @@ ParseDoDependency (line) case NotParallel: { extern int maxJobs; - + maxJobs = 1; break; } @@ -813,7 +813,7 @@ ParseDoDependency (line) * modify. */ Lst path; - + specType = ExPath; path = Suff_GetPath (&line[5]); if (path == NILLST) { @@ -829,10 +829,10 @@ ParseDoDependency (line) } } } - + /* * Have word in line. Get or create its node and stick it at - * the end of the targets list + * the end of the targets list */ if ((specType == Not) && (*line != '\0')) { if (Dir_HasWildcards(line)) { @@ -843,9 +843,9 @@ ParseDoDependency (line) * Dir module could have added a directory to the path... */ Lst emptyPath = Lst_Init(FALSE); - + Dir_Expand(line, emptyPath, curTargs); - + Lst_Destroy(emptyPath, Dir_Destroy); } else { /* @@ -854,22 +854,22 @@ ParseDoDependency (line) */ (void)Lst_AtEnd(curTargs, (ClientData)line); } - + while(!Lst_IsEmpty(curTargs)) { char *targName = (char *)Lst_DeQueue(curTargs); - + if (!Suff_IsTransform (targName)) { gn = Targ_FindNode (targName, TARG_CREATE); } else { gn = Suff_AddTransform (targName); } - + (void)Lst_AtEnd (targets, (ClientData)gn); } } else if (specType == ExPath && *line != '.' && *line != '\0') { Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line); } - + *cp = savec; /* * If it is a special type and not .PATH, it's the only target we @@ -877,7 +877,7 @@ ParseDoDependency (line) */ if (specType != Not && specType != ExPath) { Boolean warn = FALSE; - + while ((*cp != '!') && (*cp != ':') && *cp) { if (*cp != ' ' && *cp != '\t') { warn = TRUE; @@ -944,7 +944,7 @@ ParseDoDependency (line) Lst_ForEach (targets, ParseDoOp, (ClientData)&op); /* - * Get to the first source + * Get to the first source */ while (*cp && isspace (*cp)) { cp++; @@ -997,9 +997,9 @@ ParseDoDependency (line) } else if ((specType == NotParallel) || (specType == SingleShell)) { *line = '\0'; } - + /* - * NOW GO FOR THE SOURCES + * NOW GO FOR THE SOURCES */ if ((specType == Suffixes) || (specType == ExPath) || (specType == Includes) || (specType == Libs) || @@ -1118,7 +1118,7 @@ ParseDoDependency (line) line = cp; } } - + if (mainNode == NILGNODE) { /* * If we have yet to decide on a main target to make, in the @@ -1170,16 +1170,16 @@ Parse_IsVar (line) } else if ((*line == ' ') || (*line == '\t')) { /* * there can be as much white space as desired so long as there is - * only one word before the operator + * only one word before the operator */ wasSpace = TRUE; } else if (wasSpace && haveName) { /* * Stop when an = operator is found. */ - if ((*line == '+') || (*line == ':') || (*line == '?') || + if ((*line == '+') || (*line == ':') || (*line == '?') || (*line == '!')) { - break; + break; } /* @@ -1187,7 +1187,7 @@ Parse_IsVar (line) */ return (FALSE); } else { - haveName = TRUE; + haveName = TRUE; wasSpace = FALSE; } line++; @@ -1195,7 +1195,7 @@ Parse_IsVar (line) /* * A final check: if we stopped on a +, ?, ! or :, the next character must - * be an = or it ain't a valid assignment + * be an = or it ain't a valid assignment */ if (((*line == '+') || (*line == '?') || @@ -1239,9 +1239,9 @@ Parse_DoVar (line, ctxt) enum { VAR_SUBST, VAR_APPEND, VAR_SHELL, VAR_NORMAL } type; /* Type of assignment */ - char *opc; /* ptr to operator character to + char *opc; /* ptr to operator character to * null-terminate the variable name */ - /* + /* * Avoid clobbered variable warnings by forcing the compiler * to ``unregister'' variables */ @@ -1338,7 +1338,7 @@ Parse_DoVar (line, ctxt) Boolean freeCmd; /* TRUE if the command needs to be freed, i.e. * if any variable expansion was performed */ - /* + /* * Avoid clobbered variable warnings by forcing the compiler * to ``unregister'' variables */ @@ -1387,7 +1387,7 @@ Parse_DoVar (line, ctxt) */ dup2(fds[1], 1); close(fds[1]); - + execv("/bin/sh", args); _exit(1); } else if (cpid < 0) { @@ -1406,13 +1406,13 @@ Parse_DoVar (line, ctxt) * No need for the writing half */ close(fds[1]); - + buf = Buf_Init (MAKE_BSIZE); do { char result[BUFSIZ]; cc = read(fds[0], result, sizeof(result)); - if (cc > 0) + if (cc > 0) Buf_AddBytes(buf, cc, (Byte *) result); } while (cc > 0 || (cc == -1 && errno == EINTR)); @@ -1554,7 +1554,7 @@ Parse_AddIncludeDir (dir) *--------------------------------------------------------------------- * ParseDoInclude -- * Push to another file. - * + * * The input is the line minus the #include. A file spec is a string * enclosed in <> or "". The former is looked for only in sysIncPath. * The latter in . and the directories specified by -I command line @@ -1643,7 +1643,7 @@ ParseDoInclude (file) prefEnd = strrchr (fname, '/'); if (prefEnd != (char *)NULL) { char *newName; - + *prefEnd = '\0'; if (file[0] == '/') newName = strdup(file); @@ -1732,7 +1732,7 @@ ParseDoInclude (file) *--------------------------------------------------------------------- * Parse_FromString -- * Start Parsing from the given string - * + * * Results: * None * @@ -1755,7 +1755,7 @@ Parse_FromString(str) oldFile->fname = fname; oldFile->F = curFILE; oldFile->p = curPTR; - + (void) Lst_AtFront (includes, (ClientData)oldFile); curFILE = NULL; @@ -1771,7 +1771,7 @@ Parse_FromString(str) *--------------------------------------------------------------------- * ParseTraditionalInclude -- * Push to another file. - * + * * The input is the line minus the "include". The file name is * the string following the "include". * @@ -1834,7 +1834,7 @@ ParseTraditionalInclude (file) prefEnd = strrchr (fname, '/'); if (prefEnd != (char *)NULL) { char *newName; - + *prefEnd = '\0'; newName = str_concat (fname, file, STR_ADDSLASH); fullname = Dir_FindFile (newName, parseIncPath); @@ -1954,7 +1954,7 @@ ParseEOF (opened) /*- *--------------------------------------------------------------------- * ParseReadc -- - * Read a character from the current file + * Read a character from the current file * * Results: * The character that was read @@ -1967,7 +1967,7 @@ ParseReadc() { if (curFILE) return fgetc(curFILE); - + if (curPTR && *curPTR->ptr) return *curPTR->ptr++; return EOF; @@ -1977,7 +1977,7 @@ ParseReadc() /*- *--------------------------------------------------------------------- * ParseUnreadc -- - * Put back a character to the current file + * Put back a character to the current file * * Results: * None. @@ -2030,17 +2030,17 @@ ParseSkipLine(skip) c = ParseReadc(); } lineno++; - + lastc = c; c = ParseReadc (); } } - + if (c == EOF) { Parse_Error (PARSE_FATAL, "Unclosed conditional/for loop"); return ((char *)NULL); } - + /* * Read the entire line into buf */ @@ -2052,7 +2052,7 @@ ParseSkipLine(skip) } while ((c != '\n') && (c != EOF)); } lineno++; - + Buf_AddByte (buf, (Byte)'\0'); line = (char *)Buf_GetAll (buf, &lineLength); Buf_Destroy (buf, FALSE); @@ -2121,11 +2121,11 @@ ParseReadLine () break; } } - + if (c != EOF) { lastc = c; buf = Buf_Init(MAKE_BSIZE); - + while (((c = ParseReadc ()) != '\n' || (lastc == '\\')) && (c != EOF)) { @@ -2173,7 +2173,7 @@ test_char: */ ParseUnreadc('\t'); goto line_read; - } + } break; case '=': if (!semiNL) { @@ -2236,11 +2236,11 @@ test_char: */ Buf_AddByte (buf, (Byte)lastc); lastc = c; - + } line_read: lineno++; - + if (lastc != '\0') { Buf_AddByte (buf, (Byte)lastc); } @@ -2262,7 +2262,7 @@ test_char: --ep; } *ep = 0; - + if (line[0] == '.') { /* * The line might be a conditional. Ask the conditional module @@ -2294,7 +2294,7 @@ test_char: */ line = ParseSkipLine(0); if (line == NULL) { - Parse_Error (PARSE_FATAL, + Parse_Error (PARSE_FATAL, "Unexpected end of file in for loop.\n"); break; } @@ -2342,7 +2342,7 @@ ParseFinishLine() inLine = FALSE; } } - + /*- *--------------------------------------------------------------------- @@ -2407,7 +2407,7 @@ Parse_File(name, stream) /* If we're this far, the line must be a comment. */ goto nextLine; } - + if (*line == '\t') { /* * If a line starts with a tab, it can only hope to be @@ -2424,7 +2424,7 @@ Parse_File(name, stream) /* * So long as it's not a blank line and we're actually * in a dependency spec, add the command to the list of - * commands of all targets in the dependency spec + * commands of all targets in the dependency spec */ Lst_ForEach (targets, ParseAddCmd, cp); Lst_AtEnd(targCmds, (ClientData) line); @@ -2436,7 +2436,7 @@ Parse_File(name, stream) } } #ifdef SYSVINCLUDE - } else if (strncmp (line, "include", 7) == 0 && + } else if (strncmp (line, "include", 7) == 0 && strchr(line, ':') == NULL) { /* * It's an S3/S5-style "include". @@ -2461,7 +2461,7 @@ Parse_File(name, stream) #ifndef POSIX Boolean nonSpace = FALSE; #endif - + cp = line; if (isspace((unsigned char) line[0])) { while ((*cp != '\0') && isspace((unsigned char) *cp)) { @@ -2477,7 +2477,7 @@ Parse_File(name, stream) } #endif } - + #ifndef POSIX if (*cp == '\0') { if (inLine) { @@ -2494,16 +2494,16 @@ Parse_File(name, stream) cp = Var_Subst (NULL, line, VAR_CMD, TRUE); free (line); line = cp; - + /* - * Need a non-circular list for the target nodes + * Need a non-circular list for the target nodes */ if (targets) Lst_Destroy(targets, NOFREE); targets = Lst_Init (FALSE); inLine = TRUE; - + ParseDoDependency (line); #ifndef POSIX } @@ -2515,7 +2515,7 @@ Parse_File(name, stream) free (line); } /* - * Reached EOF, but it may be just EOF of an include file... + * Reached EOF, but it may be just EOF of an include file... */ } while (ParseEOF(1) == CONTINUE); @@ -2548,7 +2548,7 @@ Parse_Init () char *cp = NULL, *start; /* avoid faults on read-only strings */ static char syspath[] = _PATH_DEFSYSPATH; - + mainNode = NILGNODE; parseIncPath = Lst_Init (FALSE); sysIncPath = Lst_Init (FALSE); @@ -2560,7 +2560,7 @@ Parse_Init () * as dir1:...:dirn) to the system include path. */ for (start = syspath; *start != '\0'; start = cp) { - for (cp = start; *cp != '\0' && *cp != ':'; cp++) + for (cp = start; *cp != '\0' && *cp != ':'; cp++) continue; if (*cp == '\0') { Dir_AddDir(sysIncPath, start); @@ -2581,7 +2581,7 @@ Parse_End() Lst_Destroy(parseIncPath, Dir_Destroy); Lst_Destroy(includes, NOFREE); /* Should be empty now */ } - + /*- *----------------------------------------------------------------------- diff --git a/usr.bin/make/sprite.h b/usr.bin/make/sprite.h index ba8be95..d5462d5 100644 --- a/usr.bin/make/sprite.h +++ b/usr.bin/make/sprite.h @@ -69,7 +69,7 @@ typedef int Boolean; typedef int ReturnStatus; /* - * The following statuses overlap with the first 2 generic statuses + * The following statuses overlap with the first 2 generic statuses * defined in status.h: * * SUCCESS There was no error. @@ -81,7 +81,7 @@ typedef int ReturnStatus; /* - * A nil pointer must be something that will cause an exception if + * A nil pointer must be something that will cause an exception if * referenced. There are two nils: the kernels nil and the nil used * by user processes. */ diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index cd785f1..35e50fe 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -38,7 +38,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; */ -static char *rcsid = "$Id: str.c,v 1.8 1994/06/16 18:50:18 jtc Exp $"; +static char *rcsid = "$Id: str.c,v 1.3 1995/01/23 21:02:00 jkh Exp $"; #endif /* not lint */ #include "make.h" @@ -216,7 +216,7 @@ brk_string(str, store_argc, expand) ch = *++p; break; } - + switch (ch = *++p) { case '\0': case '\n': @@ -253,12 +253,12 @@ done: argv[argc] = (char *)NULL; /* * Str_FindSubstring -- See if a string contains a particular substring. - * + * * Results: If string contains substring, the return value is the location of * the first matching instance of substring in string. If string doesn't * contain substring, the return value is NULL. Matching is done on an exact * character-for-character basis with no wildcards or special characters. - * + * * Side effects: None. */ char * @@ -291,13 +291,13 @@ Str_FindSubstring(string, substring) /* * Str_Match -- - * + * * See if a particular string matches a particular pattern. - * + * * Results: Non-zero is returned if string matches pattern, 0 otherwise. The * matching operation permits the following special characters in the * pattern: *?\[] (see the man page for details on what these mean). - * + * * Side effects: None. */ int @@ -394,8 +394,8 @@ thisCharOK: ++pattern; /*- *----------------------------------------------------------------------- * Str_SYSVMatch -- - * Check word against pattern for a match (% is wild), - * + * Check word against pattern for a match (% is wild), + * * Results: * Returns the beginning position of a match or null. The number * of characters matched is returned in len. @@ -445,7 +445,7 @@ Str_SYSVMatch(word, pattern, len) return m; } while (*w++ != '\0'); - + return NULL; } @@ -456,7 +456,7 @@ Str_SYSVMatch(word, pattern, len) * Substitute '%' on the pattern with len characters from src. * If the pattern does not contain a '%' prepend len characters * from src. - * + * * Results: * None * diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index b5126a1..1980bae 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -505,7 +505,7 @@ SuffParseTransform(str, srcPtr, targPtr) srcLn = NILLNODE; singleLn = NILLNODE; - + /* * Loop looking first for a suffix that matches the start of the * string and then for one that exactly matches the rest of it. If @@ -605,7 +605,7 @@ Suff_AddTransform (line) if (ln == NILLNODE) { /* * Make a new graph node for the transformation. It will be filled in - * by the Parse module. + * by the Parse module. */ gn = Targ_NewGN (line); (void)Lst_AtEnd (transforms, (ClientData)gn); @@ -628,7 +628,7 @@ Suff_AddTransform (line) (void)SuffParseTransform(line, &s, &t); /* - * link the two together in the proper relationship and order + * link the two together in the proper relationship and order */ if (DEBUG(SUFF)) { printf("defining transformation from `%s' to `%s'\n", @@ -663,7 +663,7 @@ Suff_EndTransform(gnp, dummy) ClientData dummy; /* Node for transformation */ { GNode *gn = (GNode *) gnp; - + if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) && Lst_IsEmpty(gn->children)) { @@ -812,7 +812,7 @@ Suff_AddSuffix (str) * XXX: Only do this after a Suff_ClearSuffixes? */ Lst_ForEach (transforms, SuffRebuildGraph, (ClientData)s); - } + } } /*- @@ -995,7 +995,7 @@ SuffAddSrc (sp, lsp) Src *targ; /* Target structure */ targ = ls->s; - + if ((s->flags & SUFF_NULL) && (*s->name != '\0')) { /* * If the suffix has been marked as the NULL suffix, also create a Src @@ -1325,7 +1325,7 @@ SuffExpandChildren(cgnp, pgnp) * after the child */ prevLN = Lst_Member(pgn->children, (ClientData)cgn); - + /* * First do variable expansion -- this takes precedence over * wildcard expansion. If the result contains wildcards, they'll be gotten @@ -1340,7 +1340,7 @@ SuffExpandChildren(cgnp, pgnp) if (cp != (char *)NULL) { Lst members = Lst_Init(FALSE); - + if (cgn->type & OP_ARCHV) { /* * Node was an archive(member) target, so we want to call @@ -1361,7 +1361,7 @@ SuffExpandChildren(cgnp, pgnp) char *start; char *initcp = cp; /* For freeing... */ - for (start = cp; *start == ' ' || *start == '\t'; start++) + for (start = cp; *start == ' ' || *start == '\t'; start++) continue; for (cp = start; *cp != '\0'; cp++) { if (*cp == ' ' || *cp == '\t') { @@ -1468,7 +1468,7 @@ SuffExpandChildren(cgnp, pgnp) if (DEBUG(SUFF)) { printf("Wildcard expanding \"%s\"...", cgn->name); } - + if (ln != NILLNODE) { Suff *s = (Suff *)Lst_Datum(ln); @@ -1516,7 +1516,7 @@ SuffExpandChildren(cgnp, pgnp) * Nuke what's left of the list */ Lst_Destroy(exp, NOFREE); - + /* * Now the source is expanded, remove it from the list of children to * keep it from being processed. @@ -1609,7 +1609,7 @@ SuffApplyTransform(tGn, sGn, t, s) } gn = (GNode *)Lst_Datum(ln); - + if (DEBUG(SUFF)) { printf("\tapplying %s -> %s to \"%s\"\n", s->name, t->name, tGn->name); } @@ -1618,7 +1618,7 @@ SuffApplyTransform(tGn, sGn, t, s) * Record last child for expansion purposes */ ln = Lst_Last(tGn->children); - + /* * Pass the buck to Make_HandleUse to apply the rule */ @@ -1671,7 +1671,7 @@ SuffFindArchiveDeps(gn, slst) 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. @@ -1683,7 +1683,7 @@ SuffFindArchiveDeps(gn, slst) *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 @@ -1702,7 +1702,7 @@ SuffFindArchiveDeps(gn, slst) (void)Lst_AtEnd(mem->parents, (ClientData)gn); gn->unmade += 1; } - + /* * Copy in the variables from the member node to this one. */ @@ -1815,7 +1815,7 @@ SuffFindNormalDeps(gn, slst) eoname = gn->name + strlen(gn->name); sopref = gn->name; - + /* * Begin at the beginning... */ @@ -1850,7 +1850,7 @@ SuffFindNormalDeps(gn, slst) if (ln != NILLNODE) { int prefLen; /* Length of the prefix */ Src *targ; - + /* * Allocate a Src structure to which things can be transformed */ @@ -1864,7 +1864,7 @@ SuffFindNormalDeps(gn, slst) #ifdef DEBUG_SRC targ->cp = Lst_Init(FALSE); #endif - + /* * Allocate room for the prefix, whose end is found by subtracting * the length of the suffix from the end of the name. @@ -1898,7 +1898,7 @@ SuffFindNormalDeps(gn, slst) if (DEBUG(SUFF)) { printf("\tNo known suffix on %s. Using .NULL suffix\n", gn->name); } - + targ = (Src *)emalloc(sizeof (Src)); targ->file = strdup(gn->name); targ->suff = suffNull; @@ -1914,7 +1914,7 @@ SuffFindNormalDeps(gn, slst) SuffAddLevel(srcs, targ); (void)Lst_AtEnd(targs, (ClientData)targ); } - + /* * Using the list of possible sources built up from the target suffix(es), * try and find an existing file/target that matches. @@ -1956,7 +1956,7 @@ SuffFindNormalDeps(gn, slst) * that still contain variables or wildcards in their names. */ Lst_ForEach(gn->children, SuffExpandChildren, (ClientData)gn); - + if (targ == NULL) { if (DEBUG(SUFF)) { printf("\tNo valid suffix on %s\n", gn->name); @@ -2023,7 +2023,7 @@ sfnd_abort: free(gn->path); gn->path = strdup(gn->name); } - + goto sfnd_return; } @@ -2073,12 +2073,12 @@ sfnd_abort: * suffix. Note that this causes the commands list of the original * node, gn, to be replaced by the commands of the final * transformation rule. Also, the unmade field of gn is incremented. - * Etc. + * Etc. */ if (bottom->node == NILGNODE) { bottom->node = Targ_FindNode(bottom->file, TARG_CREATE); } - + for (src = bottom; src->parent != (Src *)NULL; src = src->parent) { targ = src->parent; @@ -2107,7 +2107,7 @@ sfnd_abort: targ->node->type |= OP_DEPS_FOUND; Var_Set(PREFIX, targ->pref, targ->node); - + Var_Set(TARGET, targ->node->name, targ->node); } } @@ -2139,8 +2139,8 @@ sfnd_return: Lst_Concat(slst, srcs, LST_CONCLINK); Lst_Concat(slst, targs, LST_CONCLINK); } - - + + /*- *----------------------------------------------------------------------- * Suff_FindDeps -- @@ -2173,7 +2173,7 @@ void Suff_FindDeps(gn) GNode *gn; { - + SuffFindDeps(gn, srclist); while (SuffRemoveSrc(srclist)) continue; @@ -2193,11 +2193,11 @@ SuffFindDeps (gn, slst) } else { gn->type |= OP_DEPS_FOUND; } - + if (DEBUG(SUFF)) { printf ("SuffFindDeps (%s)\n", gn->name); } - + if (gn->type & OP_ARCHV) { SuffFindArchiveDeps(gn, slst); } else if (gn->type & OP_LIB) { @@ -2211,7 +2211,7 @@ SuffFindDeps (gn, slst) */ LstNode ln; Suff *s; - + ln = Lst_Find (sufflist, (ClientData)LIBSUFF, SuffSuffHasNameP); if (gn->suffix) gn->suffix->refCount--; @@ -2362,7 +2362,7 @@ SuffPrintSuff (sp, dummy) int flag; printf ("# `%s' [%d] ", s->name, s->refCount); - + flags = s->flags; if (flags) { fputs (" (", stdout); diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 7d5057d..bd2dba8 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -269,11 +269,11 @@ Targ_FindNode (name, flags) /*- *----------------------------------------------------------------------- * Targ_FindList -- - * Make a complete list of GNodes from the given list of names + * Make a complete list of GNodes from the given list of names * * Results: * A complete list of graph nodes corresponding to all instances of all - * the names in names. + * the names in names. * * Side Effects: * If flags is TARG_CREATE, nodes will be created for all names in @@ -390,7 +390,7 @@ Targ_Precious (gn) /******************* DEBUG INFO PRINTING ****************/ static GNode *mainTarg; /* the main target, as set by Targ_SetMain */ -/*- +/*- *----------------------------------------------------------------------- * Targ_SetMain -- * Set our idea of the main target we'll be creating. Used for @@ -472,7 +472,7 @@ Targ_FmtTime (time) months[parts->tm_mon], parts->tm_mday, parts->tm_year); return(buf); } - + /*- *----------------------------------------------------------------------- * Targ_PrintType -- @@ -490,7 +490,7 @@ Targ_PrintType (type) register int type; { register int tbit; - + #ifdef __STDC__ #define PRINTBIT(attr) case CONCAT(OP_,attr): printf("." #attr " "); break #define PRINTDBIT(attr) case CONCAT(OP_,attr): if (DEBUG(TARG)) printf("." #attr " "); break @@ -577,7 +577,7 @@ TargPrintNode (gnp, passp) Lst_ForEach (gn->parents, TargPrintName, (ClientData)0); fputc ('\n', stdout); } - + printf("%-16s", gn->name); switch (gn->type & OP_OPMASK) { case OP_DEPENDS: diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index bcea186..1019ab5 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -271,15 +271,15 @@ VarFind (name, ctxt, flags) if ((env = getenv (name)) != NULL) { int len; - + v = (Var *) emalloc(sizeof(Var)); v->name = strdup(name); len = strlen(env); - + v->val = Buf_Init(len); Buf_AddBytes(v->val, len, (Byte *)env); - + v->flags = VAR_FROM_ENV; return (v); } else if (checkEnvFirst && (flags & FIND_GLOBAL) && @@ -746,7 +746,7 @@ VarRoot (word, addSpace, buf, dummy) * VarMatch -- * Place the word in the buffer if it matches the given pattern. * Callback function for VarModify to implement the :M modifier. - * + * * Results: * TRUE if a space should be placed in the buffer before the next * word. @@ -783,7 +783,7 @@ VarMatch (word, addSpace, buf, pattern) * Place the word in the buffer if it matches the given pattern. * Callback function for VarModify to implement the System V % * modifiers. - * + * * Results: * TRUE if a space should be placed in the buffer before the next * word. @@ -825,7 +825,7 @@ VarSYSVMatch (word, addSpace, buf, patp) * VarNoMatch -- * Place the word in the buffer if it doesn't match the given pattern. * Callback function for VarModify to implement the :N modifier. - * + * * Results: * TRUE if a space should be placed in the buffer before the next * word. @@ -1067,7 +1067,7 @@ VarModify (str, modProc, datum) for (i = 1; i < ac; i++) addSpace = (*modProc)(av[i], addSpace, buf, datum); - + Buf_AddByte (buf, '\0'); str = (char *)Buf_GetAll (buf, (int *)NULL); Buf_Destroy (buf, FALSE); @@ -1118,11 +1118,11 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) * expanding it in a non-local context. This * is done to support dynamic sources. The * result is just the invocation, unaltered */ - + *freePtr = FALSE; dynamic = FALSE; start = str; - + if (str[1] != '(' && str[1] != '{') { /* * If it's not bounded by braces of some sort, life is much simpler. @@ -1137,7 +1137,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) v = VarFind (name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); if (v == (Var *)NIL) { *lengthPtr = 2; - + if ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL)) { /* * If substituting a local variable in a non-local context, @@ -1195,7 +1195,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) return (var_Error); } *tstr = '\0'; - + v = VarFind (str + 2, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); if ((v == (Var *)NIL) && (ctxt != VAR_CMD) && (ctxt != VAR_GLOBAL) && ((tstr-str) == 4) && (str[3] == 'F' || str[3] == 'D')) @@ -1221,7 +1221,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) vname[0] = str[2]; vname[1] = '\0'; v = VarFind(vname, ctxt, 0); - + if (v != (Var *)NIL) { /* * No need for nested expansion or anything, as we're @@ -1229,7 +1229,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) * but nested invocations in them... */ val = (char *)Buf_GetAll(v->val, (int *)NULL); - + if (str[3] == 'D') { val = VarModify(val, VarHead, (ClientData)0); } else { @@ -1248,7 +1248,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) } } } - + if (v == (Var *)NIL) { if ((((tstr-str) == 3) || ((((tstr-str) == 4) && (str[3] == 'F' || @@ -1277,7 +1277,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL))) { int len; - + len = (tstr-str) - 3; if ((strncmp(str+2, ".TARGET", len) == 0) || (strncmp(str+2, ".ARCHIVE", len) == 0) || @@ -1287,7 +1287,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) dynamic = TRUE; } } - + if (!haveModifier) { /* * No modifiers -- have specification length so we can return @@ -1337,9 +1337,9 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) str = Var_Subst(NULL, str, ctxt, err); *freePtr = TRUE; } - + v->flags &= ~VAR_IN_USE; - + /* * Now we need to apply any modifiers the user wants applied. * These are: @@ -1365,7 +1365,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) while (*tstr != endc) { char *newStr; /* New value to return */ char termc; /* Character which terminated scan */ - + if (DEBUG(VAR)) { printf("Applying :%c to \"%s\"\n", *tstr, str); } @@ -1442,7 +1442,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) } buf = Buf_Init(0); - + /* * Pass through the lhs looking for 1) escaped delimiters, * '$'s and backslashes (place the escaped character in @@ -1468,7 +1468,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) char *cp2; int len; Boolean freeIt; - + cp2 = Var_Parse(cp, ctxt, err, &len, &freeIt); Buf_AddBytes(buf, strlen(cp2), (Byte *)cp2); if (freeIt) { @@ -1488,7 +1488,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) } Buf_AddByte(buf, (Byte)'\0'); - + /* * If lhs didn't end with the delimiter, complain and * return NULL @@ -1523,7 +1523,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) * it right here) and 3) expand any variable substitutions. */ buf = Buf_Init(0); - + tstr = cp + 1; for (cp = tstr; *cp != '\0' && *cp != delim; cp++) { if ((*cp == '\\') && @@ -1554,7 +1554,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) } Buf_AddByte(buf, (Byte)'\0'); - + /* * If didn't end in delimiter character, complain */ @@ -1633,7 +1633,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) */ VarPattern pattern; Boolean eqFound; - + pattern.flags = 0; eqFound = FALSE; /* @@ -1656,7 +1656,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) cp++; } if (*cp == endc && eqFound) { - + /* * Now we break this sucker into the lhs and * rhs. We must null terminate them of course. @@ -1666,7 +1666,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) pattern.lhs = tstr; pattern.leftLen = cp - tstr; *cp++ = '\0'; - + pattern.rhs = cp; cnt = 1; while (cnt) { @@ -1679,7 +1679,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) } pattern.rightLen = cp - pattern.rhs; *cp = '\0'; - + /* * SYSV modifications happen through the whole * string. Note the pattern is anchored at the end. @@ -1697,7 +1697,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) Error ("Unknown modifier '%c'\n", *tstr); for (cp = tstr+1; *cp != ':' && *cp != endc && *cp != '\0'; - cp++) + cp++) continue; termc = *cp; newStr = var_Error; @@ -1707,7 +1707,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) if (DEBUG(VAR)) { printf("Result is \"%s\"\n", newStr); } - + if (*freePtr) { free (str); } @@ -1731,10 +1731,10 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) *lengthPtr = tstr - start + 1; *tstr = endc; } - + if (v->flags & VAR_FROM_ENV) { Boolean destroy = FALSE; - + if (str != (char *)Buf_GetAll(v->val, (int *)NULL)) { destroy = TRUE; } else { @@ -1841,9 +1841,9 @@ Var_Subst (var, str, ctxt, undefErr) /* * Scan up to the end of the variable name. */ - for (p = &str[2]; *p && + for (p = &str[2]; *p && *p != ':' && *p != ')' && *p != '}'; p++) - if (*p == '$') + if (*p == '$') break; /* * A variable inside the variable. We cannot expand @@ -1855,14 +1855,14 @@ Var_Subst (var, str, ctxt, undefErr) str = p; continue; } - - if (strncmp(var, str + 2, p - str - 2) != 0 || + + if (strncmp(var, str + 2, p - str - 2) != 0 || var[p - str - 2] != '\0') { /* * Not the variable we want to expand, scan * until the next variable */ - for (;*p != '$' && *p != '\0'; p++) + for (;*p != '$' && *p != '\0'; p++) continue; Buf_AddBytes(buf, p - str, (Byte *) str); str = p; @@ -1876,7 +1876,7 @@ Var_Subst (var, str, ctxt, undefErr) if (!expand) continue; } - + val = Var_Parse (str, ctxt, undefErr, &length, &doFree); /* @@ -1916,7 +1916,7 @@ Var_Subst (var, str, ctxt, undefErr) * advance the string pointer. */ str += length; - + /* * Copy all the characters from the variable value straight * into the new string. @@ -1928,7 +1928,7 @@ Var_Subst (var, str, ctxt, undefErr) } } } - + Buf_AddByte (buf, '\0'); str = (char *)Buf_GetAll (buf, (int *)NULL); Buf_Destroy (buf, FALSE); @@ -1987,7 +1987,7 @@ Var_GetHead(file) * None * * Side Effects: - * The VAR_CMD and VAR_GLOBAL contexts are created + * The VAR_CMD and VAR_GLOBAL contexts are created *----------------------------------------------------------------------- */ void @@ -2005,7 +2005,7 @@ Var_End () { Lst_Destroy(allVars, VarDelete); } - + /****************** PRINT DEBUGGING INFO *****************/ static int |