summaryrefslogtreecommitdiff
path: root/usr.bin/m4/misc.c
AgeCommit message (Collapse)Author
2003-11-17Modify xalloc so that it also takes err(3)-like arguments.Marc Espie
Write an xrealloc wrapper that works the same way, and use it as well. People who feel like it may want to add more explicit error messages to all the places m4 can fail allocating memory... okay tedu@
2003-06-03Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2002-04-28Implement -s.Marc Espie
Triggered by recent FreeBSD changes. - emits #line directives at every file change (like FreeBSD) - maintains a synch_lineno variable to verify when the output gets out of synch with the input, so that it can emit #line to re-synch as well (unlike FreeBSD) To do: either handle \end-of-line, or recognize when a macro expansion is in progress, so that line synch don't perturb cpp on multi-line expansions. With this, we should have a fully POSIX-compliant m4. ok miod@
2002-04-26use ansi function declarations. ok millert@Marc Espie
2001-11-16incorrect writeTheo de Raadt
2001-10-10Quote filename properly.Marc Espie
2001-09-19inline some very common putback/chrsave. Worth roughly 10%Marc Espie
2001-09-18better end-condition, fix tracing of dnl.Marc Espie
2001-09-18instrumentation for tracing mode: macro expansionMarc Espie
2001-07-18Kill signal race. Reviewed by jjbg@Marc Espie
2000-07-27Handle unlimited diverts for m4 -g.Marc Espie
Problem with autoconf noticed by d@
2000-07-02Make the m4 machine stack dynamically sized.Marc Espie
Fix strspace automatic extension. The assumption that simply updating the current pointer works is false, there are cases where previous entries on the stack would absorp vast amounts of string space, and overload the non-updated entries. To fix it, we use a shadow copy of the stack, which only records which entries are pointers within strspace, so that a resize can adjust all those pointers at once. Reviewed by millert@
2000-03-11Add a few builtins for greater compatibility with gnu-m4, and extendedMarc Espie
functionality. * regular expressions, * line-number reporting * `meta'-macros, builtin and indir. Reviewed by pjanzen@, tested by fries@ and a few others.
2000-01-15There is no need to waste short for holding EOF in the pushback buffer.Marc Espie
Now that the input_file structure is sufficiently fleshed out, just stop EOF at the putback level, and make sure files at EOF STAY at EOF.
2000-01-13Record 50 levels of open parenthesis, open quotes, to give a post-mortem.Marc Espie
- no need to record more, as this is just for diagnosis purpose. This doesn't affect m4's main engine. - don't free file names as a compromise: the only other options would be to ref count them (not worth the complexity) or dup them systematically (ick).
2000-01-12Use a proper abstract interface for file accesses, so that we can recordMarc Espie
the file name and line number. This yields more meaningful error messages, and the possibility for yet more.
1999-11-17Turn warnings on,Marc Espie
Add missing prototypes, Make local functions static, Sort extern.h by file, Constify all char * that can be, Copy temp file name so that eval does not modify its arguments.
1999-11-17Night of the moronic coder, part 2.Marc Espie
repairs patterns such as divert(6) divert(7) undivert(6) divert(6) which are not that frequent, but were *quite* thoroughly broken...
1999-09-14Style: kill register and indent properly.Marc Espie
Let indx match netbsd flavor, to simplify diffs. Show how many quotes were not closed. Increase stack slightly, now that we're no longer bound by argspace.
1999-09-14Implement -I option and M4PATH environment variableMarc Espie
1999-09-09Bug-fix: thinkoMarc Espie
1999-09-06Remove STRSPACE limitations.Marc Espie
A bit wasteful, but not too intrusive. Also remove pushback buffer limitations, as this would be mostly useless otherwise. Incidentally, pushback buffer overflow detection in pbstr was wrong.
1999-09-06Get rid of mktemp in the handling of diversion.Marc Espie
Simply put, mkstemp/unlink/rewind has the proper semantics under Unix, and so we don't have to keep track about temp file names and remove them.
1999-09-06Misc minor changes:Marc Espie
- use err.h and kill oops, - use __progname and kill basename, - let indx use strstr - proper EOS decl
1997-12-10cgd: add a typedef which describes elements in the push-back buffer. MakeTheo de Raadt
that typedef 'short'. 'char' (which was previously used) because char may be unsigned and ((char)EOF) != EOF if that is the case. That was causing the (char)EOF (0xff) pushed back in main to be interepreted as a character, and, in some cases, to be written to the output. 'short' was used rather than 'signed char' because if the latter is used, 0xff characters in the input would confuse m4. (No point in introducing (more?) 8-bit lossage.)
1997-07-25#if __STDC__ --> #ifdef __STDC__Michael Shalayeff
1996-07-01undo mktemp cleanup until i get it rightTheo de Raadt
1996-06-26rcsidTheo de Raadt
1996-06-25mktemp open + fdopenTheo de Raadt
1995-10-18initial import of NetBSD treeTheo de Raadt