aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/var.h
Commit message (Collapse)AuthorAgeFilesLines
* The caller of Var_Value() should not change the variable value. MakeHartmut Brandt2005-05-241-1/+1
| | | | | | | | | this clear by constifying the return value. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146581
* Get rid of the third argument to Var_Value() the pointer it pointedHartmut Brandt2005-05-241-1/+1
| | | | | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146580
* Replace a lot of Var_Set(..., VAR_GLOBAL) by Var_SetGlobal().Hartmut Brandt2005-05-121-0/+1
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.237) Notes: svn path=/head/; revision=146145
* Move variable printing from main.c to var.cHartmut Brandt2005-05-121-1/+3
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.233) Notes: svn path=/head/; revision=146141
* Move some global variables to the correct files.Hartmut Brandt2005-05-121-0/+6
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.232) Notes: svn path=/head/; revision=146134
* Move declarations of variables belonging to the variable moduleHartmut Brandt2005-05-101-0/+9
| | | | | | | | | from globals.h into var.h. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.209) Notes: svn path=/head/; revision=146062
* Var_SubstOnly() is only used to subsitute a variable from the globalHartmut Brandt2005-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> Notes: svn path=/head/; revision=146048
* Move the declaration of VAR_CMD and VAR_GLOBAL from globals.h to var.hHartmut Brandt2005-05-101-0/+6
| | | | | | | | Patch: 7.196 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=146047
* Merge var_modify.c into var.c and move types and function declarationsHartmut Brandt2005-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> Notes: svn path=/head/; revision=146045
* Move some debugging code from targ.c to var.c where it actually belongs.Hartmut Brandt2005-05-101-1/+1
| | | | | | | | Patch: 7.192 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=146039
* Make make a little bit more POSIXish with regard to option parsing:Hartmut Brandt2005-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> Notes: svn path=/head/; revision=146038
* Split Var_Subst() into two functions: Var_SubstOnly() which substitutesHartmut Brandt2005-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> Notes: svn path=/head/; revision=146027
* Introduce a new pseudo-target .EXPORTVAR which allows to put aHartmut Brandt2005-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> Notes: svn path=/head/; revision=145971
* Return a Buf object from VarGetPattern() instead of a char * and a size_t.Hartmut Brandt2005-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> Notes: svn path=/head/; revision=143966
* Merge struct VarREPattern into struct VarPattern. This will help sortingHartmut Brandt2005-03-221-8/+5
| | | | | | | | | | | out common code. Patch: 7.156 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=143964
* Sort prototypes.Hartmut Brandt2005-03-221-18/+18
| | | | | | | | | Patch: 7.155 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=143963
* Fix indentation.Hartmut Brandt2005-03-221-13/+13
| | | | | | | | | Patch: 7.154 (partly) Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=143962
* Remove a temporary variable. Rename pattern to patt to be consistent.Hartmut Brandt2005-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> Notes: svn path=/head/; revision=143955
* Constify Var_Dump and simplify it by inlining VarPrintVar.Hartmut Brandt2005-03-101-1/+1
| | | | Notes: svn path=/head/; revision=143377
* Finish constification of Var_Parse() and Var_Subst().Hartmut Brandt2005-03-081-2/+2
| | | | | | | | | Patch: 0.18, 0.8, 7.110 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=143276
* Change the return value of Var_Subst to return a Buffer insteadHartmut Brandt2005-02-251-1/+1
| | | | | | | | | | | of a char *. Patch: 7.49 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=142457
* Introduce a typedef for variable value modifation functions and use itHartmut Brandt2005-02-071-9/+11
| | | | | | | | | where appropriate. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141460
* Further constification. Use a temporary hack (copying the input string)Hartmut Brandt2005-02-041-6/+6
| | | | | | | | | until Var_Subst is fixed. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141268
* Some more easy constification.Hartmut Brandt2005-02-041-2/+2
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141252
* Convert several typedefs from beeing pointers to structs to be the structsHartmut Brandt2005-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> Notes: svn path=/head/; revision=141133
* Clean up include files and file including. Split nonints.h into piecesHartmut Brandt2005-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> Notes: svn path=/head/; revision=141104
* Fix breakage introduced on 64-bit platforms with my last commit. NeedHartmut Brandt2004-12-031-2/+2
| | | | | | | to change to size_t in a couple of other places too. Notes: svn path=/head/; revision=138346
* Stylification: missing spaces, extra space after function names, castsHartmut Brandt2004-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) Notes: svn path=/head/; revision=138232
* Split var.c into var.c and var_modify.c and move all the modification funcsJuli Mallett2002-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. Notes: svn path=/head/; revision=106106