3 ?RCS: Copyright (c) 1999, Jarkko Hietaniemi
5 ?RCS: You may redistribute only under the terms of the Artistic License,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?MAKE:d_stdio_stream_array stdio_stream_array: run \
12 Compile cat rm_try Oldconfig Myread Setvar
13 ?MAKE: -pick add $@ %<
14 ?S:d_stdio_stream_array:
15 ?S: This variable tells whether there is an array holding
16 ?S: the stdio streams.
18 ?S:stdio_stream_array:
19 ?S: This variable tells the name of the array holding the stdio streams.
20 ?S: Usual values include _iob, __iob, and __sF.
22 ?C:HAS_STDIO_STREAM_ARRAY:
23 ?C: This symbol, if defined, tells that there is an array
24 ?C: holding the stdio streams.
26 ?C:STDIO_STREAM_ARRAY:
27 ?C: This symbol tells the name of the array holding the stdio streams.
28 ?C: Usual values include _iob, __iob, and __sF.
30 ?H:#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY /**/
31 ?H:?%<:#ifdef HAS_STDIO_STREAM_ARRAY
32 ?H:?%<:#define STDIO_STREAM_ARRAY $stdio_stream_array
39 Checking how to access stdio streams by file descriptor number...
41 case "$stdio_stream_array" in
42 '') $cat >try.c <<EOCP
45 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
49 for s in _iob __iob __sF
51 set try -DSTDIO_STREAM_ARRAY=$s
52 if eval $compile; then
53 case "`$run ./try`" in
54 yes) stdio_stream_array=$s; break ;;
60 case "$stdio_stream_array" in
62 I can't figure out how to access stdio streams by file descriptor number.
64 d_stdio_stream_array="$undef"
67 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
69 d_stdio_stream_array="$define"