summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/var.h
Commit message (Collapse)AuthorAgeFilesLines
* The caller of Var_Value() should not change the variable value. Makeharti2005-05-241-1/+1
| | | | | | this clear by constifying the return value. Obtained from: DragonFlyBSD
* Get rid of the third argument to Var_Value() the pointer it pointedharti2005-05-241-1/+1
| | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD
* Replace a lot of Var_Set(..., VAR_GLOBAL) by Var_SetGlobal().harti2005-05-121-0/+1
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.237)
* Move variable printing from main.c to var.charti2005-05-121-1/+3
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.233)
* Move some global variables to the correct files.harti2005-05-121-0/+6
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.232)
* Move declarations of variables belonging to the variable moduleharti2005-05-101-0/+9
| | | | | | from globals.h into var.h. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.209)
* Var_SubstOnly() is only used to subsitute a variable from the globalharti2005-05-101-1/+1
| | | | | | | | context (and only in one place to substitute the .for variable). Therefor there is no need to pass the context as a parameter. Patch: 7.197 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move the declaration of VAR_CMD and VAR_GLOBAL from globals.h to var.hharti2005-05-101-0/+6
| | | | | Patch: 7.196 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Merge var_modify.c into var.c and move types and function declarationsharti2005-05-101-61/+0
| | | | | | | that are now used only in var.c from var.h to var.c Patches: 7.193,7.194 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move some debugging code from targ.c to var.c where it actually belongs.harti2005-05-101-1/+1
| | | | | Patch: 7.192 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Make make a little bit more POSIXish with regard to option parsing:harti2005-05-101-0/+1
| | | | | | | | | | | | | | | take everything after -- as either a macro assignment or a target. Note that make still reorders arguments before --: anything starting with a dash is considered an option, anything which contains an equal sign is considered a macro assignment and everything else a target. This still is not POSIX with regard to the options, but it will probably not change because it has been make's behaviour for ages. Add a new function Var_Match() that correctly skips a macro call by just doing the same as Var_Subst() but without producing output. This will help making the parser more robust. Patches: 7.190,7.191 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Split Var_Subst() into two functions: Var_SubstOnly() which substitutesharti2005-05-091-3/+2
| | | | | | | | | | only one variable and Var_Subst() which substitutes all. Split out the test whether a variable should not be expanded into match_var(). Make access to the input string consistently using str[]. Remove two unused functions: Var_GetTail() and Var_GetHead(). Patches: 7.184-7.189 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Introduce a new pseudo-target .EXPORTVAR which allows to put aharti2005-05-061-3/+4
| | | | | | | | | | | | | | | | | | make macro into the environment of programs executed by make. This has approximately the same function as gmake's export directive. The form of a pseudo target was deliberately choosen to minimize work for POSIX compatibility (Makefiles are not allowed to use any targets starting with a dot and consisting only of uppercase letters except those specified in the standard when they want POSIX compatible behaviour, so such a Makefile can never contain .EXPORTVAR.) Change the handling of macros coming from the environment: instead of asking the environment for each variable we could not find otherwise put all the environment variables in a special variable environment just at start up. This has been tested on the ports cluster by kris. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Return a Buf object from VarGetPattern() instead of a char * and a size_t.harti2005-03-221-4/+2
| | | | | | | | Store a Buf object in struct VarPattern instead of a char * and a length. Patch: 7.158 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Merge struct VarREPattern into struct VarPattern. This will help sortingharti2005-03-221-8/+5
| | | | | | | | out common code. Patch: 7.156 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Sort prototypes.harti2005-03-221-18/+18
| | | | | | Patch: 7.155 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Fix indentation.harti2005-03-221-13/+13
| | | | | | Patch: 7.154 (partly) Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Remove a temporary variable. Rename pattern to patt to be consistent.harti2005-03-221-1/+0
| | | | | | | | | Remove unreachable code for VAR_NOSUBST - it was never set. Replace redundant code with calls to VarGetPattern(). Patch: 7.143-7.145 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Constify Var_Dump and simplify it by inlining VarPrintVar.harti2005-03-101-1/+1
|
* Finish constification of Var_Parse() and Var_Subst().harti2005-03-081-2/+2
| | | | | | Patch: 0.18, 0.8, 7.110 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Change the return value of Var_Subst to return a Buffer insteadharti2005-02-251-1/+1
| | | | | | | | of a char *. Patch: 7.49 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Introduce a typedef for variable value modifation functions and use itharti2005-02-071-9/+11
| | | | | | where appropriate. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Further constification. Use a temporary hack (copying the input string)harti2005-02-041-6/+6
| | | | | | until Var_Subst is fixed. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Some more easy constification.harti2005-02-041-2/+2
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Convert several typedefs from beeing pointers to structs to be the structsharti2005-02-021-30/+33
| | | | | | | itself. This will ease constification (think of what 'const Ptr foo' means if Ptr is a pointer to a struct). Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Clean up include files and file including. Split nonints.h into piecesharti2005-02-011-0/+25
| | | | | | | | | | | | | that get included just where they are needed. All headers include the headers that they need to compile (just with an empty .c file). Sort includes alphabetically where apropriate and fix some duplicate commenting for struct Job, struct GNode and struct Shell by removing one version and inlining the comments into the structure declaration (the comments have been somewhat outdated). This patch does not contain functional changes (checked with md5). Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Fix breakage introduced on 64-bit platforms with my last commit. Needharti2004-12-031-2/+2
| | | | to change to size_t in a couple of other places too.
* Stylification: missing spaces, extra space after function names, castsharti2004-11-301-2/+2
| | | | | | | | and the sizeof operator, missing empty lines, void casts, extra empty lines. Checked by: diff on make *.o lst.lib/*.o Submitted by: Max Okumoto <okumoto@soe.ucsd.edu> (partly)
* Split var.c into var.c and var_modify.c and move all the modification funcsjmallett2002-10-281-0/+97
to var_modify.c, for readability. constify some low hanging fruit (string manipulation functions) and the upper layers appropriately. No longer use the private strstr(3) implementation, while changing string code. Tested by: lots of successful make buildworld.
OpenPOWER on IntegriCloud