aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/suff.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old fmake. It wasn't built by default for some time. Users thatWarner Losh2015-06-161-2205/+0
| | | | | | | | | | really need it can find it in the devel/fmake port or pkg install fmake. Note: This commit is orthogonal to the question 'can we fmake buildworld'. Differential Revision: https://reviews.freebsd.org/D2840 Notes: svn path=/head/; revision=284464
* Remove inlining of functions that are used mostly in different object files.Roman Divacky2009-01-201-0/+1
| | | | | | | | | | | This gets rid of gnu89 style inlining. Also silence gcc by assigning two variables NULL. This lets use to remove NO_WERROR. Approved by: kib (mentor) Approved by: harti Notes: svn path=/head/; revision=187475
* Consistently use Var_SetGlobal().David E. O'Brien2008-12-291-2/+2
| | | | Notes: svn path=/head/; revision=186558
* Get rid of the third argument to Var_Value() the pointer it pointedHartmut Brandt2005-05-241-5/+2
| | | | | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146580
* Use the print_flags function to print the OP_ flags of a target.Hartmut Brandt2005-05-131-1/+1
| | | | | | | | Give the function one more argument to decide whether it should print the flags like a C-expression or just space-delimited. Notes: svn path=/head/; revision=146184
* Cleanup SuffFindArchDeps() to get rid of two const-warnings.Hartmut Brandt2005-05-121-11/+9
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.240) Notes: svn path=/head/; revision=146149
* Split Var_Subst() into two functions: Var_SubstOnly() which substitutesHartmut Brandt2005-05-091-1/+1
| | | | | | | | | | | | | 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
* Make paths an explicite datatype instead of using the generic Lst.Hartmut Brandt2005-03-231-33/+29
| | | | | | | | | A Path is now a TAILQ of PathElements each of which just points to a reference counted directory. Rename all functions dealing with Paths from the Dir_ prefix to a Path_ prefix. Notes: svn path=/head/; revision=144020
* Simplify buffer access by using Buf_Data() and Buf_Peel() whereHartmut Brandt2005-03-221-1/+1
| | | | | | | | | | | appropriate. Patch: 7.147-7.151 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=143959
* Replace calls to Lst_Find with either appropriate LST_FOREACH macrosHartmut Brandt2005-03-211-142/+71
| | | | | | | | plus predicate inlining or a special purpose function with takes and returns the correct types. Notes: svn path=/head/; revision=143911
* Fix a bug in matching suffixes. Under certain circumstances the codeHartmut Brandt2005-03-181-44/+25
| | | | | | | | | | | | | | | would access memory before the beginning of the string to match (the suffix match starts at the end of both the string and the suffix and proceedes to the begin until either the start of the suffix is hit or the character does not match). This could lead to a memcpy copying into random memory. Fix this by checking the length of the string to match too and replacing the Lst_Find calls with LST_FOREACH loops (last part by me). Submitted by: Matt Dillon <dillon@apollo.backplane.com> (in principle) Notes: svn path=/head/; revision=143807
* Get rid of another Lst_ForEach in favour of LST_FOREACH. Get ridHartmut Brandt2005-03-141-70/+38
| | | | | | | of the now unused struct LstSrc and collapes two functions into one. Notes: svn path=/head/; revision=143600
* Move the creation of a Src structure into its own function.Hartmut Brandt2005-03-141-43/+33
| | | | Notes: svn path=/head/; revision=143567
* Convert a couple of other uses of Lst_ForEach to LST_FOREACH andHartmut Brandt2005-03-141-48/+40
| | | | | | | simplify code. Notes: svn path=/head/; revision=143556
* Simplify the print routines by using LST_FOREACH instead of Lst_ForEachHartmut Brandt2005-03-111-63/+38
| | | | | | | | | and inlining the small printing utility functions. Create a function that can be used to produce printable representations of flag words. Notes: svn path=/head/; revision=143414
* Remove the leading underscore from structure tags. All identifiersHartmut Brandt2005-03-111-3/+3
| | | | | | | with a leading underscore are in the implementation namespace. Notes: svn path=/head/; revision=143411
* Style: Fix indentation.Hartmut Brandt2005-03-111-1062/+1074
| | | | Notes: svn path=/head/; revision=143407
* Reorganize Suff_EndTransform to be called only for nodes forHartmut Brandt2005-03-101-38/+30
| | | | | | | which it is needed (transforms). Notes: svn path=/head/; revision=143372
* Style: fix function style before working on it (mainly intendation).Hartmut Brandt2005-03-101-30/+30
| | | | Notes: svn path=/head/; revision=143353
* Split SuffExpandChildren into three functions: one that skipsHartmut Brandt2005-03-091-178/+189
| | | | | | | | | variables and expands archive specifications, one that expands wild cards and a driver that loops over the children list and expands each child if necessary replacing it with it's expansions. Notes: svn path=/head/; revision=143327
* Var_Subst() cannot return NULL so there is no reason to checkHartmut Brandt2005-03-091-103/+90
| | | | | | | for it. Notes: svn path=/head/; revision=143312
* Style: fix indentation of SuffExpandChildren before working on it.Hartmut Brandt2005-03-081-172/+188
| | | | Notes: svn path=/head/; revision=143297
* Make sure the length variable is initialized to 0 before passingHartmut Brandt2005-03-011-1/+1
| | | | | | | | | | | it to Var_Parse(). Patch: 7.85 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=142937
* Change the return value of Var_Subst to return a Buffer insteadHartmut Brandt2005-02-251-1/+5
| | | | | | | | | | | of a char *. Patch: 7.49 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=142457
* Move PrintAddr() from util.c into suff.c - the only file where it isHartmut Brandt2005-02-041-0/+17
| | | | | | | | | actuall used, and make it static. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141271
* General whitespace cleanup: remove mixes of tabs and spaces, removeHartmut Brandt2005-02-041-5/+5
| | | | | | | | | space after function names, remove spaces on emtpy lines. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141270
* Some more easy constification.Hartmut Brandt2005-02-041-1/+2
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141252
* Clean up include files and file including. Split nonints.h into piecesHartmut Brandt2005-02-011-5/+17
| | | | | | | | | | | | | | | | 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
* Remove all the cleanup functions. There is no reason to free memoryHartmut Brandt2004-12-171-28/+6
| | | | | | | | just before exiting (especially given the number of memory leaks) - it just costs time. Notes: svn path=/head/; revision=138972
* Instead of dynamically allocating list heads allocated them staticallyHartmut Brandt2004-12-161-187/+178
| | | | | | | | | | | now that their size is only two pointers. This eliminates a lot of calls to Lst_Init and from there to malloc together with many calls to Lst_Destroy (in places where the list is obviously empty). This also reduces the chance to leave a list uninitilized so we can remove more NULL pointer checks and probably eliminates a couple of memory leaks. Notes: svn path=/head/; revision=138916
* Don't free the second list in Lst_Concat for LST_CONCLINK; free itHartmut Brandt2004-12-081-0/+3
| | | | | | | in the caller instead. Notes: svn path=/head/; revision=138565
* Get rid of the sequential access feature of the lists. This was usedHartmut Brandt2004-12-081-28/+12
| | | | | | | | | | | only in a couple of places and all of them except for one were easily converted to use Lst_First/Lst_Succ. The one place is compatibility mode in job.c where the it was used to advance to the next command on each invocation of JobStart. For this case add a pointer to the node to hold the currently executed command. Notes: svn path=/head/; revision=138564
* Constify the arguments to the list compare function. This temporarilyHartmut Brandt2004-12-081-18/+32
| | | | | | | | | | | requires to make a copy of the filename in ReadMakefile and to duplicate two small functions in suff.c. This hopefully will go away when everything is constified. Submitted by: Max Okumoto <okumoto@ucsd.edu> (partly) Notes: svn path=/head/; revision=138561
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofHartmut Brandt2004-12-071-60/+60
| | | | | | | | | the structs itself not of pointers to them. This will simplify constification. Checked by: diff on the object files Notes: svn path=/head/; revision=138512
* Make needs no circular lists so remove them from the list code.Hartmut Brandt2004-12-071-27/+27
| | | | Notes: svn path=/head/; revision=138510
* Fix breakage introduced on 64-bit platforms with my last commit. NeedHartmut Brandt2004-12-031-1/+1
| | | | | | | to change to size_t in a couple of other places too. Notes: svn path=/head/; revision=138346
* Style: remove a lot of unnecessary casts, add some and spell the nullHartmut Brandt2004-12-011-131/+132
| | | | | | | | | pointer constant as NULL. Checked by: diff -r on the object files before and after Notes: svn path=/head/; revision=138264
* Stylification: missing spaces, extra space after function names, castsHartmut Brandt2004-11-301-213/+216
| | | | | | | | | | | 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
* The .DEFAULT target with no commands caused a null pointer dereference.Ruslan Ermilov2004-04-121-1/+6
| | | | | | | | PR: bin/63405 Obtained from: NetBSD Notes: svn path=/head/; revision=128165
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/Jens Schweikhardt2002-12-301-1/+1
| | | | | | | Add FreeBSD Id tag where missing. Notes: svn path=/head/; revision=108470
* Remove efree(), it isn't used consistently enough to even pretend that itJuli Mallett2002-10-231-3/+3
| | | | | | | | | might help on the systems it could possibly be used as a bandaid for. In fact, the only thing it's useful for is instrumenting free(3) calls, and in that capacity, it's better served as a local patch, than a public wrapper. Notes: svn path=/head/; revision=105826
* Convert make(1) to use ANSI style function declarations. VariableJuli Mallett2002-10-091-101/+43
| | | | | | | | | | | | | | documentation already adequatedly existed in the description in most cases. Where it did not, it was added. If no documentation existed beforehand, then none was added. Some unused dummies for use in the traversal functions were marked as __unused during the conversion. Occasionally, local style fixes were applied to lines already being modified or influenced. Now make(1) should always build with WARNS=3. Notes: svn path=/head/; revision=104696
* Make make(1) WARNS=6 clean except for const issues. This mostly involvesJuli Mallett2002-09-281-15/+15
| | | | | | | | | | | | | | renaming variables to not shadow libc functions or greater scope locals. Kinda makes one wonder if the extern ones weren't meant in some of these places :) The only thing I'd still like to do WRT this is possibly combine rstat and status in compat.c -- that should be fine, as I do not think the codepaths will want both around at once. Sponsored by: Bright Path Solutions Notes: svn path=/head/; revision=104121
* Add empty default cases where they should be, remove non-local execution stuffJuli Mallett2002-09-281-0/+5
| | | | | | | | | | | | | in compat.c which doesn't even have preprocessor-conditional-hidden support code, and add a debugging statement where we might end up with a nil list somehow, but where I doubt it. First confirmed userland kill for Flexelint. Sponsored by: Bright Path Solutions Notes: svn path=/head/; revision=104108
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichJuli Mallett2002-09-181-29/+29
| | | | | | | | is merely printf() but to stderr. This takes care of the caveat which lead to the use of a vararg macro -- getting everything to stderr. Notes: svn path=/head/; revision=103545
* Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingJuli Mallett2002-09-171-76/+32
| | | | | | | | | | | | variable length arguments to a macro. Bump version as this makes DEBUG statements *always* go to stderr rather than sometimes stdout. There are a few stragglers, which I will take care of as soon as I can. Mostly these relate to the need-for-death-of some of the remote job code. Nearby stylistic nits and XXX added/fixed where appropriate. Notes: svn path=/head/; revision=103508
* #define<space> -> #define<tab>Juli Mallett2002-09-171-3/+3
| | | | Notes: svn path=/head/; revision=103503
* Update SCM ID method.David E. O'Brien2002-04-131-3/+1
| | | | Notes: svn path=/head/; revision=94587
* De'register.David E. O'Brien2002-04-131-12/+12
| | | | Notes: svn path=/head/; revision=94584
* remove __PWarner Losh2002-03-221-24/+24
| | | | Notes: svn path=/head/; revision=92921