summaryrefslogtreecommitdiff
path: root/usr.bin/make/lowparse.c
AgeCommit message (Collapse)Author
2004-04-07ISO function declarations, trim a few comments, rename a few variables toMarc Espie
more explicit/more consistent names. okay otto@
2002-12-29check -DCLEANUP compilationMarc Espie
2001-11-11Fixed version... don't see how this could work on i386, since it didn'tMarc Espie
initialize create in main.c.
2001-11-11undo changes that crash on (at least) the alphaTheo de Raadt
2001-11-11Redo LstInit as a macro: smaller and faster code in all cases, zeroing twoMarc Espie
pointers is simpler than calling a function. Recognize purely static lst headers, which don't really need any initialization. ok miod@
2001-07-18Avoid dumping core when reporting open conditionals.Marc Espie
Turns out that current is NULL when Parse_Fatal is called in this case, so just do something sensible in error reporting functions when current is NULL...
2001-07-11Typo in commentMarc Espie
2001-05-29Take includes out of lst.h, re-add what's needed to separate files.Marc Espie
Removes remaining lint stuff from lst.lib.
2001-05-29Blech! gcc is a stupid program. Compiling with -fno-builtin shows lotsMarc Espie
of missing function declarations.
2001-05-23Mostly clean-up:Marc Espie
- 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).
2001-05-14Ensure IFile str is always intialized, so that we can free it withoutMarc Espie
problems. Bug found by wilfried@.
2001-05-07avoid closing the same file twice. parse module assumes ownership ofMarc Espie
file handles it's passed to. (this is apparently harmless on BSDs, but is still a bug).
2001-05-03Synch with my current work.Marc Espie
Numerous changes: - generate can build several tables - style cleanup - statistics code - use variable names throughout (struct Name) - recursive variables everywhere - faster parser (pass buffer along instead of allocating multiple copies) - correct parser. Handles comments everywhere, and ; correctly - more string intervals - simplified dir.c, less recursion. - extended for loops - sinclude() - finished removing extra junk from Lst_* - handles ${@D} and friends in a simpler way - cleaned up and modular VarModifiers handling. - recognizes some gnu Makefile usages and errors out about them. Additionally, some extra functionality is defined by FEATURES. The set of functionalities is currently hardcoded to OpenBSD defaults, but this may include support for some NetBSD extensions, like ODE modifiers. Backed by miod@ and millert@, who finally got sick of my endless patches...
2000-11-24Clean-ups:Marc Espie
* Buf_Destroy can be a macro * X_ instead of _X for struct names, to avoid infringing on the system's namespace. * better wildcard detection heuristics * fix #ifdef CLEANUP code * a few comments
2000-09-14Some systematic clean-up.Marc Espie
- UNUSED macro that expands to __attribute__((unused)) for gcc - move rcsid around so that they can be tagged UNUSED. - activate -Wunused. - use UNUSED instead of kludgy junk for function arguments. - add extern to all extern prototypes. - update comments in lst.h. - clean up var.c a little bit, constifying arguments, updating comments...
2000-07-17FALLTHRU -> FALLTHROUGH, requested by miod@ and style(9)Marc Espie
2000-06-23This is complementary to the previous patch.Marc Espie
There is no code change in this patch, we just move the remaining `lowparse' functions to the right file, and adjust the interface file accordingly. Reviewed by miod@
2000-06-23This patch is worth a lot, speed-wise.Marc Espie
This does introduce a proper stack of IFiles to handle included files: instead of having the current file be a special case, it's also an IFile. The corresponding code is slightly unobfuscated, removing the error-prone ParseEOF function, freeing the filename systematically (thus, main.c needs to strdup stdin), and merging both include functions lookup into one. The speed gain comes from changing the IFile structure to merge with fgetln seamlessly. The low-level parse code is mostly moved to a new file, lowparse.c, to make things easier to read (see next patch as well). Accordingly, util.c gains a fgetln. Note the interaction between Parse_File, Dir_FindFile, and ReadMakefile in main.c. This patch closes a subtle memory hole (only the Makefile names, so rather small). Reviewed by miod@.