Home | History | Annotate | Download | only in sh
History log of /src/bin/sh/output.h
RevisionDateAuthorComments
 1.28  10-Nov-2021  kre Add a couple of macro definitions for dealing with shell I/O errors.
(Macros akin to stdio's ferror() and clearerr()).

NFC: the macros are defined, but not yet used anywhere. Uses coming soonish.
 1.27  21-Nov-2017  kre branches: 1.27.4;
Remove the -X option from SMALL shells (as used on boot floppies,
some other install media, mini-roots, etc.) It is unlikely that
such a shell will be used for much script debugging (and the old -x
still exists of course) and it adds a little bloat, so, zap...

The ancient unused (unrelated) xioctl() function is gone as well
(from all shells).
 1.26  19-Nov-2017  kre Implement the -X option - an apparent variant of -x which sends all trace
output to the stderr which existed when the -X option was (last) enabled.
It also enables tracing by enabling -x (and when reset, +X, also resets
the 'x' flag (+x)). Note that it is still -x/+x which actually
enables/disables the trace output. Hence "apparent variant" - what -X
actually does (aside from setting -x) is just to lock the trace output,
rather than having it follow wherever stderr is later redirected.
 1.25  19-Nov-2017  kre Rearrange "struct output" to be slightly more friendly (I think)
to I32 P64 systems - keep nextc first, as that's used in macros,
and nleft next, as that's used (and both are updated) in the same macro,
which is used frequently, this increases the chance they're in the
same cache line (unchanged from before). Beyond that it matters less,
so just shuffle a bit to avoid internal padding when pointers are 64 bits.
Note that there are just 3 of these structs (currently), even if there was
to be a memory saving (there probably won't be, trailing padding will eat it)
it would be of the order of 12 or 24 bytes total, so all this really
just panders to my sense of rightness....

Note to anyone who might be tempted, please don't update the struct
initializers to use newer C forms - eventually sh is planned to become
a host tool, and a separable package, so it wants to remain able to be
compiled using older (though at least ansi) compilers that implement only
older C variants.
 1.24  15-Mar-2012  joerg Add __printflike attribution to use vprintf and friends with an argument
as format string.
 1.23  23-Aug-2011  christos branches: 1.23.2;
add more gcc printf format attributes
 1.22  29-Oct-2010  stacktic Make sh build in debug mode
 1.21  30-Aug-2010  christos dprintf is claimed by posix.
 1.20  31-Oct-2008  christos show better quoting output for sh -x, from Aleksey Cheusov
 1.19  12-Oct-2008  dholland output.c output.h: expose OUTPUT_ERR (flag for an exposed flags variable)
bltin.h: support ferror()
echo.c: use ferror() to fail on output write errors

Another piece of PR bin/39574.
 1.18  29-Mar-2008  apb Remove trailing ';' in definitions of out1c and out2c macros.
 1.17  07-Aug-2003  agc branches: 1.17.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.16  24-Nov-2002  christos Fixes from David Laight:
- ansification
- format of output of jobs command (etc)
- job identiers %+, %- etc
- $? and $(...)
- correct quoting of output of set, export -p and readonly -p
- differentiation between nornal and 'posix special' builtins
- correct behaviour (posix) for errors on builtins and special builtins
- builtin printf and kill
- set -o debug (if compiled with DEBUG)
- cd src obj (as ksh - too useful to do without)
- unset -e name, remove non-readonly variable from export list.
(so I could unset -e PS1 before running the test shell...)
 1.15  25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.14  31-Jan-1998  christos - Add gcc attributes to printf like functions
- Fix format strings to be const
- Fix buffer length to be size_t
- Add %p format
- Avoid code duplication in varargs/stdarg cases
 1.13  11-Apr-1997  christos branches: 1.13.2;
#if __STDC__ -> #ifdef __STDC__
 1.12  16-Oct-1996  christos PR/2808: Remove trailing whitespace (from FreeBSD)
 1.11  11-May-1995  christos branches: 1.11.6;
Merge in my changes from vangogh, and fix the x=`false`; echo $? == 0
bug.
 1.10  21-Mar-1995  cgd convert to new RCS id conventions.
 1.9  05-Dec-1994  cgd clean up further. more patches from Jim Jegers
 1.8  11-Jun-1994  mycroft Add RCS ids.
 1.7  12-May-1994  jtc add const qualifier to get rid of compilation warnings.
 1.6  11-May-1994  jtc sync with 4.4lite
 1.5  04-May-1994  jtc Added const qualifier to char * function arguments to eliminate
compiler warning.
 1.4  01-Aug-1993  mycroft Add RCS identifiers.
 1.3  23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2  22-Mar-1993  cgd added rcs ids to all files
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  11-May-1994  jtc 44lite code
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.11.6.1  26-Jan-1997  rat Update /bin/sh from trunk per request of Christos Zoulas. Fixes
many bugs.
 1.13.2.1  08-May-1998  mycroft Sync with trunk, per request of christos.
 1.17.16.1  18-Nov-2008  bouyer Pull up following revision(s) (requested by dholland in ticket #1232):
bin/echo/echo.c: revision 1.18
bin/sh/bltin/bltin.h: revision 1.13
bin/sh/bltin/echo.c: revision 1.14
bin/sh/output.c: revision 1.30
bin/sh/output.h: revision 1.19
Check ferror(stdout) and exit(1) if there's been a problem.
Fixes PR bin/39574 from Ed Ravin, but with a simpler patch.
output.c output.h: expose OUTPUT_ERR (flag for an exposed flags variable)
bltin.h: support ferror()
echo.c: use ferror() to fail on output write errors
Another piece of PR bin/39574.
 1.23.2.1  17-Apr-2012  yamt sync with head
 1.27.4.2  21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.27.4.1  21-Apr-2020  martin Sync with HEAD

RSS XML Feed