summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/parsevar.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* add !!=espie2016-10-231-5/+24
| | | | feedback and okay millert@
* wrappers for is*/to* that make damn sure their arguments areespie2013-11-221-5/+5
| | | | | | cast to unsigned chars. okay deraadt@
* Correct $OpenBSD$ stuffespie2010-07-191-2/+1
|
* two small changes:espie2010-07-191-1/+1
| | | | | | | | | | | - allow variables in SysV modifiers, as requested by matthieu@ (since recursive variables are an extension, this just extends the extension) - variation on :Q called :QL (quote list), which does quote every character EXCEPT for whitespace. e.g., toto: @for i in ${VAR:QL} ...
* Parse_DoVar -> Parse_As_Var_Assignmentespie2007-09-171-2/+2
|
* zap more spaces at end of lineespie2007-09-171-2/+2
|
* kill extra spaces at end of lineespie2007-09-171-6/+6
|
* remove dead code: #define RECHECK is always onespie2007-09-161-1/+1
|
* everywhere except in Var_Parse, we always add/append variables to theespie2007-07-301-4/+4
| | | | | | | | VAR_GLOBAL context, so make it the common case: rename the basic functions to Var_Set_with_ctxt/Var_Append_with_ctxt, define Var_Set and Var_Append as macros that specify VAR_GLOBAL, and use these. okay miod@
* simplify the handling of assignment operators, by introducing a VAR_INVALIDespie2007-07-301-30/+26
| | | | | | state and using it, leading to a simpler loop and less code. okay miod@
* reformat to 8 chars tab, zap unneeded comment (no binary change)espie2007-07-241-136/+137
|
* repair, sorry about that (obvious typo, duh)espie2007-07-091-2/+2
|
* rename variable to errorIsOkay. What does oldVars mean anyway ?espie2007-07-081-7/+8
|
* A set of big related changes. okay millert@, tested further by kettenis@espie2007-07-081-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and matthieu@ This all revolves around putting ALL global variables into one single big hash, and using flags. This removes some impossible to understand stuff, like old varfind, and allows for some nice stuff. - each time we reference a global variable, we create it, possibly as a dummy variable. - each time we go to the environment, we remember it, thus we no longer go back to it. Lists of dependant changes: - isolate changes to oldVars and checkEnvFirst. - remove VAR_CMD and VAR_GLOBAL contexts. The only distinction is in parsevar. Split Parse_DoVar into Parse_DoVar and Parse_CmdlineVar - rework var modules around obtain_global_var, observe flags in various functions like Var_Value and Var_Seti. - Var_Seti/Var_Appendi are almost the same code, use that internally. - add magic to handle the very special SHELL variable. - introduce Var_Definedi for the cases where we don't want the actual value, to simplify tests. - add keyword .poison, parse it and set global flags accordingly. - do poison_checks where needed. - document poison. - in for loops, set variable temporarily, so that Var_SubstVar will also substitute it in varmodifiers expressions.
* ISO function declarations, trim a few comments, rename a few variables toespie2004-04-071-8/+5
| | | | | | more explicit/more consistent names. okay otto@
* Mostly clean-up:espie2001-05-231-0/+210
- cut up those huge include files into separate interfaces for all modules. Put the interface documentation there, and not with the implementation. - light-weight includes for needed concrete types (lst_t.h, timestamp_t.h). - cut out some more logically separate parts: cmd_exec, varname, parsevar, timestamp. - put all error handling functions together, so that we will be able to clean them up. - more systematic naming: functioni to handle interval, function to handle string. - put the init/end code apart to minimize coupling. - kill weird types like ReturnStatus and Boolean. Use standard bool (with a fallback for non-iso systems) - better interface documentation for lots of subsystems. As a result, make compilation goes somewhat faster (5%, even considering the largish BSD copyrights to read). The corresponding preprocessed source goes down from 1,5M to 1M. A few minor code changes as well: Parse_DoVar is no longer destructive. Parse_IsVar functionality is folded into Parse_DoVar (as it knows what an assignment is), a few more interval handling functions. Avoid calling XXX_End when they do nothing, just #define XXX_End to nothing. Parse_DoVar is slightly more general: it will handle compound assignments as long as they make sense, e.g., VAR +!= cmd will work. As a side effect, VAR++=value now triggers an error (two + in assignment). - this stuff doesn't occur in portable Makefiles. - writing VAR++ = value or VAR+ +=value disambiguates it. - this is a good thing, it uncovered a bug in bsd.port.mk. Tested by naddy@. Okayed millert@. I'll handle the fallback if there is any. This went through a full make build anyways, including isakmpd (without mickey's custom binutils, as he didn't see fit to share it with me).