home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-14 | 48.4 KB | 1,693 lines |
- Newsgroups: comp.sources.misc
- From: karl@sugar.neosoft.com (Karl Lehenbauer)
- Subject: v25i073: tcl - tool command language, version 6.1, Part05/33
- Message-ID: <1991Nov14.202716.23458@sparky.imd.sterling.com>
- X-Md4-Signature: c3f11c6192843647928857426e4feae6
- Date: Thu, 14 Nov 1991 20:27:16 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: karl@sugar.neosoft.com (Karl Lehenbauer)
- Posting-number: Volume 25, Issue 73
- Archive-name: tcl/part05
- Environment: UNIX
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 5 (of 33)."
- # Contents: tcl6.1/doc/AssembCmd.man tcl6.1/doc/CrtPipelin.man
- # tcl6.1/doc/Eval.man tcl6.1/doc/ExprLong.man tcl6.1/doc/GetInt.man
- # tcl6.1/tclUnix.h
- # Wrapped by karl@one on Tue Nov 12 19:44:14 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'tcl6.1/doc/AssembCmd.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tcl6.1/doc/AssembCmd.man'\"
- else
- echo shar: Extracting \"'tcl6.1/doc/AssembCmd.man'\" \(6500 characters\)
- sed "s/^X//" >'tcl6.1/doc/AssembCmd.man' <<'END_OF_FILE'
- X'\" Copyright 1989 Regents of the University of California
- X'\" Permission to use, copy, modify, and distribute this
- X'\" documentation for any purpose and without fee is hereby
- X'\" granted, provided that this notice appears in all copies.
- X'\" The University of California makes no representations about
- X'\" the suitability of this material for any purpose. It is
- X'\" provided "as is" without express or implied warranty.
- X'\"
- X'\" $Header: /sprite/src/lib/tcl/RCS/Tcl_AssembleCmd.man,v 1.1 90/03/11 10:30:28 ouster Exp $ SPRITE (Berkeley)
- X'\"
- X.\" The definitions below are for supplemental macros used in Sprite
- X.\" manual entries.
- X.\"
- X.\" .HS name section [date [version]]
- X.\" Replacement for .TH in other man pages. See below for valid
- X.\" section names.
- X.\"
- X.\" .AP type name in/out [indent]
- X.\" Start paragraph describing an argument to a library procedure.
- X.\" type is type of argument (int, etc.), in/out is either "in", "out",
- X.\" or "in/out" to describe whether procedure reads or modifies arg,
- X.\" and indent is equivalent to second arg of .IP (shouldn't ever be
- X.\" needed; use .AS below instead)
- X.\"
- X.\" .AS [type [name]]
- X.\" Give maximum sizes of arguments for setting tab stops. Type and
- X.\" name are examples of largest possible arguments that will be passed
- X.\" to .AP later. If args are omitted, default tab stops are used.
- X.\"
- X.\" .BS
- X.\" Start box enclosure. From here until next .BE, everything will be
- X.\" enclosed in one large box.
- X.\"
- X.\" .BE
- X.\" End of box enclosure.
- X.\"
- X.\" .VS
- X.\" Begin vertical sidebar, for use in marking newly-changed parts
- X.\" of man pages.
- X.\"
- X.\" .VE
- X.\" End of vertical sidebar.
- X.\"
- X.\" .DS
- X.\" Begin an indented unfilled display.
- X.\"
- X.\" .DE
- X.\" End of indented unfilled display.
- X.\"
- X' # Heading for Sprite man pages
- X.de HS
- X.if '\\$2'cmds' .TH \\$1 1 \\$3 \\$4
- X.if '\\$2'lib' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tcl' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tk' .TH \\$1 3 \\$3 \\$4
- X.if t .wh -1.3i ^B
- X.nr ^l \\n(.l
- X.ad b
- X..
- X' # Start an argument description
- X.de AP
- X.ie !"\\$4"" .TP \\$4
- X.el \{\
- X. ie !"\\$2"" .TP \\n()Cu
- X. el .TP 15
- X.\}
- X.ie !"\\$3"" \{\
- X.ta \\n()Au \\n()Bu
- X\&\\$1 \\fI\\$2\\fP (\\$3)
- X.\".b
- X.\}
- X.el \{\
- X.br
- X.ie !"\\$2"" \{\
- X\&\\$1 \\fI\\$2\\fP
- X.\}
- X.el \{\
- X\&\\fI\\$1\\fP
- X.\}
- X.\}
- X..
- X' # define tabbing values for .AP
- X.de AS
- X.nr )A 10n
- X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
- X.nr )B \\n()Au+15n
- X.\"
- X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
- X.nr )C \\n()Bu+\\w'(in/out)'u+2n
- X..
- X' # BS - start boxed text
- X' # ^y = starting y location
- X' # ^b = 1
- X.de BS
- X.br
- X.mk ^y
- X.nr ^b 1u
- X.if n .nf
- X.if n .ti 0
- X.if n \l'\\n(.lu\(ul'
- X.if n .fi
- X..
- X' # BE - end boxed text (draw box now)
- X.de BE
- X.nf
- X.ti 0
- X.mk ^t
- X.ie n \l'\\n(^lu\(ul'
- X.el \{\
- X.\" Draw four-sided box normally, but don't draw top of
- X.\" box if the box started on an earlier page.
- X.ie !\\n(^b-1 \{\
- X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.el \}\
- X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.\}
- X.fi
- X.br
- X.nr ^b 0
- X..
- X' # VS - start vertical sidebar
- X' # ^Y = starting y location
- X' # ^v = 1 (for troff; for nroff this doesn't matter)
- X.de VS
- X.mk ^Y
- X.ie n 'mc \s12\(br\s0
- X.el .nr ^v 1u
- X..
- X' # VE - end of vertical sidebar
- X.de VE
- X.ie n 'mc
- X.el \{\
- X.ev 2
- X.nf
- X.ti 0
- X.mk ^t
- X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
- X.sp -1
- X.fi
- X.ev
- X.\}
- X.nr ^v 0
- X..
- X' # Special macro to handle page bottom: finish off current
- X' # box/sidebar if in box/sidebar mode, then invoked standard
- X' # page bottom macro.
- X.de ^B
- X.ev 2
- X'ti 0
- X'nf
- X.mk ^t
- X.if \\n(^b \{\
- X.\" Draw three-sided box if this is the box's first page,
- X.\" draw two sides but no top otherwise.
- X.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.\}
- X.if \\n(^v \{\
- X.nr ^x \\n(^tu+1v-\\n(^Yu
- X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
- X.\}
- X.bp
- X'fi
- X.ev
- X.if \\n(^b \{\
- X.mk ^y
- X.nr ^b 2
- X.\}
- X.if \\n(^v \{\
- X.mk ^Y
- X.\}
- X..
- X' # DS - begin display
- X.de DS
- X.RS
- X.nf
- X.sp
- X..
- X' # DE - end display
- X.de DE
- X.fi
- X.RE
- X.sp .5
- X..
- X.HS Tcl_AssembleCmd tcl
- X.BS
- X.SH NAME
- XTcl_CreateCmdBuf, Tcl_AssembleCmd, Tcl_DeleteCmdBuf \- buffer pieces of Tcl commands
- X.SH SYNOPSIS
- X.nf
- X\fB#include <tcl.h>\fR
- X.sp
- XTcl_CmdBuf
- X\fBTcl_CreateCmdBuf\fR()
- X.sp
- X\fBTcl_DeleteCmdBuf\fR(\fIbuffer\fR)
- X.sp
- Xchar *
- X\fBTcl_AssembleCmd\fR(\fIbuffer\fR, \fIstring\fR)
- X.SH ARGUMENTS
- X.AS Tcl_CmdBuf *string;
- X.AP Tcl_CmdBuf buffer in
- XToken for a command buffer (the result of some previous call to
- X\fBTcl_CreateCmdBuf\fR).
- X.AP char *string in
- XAdditional piece of command input to be added to anything currently
- Xbuffered.
- X.BE
- X
- X.SH DESCRIPTION
- X.PP
- XThese three procedures provide a convenient mechanism for assembling
- XTcl commands from an input source where command boundaries are not
- Xobvious. For example, if input is being read from a terminal, a user
- Xmay type commands that span multiple lines. In situations like
- Xthis, \fBTcl_AssembleCmd\fR can be called with the individual lines
- Xas they are received. It buffers the lines internally and returns
- Xfull commands when they are complete.
- X.PP
- XA command buffer is created by calling \fBTcl_CreateCmdBuf\fR, and
- Xit is deleted by calling \fBTcl_DeleteCmdBuf\fR. There may be any
- Xnumber of command buffers for a particular program or even for a
- Xparticular interpreter; in most cases there should be one
- Xbuffer for each independent source of command input.
- X.PP
- XWhen input arrives from a source you should call \fBTcl_AssembleCmd\fR,
- Xpassing it the new input as the \fIstring\fR argument.
- X\fBTcl_AssembleCmd\fR will add the new input to anything currently
- Xbuffered in \fIbuffer\fR. If the information now buffered represents
- Xa complete Tcl command (i.e. the whole command ends with a newline
- Xcharacter and there are no unmatched quotes, braces, or brackets),
- Xthen \fBTcl_AssembleCmd\fR returns a pointer to the complete command
- Xand arranges for the buffer to be cleared on the next call to
- X\fBTcl_AssembleCmd\fR. If the command is still incomplete (because,
- Xfor example, there are unmatched braces) then \fBTcl_AssembleCmd\fR
- Xreturns NULL. \fBTcl_AssembleCmd\fR keeps a private copy of the
- Xcommand being assembled, so that the caller need not preserve the
- Xcontents of \fIstring\fR between calls to \fBTcl_AssembleCmd\fR.
- X\fBTcl_AssembleCmd\fR supports commands of arbitrary length (up to
- Xthe total memory limit imposed by the operating system, if any).
- X
- X.SH KEYWORDS
- Xassemble, buffer, partial command
- END_OF_FILE
- if test 6500 -ne `wc -c <'tcl6.1/doc/AssembCmd.man'`; then
- echo shar: \"'tcl6.1/doc/AssembCmd.man'\" unpacked with wrong size!
- fi
- # end of 'tcl6.1/doc/AssembCmd.man'
- fi
- if test -f 'tcl6.1/doc/CrtPipelin.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tcl6.1/doc/CrtPipelin.man'\"
- else
- echo shar: Extracting \"'tcl6.1/doc/CrtPipelin.man'\" \(8122 characters\)
- sed "s/^X//" >'tcl6.1/doc/CrtPipelin.man' <<'END_OF_FILE'
- X'\" Copyright 1989 Regents of the University of California
- X'\" Permission to use, copy, modify, and distribute this
- X'\" documentation for any purpose and without fee is hereby
- X'\" granted, provided that this notice appears in all copies.
- X'\" The University of California makes no representations about
- X'\" the suitability of this material for any purpose. It is
- X'\" provided "as is" without express or implied warranty.
- X'\"
- X'\" $Header: /user6/ouster/tcl/doc/RCS/CrtPipelin.man,v 1.1 91/07/20 11:21:26 ouster Exp $ SPRITE (Berkeley)
- X'\"
- X.\" The definitions below are for supplemental macros used in Sprite
- X.\" manual entries.
- X.\"
- X.\" .HS name section [date [version]]
- X.\" Replacement for .TH in other man pages. See below for valid
- X.\" section names.
- X.\"
- X.\" .AP type name in/out [indent]
- X.\" Start paragraph describing an argument to a library procedure.
- X.\" type is type of argument (int, etc.), in/out is either "in", "out",
- X.\" or "in/out" to describe whether procedure reads or modifies arg,
- X.\" and indent is equivalent to second arg of .IP (shouldn't ever be
- X.\" needed; use .AS below instead)
- X.\"
- X.\" .AS [type [name]]
- X.\" Give maximum sizes of arguments for setting tab stops. Type and
- X.\" name are examples of largest possible arguments that will be passed
- X.\" to .AP later. If args are omitted, default tab stops are used.
- X.\"
- X.\" .BS
- X.\" Start box enclosure. From here until next .BE, everything will be
- X.\" enclosed in one large box.
- X.\"
- X.\" .BE
- X.\" End of box enclosure.
- X.\"
- X.\" .VS
- X.\" Begin vertical sidebar, for use in marking newly-changed parts
- X.\" of man pages.
- X.\"
- X.\" .VE
- X.\" End of vertical sidebar.
- X.\"
- X.\" .DS
- X.\" Begin an indented unfilled display.
- X.\"
- X.\" .DE
- X.\" End of indented unfilled display.
- X.\"
- X' # Heading for Sprite man pages
- X.de HS
- X.if '\\$2'cmds' .TH \\$1 1 \\$3 \\$4
- X.if '\\$2'lib' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tcl' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tk' .TH \\$1 3 \\$3 \\$4
- X.if t .wh -1.3i ^B
- X.nr ^l \\n(.l
- X.ad b
- X..
- X' # Start an argument description
- X.de AP
- X.ie !"\\$4"" .TP \\$4
- X.el \{\
- X. ie !"\\$2"" .TP \\n()Cu
- X. el .TP 15
- X.\}
- X.ie !"\\$3"" \{\
- X.ta \\n()Au \\n()Bu
- X\&\\$1 \\fI\\$2\\fP (\\$3)
- X.\".b
- X.\}
- X.el \{\
- X.br
- X.ie !"\\$2"" \{\
- X\&\\$1 \\fI\\$2\\fP
- X.\}
- X.el \{\
- X\&\\fI\\$1\\fP
- X.\}
- X.\}
- X..
- X' # define tabbing values for .AP
- X.de AS
- X.nr )A 10n
- X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
- X.nr )B \\n()Au+15n
- X.\"
- X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
- X.nr )C \\n()Bu+\\w'(in/out)'u+2n
- X..
- X' # BS - start boxed text
- X' # ^y = starting y location
- X' # ^b = 1
- X.de BS
- X.br
- X.mk ^y
- X.nr ^b 1u
- X.if n .nf
- X.if n .ti 0
- X.if n \l'\\n(.lu\(ul'
- X.if n .fi
- X..
- X' # BE - end boxed text (draw box now)
- X.de BE
- X.nf
- X.ti 0
- X.mk ^t
- X.ie n \l'\\n(^lu\(ul'
- X.el \{\
- X.\" Draw four-sided box normally, but don't draw top of
- X.\" box if the box started on an earlier page.
- X.ie !\\n(^b-1 \{\
- X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.el \}\
- X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.\}
- X.fi
- X.br
- X.nr ^b 0
- X..
- X' # VS - start vertical sidebar
- X' # ^Y = starting y location
- X' # ^v = 1 (for troff; for nroff this doesn't matter)
- X.de VS
- X.mk ^Y
- X.ie n 'mc \s12\(br\s0
- X.el .nr ^v 1u
- X..
- X' # VE - end of vertical sidebar
- X.de VE
- X.ie n 'mc
- X.el \{\
- X.ev 2
- X.nf
- X.ti 0
- X.mk ^t
- X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
- X.sp -1
- X.fi
- X.ev
- X.\}
- X.nr ^v 0
- X..
- X' # Special macro to handle page bottom: finish off current
- X' # box/sidebar if in box/sidebar mode, then invoked standard
- X' # page bottom macro.
- X.de ^B
- X.ev 2
- X'ti 0
- X'nf
- X.mk ^t
- X.if \\n(^b \{\
- X.\" Draw three-sided box if this is the box's first page,
- X.\" draw two sides but no top otherwise.
- X.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.\}
- X.if \\n(^v \{\
- X.nr ^x \\n(^tu+1v-\\n(^Yu
- X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
- X.\}
- X.bp
- X'fi
- X.ev
- X.if \\n(^b \{\
- X.mk ^y
- X.nr ^b 2
- X.\}
- X.if \\n(^v \{\
- X.mk ^Y
- X.\}
- X..
- X' # DS - begin display
- X.de DS
- X.RS
- X.nf
- X.sp
- X..
- X' # DE - end display
- X.de DE
- X.fi
- X.RE
- X.sp .5
- X..
- X.HS Tcl_CreatePipeline tcl
- X.VS
- X.BS
- X.SH NAME
- XTcl_CreatePipeline \- create one or more child processes, with I/O redirection
- X.SH SYNOPSIS
- X.nf
- X\fB#include <tcl.h>\fR
- X.sp
- Xint
- X\fBTcl_CreatePipeline\fR(\fIinterp, argc, argv, pidArrayPtr, inPipePtr, outPipePtr, errFilePtr\fR)
- X.SH ARGUMENTS
- X.AS Tcl_Interp **pidArrayPtr
- X.AP Tcl_Interp *interp in
- XInterpreter to use for error reporting.
- X.AP int argc in
- XNumber of strings in \fIargv\fR array.
- X.AP char **argv in
- XArray of strings describing command(s) and I/O redirection.
- X.AP int **pidArrayPtr out
- XThe value at \fI*pidArrayPtr\fR is modified to hold a pointer to
- Xan array of process identifiers. The array is dynamically
- Xallocated and must be freed by the caller.
- X.AP char *inPipePtr out
- XIf this argument is NULL then standard input for the first command
- Xin the pipeline comes from the current standard input.
- XIf \fIinPipePtr\fR is not NULL then \fBTcl_CreatePipeline\fR will
- Xcreate a pipe, arrange for it to be used for standard input
- Xto the first command,
- Xand store a file id for writing to that pipe at \fI*inPipePtr\fR.
- XIf the command specified its own input using redirection, then
- Xno pipe is created and -1 is stored at \fI*inPipePtr\fR.
- X.AP char *outPipePtr out
- XIf this argument is NULL then standard output for the last command
- Xin the pipeline goes to the current standard output.
- XIf \fIoutPipePtr\fR is not NULL then \fBTcl_CreatePipeline\fR will
- Xcreate a pipe, arrange for it to be used for standard output from
- Xthe last command, and store a file id for reading from that
- Xpipe at \fI*outPipePtr\fR.
- XIf the command specified its own output using redirection then
- Xno pipe is created and -1 is stored at \fI*outPipePtr\fR.
- X.AP char *errFilePtr out
- XIf this argument is NULL then error output for all the commands
- Xin the pipeline will go to the current standard error file.
- XIf \fIerrFilePtr\fR is not NULL, error output from all the commands
- Xin the pipeline will go to a temporary file created by
- X\fBTcl_CreatePipeline\fR.
- XA file id to read from that file will be stored at \fI*errFilePtr\fR.
- XThe file will already have been removed, so closing the file
- Xdescriptor at \fI*errFilePtr\fR will cause the file to be flushed
- Xcompletely.
- X.BE
- X
- X.SH DESCRIPTION
- X.PP
- X\fBTcl_CreatePipeline\fR processes the \fIargv\fR array and sets
- Xup one or more child processes in a pipeline configuration.
- X\fBTcl_CreatePipeline\fR handles pipes specified with ``|'',
- Xinput redirection specified with ``<'' or ``<<'', and output
- Xredirection specified with ``>''; see the documentation for
- Xthe \fBexec\fR command for details on these specifications.
- XThe return value from \fBTcl_CreatePipeline\fR is a count of
- Xthe number of child processes created; the process identifiers
- Xfor those processes are stored in a \fImalloc\fR-ed array and
- Xa pointer to that array is stored at \fI*pidArrayPtr\fR.
- XIt is the caller's responsibility to free the array when finished
- Xwith it.
- X.PP
- XIf the \fIinPipePtr\fR, \fIoutPipePtr\fR, and \fIerrFilePtr\fR
- Xarguments are NULL then the pipeline's standard input, standard
- Xoutput, and standard error are taken from the corresponding
- Xstreams of the process. Non-NULL values may be specified for
- Xthese arguments to use pipes for standard input and standard
- Xoutput and a file for standard error. \fBTcl_CreatePipeline\fR
- Xwill create the requested pipes or file and return file identifiers
- Xthat may be used to read or write them. It is the caller's
- Xresponsibility to close all of these files when they are no
- Xlonger needed. If \fIargv\fR specifies redirection for standard
- Xinput or standard output, then pipes will not be created even
- Xif requested by the \fIinPipePtr\fR and \fIoutPipePtr\fR
- Xarguments.
- X.PP
- XIf an error occurs in \fBTcl_CreatePipeline\fR (e.g. ``|'' or
- X``<'' was the last argument in \fIargv\fR, or it wasn't possible
- Xto fork off a child), then -1 is returned
- Xand \fIinterp->result\fR is set to an error message.
- X
- X.SH "SEE ALSO"
- X\fBTcl_WaitPids\fR, \fBTcl_DetachPids\fR
- X
- X.SH KEYWORDS
- Xbackground, child, detach, fork, process, status, wait
- X.VE
- END_OF_FILE
- if test 8122 -ne `wc -c <'tcl6.1/doc/CrtPipelin.man'`; then
- echo shar: \"'tcl6.1/doc/CrtPipelin.man'\" unpacked with wrong size!
- fi
- # end of 'tcl6.1/doc/CrtPipelin.man'
- fi
- if test -f 'tcl6.1/doc/Eval.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tcl6.1/doc/Eval.man'\"
- else
- echo shar: Extracting \"'tcl6.1/doc/Eval.man'\" \(8197 characters\)
- sed "s/^X//" >'tcl6.1/doc/Eval.man' <<'END_OF_FILE'
- X'\" Copyright 1989 Regents of the University of California
- X'\" Permission to use, copy, modify, and distribute this
- X'\" documentation for any purpose and without fee is hereby
- X'\" granted, provided that this notice appears in all copies.
- X'\" The University of California makes no representations about
- X'\" the suitability of this material for any purpose. It is
- X'\" provided "as is" without express or implied warranty.
- X'\"
- X'\" $Header: /user6/ouster/tcl/doc/RCS/Eval.man,v 1.6 91/10/24 16:23:51 ouster Exp $ SPRITE (Berkeley)
- X'\"
- X.\" The definitions below are for supplemental macros used in Sprite
- X.\" manual entries.
- X.\"
- X.\" .HS name section [date [version]]
- X.\" Replacement for .TH in other man pages. See below for valid
- X.\" section names.
- X.\"
- X.\" .AP type name in/out [indent]
- X.\" Start paragraph describing an argument to a library procedure.
- X.\" type is type of argument (int, etc.), in/out is either "in", "out",
- X.\" or "in/out" to describe whether procedure reads or modifies arg,
- X.\" and indent is equivalent to second arg of .IP (shouldn't ever be
- X.\" needed; use .AS below instead)
- X.\"
- X.\" .AS [type [name]]
- X.\" Give maximum sizes of arguments for setting tab stops. Type and
- X.\" name are examples of largest possible arguments that will be passed
- X.\" to .AP later. If args are omitted, default tab stops are used.
- X.\"
- X.\" .BS
- X.\" Start box enclosure. From here until next .BE, everything will be
- X.\" enclosed in one large box.
- X.\"
- X.\" .BE
- X.\" End of box enclosure.
- X.\"
- X.\" .VS
- X.\" Begin vertical sidebar, for use in marking newly-changed parts
- X.\" of man pages.
- X.\"
- X.\" .VE
- X.\" End of vertical sidebar.
- X.\"
- X.\" .DS
- X.\" Begin an indented unfilled display.
- X.\"
- X.\" .DE
- X.\" End of indented unfilled display.
- X.\"
- X' # Heading for Sprite man pages
- X.de HS
- X.if '\\$2'cmds' .TH \\$1 1 \\$3 \\$4
- X.if '\\$2'lib' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tcl' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tk' .TH \\$1 3 \\$3 \\$4
- X.if t .wh -1.3i ^B
- X.nr ^l \\n(.l
- X.ad b
- X..
- X' # Start an argument description
- X.de AP
- X.ie !"\\$4"" .TP \\$4
- X.el \{\
- X. ie !"\\$2"" .TP \\n()Cu
- X. el .TP 15
- X.\}
- X.ie !"\\$3"" \{\
- X.ta \\n()Au \\n()Bu
- X\&\\$1 \\fI\\$2\\fP (\\$3)
- X.\".b
- X.\}
- X.el \{\
- X.br
- X.ie !"\\$2"" \{\
- X\&\\$1 \\fI\\$2\\fP
- X.\}
- X.el \{\
- X\&\\fI\\$1\\fP
- X.\}
- X.\}
- X..
- X' # define tabbing values for .AP
- X.de AS
- X.nr )A 10n
- X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
- X.nr )B \\n()Au+15n
- X.\"
- X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
- X.nr )C \\n()Bu+\\w'(in/out)'u+2n
- X..
- X' # BS - start boxed text
- X' # ^y = starting y location
- X' # ^b = 1
- X.de BS
- X.br
- X.mk ^y
- X.nr ^b 1u
- X.if n .nf
- X.if n .ti 0
- X.if n \l'\\n(.lu\(ul'
- X.if n .fi
- X..
- X' # BE - end boxed text (draw box now)
- X.de BE
- X.nf
- X.ti 0
- X.mk ^t
- X.ie n \l'\\n(^lu\(ul'
- X.el \{\
- X.\" Draw four-sided box normally, but don't draw top of
- X.\" box if the box started on an earlier page.
- X.ie !\\n(^b-1 \{\
- X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.el \}\
- X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.\}
- X.fi
- X.br
- X.nr ^b 0
- X..
- X' # VS - start vertical sidebar
- X' # ^Y = starting y location
- X' # ^v = 1 (for troff; for nroff this doesn't matter)
- X.de VS
- X.mk ^Y
- X.ie n 'mc \s12\(br\s0
- X.el .nr ^v 1u
- X..
- X' # VE - end of vertical sidebar
- X.de VE
- X.ie n 'mc
- X.el \{\
- X.ev 2
- X.nf
- X.ti 0
- X.mk ^t
- X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
- X.sp -1
- X.fi
- X.ev
- X.\}
- X.nr ^v 0
- X..
- X' # Special macro to handle page bottom: finish off current
- X' # box/sidebar if in box/sidebar mode, then invoked standard
- X' # page bottom macro.
- X.de ^B
- X.ev 2
- X'ti 0
- X'nf
- X.mk ^t
- X.if \\n(^b \{\
- X.\" Draw three-sided box if this is the box's first page,
- X.\" draw two sides but no top otherwise.
- X.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.\}
- X.if \\n(^v \{\
- X.nr ^x \\n(^tu+1v-\\n(^Yu
- X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
- X.\}
- X.bp
- X'fi
- X.ev
- X.if \\n(^b \{\
- X.mk ^y
- X.nr ^b 2
- X.\}
- X.if \\n(^v \{\
- X.mk ^Y
- X.\}
- X..
- X' # DS - begin display
- X.de DS
- X.RS
- X.nf
- X.sp
- X..
- X' # DE - end display
- X.de DE
- X.fi
- X.RE
- X.sp .5
- X..
- X.HS Tcl_Eval tcl
- X.BS
- X.SH NAME
- XTcl_Eval, Tcl_VarEval, Tcl_EvalFile \- execute Tcl commands
- X.SH SYNOPSIS
- X.nf
- X\fB#include <tcl.h>\fR
- X.sp
- Xint
- X\fBTcl_Eval\fR(\fIinterp, cmd, flags, termPtr\fR)
- X.sp
- Xint
- X\fBTcl_VarEval\fR(\fIinterp, string, string, ... \fB(char *) NULL\fR)
- X.sp
- Xint
- X\fBTcl_EvalFile\fR(\fIinterp, fileName\fR)
- X.SH ARGUMENTS
- X.AS Tcl_Interp **termPtr;
- X.AP Tcl_Interp *interp in
- XInterpreter in which to execute the command. String result will be
- Xstored in \fIinterp->result\fR.
- X.AP char *cmd in
- XCommand (or sequence of commands) to execute.
- X.AP int flags in
- XEither \fBTCL_BRACKET_TERM\fR or 0.
- XIf 0, then \fBTcl_Eval\fR will process commands from \fIcmd\fR until
- Xit reaches the null character at the end of the string.
- XIf \fBTCL_BRACKET_TERM\fR,
- Xthen \fBTcl_Eval\fR will process comands from \fIcmd\fR until either it
- Xreaches a null character or it encounters a close bracket that isn't
- Xbackslashed or enclosed in braces, at which point it will return.
- XUnder normal conditions, \fIflags\fR should be 0.
- X.AP char **termPtr out
- XIf \fItermPtr\fR is non-NULL, \fBTcl_Eval\fR fills in *\fItermPtr\fR with
- Xthe address of the character just after the last one in the last command
- Xsuccessfully executed (normally the null character at the end of \fIcmd\fR).
- XIf an error occurs in the first command in \fIcmd\fR, then \fI*termPtr\fR
- Xwill be set to \fIcmd\fR.
- X.AP char *string in
- XString forming part of Tcl command.
- X.AP char *fileName in
- XName of file containing Tcl command string.
- X.BE
- X
- X.SH DESCRIPTION
- X.PP
- XAll three of these procedures execute Tcl commands.
- X\fBTcl_Eval\fR is the core procedure: it parses commands
- Xfrom \fIcmd\fR and executes them in
- Xorder until either an error occurs or \fBTcl_Eval\fR reaches a terminating
- Xcharacter (']' or '\e0', depending on the value of \fIflags\fR).
- XThe return value from \fBTcl_Eval\fR is one
- Xof the Tcl return codes \fBTCL_OK\fR, \fBTCL_ERROR\fR, \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or
- X\fBTCL_CONTINUE\fR, and \fIinterp->result\fR will point to
- Xa string with additional information (result value or error message).
- XThis return information corresponds to the last command executed from
- X\fIcmd\fR.
- X.PP
- X\fBTcl_VarEval\fR takes any number of string arguments
- Xof any length, concatenates
- Xthem into a single string, then calls \fBTcl_Eval\fR to
- Xexecute that string as a Tcl command.
- XIt returns the result of the command and also modifies
- X\fIinterp->result\fR in the usual fashion for Tcl commands. The
- Xlast argument to \fBTcl_VarEval\fR must be NULL to indicate the end
- Xof arguments.
- X.PP
- X\fBTcl_EvalFile\fR reads the file given by \fIfileName\fR and evaluates
- Xits contents as a Tcl command by calling \fBTcl_Eval\fR. It returns
- Xa standard Tcl result that reflects the result of evaluating the
- Xfile.
- XIf the file couldn't be read then a Tcl error is returned to describe
- Xwhy the file couldn't be read.
- X.PP
- XDuring the processing of a Tcl command it is legal to make nested
- Xcalls to evaluate other commands (this is how conditionals, loops,
- Xand procedures are implemented).
- XIf a code other than
- X\fBTCL_OK\fR is returned from a nested \fBTcl_Eval\fR invocation, then the
- Xcaller should normally return immediately, passing that same
- Xreturn code back to its caller, and so on until the top-level application is
- Xreached. A few commands, like \fBfor\fR, will check for certain
- Xreturn codes, like \fBTCL_BREAK\fR and \fBTCL_CONTINUE\fR, and process them
- Xspecially without returning.
- X.PP
- X\fBTcl_Eval\fR keeps track of how many nested Tcl_Eval invocations are
- Xin progress for \fIinterp\fR.
- XIf a code of \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR is
- Xabout to be returned from the topmost \fBTcl_Eval\fR invocation for
- X\fIinterp\fR, then \fBTcl_Eval\fR converts the return code to \fBTCL_ERROR\fR
- Xand sets \fIinterp->result\fR to point to an error message indicating that
- Xthe \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command was
- Xinvoked in an inappropriate place. This means that top-level
- Xapplications should never see a return code from \fBTcl_Eval\fR other then
- X\fBTCL_OK\fR or \fBTCL_ERROR\fR.
- X
- X.SH KEYWORDS
- Xcommand, execute, file, interpreter
- END_OF_FILE
- if test 8197 -ne `wc -c <'tcl6.1/doc/Eval.man'`; then
- echo shar: \"'tcl6.1/doc/Eval.man'\" unpacked with wrong size!
- fi
- # end of 'tcl6.1/doc/Eval.man'
- fi
- if test -f 'tcl6.1/doc/ExprLong.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tcl6.1/doc/ExprLong.man'\"
- else
- echo shar: Extracting \"'tcl6.1/doc/ExprLong.man'\" \(7263 characters\)
- sed "s/^X//" >'tcl6.1/doc/ExprLong.man' <<'END_OF_FILE'
- X'\" Copyright 1989 Regents of the University of California
- X'\" Permission to use, copy, modify, and distribute this
- X'\" documentation for any purpose and without fee is hereby
- X'\" granted, provided that this notice appears in all copies.
- X'\" The University of California makes no representations about
- X'\" the suitability of this material for any purpose. It is
- X'\" provided "as is" without express or implied warranty.
- X'\"
- X'\" $Header: /user6/ouster/tcl/doc/RCS/ExprLong.man,v 1.2 91/05/31 11:52:56 ouster Exp $ SPRITE (Berkeley)
- X'\"
- X.\" The definitions below are for supplemental macros used in Sprite
- X.\" manual entries.
- X.\"
- X.\" .HS name section [date [version]]
- X.\" Replacement for .TH in other man pages. See below for valid
- X.\" section names.
- X.\"
- X.\" .AP type name in/out [indent]
- X.\" Start paragraph describing an argument to a library procedure.
- X.\" type is type of argument (int, etc.), in/out is either "in", "out",
- X.\" or "in/out" to describe whether procedure reads or modifies arg,
- X.\" and indent is equivalent to second arg of .IP (shouldn't ever be
- X.\" needed; use .AS below instead)
- X.\"
- X.\" .AS [type [name]]
- X.\" Give maximum sizes of arguments for setting tab stops. Type and
- X.\" name are examples of largest possible arguments that will be passed
- X.\" to .AP later. If args are omitted, default tab stops are used.
- X.\"
- X.\" .BS
- X.\" Start box enclosure. From here until next .BE, everything will be
- X.\" enclosed in one large box.
- X.\"
- X.\" .BE
- X.\" End of box enclosure.
- X.\"
- X.\" .VS
- X.\" Begin vertical sidebar, for use in marking newly-changed parts
- X.\" of man pages.
- X.\"
- X.\" .VE
- X.\" End of vertical sidebar.
- X.\"
- X.\" .DS
- X.\" Begin an indented unfilled display.
- X.\"
- X.\" .DE
- X.\" End of indented unfilled display.
- X.\"
- X' # Heading for Sprite man pages
- X.de HS
- X.if '\\$2'cmds' .TH \\$1 1 \\$3 \\$4
- X.if '\\$2'lib' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tcl' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tk' .TH \\$1 3 \\$3 \\$4
- X.if t .wh -1.3i ^B
- X.nr ^l \\n(.l
- X.ad b
- X..
- X' # Start an argument description
- X.de AP
- X.ie !"\\$4"" .TP \\$4
- X.el \{\
- X. ie !"\\$2"" .TP \\n()Cu
- X. el .TP 15
- X.\}
- X.ie !"\\$3"" \{\
- X.ta \\n()Au \\n()Bu
- X\&\\$1 \\fI\\$2\\fP (\\$3)
- X.\".b
- X.\}
- X.el \{\
- X.br
- X.ie !"\\$2"" \{\
- X\&\\$1 \\fI\\$2\\fP
- X.\}
- X.el \{\
- X\&\\fI\\$1\\fP
- X.\}
- X.\}
- X..
- X' # define tabbing values for .AP
- X.de AS
- X.nr )A 10n
- X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
- X.nr )B \\n()Au+15n
- X.\"
- X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
- X.nr )C \\n()Bu+\\w'(in/out)'u+2n
- X..
- X' # BS - start boxed text
- X' # ^y = starting y location
- X' # ^b = 1
- X.de BS
- X.br
- X.mk ^y
- X.nr ^b 1u
- X.if n .nf
- X.if n .ti 0
- X.if n \l'\\n(.lu\(ul'
- X.if n .fi
- X..
- X' # BE - end boxed text (draw box now)
- X.de BE
- X.nf
- X.ti 0
- X.mk ^t
- X.ie n \l'\\n(^lu\(ul'
- X.el \{\
- X.\" Draw four-sided box normally, but don't draw top of
- X.\" box if the box started on an earlier page.
- X.ie !\\n(^b-1 \{\
- X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.el \}\
- X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.\}
- X.fi
- X.br
- X.nr ^b 0
- X..
- X' # VS - start vertical sidebar
- X' # ^Y = starting y location
- X' # ^v = 1 (for troff; for nroff this doesn't matter)
- X.de VS
- X.mk ^Y
- X.ie n 'mc \s12\(br\s0
- X.el .nr ^v 1u
- X..
- X' # VE - end of vertical sidebar
- X.de VE
- X.ie n 'mc
- X.el \{\
- X.ev 2
- X.nf
- X.ti 0
- X.mk ^t
- X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
- X.sp -1
- X.fi
- X.ev
- X.\}
- X.nr ^v 0
- X..
- X' # Special macro to handle page bottom: finish off current
- X' # box/sidebar if in box/sidebar mode, then invoked standard
- X' # page bottom macro.
- X.de ^B
- X.ev 2
- X'ti 0
- X'nf
- X.mk ^t
- X.if \\n(^b \{\
- X.\" Draw three-sided box if this is the box's first page,
- X.\" draw two sides but no top otherwise.
- X.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.\}
- X.if \\n(^v \{\
- X.nr ^x \\n(^tu+1v-\\n(^Yu
- X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
- X.\}
- X.bp
- X'fi
- X.ev
- X.if \\n(^b \{\
- X.mk ^y
- X.nr ^b 2
- X.\}
- X.if \\n(^v \{\
- X.mk ^Y
- X.\}
- X..
- X' # DS - begin display
- X.de DS
- X.RS
- X.nf
- X.sp
- X..
- X' # DE - end display
- X.de DE
- X.fi
- X.RE
- X.sp .5
- X..
- X.HS Tcl_ExprLong tcl
- X.BS
- X.SH NAME
- XTcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBool, Tcl_ExprString \- evaluate an expression
- X.SH SYNOPSIS
- X.nf
- X\fB#include <tcl.h>\fR
- X.VS
- X.sp
- Xint
- X\fBTcl_ExprLong\fR(\fIinterp, string, longPtr\fR)
- X.sp
- Xint
- X\fBTcl_ExprDouble\fR(\fIinterp, string, doublePtr\fR)
- X.sp
- Xint
- X\fBTcl_ExprBoolean\fR(\fIinterp, string, booleanPtr\fR)
- X.sp
- Xint
- X\fBTcl_ExprString\fR(\fIinterp, string\fR)
- X.SH ARGUMENTS
- X.AS Tcl_Interp *interp
- X.AP Tcl_Interp *interp in
- XInterpreter in whose context to evaluate \fIstring\fR.
- X.AP char *string in
- XExpression to be evaluated.
- X.AP long *longPtr out
- XPointer to location in which to store the integer value of the
- Xexpression.
- X.AP int *doublePtr out
- XPointer to location in which to store the floating-point value of the
- Xexpression.
- X.AP int *booleanPtr out
- XPointer to location in which to store the 0/1 boolean value of the
- Xexpression.
- X.BE
- X
- X.SH DESCRIPTION
- X.PP
- XThese four procedures all evaluate a string expression, returning
- Xthe result in one of four different forms.
- XThe expression is given by the \fIstring\fR argument, and it
- Xcan have any of the forms accepted by the \fBexpr\fR command.
- XThe \fIinterp\fR argument refers to an interpreter used to
- Xevaluate the expression (e.g. for variables and nested Tcl
- Xcommands) and to return error information. \fIInterp->result\fR
- Xis assumed to be initialized in the standard fashion when any
- Xof the procedures are invoked.
- X.PP
- XFor all of these procedures the return value is a standard
- XTcl result: \fBTCL_OK\fR means the expression was succesfully
- Xevaluated, and \fBTCL_ERROR\fR means that an error occurred while
- Xevaluating the expression. If \fBTCL_ERROR\fR is returned then
- X\fIinterp->result\fR will hold a message describing the error.
- XIf an error occurs while executing a Tcl command embedded in
- X\fIstring\fR, then that error will be returned.
- X.PP
- XIf the expression is successfully evaluated, then its value will
- Xbe returned in one of four forms, depending on which procedure
- Xis invoked.
- X\fBTcl_ExprLong\fR stores an integer value at \fI*longPtr\fR.
- XIf the expression's actual value was a floating-point number,
- Xthen it is truncated to an integer.
- XIf the expression's actual value was a non-numeric string then
- Xan error is returned.
- X.PP
- X\fBTcl_ExprDouble\fR stores a floating-point value at \fI*doublePtr\fR.
- XIf the expression's actual value was an integer, it is converted to
- Xfloating-point.
- XIf the expression's actual value was a non-numeric string then
- Xan error is returned.
- X.PP
- X\fBTcl_ExprBoolean\fR stores a 0/1 integer value at \fI*booleanPtr\fR.
- XIf the expression's actual value was an integer or floating-point
- Xnumber, then \fBTcl_ExprBoolean\fR stores 0 at \fI*booleanPtr\fR if
- Xthe value was zero and 1 otherwise.
- XIf the expression's actual value was a non-numeric string then
- Xan error is returned.
- X.PP
- X\fBTcl_ExprString\fR returns the value of the expression as a
- Xstring stored in \fIinterp->result\fR.
- XIf the expression's actual value was an integer or floating-point
- Xnumber, then \fBTcl_ExprString\fR converts it to string (using \fBsprintf\fR
- Xwith a ``%d'' or ``%g'' converter).
- X
- X.SH KEYWORDS
- Xboolean, double, evaluate, expression, integer, string
- X.VE
- END_OF_FILE
- if test 7263 -ne `wc -c <'tcl6.1/doc/ExprLong.man'`; then
- echo shar: \"'tcl6.1/doc/ExprLong.man'\" unpacked with wrong size!
- fi
- # end of 'tcl6.1/doc/ExprLong.man'
- fi
- if test -f 'tcl6.1/doc/GetInt.man' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tcl6.1/doc/GetInt.man'\"
- else
- echo shar: Extracting \"'tcl6.1/doc/GetInt.man'\" \(6873 characters\)
- sed "s/^X//" >'tcl6.1/doc/GetInt.man' <<'END_OF_FILE'
- X'\" Copyright 1989 Regents of the University of California
- X'\" Permission to use, copy, modify, and distribute this
- X'\" documentation for any purpose and without fee is hereby
- X'\" granted, provided that this notice appears in all copies.
- X'\" The University of California makes no representations about
- X'\" the suitability of this material for any purpose. It is
- X'\" provided "as is" without express or implied warranty.
- X'\"
- X'\" $Header: /user6/ouster/tcl/doc/RCS/GetInt.man,v 1.2 90/07/28 10:59:43 ouster Exp $ SPRITE (Berkeley)
- X'\"
- X.\" The definitions below are for supplemental macros used in Sprite
- X.\" manual entries.
- X.\"
- X.\" .HS name section [date [version]]
- X.\" Replacement for .TH in other man pages. See below for valid
- X.\" section names.
- X.\"
- X.\" .AP type name in/out [indent]
- X.\" Start paragraph describing an argument to a library procedure.
- X.\" type is type of argument (int, etc.), in/out is either "in", "out",
- X.\" or "in/out" to describe whether procedure reads or modifies arg,
- X.\" and indent is equivalent to second arg of .IP (shouldn't ever be
- X.\" needed; use .AS below instead)
- X.\"
- X.\" .AS [type [name]]
- X.\" Give maximum sizes of arguments for setting tab stops. Type and
- X.\" name are examples of largest possible arguments that will be passed
- X.\" to .AP later. If args are omitted, default tab stops are used.
- X.\"
- X.\" .BS
- X.\" Start box enclosure. From here until next .BE, everything will be
- X.\" enclosed in one large box.
- X.\"
- X.\" .BE
- X.\" End of box enclosure.
- X.\"
- X.\" .VS
- X.\" Begin vertical sidebar, for use in marking newly-changed parts
- X.\" of man pages.
- X.\"
- X.\" .VE
- X.\" End of vertical sidebar.
- X.\"
- X.\" .DS
- X.\" Begin an indented unfilled display.
- X.\"
- X.\" .DE
- X.\" End of indented unfilled display.
- X.\"
- X' # Heading for Sprite man pages
- X.de HS
- X.if '\\$2'cmds' .TH \\$1 1 \\$3 \\$4
- X.if '\\$2'lib' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tcl' .TH \\$1 3 \\$3 \\$4
- X.if '\\$2'tk' .TH \\$1 3 \\$3 \\$4
- X.if t .wh -1.3i ^B
- X.nr ^l \\n(.l
- X.ad b
- X..
- X' # Start an argument description
- X.de AP
- X.ie !"\\$4"" .TP \\$4
- X.el \{\
- X. ie !"\\$2"" .TP \\n()Cu
- X. el .TP 15
- X.\}
- X.ie !"\\$3"" \{\
- X.ta \\n()Au \\n()Bu
- X\&\\$1 \\fI\\$2\\fP (\\$3)
- X.\".b
- X.\}
- X.el \{\
- X.br
- X.ie !"\\$2"" \{\
- X\&\\$1 \\fI\\$2\\fP
- X.\}
- X.el \{\
- X\&\\fI\\$1\\fP
- X.\}
- X.\}
- X..
- X' # define tabbing values for .AP
- X.de AS
- X.nr )A 10n
- X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
- X.nr )B \\n()Au+15n
- X.\"
- X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
- X.nr )C \\n()Bu+\\w'(in/out)'u+2n
- X..
- X' # BS - start boxed text
- X' # ^y = starting y location
- X' # ^b = 1
- X.de BS
- X.br
- X.mk ^y
- X.nr ^b 1u
- X.if n .nf
- X.if n .ti 0
- X.if n \l'\\n(.lu\(ul'
- X.if n .fi
- X..
- X' # BE - end boxed text (draw box now)
- X.de BE
- X.nf
- X.ti 0
- X.mk ^t
- X.ie n \l'\\n(^lu\(ul'
- X.el \{\
- X.\" Draw four-sided box normally, but don't draw top of
- X.\" box if the box started on an earlier page.
- X.ie !\\n(^b-1 \{\
- X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.el \}\
- X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
- X.\}
- X.\}
- X.fi
- X.br
- X.nr ^b 0
- X..
- X' # VS - start vertical sidebar
- X' # ^Y = starting y location
- X' # ^v = 1 (for troff; for nroff this doesn't matter)
- X.de VS
- X.mk ^Y
- X.ie n 'mc \s12\(br\s0
- X.el .nr ^v 1u
- X..
- X' # VE - end of vertical sidebar
- X.de VE
- X.ie n 'mc
- X.el \{\
- X.ev 2
- X.nf
- X.ti 0
- X.mk ^t
- X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
- X.sp -1
- X.fi
- X.ev
- X.\}
- X.nr ^v 0
- X..
- X' # Special macro to handle page bottom: finish off current
- X' # box/sidebar if in box/sidebar mode, then invoked standard
- X' # page bottom macro.
- X.de ^B
- X.ev 2
- X'ti 0
- X'nf
- X.mk ^t
- X.if \\n(^b \{\
- X.\" Draw three-sided box if this is the box's first page,
- X.\" draw two sides but no top otherwise.
- X.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
- X.\}
- X.if \\n(^v \{\
- X.nr ^x \\n(^tu+1v-\\n(^Yu
- X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
- X.\}
- X.bp
- X'fi
- X.ev
- X.if \\n(^b \{\
- X.mk ^y
- X.nr ^b 2
- X.\}
- X.if \\n(^v \{\
- X.mk ^Y
- X.\}
- X..
- X' # DS - begin display
- X.de DS
- X.RS
- X.nf
- X.sp
- X..
- X' # DE - end display
- X.de DE
- X.fi
- X.RE
- X.sp .5
- X..
- X.HS Tcl_GetInt tcl
- X.BS
- X.SH NAME
- XTcl_GetInt, Tcl_GetDouble, Tcl_GetBoolean \- convert from string to integer, double, or boolean
- X.SH SYNOPSIS
- X.nf
- X\fB#include <tcl.h>\fR
- X.sp
- Xint
- X\fBTcl_GetInt\fR(\fIinterp, string, intPtr\fR)
- X.sp
- Xint
- X\fBTcl_GetDouble\fR(\fIinterp, string, doublePtr\fR)
- X.sp
- Xint
- X\fBTcl_GetBoolean\fR(\fIinterp, string, boolPtr\fR)
- X.SH ARGUMENTS
- X.AS Tcl_Interp *interp
- X.AP Tcl_Interp *interp in
- XInterpreter to use for error reporting.
- X.AP char *string in
- XTextual value to be converted.
- X.AP int *intPtr out
- XPoints to place to store integer value converted from \fIstring\fR.
- X.AP double *doublePtr out
- XPoints to place to store double-precision floating-point
- Xvalue converted from \fIstring\fR.
- X.AP int *boolPtr out
- XPoints to place to store boolean value (0 or 1) converted from \fIstring\fR.
- X.BE
- X
- X.SH DESCRIPTION
- X.PP
- XThese procedures convert from strings to integers or double-precision
- Xfloating-point values or booleans (represented as 0- or 1-valued
- Xintegers). Each of the procedures takes a \fIstring\fR argument,
- Xconverts it to an internal form of a particular type, and stores
- Xthe converted value at the location indicated by the procedure's
- Xthird argument. If all goes well, each of the procedures returns
- XTCL_OK. If \fIstring\fR doesn't have the proper syntax for the
- Xdesired type then TCL_ERROR is returned, an error message is left
- Xin \fIinterp->result\fR, and nothing is stored at *\fIintPtr\fR
- Xor *\fIdoublePtr\fR or *\fIboolPtr\fR.
- X.PP
- X\fBTcl_GetInt\fR expects \fIstring\fR to consist of a collection
- Xof integer digits, optionally signed and optionally preceded by
- Xwhite space. If the first two characters of \fIstring\fR are ``0x''
- Xthen \fIstring\fR is expected to be in hexadecimal form; otherwise,
- Xif the first character of \fIstring\fR is ``0'' then \fIstring\fR
- Xis expected to be in octal form; otherwise, \fIstring\fR is
- Xexpected to be in decimal form.
- X.PP
- X\fBTcl_GetDouble\fR expects \fIstring\fR to consist of a floating-point
- Xnumber, which is: white space; a sign; a sequence of digits; a
- Xdecimal point; a sequence of digits; the letter ``e''; and a
- Xsigned decimal exponent. Any of the fields may be omitted, except that
- Xthe digits either before or after the decimal point must be present
- Xand if the ``e'' is present then it must be followed by the
- Xexponent number.
- X.PP
- X\fBTcl_GetBoolean\fR expects \fIstring\fR to specify a boolean
- Xvalue. If \fIstring\fR is any of \fB0\fR, \fBfalse\fR, or
- X\fBno\fR, then \fBTcl_GetBoolean\fR stores a zero value at
- X\fI*boolPtr\fR. If \fIstring\fR is any of \fB1\fR, \fBtrue\fR,
- Xor \fByes\fR, then 1 is stored at \fI*boolPtr\fR. Any of these
- Xvalues may be abbreviated, and upper-case spellings are also
- Xacceptable.
- X
- X.SH KEYWORDS
- Xboolean, conversion, double, floating-point, integer
- END_OF_FILE
- if test 6873 -ne `wc -c <'tcl6.1/doc/GetInt.man'`; then
- echo shar: \"'tcl6.1/doc/GetInt.man'\" unpacked with wrong size!
- fi
- # end of 'tcl6.1/doc/GetInt.man'
- fi
- if test -f 'tcl6.1/tclUnix.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'tcl6.1/tclUnix.h'\"
- else
- echo shar: Extracting \"'tcl6.1/tclUnix.h'\" \(6487 characters\)
- sed "s/^X//" >'tcl6.1/tclUnix.h' <<'END_OF_FILE'
- X/*
- X * tclUnix.h --
- X *
- X * This file reads in UNIX-related header files and sets up
- X * UNIX-related macros for Tcl's UNIX core. It should be the
- X * only file that contains #ifdefs to handle different flavors
- X * of UNIX. This file sets up the union of all UNIX-related
- X * things needed by any of the Tcl core files. This file
- X * depends on configuration #defines in tclConfig.h
- X *
- X * The material in this file was originally contributed by
- X * Karl Lehenbauer, Mark Diekhans and Peter da Silva.
- X *
- X * Copyright 1991 Regents of the University of California
- X * Permission to use, copy, modify, and distribute this
- X * software and its documentation for any purpose and without
- X * fee is hereby granted, provided that this copyright
- X * notice appears in all copies. The University of California
- X * makes no representations about the suitability of this
- X * software for any purpose. It is provided "as is" without
- X * express or implied warranty.
- X *
- X * $Header: /user6/ouster/tcl/RCS/tclUnix.h,v 1.21 91/11/07 09:41:54 ouster Exp $ SPRITE (Berkeley)
- X */
- X
- X#ifndef _TCLUNIX
- X#define _TCLUNIX
- X
- X/*
- X * The following #defines are used to distinguish between different
- X * UNIX systems. These #defines are normally set by the "config" script
- X * based on information it gets by looking in the include and library
- X * areas. The defaults below are for BSD-based systems like SunOS
- X * or Ultrix.
- X *
- X * TCL_GETTOD - 1 means there exists a library procedure
- X * "gettimeofday" (e.g. BSD systems). 0 means
- X * have to use "times" instead.
- X * TCL_GETWD - 1 means there exists a library procedure
- X * "getwd" (e.g. BSD systems). 0 means
- X * have to use "getcwd" instead.
- X * TCL_SYS_ERRLIST - 1 means that the array sys_errlist is
- X * defined as part of the C library.
- X * TCL_SYS_TIME_H - 1 means there exists an include file
- X * <sys/time.h> (e.g. BSD derivatives).
- X * TCL_SYS_WAIT_H - 1 means there exists an include file
- X * <sys/wait.h> that defines constants related
- X * to the results of "wait".
- X * TCL_UNION_WAIT - 1 means that the "wait" system call returns
- X * a structure of type "union wait" (e.g. BSD
- X * systems). 0 means "wait" returns an int
- X * (e.g. System V and POSIX).
- X * TCL_PID_T - 1 means that <sys/types> defines types
- X * pid_t and uid_t. 0 means that it doesn't.
- X */
- X
- X#define TCL_GETTOD 0
- X#define TCL_GETWD 0
- X#define TCL_SYS_ERRLIST 1
- X#define TCL_SYS_TIME_H 1
- X#define TCL_SYS_WAIT_H 1
- X#define TCL_UNION_WAIT 0
- X#define TCL_PID_T 1
- X
- X#include <errno.h>
- X#include <fcntl.h>
- X#include <limits.h>
- X#include <pwd.h>
- X#include <signal.h>
- X#include <sys/param.h>
- X#include <sys/types.h>
- X#include <dirent.h>
- X#include <sys/file.h>
- X#include <sys/stat.h>
- X#if TCL_SYS_TIME_H
- X# include <sys/time.h>
- X#else
- X# include <time.h>
- X#endif
- X#if TCL_SYS_WAIT_H
- X# include <sys/wait.h>
- X#endif
- X
- X/*
- X * Not all systems declare the errno variable in errno.h. so this
- X * file does it explicitly. The list of system error messages also
- X * isn't generally declared in a header file anywhere.
- X */
- X
- Xextern int errno;
- Xextern int sys_nerr;
- Xextern char *sys_errlist[];
- X
- X/*
- X * The type of the status returned by wait varies from UNIX system
- X * to UNIX system. The macro below defines it:
- X */
- X
- X#if TCL_UNION_WAIT
- X# define WAIT_STATUS_TYPE union wait
- X#else
- X# define WAIT_STATUS_TYPE int
- X#endif
- X
- X/*
- X * Supply definitions for macros to query wait status, if not already
- X * defined in header files above.
- X */
- X
- X#ifndef WIFEXITED
- X# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0)
- X#endif
- X
- X#ifndef WEXITSTATUS
- X# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
- X#endif
- X
- X#ifndef WIFSIGNALED
- X# define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
- X#endif
- X
- X#ifndef WTERMSIG
- X# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
- X#endif
- X
- X#ifndef WIFSTOPPED
- X# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177)
- X#endif
- X
- X#ifndef WSTOPSIG
- X# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
- X#endif
- X
- X/*
- X * Supply macros for seek offsets, if they're not already provided by
- X * an include file.
- X */
- X
- X#ifndef SEEK_SET
- X# define SEEK_SET 0
- X#endif
- X
- X#ifndef SEEK_CUR
- X# define SEEK_CUR 1
- X#endif
- X
- X#ifndef SEEK_END
- X# define SEEK_END 2
- X#endif
- X
- X/*
- X * The stuff below is needed by the "time" command. If this
- X * system has no gettimeofday call, then must use times and the
- X * CLK_TCK #define (from sys/param.h) to compute elapsed time.
- X * Unfortunately, some systems only have HZ and no CLK_TCK, and
- X * some might not even have HZ.
- X */
- X
- X#if ! TCL_GETTOD
- X# include <sys/times.h>
- X# include <sys/param.h>
- X# ifndef CLK_TCK
- X# ifdef HZ
- X# define CLK_TCK HZ
- X# else
- X# define CLK_TCK 60
- X# endif
- X# endif
- X#endif
- X
- X/*
- X * Define access mode constants if they aren't already defined.
- X */
- X
- X#ifndef F_OK
- X# define F_OK 00
- X#endif
- X#ifndef X_OK
- X# define X_OK 01
- X#endif
- X#ifndef W_OK
- X# define W_OK 02
- X#endif
- X#ifndef R_OK
- X# define R_OK 04
- X#endif
- X
- X/*
- X * Make sure that MAXPATHLEN is defined.
- X */
- X
- X#ifndef MAXPATHLEN
- X# ifdef _POSIX_PATH_MAX
- X# define MAXPATHLEN _POSIX_PATH_MAX
- X# else
- X# define MAXPATHLEN 2048
- X# endif
- X#endif
- X
- X/*
- X * Define pid_t and uid_t if they're not already defined.
- X */
- X
- X#if ! TCL_PID_T
- X# define pid_t int
- X# define uid_t int
- X#endif
- X
- X/*
- X * Variables provided by the C library:
- X */
- X
- Xextern char **environ;
- X
- X/*
- X * Library procedures used by Tcl but not declared in a header file:
- X */
- X
- Xextern int access _ANSI_ARGS_((CONST char *path, int mode));
- Xextern int chdir _ANSI_ARGS_((CONST char *path));
- Xextern int close _ANSI_ARGS_((int fd));
- Xextern int dup2 _ANSI_ARGS_((int src, int dst));
- Xextern int execvp _ANSI_ARGS_((CONST char *name, char **argv));
- Xextern void _exit _ANSI_ARGS_((int status));
- Xextern pid_t fork _ANSI_ARGS_((void));
- Xextern uid_t geteuid _ANSI_ARGS_((void));
- Xextern pid_t getpid _ANSI_ARGS_((void));
- Xextern char * getcwd _ANSI_ARGS_((char *buffer, int size));
- Xextern char * getwd _ANSI_ARGS_((char *buffer));
- Xextern int kill _ANSI_ARGS_((pid_t pid, int sig));
- Xextern long lseek _ANSI_ARGS_((int fd, int offset, int whence));
- Xextern char * mktemp _ANSI_ARGS_((char *template));
- Xextern int open _ANSI_ARGS_((CONST char *path, int flags, int mode));
- Xextern int pipe _ANSI_ARGS_((int *fdPtr));
- Xextern int read _ANSI_ARGS_((int fd, char *buf, int numBytes));
- Xextern int unlink _ANSI_ARGS_((CONST char *path));
- Xextern int write _ANSI_ARGS_((int fd, char *buf, int numBytes));
- X
- X#endif /* _TCLUNIX */
- END_OF_FILE
- if test 6487 -ne `wc -c <'tcl6.1/tclUnix.h'`; then
- echo shar: \"'tcl6.1/tclUnix.h'\" unpacked with wrong size!
- fi
- # end of 'tcl6.1/tclUnix.h'
- fi
- echo shar: End of archive 5 \(of 33\).
- cp /dev/null ark5isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 33 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-