summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/lst.lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gc lst_ForEachNodeWhile, which isn't actually in use anywhereespie2015-10-142-15/+2
|
* make sure we use stdbool.hespie2015-10-141-2/+2
| | | | | Mostly diff by Daniel Dickman, who told me to commit in his stead, as he's tied up at work.
* zap really odd code that's not actually in-use.espie2015-01-131-19/+8
| | | | okay millert@
* adjust to ohash being in libutil now, and to the interface changes.espie2014-05-123-0/+223
| | | | | | fix potential integer overflows in memory allocation (mostly for pedagogical purposes, these are unlikely to overflow in practice) move the rest of lst.lib stuff into its own directory.
* Correct $OpenBSD$ stuffespie2010-07-1916-32/+16
|
* new function: lstRequeue, to be used by the job handlerespie2008-01-121-0/+54
|
* remove dead code: #define RECHECK is always onespie2007-09-1615-15/+15
|
* everywhere except in Var_Parse, we always add/append variables to theespie2007-07-3015-15/+15
| | | | | | | | 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@
* reindent, no code changeespie2007-07-2915-204/+204
|
* having a function that iterates through node's datum so that we retrieveespie2007-01-041-1/+10
| | | | | | | | | | the list item with lst_member is non-sensical, create a new function (Lst_ForEachNodeWhile) that iterates through lstnodes directly and use it. Less obfuscated, slightly more efficient... okay otto@
* ISO function declarations, trim a few comments, rename a few variables toespie2004-04-0715-86/+48
| | | | | | more explicit/more consistent names. okay otto@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-0315-90/+30
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* From Andrushock, s/sucess/success/gmillert2002-12-091-2/+2
|
* byebye. Not used. Just keeps getting out of synch.espie2001-08-191-11/+0
|
* Take includes out of lst.h, re-add what's needed to separate files.espie2001-05-2915-146/+33
| | | | Removes remaining lint stuff from lst.lib.
* Mostly clean-up:espie2001-05-2316-43/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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).
* Synch with my current work.espie2001-05-0325-897/+274
| | | | | | | | | | | | | | | | | | | | | | | | | 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...
* Some systematic clean-up.espie2000-09-1422-187/+204
| | | | | | | | | | - 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...
* Trivial consequences of the previous list changes:espie2000-06-235-229/+6
| | | | | | | | | | | - audit code for Lst_Datum, it's never applied to an empty pointer, so check can be removed -> turn into a macro, - Lst_First, Lst_Last can become macro as well - specialized version of Lst_Succ (Lst_Adv) to use in loops where it cannot fail, - Lst_Open can no longer fail. Trim down corresponding code. Reviewed millert@, miod@
* Needed to allow complete dynamic list removal.espie2000-06-171-0/+107
|
* This removes the few instances of Lst_New left.espie2000-06-1717-157/+57
| | | | | | | | | | | | | | | - replaces Lst_Duplicate with Lst_Clone, which does not allocate storage - split Lst_Concat into Lst_Concat/Lst_ConcatDestroy Thus, all the LstValid checks are gone, since we always invoke list functions with valid pointers. Note that dynamic list allocation accounted for roughly 20% of all calls to malloc. The extraneous calls to malloc left are now mostly in parse.c, which makes some wasteful usage of temporary buffers. With those few patches, the code is sturdier, and easier to maintain. Reviewed by millert@
* This patch introduces a distinction betweenespie2000-06-173-33/+38
| | | | | | | | | | | | | | Lst_Init (constructor) and Lst_New (allocation + construction) Lst_Destroy (destructor) and Lst_Delete (deallocation + destruction), and uses that to turn most dynamic allocation of lists (Lst pointers) into static structures (LIST). Most of this is mundane, except for allGNs in targ.c, where the code must be checked to verify that Targ_Init is called soon enough. Lst_New is a temporary addition. All lists will soon be static. Reviewed by millert@, like the previous patch.
* This patch moves the definition of lists and list nodes to lst.h.espie2000-06-1721-288/+180
| | | | | | | | | | | | | | C is not well-suited for opaque data structures. Then it proceeds by removing a lot of non-sensical casts and white space. There are two motivations behind this change: * small functions like Lst_First can now be redefined as macros safely (otherwise, the cast would mean that you might write Lst_First(5) and find out about it rather late) * the size of the Lst data structure is exposed to user code. This will be used to allocate lists statically, instead of malloc/free them like crazy.
* Clean-up patch: use `void *' instead of old-fashioned ClientData/Address.espie2000-06-1016-56/+56
|
* no longer neededespie2000-06-101-79/+0
|
* Thus, Lst_ForEach no longer needs returning a status.espie2000-06-104-63/+30
| | | | | | | | | In fact, it can become a macro based on Lst_ForEachFrom. This also introduces Lst_Every, as a shortcut for the very common case where Lst_ForEach does not need any user data. Finally, make consistent use of a few function typedefs, instead of having explicit void (*)(Lst) arguments all over the place.
* Remove idiotic, braindead casts T* -> void*espie2000-03-262-11/+10
| | | | | | | They serve no purpose, except hiding potential bugs. In particular, remove (ClientData) cast from macro, showing potentially troublesome use of Hashes to store time_t.
* Rearrange Lst_Find interface to conform better with other functions.espie1999-12-193-115/+18
|
* Nothing ever checks ReturnStatus on Lst_Insert, Lst_Append, Lst_AtFront,espie1999-12-1810-103/+58
| | | | | | Lst_AtEnd, Lst_Concat, Lst_Remove, Lst_Replace. Don't bother returning one.
* NIL, NILGNODE, etc, are only glorified NULL.espie1999-12-1821-126/+122
| | | | | | Get rid of them. Get rid of list.h, nothing uses it anyway.
* make does not use circular lists, get rid of the extra weight.espie1999-12-186-56/+18
|
* Modifications from netbsd:espie1998-12-0528-54/+54
| | | | | | | | | | | | | | | | | | - don't interfere with MACHINE/MACHINE_ARCH defines for bootstrap - type clean-up, time_t, and printing `unknown' ints - fix TARGET/MEMBER bug in archive rules - memmove... - cleaner Error handler. - reentrant brk_string - .MAKE env variable - preliminary scaffolding for .NOPATH Other improvements: - efree - shellneed streamlined - display Stop in .CURDIR after an error. - document most features and misfeatures. - add a few OpenBSD notes to the tutorial.
* some ansimickey1998-02-221-2/+2
|
* changed to CFLAGS+=, closes PR user/116.flipk1997-03-031-2/+2
|
* Sync with NetBSD:millert1996-11-3028-215/+218
| | | | | | | - Merge in FreeBSD and Lite2 changes. - Fix bug where a non-archive target with a .a suffix would always be considered to be out of date, since it does not have a TOC. - Fix NetBSD PR #2930: declare missing variable.
* rcsidderaadt1996-06-2628-26/+54
|
* from christos@netbsd:deraadt1995-12-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minor: - ${.PREFIX} should never contain a full pathname - Fixed gcc -Wall warnings Major: - compatMake is now FALSE. This means that we are now running in full pmake mode: * rules on dependency lines can be executed in parallel and or out of sequence: foo: bar baz can fire the rule for baz before the rule for bar is fired. To enforce bar to be fired before baz, another rule needs to be added. [bar: baz] * adjacent shell commands in a target are now executed by a single invocation of the shell, not one invocation of the shell per line (compatMake can be turned off using the -B flag) - The -j flag now works... I.e. make -j 4 will fork up to four jobs in parallel when it can. The target name is printed before each burst of output caused by the target execution as '--- target ---', when j > 1 - I have changed all the Makefiles so that they work with make -j N, and I have tested the whole netbsd by: 'make -j 4 cleandir; make -j 4 depend; make -j 4; make -j 4 install' - I have not compiled or tested this version of make with -DREMOTE. - Turn compat mode on by default. It gets turned off when the -j without the -B flag is specified. [Thus you can use -j 1 to turn it off]. - Fix malloc -> emalloc as Gordon noted. Updates for POSIX/SVR4 compiling: arch.c: Don't require ranlib stuff. Not everybody has it. dir.c: SunOS-4 != Solaris; change #ifdef sun to #if sun && !__svr4__ job.c, compat.c: Don't use 'union wait', use int and the W*() macros. main.c: Check for uname() == -1; some unames return > 0... util.c, job.c: Add signal() with BSD semantics for svr4, don't use bsd sigmask and friends. from cgd@netbsd: pull in make.h. (PAlloc() now uses emalloc(), which is prototyped in make.h. If the prototype is not in scope on the Alpha, I see lots of "cast to pointer from integer of different size" warnings.)
* initial import of NetBSD treederaadt1995-10-1828-0/+2578