home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume25 / tcl / part04 < prev    next >
Encoding:
Text File  |  1991-11-14  |  51.8 KB  |  1,883 lines

  1. Newsgroups: comp.sources.misc
  2. From: karl@sugar.neosoft.com (Karl Lehenbauer)
  3. Subject:  v25i072:  tcl - tool command language, version 6.1, Part04/33
  4. Message-ID: <1991Nov14.202646.23389@sparky.imd.sterling.com>
  5. X-Md4-Signature: c385d257411e7c39d39d239dece773d7
  6. Date: Thu, 14 Nov 1991 20:26:46 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: karl@sugar.neosoft.com (Karl Lehenbauer)
  10. Posting-number: Volume 25, Issue 72
  11. Archive-name: tcl/part04
  12. Environment: UNIX
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 4 (of 33)."
  21. # Contents:  tcl6.1/doc/Backslash.man tcl6.1/doc/Concat.man
  22. #   tcl6.1/doc/CrtInterp.man tcl6.1/doc/History.man
  23. #   tcl6.1/doc/TildeSubst.man tcl6.1/tclAssem.c tcl6.1/tests/exec.test
  24. #   tcl6.1/tests/upvar.test
  25. # Wrapped by karl@one on Tue Nov 12 19:44:13 1991
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'tcl6.1/doc/Backslash.man' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'tcl6.1/doc/Backslash.man'\"
  29. else
  30. echo shar: Extracting \"'tcl6.1/doc/Backslash.man'\" \(5407 characters\)
  31. sed "s/^X//" >'tcl6.1/doc/Backslash.man' <<'END_OF_FILE'
  32. X'\" Copyright 1989 Regents of the University of California
  33. X'\" Permission to use, copy, modify, and distribute this
  34. X'\" documentation for any purpose and without fee is hereby
  35. X'\" granted, provided that this notice appears in all copies.
  36. X'\" The University of California makes no representations about
  37. X'\" the suitability of this material for any purpose.  It is
  38. X'\" provided "as is" without express or implied warranty.
  39. X'\" 
  40. X'\" $Header: /user6/ouster/tcl/doc/RCS/Backslash.man,v 1.6 91/05/23 14:11:06 ouster Exp $ SPRITE (Berkeley)
  41. X'\" 
  42. X.\" The definitions below are for supplemental macros used in Sprite
  43. X.\" manual entries.
  44. X.\"
  45. X.\" .HS name section [date [version]]
  46. X.\"    Replacement for .TH in other man pages.  See below for valid
  47. X.\"    section names.
  48. X.\"
  49. X.\" .AP type name in/out [indent]
  50. X.\"    Start paragraph describing an argument to a library procedure.
  51. X.\"    type is type of argument (int, etc.), in/out is either "in", "out",
  52. X.\"    or "in/out" to describe whether procedure reads or modifies arg,
  53. X.\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  54. X.\"    needed;  use .AS below instead)
  55. X.\"
  56. X.\" .AS [type [name]]
  57. X.\"    Give maximum sizes of arguments for setting tab stops.  Type and
  58. X.\"    name are examples of largest possible arguments that will be passed
  59. X.\"    to .AP later.  If args are omitted, default tab stops are used.
  60. X.\"
  61. X.\" .BS
  62. X.\"    Start box enclosure.  From here until next .BE, everything will be
  63. X.\"    enclosed in one large box.
  64. X.\"
  65. X.\" .BE
  66. X.\"    End of box enclosure.
  67. X.\"
  68. X.\" .VS
  69. X.\"    Begin vertical sidebar, for use in marking newly-changed parts
  70. X.\"    of man pages.
  71. X.\"
  72. X.\" .VE
  73. X.\"    End of vertical sidebar.
  74. X.\"
  75. X.\" .DS
  76. X.\"    Begin an indented unfilled display.
  77. X.\"
  78. X.\" .DE
  79. X.\"    End of indented unfilled display.
  80. X.\"
  81. X'    # Heading for Sprite man pages
  82. X.de HS
  83. X.if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
  84. X.if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
  85. X.if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
  86. X.if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
  87. X.if t .wh -1.3i ^B
  88. X.nr ^l \\n(.l
  89. X.ad b
  90. X..
  91. X'    # Start an argument description
  92. X.de AP
  93. X.ie !"\\$4"" .TP \\$4
  94. X.el \{\
  95. X.   ie !"\\$2"" .TP \\n()Cu
  96. X.   el          .TP 15
  97. X.\}
  98. X.ie !"\\$3"" \{\
  99. X.ta \\n()Au \\n()Bu
  100. X\&\\$1    \\fI\\$2\\fP    (\\$3)
  101. X.\".b
  102. X.\}
  103. X.el \{\
  104. X.br
  105. X.ie !"\\$2"" \{\
  106. X\&\\$1    \\fI\\$2\\fP
  107. X.\}
  108. X.el \{\
  109. X\&\\fI\\$1\\fP
  110. X.\}
  111. X.\}
  112. X..
  113. X'    # define tabbing values for .AP
  114. X.de AS
  115. X.nr )A 10n
  116. X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
  117. X.nr )B \\n()Au+15n
  118. X.\"
  119. X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  120. X.nr )C \\n()Bu+\\w'(in/out)'u+2n
  121. X..
  122. X'    # BS - start boxed text
  123. X'    # ^y = starting y location
  124. X'    # ^b = 1
  125. X.de BS
  126. X.br
  127. X.mk ^y
  128. X.nr ^b 1u
  129. X.if n .nf
  130. X.if n .ti 0
  131. X.if n \l'\\n(.lu\(ul'
  132. X.if n .fi
  133. X..
  134. X'    # BE - end boxed text (draw box now)
  135. X.de BE
  136. X.nf
  137. X.ti 0
  138. X.mk ^t
  139. X.ie n \l'\\n(^lu\(ul'
  140. X.el \{\
  141. X.\"    Draw four-sided box normally, but don't draw top of
  142. X.\"    box if the box started on an earlier page.
  143. X.ie !\\n(^b-1 \{\
  144. X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  145. X.\}
  146. X.el \}\
  147. X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  148. X.\}
  149. X.\}
  150. X.fi
  151. X.br
  152. X.nr ^b 0
  153. X..
  154. X'    # VS - start vertical sidebar
  155. X'    # ^Y = starting y location
  156. X'    # ^v = 1 (for troff;  for nroff this doesn't matter)
  157. X.de VS
  158. X.mk ^Y
  159. X.ie n 'mc \s12\(br\s0
  160. X.el .nr ^v 1u
  161. X..
  162. X'    # VE - end of vertical sidebar
  163. X.de VE
  164. X.ie n 'mc
  165. X.el \{\
  166. X.ev 2
  167. X.nf
  168. X.ti 0
  169. X.mk ^t
  170. X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  171. X.sp -1
  172. X.fi
  173. X.ev
  174. X.\}
  175. X.nr ^v 0
  176. X..
  177. X'    # Special macro to handle page bottom:  finish off current
  178. X'    # box/sidebar if in box/sidebar mode, then invoked standard
  179. X'    # page bottom macro.
  180. X.de ^B
  181. X.ev 2
  182. X'ti 0
  183. X'nf
  184. X.mk ^t
  185. X.if \\n(^b \{\
  186. X.\"    Draw three-sided box if this is the box's first page,
  187. X.\"    draw two sides but no top otherwise.
  188. 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
  189. X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  190. X.\}
  191. X.if \\n(^v \{\
  192. X.nr ^x \\n(^tu+1v-\\n(^Yu
  193. X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  194. X.\}
  195. X.bp
  196. X'fi
  197. X.ev
  198. X.if \\n(^b \{\
  199. X.mk ^y
  200. X.nr ^b 2
  201. X.\}
  202. X.if \\n(^v \{\
  203. X.mk ^Y
  204. X.\}
  205. X..
  206. X'    # DS - begin display
  207. X.de DS
  208. X.RS
  209. X.nf
  210. X.sp
  211. X..
  212. X'    # DE - end display
  213. X.de DE
  214. X.fi
  215. X.RE
  216. X.sp .5
  217. X..
  218. X.HS Tcl_Backslash tcl
  219. X.BS
  220. X.SH NAME
  221. XTcl_Backslash \- parse a backslash sequence
  222. X.SH SYNOPSIS
  223. X.nf
  224. X\fB#include <tcl.h>\fR
  225. X.sp
  226. Xchar
  227. X\fBTcl_Backslash\fR(\fIsrc, countPtr\fR)
  228. X.SH ARGUMENTS
  229. X.AP char *src in
  230. XPointer to a string starting with a backslash.
  231. X.AP int *countPtr out
  232. XIf \fIcountPtr\fR isn't NULL, \fI*countPtr\fR gets filled
  233. Xin with number of characters in the backslash sequence, including
  234. Xthe backslash character.
  235. X.BE
  236. X
  237. X.SH DESCRIPTION
  238. X.PP
  239. XThis is a utility procedure used by several of the Tcl
  240. Xcommands.  It parses a backslash sequence and returns
  241. Xthe single character corresponding to the sequence.
  242. X.VS
  243. XIf the backslash sequence should be replaced by no character
  244. Xat all (e.g. backslash-newline) then \fBTcl_Backslash\fR returns 0.
  245. X.VE
  246. X\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number
  247. Xof characters in the backslash sequence.
  248. XIf \fIsrc\fR doesn't point to a backslash
  249. Xsequence understood by Tcl, then Tcl_Backslash returns a backslash
  250. Xas its result and \fI*countPtr\fR gets set to 1 (in this case the
  251. Xbackslash character should not get any special treatment).
  252. X.PP
  253. XSee the Tcl manual entry for information on the valid
  254. Xbackslash sequences.
  255. X.VS
  256. XAll of the sequences described in the Tcl
  257. Xmanual entry are supported by \fBTcl_Backslash\fR.
  258. X.VE
  259. X
  260. X.SH KEYWORDS
  261. Xbackslash, parse
  262. END_OF_FILE
  263. if test 5407 -ne `wc -c <'tcl6.1/doc/Backslash.man'`; then
  264.     echo shar: \"'tcl6.1/doc/Backslash.man'\" unpacked with wrong size!
  265. fi
  266. # end of 'tcl6.1/doc/Backslash.man'
  267. fi
  268. if test -f 'tcl6.1/doc/Concat.man' -a "${1}" != "-c" ; then 
  269.   echo shar: Will not clobber existing file \"'tcl6.1/doc/Concat.man'\"
  270. else
  271. echo shar: Extracting \"'tcl6.1/doc/Concat.man'\" \(5457 characters\)
  272. sed "s/^X//" >'tcl6.1/doc/Concat.man' <<'END_OF_FILE'
  273. X'\" Copyright 1989 Regents of the University of California
  274. X'\" Permission to use, copy, modify, and distribute this
  275. X'\" documentation for any purpose and without fee is hereby
  276. X'\" granted, provided that this notice appears in all copies.
  277. X'\" The University of California makes no representations about
  278. X'\" the suitability of this material for any purpose.  It is
  279. X'\" provided "as is" without express or implied warranty.
  280. X'\" 
  281. X'\" $Header: /user6/ouster/tcl/doc/RCS/Concat.man,v 1.2 91/05/29 14:45:29 ouster Exp $ SPRITE (Berkeley)
  282. X'\" 
  283. X.\" The definitions below are for supplemental macros used in Sprite
  284. X.\" manual entries.
  285. X.\"
  286. X.\" .HS name section [date [version]]
  287. X.\"    Replacement for .TH in other man pages.  See below for valid
  288. X.\"    section names.
  289. X.\"
  290. X.\" .AP type name in/out [indent]
  291. X.\"    Start paragraph describing an argument to a library procedure.
  292. X.\"    type is type of argument (int, etc.), in/out is either "in", "out",
  293. X.\"    or "in/out" to describe whether procedure reads or modifies arg,
  294. X.\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  295. X.\"    needed;  use .AS below instead)
  296. X.\"
  297. X.\" .AS [type [name]]
  298. X.\"    Give maximum sizes of arguments for setting tab stops.  Type and
  299. X.\"    name are examples of largest possible arguments that will be passed
  300. X.\"    to .AP later.  If args are omitted, default tab stops are used.
  301. X.\"
  302. X.\" .BS
  303. X.\"    Start box enclosure.  From here until next .BE, everything will be
  304. X.\"    enclosed in one large box.
  305. X.\"
  306. X.\" .BE
  307. X.\"    End of box enclosure.
  308. X.\"
  309. X.\" .VS
  310. X.\"    Begin vertical sidebar, for use in marking newly-changed parts
  311. X.\"    of man pages.
  312. X.\"
  313. X.\" .VE
  314. X.\"    End of vertical sidebar.
  315. X.\"
  316. X.\" .DS
  317. X.\"    Begin an indented unfilled display.
  318. X.\"
  319. X.\" .DE
  320. X.\"    End of indented unfilled display.
  321. X.\"
  322. X'    # Heading for Sprite man pages
  323. X.de HS
  324. X.if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
  325. X.if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
  326. X.if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
  327. X.if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
  328. X.if t .wh -1.3i ^B
  329. X.nr ^l \\n(.l
  330. X.ad b
  331. X..
  332. X'    # Start an argument description
  333. X.de AP
  334. X.ie !"\\$4"" .TP \\$4
  335. X.el \{\
  336. X.   ie !"\\$2"" .TP \\n()Cu
  337. X.   el          .TP 15
  338. X.\}
  339. X.ie !"\\$3"" \{\
  340. X.ta \\n()Au \\n()Bu
  341. X\&\\$1    \\fI\\$2\\fP    (\\$3)
  342. X.\".b
  343. X.\}
  344. X.el \{\
  345. X.br
  346. X.ie !"\\$2"" \{\
  347. X\&\\$1    \\fI\\$2\\fP
  348. X.\}
  349. X.el \{\
  350. X\&\\fI\\$1\\fP
  351. X.\}
  352. X.\}
  353. X..
  354. X'    # define tabbing values for .AP
  355. X.de AS
  356. X.nr )A 10n
  357. X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
  358. X.nr )B \\n()Au+15n
  359. X.\"
  360. X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  361. X.nr )C \\n()Bu+\\w'(in/out)'u+2n
  362. X..
  363. X'    # BS - start boxed text
  364. X'    # ^y = starting y location
  365. X'    # ^b = 1
  366. X.de BS
  367. X.br
  368. X.mk ^y
  369. X.nr ^b 1u
  370. X.if n .nf
  371. X.if n .ti 0
  372. X.if n \l'\\n(.lu\(ul'
  373. X.if n .fi
  374. X..
  375. X'    # BE - end boxed text (draw box now)
  376. X.de BE
  377. X.nf
  378. X.ti 0
  379. X.mk ^t
  380. X.ie n \l'\\n(^lu\(ul'
  381. X.el \{\
  382. X.\"    Draw four-sided box normally, but don't draw top of
  383. X.\"    box if the box started on an earlier page.
  384. X.ie !\\n(^b-1 \{\
  385. X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  386. X.\}
  387. X.el \}\
  388. X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  389. X.\}
  390. X.\}
  391. X.fi
  392. X.br
  393. X.nr ^b 0
  394. X..
  395. X'    # VS - start vertical sidebar
  396. X'    # ^Y = starting y location
  397. X'    # ^v = 1 (for troff;  for nroff this doesn't matter)
  398. X.de VS
  399. X.mk ^Y
  400. X.ie n 'mc \s12\(br\s0
  401. X.el .nr ^v 1u
  402. X..
  403. X'    # VE - end of vertical sidebar
  404. X.de VE
  405. X.ie n 'mc
  406. X.el \{\
  407. X.ev 2
  408. X.nf
  409. X.ti 0
  410. X.mk ^t
  411. X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  412. X.sp -1
  413. X.fi
  414. X.ev
  415. X.\}
  416. X.nr ^v 0
  417. X..
  418. X'    # Special macro to handle page bottom:  finish off current
  419. X'    # box/sidebar if in box/sidebar mode, then invoked standard
  420. X'    # page bottom macro.
  421. X.de ^B
  422. X.ev 2
  423. X'ti 0
  424. X'nf
  425. X.mk ^t
  426. X.if \\n(^b \{\
  427. X.\"    Draw three-sided box if this is the box's first page,
  428. X.\"    draw two sides but no top otherwise.
  429. 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
  430. X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  431. X.\}
  432. X.if \\n(^v \{\
  433. X.nr ^x \\n(^tu+1v-\\n(^Yu
  434. X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  435. X.\}
  436. X.bp
  437. X'fi
  438. X.ev
  439. X.if \\n(^b \{\
  440. X.mk ^y
  441. X.nr ^b 2
  442. X.\}
  443. X.if \\n(^v \{\
  444. X.mk ^Y
  445. X.\}
  446. X..
  447. X'    # DS - begin display
  448. X.de DS
  449. X.RS
  450. X.nf
  451. X.sp
  452. X..
  453. X'    # DE - end display
  454. X.de DE
  455. X.fi
  456. X.RE
  457. X.sp .5
  458. X..
  459. X.HS Tcl_Concat tcl
  460. X.BS
  461. X.SH NAME
  462. XTcl_Concat \- concatenate a collection of strings
  463. X.SH SYNOPSIS
  464. X.nf
  465. X\fB#include <tcl.h>\fR
  466. X.sp
  467. Xchar *
  468. X\fBTcl_Concat\fR(\fIargc, argv\fR)
  469. X.SH ARGUMENTS
  470. X.AP int argc in
  471. XNumber of strings.
  472. X.AP char *argv[] in
  473. XArray of strings to concatenate.  Must have \fIargc\fR entries.
  474. X.BE
  475. X
  476. X.SH DESCRIPTION
  477. X.PP
  478. X\fBTcl_Concat\fR is a utility procedure used by several of the
  479. XTcl commands.  Given a collection of strings, it concatenates
  480. Xthem together into a single string, with the original strings
  481. Xseparated by spaces.  This procedure behaves differently than
  482. X\fBTcl_Merge\fR, in that the arguments are simply concatenated:
  483. Xno effort is made to ensure proper list structure.
  484. X.VS
  485. XHowever, in most common usage the arguments will all be proper
  486. Xlists themselves;  if this is true, then the result will also have
  487. Xproper list structure.
  488. X.PP
  489. X\fBTcl_Concat\fR eliminates leading and trailing white space as it
  490. Xcopies strings from \fBargv\fR to the result.  If an element of
  491. X\fBargv\fR consists of nothing but white space, then that string
  492. Xis ignored entirely.  This white-space removal was added to make
  493. Xthe output of the \fBconcat\fR command cleaner-looking.
  494. X.VE
  495. X.PP
  496. XThe result string is dynamically allocated
  497. Xusing \fBmalloc()\fR;  the caller must eventually release the space
  498. Xby calling \fBfree()\fR.
  499. X
  500. X.SH KEYWORDS
  501. Xconcatenate, strings
  502. END_OF_FILE
  503. if test 5457 -ne `wc -c <'tcl6.1/doc/Concat.man'`; then
  504.     echo shar: \"'tcl6.1/doc/Concat.man'\" unpacked with wrong size!
  505. fi
  506. # end of 'tcl6.1/doc/Concat.man'
  507. fi
  508. if test -f 'tcl6.1/doc/CrtInterp.man' -a "${1}" != "-c" ; then 
  509.   echo shar: Will not clobber existing file \"'tcl6.1/doc/CrtInterp.man'\"
  510. else
  511. echo shar: Extracting \"'tcl6.1/doc/CrtInterp.man'\" \(5355 characters\)
  512. sed "s/^X//" >'tcl6.1/doc/CrtInterp.man' <<'END_OF_FILE'
  513. X'\" Copyright 1989 Regents of the University of California
  514. X'\" Permission to use, copy, modify, and distribute this
  515. X'\" documentation for any purpose and without fee is hereby
  516. X'\" granted, provided that this notice appears in all copies.
  517. X'\" The University of California makes no representations about
  518. X'\" the suitability of this material for any purpose.  It is
  519. X'\" provided "as is" without express or implied warranty.
  520. X'\" 
  521. X'\" $Header: /user6/ouster/tcl/doc/RCS/CrtInterp.man,v 1.3 91/07/23 21:47:05 ouster Exp $ SPRITE (Berkeley)
  522. X'\" 
  523. X.\" The definitions below are for supplemental macros used in Sprite
  524. X.\" manual entries.
  525. X.\"
  526. X.\" .HS name section [date [version]]
  527. X.\"    Replacement for .TH in other man pages.  See below for valid
  528. X.\"    section names.
  529. X.\"
  530. X.\" .AP type name in/out [indent]
  531. X.\"    Start paragraph describing an argument to a library procedure.
  532. X.\"    type is type of argument (int, etc.), in/out is either "in", "out",
  533. X.\"    or "in/out" to describe whether procedure reads or modifies arg,
  534. X.\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  535. X.\"    needed;  use .AS below instead)
  536. X.\"
  537. X.\" .AS [type [name]]
  538. X.\"    Give maximum sizes of arguments for setting tab stops.  Type and
  539. X.\"    name are examples of largest possible arguments that will be passed
  540. X.\"    to .AP later.  If args are omitted, default tab stops are used.
  541. X.\"
  542. X.\" .BS
  543. X.\"    Start box enclosure.  From here until next .BE, everything will be
  544. X.\"    enclosed in one large box.
  545. X.\"
  546. X.\" .BE
  547. X.\"    End of box enclosure.
  548. X.\"
  549. X.\" .VS
  550. X.\"    Begin vertical sidebar, for use in marking newly-changed parts
  551. X.\"    of man pages.
  552. X.\"
  553. X.\" .VE
  554. X.\"    End of vertical sidebar.
  555. X.\"
  556. X.\" .DS
  557. X.\"    Begin an indented unfilled display.
  558. X.\"
  559. X.\" .DE
  560. X.\"    End of indented unfilled display.
  561. X.\"
  562. X'    # Heading for Sprite man pages
  563. X.de HS
  564. X.if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
  565. X.if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
  566. X.if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
  567. X.if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
  568. X.if t .wh -1.3i ^B
  569. X.nr ^l \\n(.l
  570. X.ad b
  571. X..
  572. X'    # Start an argument description
  573. X.de AP
  574. X.ie !"\\$4"" .TP \\$4
  575. X.el \{\
  576. X.   ie !"\\$2"" .TP \\n()Cu
  577. X.   el          .TP 15
  578. X.\}
  579. X.ie !"\\$3"" \{\
  580. X.ta \\n()Au \\n()Bu
  581. X\&\\$1    \\fI\\$2\\fP    (\\$3)
  582. X.\".b
  583. X.\}
  584. X.el \{\
  585. X.br
  586. X.ie !"\\$2"" \{\
  587. X\&\\$1    \\fI\\$2\\fP
  588. X.\}
  589. X.el \{\
  590. X\&\\fI\\$1\\fP
  591. X.\}
  592. X.\}
  593. X..
  594. X'    # define tabbing values for .AP
  595. X.de AS
  596. X.nr )A 10n
  597. X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
  598. X.nr )B \\n()Au+15n
  599. X.\"
  600. X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  601. X.nr )C \\n()Bu+\\w'(in/out)'u+2n
  602. X..
  603. X'    # BS - start boxed text
  604. X'    # ^y = starting y location
  605. X'    # ^b = 1
  606. X.de BS
  607. X.br
  608. X.mk ^y
  609. X.nr ^b 1u
  610. X.if n .nf
  611. X.if n .ti 0
  612. X.if n \l'\\n(.lu\(ul'
  613. X.if n .fi
  614. X..
  615. X'    # BE - end boxed text (draw box now)
  616. X.de BE
  617. X.nf
  618. X.ti 0
  619. X.mk ^t
  620. X.ie n \l'\\n(^lu\(ul'
  621. X.el \{\
  622. X.\"    Draw four-sided box normally, but don't draw top of
  623. X.\"    box if the box started on an earlier page.
  624. X.ie !\\n(^b-1 \{\
  625. X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  626. X.\}
  627. X.el \}\
  628. X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  629. X.\}
  630. X.\}
  631. X.fi
  632. X.br
  633. X.nr ^b 0
  634. X..
  635. X'    # VS - start vertical sidebar
  636. X'    # ^Y = starting y location
  637. X'    # ^v = 1 (for troff;  for nroff this doesn't matter)
  638. X.de VS
  639. X.mk ^Y
  640. X.ie n 'mc \s12\(br\s0
  641. X.el .nr ^v 1u
  642. X..
  643. X'    # VE - end of vertical sidebar
  644. X.de VE
  645. X.ie n 'mc
  646. X.el \{\
  647. X.ev 2
  648. X.nf
  649. X.ti 0
  650. X.mk ^t
  651. X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  652. X.sp -1
  653. X.fi
  654. X.ev
  655. X.\}
  656. X.nr ^v 0
  657. X..
  658. X'    # Special macro to handle page bottom:  finish off current
  659. X'    # box/sidebar if in box/sidebar mode, then invoked standard
  660. X'    # page bottom macro.
  661. X.de ^B
  662. X.ev 2
  663. X'ti 0
  664. X'nf
  665. X.mk ^t
  666. X.if \\n(^b \{\
  667. X.\"    Draw three-sided box if this is the box's first page,
  668. X.\"    draw two sides but no top otherwise.
  669. 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
  670. X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  671. X.\}
  672. X.if \\n(^v \{\
  673. X.nr ^x \\n(^tu+1v-\\n(^Yu
  674. X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  675. X.\}
  676. X.bp
  677. X'fi
  678. X.ev
  679. X.if \\n(^b \{\
  680. X.mk ^y
  681. X.nr ^b 2
  682. X.\}
  683. X.if \\n(^v \{\
  684. X.mk ^Y
  685. X.\}
  686. X..
  687. X'    # DS - begin display
  688. X.de DS
  689. X.RS
  690. X.nf
  691. X.sp
  692. X..
  693. X'    # DE - end display
  694. X.de DE
  695. X.fi
  696. X.RE
  697. X.sp .5
  698. X..
  699. X.HS Tcl_CreateInterp tcl
  700. X.BS
  701. X.SH NAME
  702. XTcl_CreateInterp, Tcl_DeleteInterp \- create and delete Tcl command interpreters
  703. X.SH SYNOPSIS
  704. X.nf
  705. X\fB#include <tcl.h>\fR
  706. X.sp
  707. XTcl_Interp *
  708. X\fBTcl_CreateInterp\fR()
  709. X.sp
  710. X\fBTcl_DeleteInterp\fR(\fIinterp\fR)
  711. X.SH ARGUMENTS
  712. X.AS Tcl_Interp *interp
  713. X.AP Tcl_Interp *interp in
  714. XToken for interpreter to be destroyed.
  715. X.BE
  716. X
  717. X.SH DESCRIPTION
  718. X.PP
  719. X\fBTcl_CreateInterp\fR creates a new interpreter structure and returns
  720. Xa token for it.  The token is required in calls to most other Tcl
  721. Xprocedures, such as \fBTcl_CreateCommand\fR, \fBTcl_Eval\fR, and
  722. X\fBTcl_DeleteInterp\fR.
  723. XClients are only allowed to access a few of the fields of
  724. XTcl_Interp structures;  see the Tcl_Interp
  725. Xand \fBTcl_CreateCommand\fR man pages for details.
  726. XThe new interpreter is initialized with no defined variables and only
  727. Xthe built-in Tcl commands.  To bind in additional commands, call
  728. X\fBTcl_CreateCommand\fR.
  729. X.PP
  730. X\fBTcl_DeleteInterp\fR destroys a command interpreter and releases all of
  731. Xthe resources associated with it, including variables, procedures,
  732. Xand application-specific command bindings.  After \fBTcl_DeleteInterp\fR
  733. Xreturns the caller should never again use the \fIinterp\fR token.
  734. X
  735. X.SH KEYWORDS
  736. Xcommand, create, delete, interpreter
  737. END_OF_FILE
  738. if test 5355 -ne `wc -c <'tcl6.1/doc/CrtInterp.man'`; then
  739.     echo shar: \"'tcl6.1/doc/CrtInterp.man'\" unpacked with wrong size!
  740. fi
  741. # end of 'tcl6.1/doc/CrtInterp.man'
  742. fi
  743. if test -f 'tcl6.1/doc/History.man' -a "${1}" != "-c" ; then 
  744.   echo shar: Will not clobber existing file \"'tcl6.1/doc/History.man'\"
  745. else
  746. echo shar: Extracting \"'tcl6.1/doc/History.man'\" \(6235 characters\)
  747. sed "s/^X//" >'tcl6.1/doc/History.man' <<'END_OF_FILE'
  748. X'\" Copyright 1989 Regents of the University of California
  749. X'\" Permission to use, copy, modify, and distribute this
  750. X'\" documentation for any purpose and without fee is hereby
  751. X'\" granted, provided that this notice appears in all copies.
  752. X'\" The University of California makes no representations about
  753. X'\" the suitability of this material for any purpose.  It is
  754. X'\" provided "as is" without express or implied warranty.
  755. X'\" 
  756. X'\" $Header: /user6/ouster/tcl/doc/RCS/History.man,v 1.3 91/10/27 14:29:31 ouster Exp $ SPRITE (Berkeley)
  757. X'\" 
  758. X.\" The definitions below are for supplemental macros used in Sprite
  759. X.\" manual entries.
  760. X.\"
  761. X.\" .HS name section [date [version]]
  762. X.\"    Replacement for .TH in other man pages.  See below for valid
  763. X.\"    section names.
  764. X.\"
  765. X.\" .AP type name in/out [indent]
  766. X.\"    Start paragraph describing an argument to a library procedure.
  767. X.\"    type is type of argument (int, etc.), in/out is either "in", "out",
  768. X.\"    or "in/out" to describe whether procedure reads or modifies arg,
  769. X.\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  770. X.\"    needed;  use .AS below instead)
  771. X.\"
  772. X.\" .AS [type [name]]
  773. X.\"    Give maximum sizes of arguments for setting tab stops.  Type and
  774. X.\"    name are examples of largest possible arguments that will be passed
  775. X.\"    to .AP later.  If args are omitted, default tab stops are used.
  776. X.\"
  777. X.\" .BS
  778. X.\"    Start box enclosure.  From here until next .BE, everything will be
  779. X.\"    enclosed in one large box.
  780. X.\"
  781. X.\" .BE
  782. X.\"    End of box enclosure.
  783. X.\"
  784. X.\" .VS
  785. X.\"    Begin vertical sidebar, for use in marking newly-changed parts
  786. X.\"    of man pages.
  787. X.\"
  788. X.\" .VE
  789. X.\"    End of vertical sidebar.
  790. X.\"
  791. X.\" .DS
  792. X.\"    Begin an indented unfilled display.
  793. X.\"
  794. X.\" .DE
  795. X.\"    End of indented unfilled display.
  796. X.\"
  797. X'    # Heading for Sprite man pages
  798. X.de HS
  799. X.if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
  800. X.if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
  801. X.if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
  802. X.if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
  803. X.if t .wh -1.3i ^B
  804. X.nr ^l \\n(.l
  805. X.ad b
  806. X..
  807. X'    # Start an argument description
  808. X.de AP
  809. X.ie !"\\$4"" .TP \\$4
  810. X.el \{\
  811. X.   ie !"\\$2"" .TP \\n()Cu
  812. X.   el          .TP 15
  813. X.\}
  814. X.ie !"\\$3"" \{\
  815. X.ta \\n()Au \\n()Bu
  816. X\&\\$1    \\fI\\$2\\fP    (\\$3)
  817. X.\".b
  818. X.\}
  819. X.el \{\
  820. X.br
  821. X.ie !"\\$2"" \{\
  822. X\&\\$1    \\fI\\$2\\fP
  823. X.\}
  824. X.el \{\
  825. X\&\\fI\\$1\\fP
  826. X.\}
  827. X.\}
  828. X..
  829. X'    # define tabbing values for .AP
  830. X.de AS
  831. X.nr )A 10n
  832. X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
  833. X.nr )B \\n()Au+15n
  834. X.\"
  835. X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  836. X.nr )C \\n()Bu+\\w'(in/out)'u+2n
  837. X..
  838. X'    # BS - start boxed text
  839. X'    # ^y = starting y location
  840. X'    # ^b = 1
  841. X.de BS
  842. X.br
  843. X.mk ^y
  844. X.nr ^b 1u
  845. X.if n .nf
  846. X.if n .ti 0
  847. X.if n \l'\\n(.lu\(ul'
  848. X.if n .fi
  849. X..
  850. X'    # BE - end boxed text (draw box now)
  851. X.de BE
  852. X.nf
  853. X.ti 0
  854. X.mk ^t
  855. X.ie n \l'\\n(^lu\(ul'
  856. X.el \{\
  857. X.\"    Draw four-sided box normally, but don't draw top of
  858. X.\"    box if the box started on an earlier page.
  859. X.ie !\\n(^b-1 \{\
  860. X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  861. X.\}
  862. X.el \}\
  863. X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  864. X.\}
  865. X.\}
  866. X.fi
  867. X.br
  868. X.nr ^b 0
  869. X..
  870. X'    # VS - start vertical sidebar
  871. X'    # ^Y = starting y location
  872. X'    # ^v = 1 (for troff;  for nroff this doesn't matter)
  873. X.de VS
  874. X.mk ^Y
  875. X.ie n 'mc \s12\(br\s0
  876. X.el .nr ^v 1u
  877. X..
  878. X'    # VE - end of vertical sidebar
  879. X.de VE
  880. X.ie n 'mc
  881. X.el \{\
  882. X.ev 2
  883. X.nf
  884. X.ti 0
  885. X.mk ^t
  886. X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  887. X.sp -1
  888. X.fi
  889. X.ev
  890. X.\}
  891. X.nr ^v 0
  892. X..
  893. X'    # Special macro to handle page bottom:  finish off current
  894. X'    # box/sidebar if in box/sidebar mode, then invoked standard
  895. X'    # page bottom macro.
  896. X.de ^B
  897. X.ev 2
  898. X'ti 0
  899. X'nf
  900. X.mk ^t
  901. X.if \\n(^b \{\
  902. X.\"    Draw three-sided box if this is the box's first page,
  903. X.\"    draw two sides but no top otherwise.
  904. 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
  905. X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  906. X.\}
  907. X.if \\n(^v \{\
  908. X.nr ^x \\n(^tu+1v-\\n(^Yu
  909. X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  910. X.\}
  911. X.bp
  912. X'fi
  913. X.ev
  914. X.if \\n(^b \{\
  915. X.mk ^y
  916. X.nr ^b 2
  917. X.\}
  918. X.if \\n(^v \{\
  919. X.mk ^Y
  920. X.\}
  921. X..
  922. X'    # DS - begin display
  923. X.de DS
  924. X.RS
  925. X.nf
  926. X.sp
  927. X..
  928. X'    # DE - end display
  929. X.de DE
  930. X.fi
  931. X.RE
  932. X.sp .5
  933. X..
  934. X.HS Tcl_InitHistory tcl
  935. X.BS
  936. X.SH NAME
  937. XTcl_InitHistory, Tcl_RecordAndEval \- procedures for managing history list
  938. X.SH SYNOPSIS
  939. X.nf
  940. X\fB#include <tcl.h>\fR
  941. X.sp
  942. X.VS
  943. X\fBTcl_InitHistory\fR(\fIinterp\fR)
  944. X.VE
  945. X.sp
  946. Xint
  947. X\fBTcl_RecordAndEval\fR(\fIinterp, cmd, flags\fR)
  948. X.SH ARGUMENTS
  949. X.AS Tcl_Interp *interp;
  950. X.AP Tcl_Interp *interp in
  951. XTcl interpreter in which history facilities are being used.
  952. X.AP char *cmd in
  953. XCommand (or sequence of commands) to execute.
  954. X.AP char flags in
  955. XFlags to pass to \fBTcl_Eval\fR (normally 0).  If -1, then the
  956. Xcommand is not executed;  it's just recorded.
  957. X.BE
  958. X
  959. X.SH DESCRIPTION
  960. X.PP
  961. XThe procedure \fBTcl_HistoryInit\fR is invoked to enable the
  962. X.VS
  963. Xhistory facilities in an interpreter (by default there is no
  964. X\fBhistory\fR command in an interpreter).
  965. XAfter this command has been executed the \fBhistory\fR
  966. Xcommand will be available in \fIinterp\fR and the history facilities
  967. Xwill be initialized.
  968. X\fBTcl_HistoryInit\fR is invoked automatically by
  969. X\fBTcl_RecordAndEval\fR, so it need not be invoked explicitly
  970. Xunless the \fBhistory\fR command is to
  971. Xbe used before \fBTcl_RecordAndEval\fR has been called.
  972. X.VE
  973. X.PP
  974. X\fBTcl_RecordAndEval\fR is invoked to record a command on the history
  975. Xlist and then execute it.  Programs that do not wish to use the history
  976. Xmechanism should not call \fBTcl_RecordAndEval\fR;  they should call
  977. X\fBTcl_Eval\fR instead.  Furthermore, \fBTcl_RecordAndEval\fR should
  978. Xonly be called with top-level commands typed by the user, since the
  979. Xpurpose of history is to allow the user to re-issue recently-invoked
  980. Xcommands.
  981. X.PP
  982. X\fBTcl_RecordAndEval\fR does three things.
  983. XFirst, it calls \fBTcl_HistoryInit\fR to initialize history for the
  984. Xinterpreter \fIinterp\fR, if this hasn't already been done.
  985. XSecond, \fBTcl_RecordAndEval\fR saves \fIcommand\fR in
  986. Xthe history list for \fIinterp\fR, making a new event to hold the
  987. Xcommand.
  988. XThird, \fBTcl_RecordAndEval\fR executes the command by passing it
  989. Xand \fIflags\fR to \fBTcl_Eval\fR.  If \fIflags\fR is -1 then only
  990. Xthe first two steps are taken;  the command will not be executed.
  991. X
  992. X.SH KEYWORDS
  993. Xcommand, event, execute, history, interpreter, record
  994. END_OF_FILE
  995. if test 6235 -ne `wc -c <'tcl6.1/doc/History.man'`; then
  996.     echo shar: \"'tcl6.1/doc/History.man'\" unpacked with wrong size!
  997. fi
  998. # end of 'tcl6.1/doc/History.man'
  999. fi
  1000. if test -f 'tcl6.1/doc/TildeSubst.man' -a "${1}" != "-c" ; then 
  1001.   echo shar: Will not clobber existing file \"'tcl6.1/doc/TildeSubst.man'\"
  1002. else
  1003. echo shar: Extracting \"'tcl6.1/doc/TildeSubst.man'\" \(5835 characters\)
  1004. sed "s/^X//" >'tcl6.1/doc/TildeSubst.man' <<'END_OF_FILE'
  1005. X'\" Copyright 1989 Regents of the University of California
  1006. X'\" Permission to use, copy, modify, and distribute this
  1007. X'\" documentation for any purpose and without fee is hereby
  1008. X'\" granted, provided that this notice appears in all copies.
  1009. X'\" The University of California makes no representations about
  1010. X'\" the suitability of this material for any purpose.  It is
  1011. X'\" provided "as is" without express or implied warranty.
  1012. X'\" 
  1013. X'\" $Header: /user6/ouster/tcl/doc/RCS/TildeSubst.man,v 1.3 91/04/03 15:14:15 ouster Exp $ SPRITE (Berkeley)
  1014. X'\" 
  1015. X.\" The definitions below are for supplemental macros used in Sprite
  1016. X.\" manual entries.
  1017. X.\"
  1018. X.\" .HS name section [date [version]]
  1019. X.\"    Replacement for .TH in other man pages.  See below for valid
  1020. X.\"    section names.
  1021. X.\"
  1022. X.\" .AP type name in/out [indent]
  1023. X.\"    Start paragraph describing an argument to a library procedure.
  1024. X.\"    type is type of argument (int, etc.), in/out is either "in", "out",
  1025. X.\"    or "in/out" to describe whether procedure reads or modifies arg,
  1026. X.\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  1027. X.\"    needed;  use .AS below instead)
  1028. X.\"
  1029. X.\" .AS [type [name]]
  1030. X.\"    Give maximum sizes of arguments for setting tab stops.  Type and
  1031. X.\"    name are examples of largest possible arguments that will be passed
  1032. X.\"    to .AP later.  If args are omitted, default tab stops are used.
  1033. X.\"
  1034. X.\" .BS
  1035. X.\"    Start box enclosure.  From here until next .BE, everything will be
  1036. X.\"    enclosed in one large box.
  1037. X.\"
  1038. X.\" .BE
  1039. X.\"    End of box enclosure.
  1040. X.\"
  1041. X.\" .VS
  1042. X.\"    Begin vertical sidebar, for use in marking newly-changed parts
  1043. X.\"    of man pages.
  1044. X.\"
  1045. X.\" .VE
  1046. X.\"    End of vertical sidebar.
  1047. X.\"
  1048. X.\" .DS
  1049. X.\"    Begin an indented unfilled display.
  1050. X.\"
  1051. X.\" .DE
  1052. X.\"    End of indented unfilled display.
  1053. X.\"
  1054. X'    # Heading for Sprite man pages
  1055. X.de HS
  1056. X.if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
  1057. X.if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
  1058. X.if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
  1059. X.if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
  1060. X.if t .wh -1.3i ^B
  1061. X.nr ^l \\n(.l
  1062. X.ad b
  1063. X..
  1064. X'    # Start an argument description
  1065. X.de AP
  1066. X.ie !"\\$4"" .TP \\$4
  1067. X.el \{\
  1068. X.   ie !"\\$2"" .TP \\n()Cu
  1069. X.   el          .TP 15
  1070. X.\}
  1071. X.ie !"\\$3"" \{\
  1072. X.ta \\n()Au \\n()Bu
  1073. X\&\\$1    \\fI\\$2\\fP    (\\$3)
  1074. X.\".b
  1075. X.\}
  1076. X.el \{\
  1077. X.br
  1078. X.ie !"\\$2"" \{\
  1079. X\&\\$1    \\fI\\$2\\fP
  1080. X.\}
  1081. X.el \{\
  1082. X\&\\fI\\$1\\fP
  1083. X.\}
  1084. X.\}
  1085. X..
  1086. X'    # define tabbing values for .AP
  1087. X.de AS
  1088. X.nr )A 10n
  1089. X.if !"\\$1"" .nr )A \\w'\\$1'u+3n
  1090. X.nr )B \\n()Au+15n
  1091. X.\"
  1092. X.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  1093. X.nr )C \\n()Bu+\\w'(in/out)'u+2n
  1094. X..
  1095. X'    # BS - start boxed text
  1096. X'    # ^y = starting y location
  1097. X'    # ^b = 1
  1098. X.de BS
  1099. X.br
  1100. X.mk ^y
  1101. X.nr ^b 1u
  1102. X.if n .nf
  1103. X.if n .ti 0
  1104. X.if n \l'\\n(.lu\(ul'
  1105. X.if n .fi
  1106. X..
  1107. X'    # BE - end boxed text (draw box now)
  1108. X.de BE
  1109. X.nf
  1110. X.ti 0
  1111. X.mk ^t
  1112. X.ie n \l'\\n(^lu\(ul'
  1113. X.el \{\
  1114. X.\"    Draw four-sided box normally, but don't draw top of
  1115. X.\"    box if the box started on an earlier page.
  1116. X.ie !\\n(^b-1 \{\
  1117. X\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  1118. X.\}
  1119. X.el \}\
  1120. X\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  1121. X.\}
  1122. X.\}
  1123. X.fi
  1124. X.br
  1125. X.nr ^b 0
  1126. X..
  1127. X'    # VS - start vertical sidebar
  1128. X'    # ^Y = starting y location
  1129. X'    # ^v = 1 (for troff;  for nroff this doesn't matter)
  1130. X.de VS
  1131. X.mk ^Y
  1132. X.ie n 'mc \s12\(br\s0
  1133. X.el .nr ^v 1u
  1134. X..
  1135. X'    # VE - end of vertical sidebar
  1136. X.de VE
  1137. X.ie n 'mc
  1138. X.el \{\
  1139. X.ev 2
  1140. X.nf
  1141. X.ti 0
  1142. X.mk ^t
  1143. X\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  1144. X.sp -1
  1145. X.fi
  1146. X.ev
  1147. X.\}
  1148. X.nr ^v 0
  1149. X..
  1150. X'    # Special macro to handle page bottom:  finish off current
  1151. X'    # box/sidebar if in box/sidebar mode, then invoked standard
  1152. X'    # page bottom macro.
  1153. X.de ^B
  1154. X.ev 2
  1155. X'ti 0
  1156. X'nf
  1157. X.mk ^t
  1158. X.if \\n(^b \{\
  1159. X.\"    Draw three-sided box if this is the box's first page,
  1160. X.\"    draw two sides but no top otherwise.
  1161. 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
  1162. X.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  1163. X.\}
  1164. X.if \\n(^v \{\
  1165. X.nr ^x \\n(^tu+1v-\\n(^Yu
  1166. X\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  1167. X.\}
  1168. X.bp
  1169. X'fi
  1170. X.ev
  1171. X.if \\n(^b \{\
  1172. X.mk ^y
  1173. X.nr ^b 2
  1174. X.\}
  1175. X.if \\n(^v \{\
  1176. X.mk ^Y
  1177. X.\}
  1178. X..
  1179. X'    # DS - begin display
  1180. X.de DS
  1181. X.RS
  1182. X.nf
  1183. X.sp
  1184. X..
  1185. X'    # DE - end display
  1186. X.de DE
  1187. X.fi
  1188. X.RE
  1189. X.sp .5
  1190. X..
  1191. X.HS Tcl_TildeSubst tcl
  1192. X.BS
  1193. X.SH NAME
  1194. XTcl_TildeSubst \- replace tilde with home directory in a file name
  1195. X.SH SYNOPSIS
  1196. X.nf
  1197. X\fB#include <tcl.h>\fR
  1198. X.sp
  1199. Xchar *
  1200. X\Tcl_TildeSubst\fR(\fIinterp\fR, \fIname\fR)
  1201. X.SH ARGUMENTS
  1202. X.AP Tcl_Interp *interp in
  1203. XInterpreter in which to report an error, if any.
  1204. X.AP char *name in
  1205. XFile name, which may start with a ``~''.
  1206. X.BE
  1207. X
  1208. X.SH DESCRIPTION
  1209. X.PP
  1210. XThis utility procedure does tilde substition.  If \fIname\fR doesn't
  1211. Xstart with a ``~'' character, then the procedure returns \fIname\fR.
  1212. XIf \fIname\fR does start with a tilde, then \fBTcl_TildeSubst\fR
  1213. Xreturns a new string identical to \fIname\fR except that the first
  1214. Xelement of \fIname\fR is replaced with the location of the home
  1215. Xdirectory for the given user.  The substitution is carried out in
  1216. Xthe same way that it would be done by \fIcsh\fR.  If the tilde is
  1217. Xfollowed immediately by a slash, then the \fB$HOME\fR environment
  1218. Xvariable is substituted.  Otherwise the characters between the
  1219. Xtilde and the next slash are taken as a user name, which is
  1220. Xlooked up in the password file;  the user's home directory is
  1221. Xretrieved from the password file and substituted.
  1222. X.PP
  1223. XThe string returned by \fBTcl_TildeSubst\fR is a static string
  1224. Xbelonging to \fBTcl_TildeSubst\fR.  Its value will only persist
  1225. Xuntil the next call to \fBTcl_TildeSubst\fR;  the caller should
  1226. Xmake a copy of the result if it needs to live a long time.
  1227. X.PP
  1228. XIf an error occurs (e.g. because there was no user by the given
  1229. Xname) then NULL is returned and an error message will be left
  1230. Xat \fIinterp->result\fR.  It is assumed that \fIinterp->result\fR
  1231. Xhas been initialized in the standard way when \fBTcl_TildeSubst\fR
  1232. Xis invoked.
  1233. X
  1234. X.SH KEYWORDS
  1235. Xfile name, home directory, tilde, user
  1236. END_OF_FILE
  1237. if test 5835 -ne `wc -c <'tcl6.1/doc/TildeSubst.man'`; then
  1238.     echo shar: \"'tcl6.1/doc/TildeSubst.man'\" unpacked with wrong size!
  1239. fi
  1240. # end of 'tcl6.1/doc/TildeSubst.man'
  1241. fi
  1242. if test -f 'tcl6.1/tclAssem.c' -a "${1}" != "-c" ; then 
  1243.   echo shar: Will not clobber existing file \"'tcl6.1/tclAssem.c'\"
  1244. else
  1245. echo shar: Extracting \"'tcl6.1/tclAssem.c'\" \(5788 characters\)
  1246. sed "s/^X//" >'tcl6.1/tclAssem.c' <<'END_OF_FILE'
  1247. X/* 
  1248. X * tclAssem.c --
  1249. X *
  1250. X *    This file contains procedures to help assemble Tcl commands
  1251. X *    from an input source  where commands may arrive in pieces, e.g.
  1252. X *    several lines of type-in corresponding to one command.
  1253. X *
  1254. X * Copyright 1990-1991 Regents of the University of California
  1255. X * Permission to use, copy, modify, and distribute this
  1256. X * software and its documentation for any purpose and without
  1257. X * fee is hereby granted, provided that the above copyright
  1258. X * notice appear in all copies.  The University of California
  1259. X * makes no representations about the suitability of this
  1260. X * software for any purpose.  It is provided "as is" without
  1261. X * express or implied warranty.
  1262. X */
  1263. X
  1264. X#ifndef lint
  1265. Xstatic char rcsid[] = "$Header: /sprite/src/lib/tcl/RCS/tclAssem.c,v 1.8 91/09/23 11:22:22 ouster Exp $ SPRITE (Berkeley)";
  1266. X#endif /* not lint */
  1267. X
  1268. X#include "tclInt.h"
  1269. X
  1270. X/*
  1271. X * The structure below is the internal representation for a command
  1272. X * buffer, which is used to hold a piece of a command until a full
  1273. X * command is available.  When a full command is available, it will
  1274. X * be returned to the user, but it will also be retained in the buffer
  1275. X * until the NEXT call to Tcl_AssembleCmd, at which point it will be
  1276. X * removed.
  1277. X */
  1278. X
  1279. Xtypedef struct {
  1280. X    char *buffer;        /* Storage for command being assembled.
  1281. X                 * Malloc-ed, and grows as needed. */
  1282. X    int bufSize;        /* Total number of bytes in buffer. */
  1283. X    int bytesUsed;        /* Number of bytes in buffer currently
  1284. X                 * occupied (0 means there is not a
  1285. X                 * buffered incomplete command). */
  1286. X} CmdBuf;
  1287. X
  1288. X/*
  1289. X * Default amount of space to allocate in command buffer:
  1290. X */
  1291. X
  1292. X#define CMD_BUF_SIZE 100
  1293. X
  1294. X/*
  1295. X *----------------------------------------------------------------------
  1296. X *
  1297. X * Tcl_CreateCmdBuf --
  1298. X *
  1299. X *    Allocate and initialize a command buffer.
  1300. X *
  1301. X * Results:
  1302. X *    The return value is a token that may be passed to
  1303. X *    Tcl_AssembleCmd and Tcl_DeleteCmdBuf.
  1304. X *
  1305. X * Side effects:
  1306. X *    Memory is allocated.
  1307. X *
  1308. X *----------------------------------------------------------------------
  1309. X */
  1310. X
  1311. XTcl_CmdBuf
  1312. XTcl_CreateCmdBuf()
  1313. X{
  1314. X    register CmdBuf *cbPtr;
  1315. X
  1316. X    cbPtr = (CmdBuf *) ckalloc(sizeof(CmdBuf));
  1317. X    cbPtr->buffer = (char *) ckalloc(CMD_BUF_SIZE);
  1318. X    cbPtr->bufSize = CMD_BUF_SIZE;
  1319. X    cbPtr->bytesUsed = 0;
  1320. X    return (Tcl_CmdBuf) cbPtr;
  1321. X}
  1322. X
  1323. X/*
  1324. X *----------------------------------------------------------------------
  1325. X *
  1326. X * Tcl_DeleteCmdBuf --
  1327. X *
  1328. X *    Release all of the resources associated with a command buffer.
  1329. X *    The caller should never again use buffer again.
  1330. X *
  1331. X * Results:
  1332. X *    None.
  1333. X *
  1334. X * Side effects:
  1335. X *    Memory is released.
  1336. X *
  1337. X *----------------------------------------------------------------------
  1338. X */
  1339. X
  1340. Xvoid
  1341. XTcl_DeleteCmdBuf(buffer)
  1342. X    Tcl_CmdBuf buffer;        /* Token for command buffer (return value
  1343. X                 * from previous call to Tcl_CreateCmdBuf). */
  1344. X{
  1345. X    register CmdBuf *cbPtr = (CmdBuf *) buffer;
  1346. X
  1347. X    ckfree(cbPtr->buffer);
  1348. X    ckfree((char *) cbPtr);
  1349. X}
  1350. X
  1351. X/*
  1352. X *----------------------------------------------------------------------
  1353. X *
  1354. X * Tcl_AssembleCmd --
  1355. X *
  1356. X *    This is a utility procedure to assist in situations where
  1357. X *    commands may be read piece-meal from some input source.  Given
  1358. X *    some input text, it adds the text to an input buffer and returns
  1359. X *    whole commands when they are ready.
  1360. X *
  1361. X * Results:
  1362. X *    If the addition of string to any currently-buffered information
  1363. X *    results in one or more complete Tcl commands, then the return value
  1364. X *    is a pointer to the complete command(s).  The command value will
  1365. X *    only be valid until the next call to this procedure with the
  1366. X *    same buffer.  If the addition of string leaves an incomplete
  1367. X *    command at the end of the buffer, then NULL is returned.
  1368. X *
  1369. X * Side effects:
  1370. X *    If string leaves a command incomplete, the partial command
  1371. X *    information is buffered for use in later calls to this procedure.
  1372. X *    Once a command has been returned, that command is deleted from
  1373. X *    the buffer on the next call to this procedure.
  1374. X *
  1375. X *----------------------------------------------------------------------
  1376. X */
  1377. X
  1378. Xchar *
  1379. XTcl_AssembleCmd(buffer, string)
  1380. X    Tcl_CmdBuf buffer;        /* Token for a command buffer previously
  1381. X                 * created by Tcl_CreateCmdBuf.  */
  1382. X    char *string;        /* Bytes to be appended to command stream.
  1383. X                 * Note:  if the string is zero length,
  1384. X                 * then whatever is buffered will be
  1385. X                 * considered to be a complete command
  1386. X                 * regardless of whether parentheses are
  1387. X                 * matched or not. */
  1388. X{
  1389. X    register CmdBuf *cbPtr = (CmdBuf *) buffer;
  1390. X    int length, totalLength;
  1391. X    register char *p;
  1392. X
  1393. X    /*
  1394. X     * If an empty string is passed in, just pretend the current
  1395. X     * command is complete, whether it really is or not.
  1396. X     */
  1397. X
  1398. X    length = strlen(string);
  1399. X    if (length == 0) {
  1400. X    cbPtr->bytesUsed = 0;
  1401. X    return cbPtr->buffer;
  1402. X    }
  1403. X
  1404. X    /*
  1405. X     * Add the new information to the buffer.  If the current buffer
  1406. X     * isn't large enough, grow it by at least a factor of two, or
  1407. X     * enough to hold the new text.
  1408. X     */
  1409. X
  1410. X    length = strlen(string);
  1411. X    totalLength = cbPtr->bytesUsed + length + 1;
  1412. X    if (totalLength > cbPtr->bufSize) {
  1413. X    unsigned int newSize;
  1414. X    char *newBuf;
  1415. X
  1416. X    newSize = cbPtr->bufSize*2;
  1417. X    if (newSize < totalLength) {
  1418. X        newSize = totalLength;
  1419. X    }
  1420. X    newBuf = (char *) ckalloc(newSize);
  1421. X    strcpy(newBuf, cbPtr->buffer);
  1422. X    ckfree(cbPtr->buffer);
  1423. X    cbPtr->buffer = newBuf;
  1424. X    cbPtr->bufSize = newSize;
  1425. X    }
  1426. X    strcpy(cbPtr->buffer+cbPtr->bytesUsed, string);
  1427. X    cbPtr->bytesUsed += length;
  1428. X
  1429. X    /*
  1430. X     * See if there is now a complete command in the buffer.
  1431. X     */
  1432. X
  1433. X    p = cbPtr->buffer;
  1434. X    while (1) {
  1435. X    int gotNewLine = 0;
  1436. X
  1437. X    while (isspace(*p)) {
  1438. X        if (*p == '\n') {
  1439. X        gotNewLine = 1;
  1440. X        }
  1441. X        p++;
  1442. X    }
  1443. X    if (*p == 0) {
  1444. X        if (gotNewLine) {
  1445. X        cbPtr->bytesUsed = 0;
  1446. X        return cbPtr->buffer;
  1447. X        }
  1448. X        return NULL;
  1449. X    }
  1450. X    p = TclWordEnd(p, 0);
  1451. X    }
  1452. X}
  1453. END_OF_FILE
  1454. if test 5788 -ne `wc -c <'tcl6.1/tclAssem.c'`; then
  1455.     echo shar: \"'tcl6.1/tclAssem.c'\" unpacked with wrong size!
  1456. fi
  1457. # end of 'tcl6.1/tclAssem.c'
  1458. fi
  1459. if test -f 'tcl6.1/tests/exec.test' -a "${1}" != "-c" ; then 
  1460.   echo shar: Will not clobber existing file \"'tcl6.1/tests/exec.test'\"
  1461. else
  1462. echo shar: Extracting \"'tcl6.1/tests/exec.test'\" \(6291 characters\)
  1463. sed "s/^X//" >'tcl6.1/tests/exec.test' <<'END_OF_FILE'
  1464. X# Commands covered:  exec
  1465. X#
  1466. X# This file contains a collection of tests for one or more of the Tcl
  1467. X# built-in commands.  Sourcing this file into Tcl runs the tests and
  1468. X# generates output for errors.  No output means no errors were found.
  1469. X#
  1470. X# Copyright 1991 Regents of the University of California
  1471. X# Permission to use, copy, modify, and distribute this
  1472. X# software and its documentation for any purpose and without
  1473. X# fee is hereby granted, provided that this copyright notice
  1474. X# appears in all copies.  The University of California makes no
  1475. X# representations about the suitability of this software for any
  1476. X# purpose.  It is provided "as is" without express or implied
  1477. X# warranty.
  1478. X#
  1479. X# $Header: /sprite/src/lib/tcl/tests/RCS/exec.test,v 1.16 91/09/11 17:29:55 ouster Exp $ (Berkeley)
  1480. X
  1481. Xif {[string compare test [info procs test]] == 1} then {source defs}
  1482. X
  1483. X# Basic operations.
  1484. X
  1485. Xtest exec-1.1 {basic exec operation} {
  1486. X    exec echo a b c
  1487. X} "a b c"
  1488. Xtest exec-1.2 {pipelining} {
  1489. X    exec echo a b c d | cat | cat
  1490. X} "a b c d"
  1491. Xtest exec-1.3 {pipelining} {
  1492. X    set a [exec echo a b c d | cat | wc]
  1493. X    list [scan $a "%d %d %d" b c d] $b $c $d
  1494. X} {3 1 4 8}
  1495. X
  1496. X# I/O redirection: input from Tcl command.
  1497. X
  1498. Xtest exec-2.1 {redirecting input from immediate source} {
  1499. X    exec cat << "Sample text"
  1500. X} {Sample text}
  1501. Xtest exec-2.2 {redirecting input from immediate source} {
  1502. X    exec << "Sample text" cat | cat
  1503. X} {Sample text}
  1504. Xtest exec-2.3 {redirecting input from immediate source} {
  1505. X    exec cat << "Sample text" | cat
  1506. X} {Sample text}
  1507. Xtest exec-2.4 {redirecting input from immediate source} {
  1508. X    exec  cat | cat << "Sample text"
  1509. X} {Sample text}
  1510. X
  1511. X# I/O redirection: output to file.
  1512. X
  1513. Xcatch [exec rm -f gorp.file]
  1514. Xtest exec-3.1 {redirecting output to file} {
  1515. X    exec echo "Some simple words" > gorp.file
  1516. X    exec cat gorp.file
  1517. X} "Some simple words"
  1518. Xtest exec-3.2 {redirecting output to file} {
  1519. X    exec echo "More simple words" | > gorp.file cat | cat
  1520. X    exec cat gorp.file
  1521. X} "More simple words"
  1522. Xtest exec-3.3 {redirecting output to file} {
  1523. X    exec > gorp.file echo "Different simple words" | cat | cat
  1524. X    exec cat gorp.file
  1525. X} "Different simple words"
  1526. X
  1527. X# I/O redirection: input from file.
  1528. X
  1529. Xexec echo "Just a few thoughts" > gorp.file
  1530. Xtest exec-4.1 {redirecting input from file} {
  1531. X    exec cat < gorp.file
  1532. X} {Just a few thoughts}
  1533. Xtest exec-4.2 {redirecting input from file} {
  1534. X    exec cat | cat < gorp.file
  1535. X} {Just a few thoughts}
  1536. Xtest exec-4.3 {redirecting input from file} {
  1537. X    exec cat < gorp.file | cat
  1538. X} {Just a few thoughts}
  1539. Xtest exec-4.4 {redirecting input from file} {
  1540. X    exec < gorp.file cat | cat
  1541. X} {Just a few thoughts}
  1542. X
  1543. X# I/O redirection: combinations.
  1544. X
  1545. Xcatch {exec rm -f gorp.file2}
  1546. Xtest exec-5.1 {multiple I/O redirections} {
  1547. X    exec << "command input" > gorp.file2 cat < gorp.file
  1548. X    exec cat gorp.file2
  1549. X} {Just a few thoughts}
  1550. Xtest exec-5.2 {multiple I/O redirections} {
  1551. X    exec < gorp.file << "command input" cat
  1552. X} {command input}
  1553. X
  1554. X# Long input to command and output from command.
  1555. X
  1556. Xset a "0123456789 xxxxxxxxx abcdefghi ABCDEFGHIJK\n"
  1557. Xset a [concat $a $a $a $a]
  1558. Xset a [concat $a $a $a $a]
  1559. Xset a [concat $a $a $a $a]
  1560. Xset a [concat $a $a $a $a]
  1561. Xtest exec-6.1 {long input and output} {
  1562. X    exec cat << $a
  1563. X} $a
  1564. X
  1565. X# Commands that return errors.
  1566. X
  1567. Xtest exec-7.1 {commands returning errors} {
  1568. X    set x [catch {exec gorp} msg]
  1569. X    list $x $msg [lindex $errorCode 0] [lrange $errorCode 2 end]
  1570. X} {1 {couldn't find "gorp" to execute} CHILDSTATUS 1}
  1571. Xtest exec-7.2 {commands returning errors} {
  1572. X    set x [catch {exec foo | gorp} msg]
  1573. X    set x1 {couldn't find "foo" to execute
  1574. Xcouldn't find "gorp" to execute}
  1575. X    set x2 {couldn't find "gorp" to execute
  1576. Xcouldn't find "foo" to execute}
  1577. X    set y [expr {($msg == $x1) || ($msg == $x2)}]
  1578. X    list $x $y [lindex $errorCode 0] [lrange $errorCode 2 end]
  1579. X} {1 1 CHILDSTATUS 1}
  1580. Xtest exec-7.3 {commands returning errors} {
  1581. X    list [catch {exec sleep 1 | sh -c "exit 43" | sleep 1} msg] $msg
  1582. X} {1 {}}
  1583. Xtest exec-7.4 {commands returning errors} {
  1584. X    list [catch {exec gorp | echo a b c} msg] $msg
  1585. X} {1 {a b c
  1586. Xcouldn't find "gorp" to execute}}
  1587. X
  1588. X# Errors in executing the Tcl command, as opposed to errors in the
  1589. X# processes that are invoked.
  1590. X
  1591. Xtest exec-8.1 {errors in exec invocation} {
  1592. X    list [catch {exec} msg] $msg
  1593. X} {1 {didn't specify command to execute}}
  1594. Xtest exec-8.2 {errors in exec invocation} {
  1595. X    list [catch {exec | cat} msg] $msg
  1596. X} {1 {illegal use of | in command}}
  1597. Xtest exec-8.3 {errors in exec invocation} {
  1598. X    list [catch {exec cat |} msg] $msg
  1599. X} {1 {illegal use of | in command}}
  1600. Xtest exec-8.4 {errors in exec invocation} {
  1601. X    list [catch {exec cat | | cat} msg] $msg
  1602. X} {1 {illegal use of | in command}}
  1603. Xtest exec-8.5 {errors in exec invocation} {
  1604. X    list [catch {exec cat <} msg] $msg
  1605. X} {1 {can't specify "<" as last word in command}}
  1606. Xtest exec-8.6 {errors in exec invocation} {
  1607. X    list [catch {exec cat >} msg] $msg
  1608. X} {1 {can't specify ">" as last word in command}}
  1609. Xtest exec-8.7 {errors in exec invocation} {
  1610. X    list [catch {exec cat <<} msg] $msg
  1611. X} {1 {can't specify "<<" as last word in command}}
  1612. Xtest exec-8.8 {errors in exec invocation} {
  1613. X    list [catch {exec cat < a/b/c} msg] [string tolower $msg]
  1614. X} {1 {couldn't read file "a/b/c": no such file or directory}}
  1615. Xtest exec-8.9 {errors in exec invocation} {
  1616. X    list [catch {exec cat << foo > a/b/c} msg] [string tolower $msg]
  1617. X} {1 {couldn't write file "a/b/c": no such file or directory}}
  1618. X
  1619. X# Commands in background.
  1620. X
  1621. Xtest exec-9.1 {commands in background} {
  1622. X    set x [lindex [time {exec sleep 5 &}] 0]
  1623. X    expr $x<1000000
  1624. X} 1
  1625. Xtest exec-9.2 {commands in background} {
  1626. X    list [catch {exec echo a &b} msg] $msg
  1627. X} {0 {a &b}}
  1628. X
  1629. X# Make sure "errorCode" is set correctly.
  1630. X
  1631. Xtest exec-10.1 {setting errorCode variable} {
  1632. X    list [catch {exec cat < a/b/c} msg] [string tolower $errorCode]
  1633. X} {1 {unix enoent {no such file or directory}}}
  1634. Xtest exec-10.2 {setting errorCode variable} {
  1635. X    list [catch {exec cat > a/b/c} msg] [string tolower $errorCode]
  1636. X} {1 {unix enoent {no such file or directory}}}
  1637. Xtest exec-10.3 {setting errorCode variable} {
  1638. X    set x [catch {exec _weirdo_command_} msg]
  1639. X    list $x $msg [lindex $errorCode 0] [lrange $errorCode 2 end]
  1640. X} {1 {couldn't find "_weirdo_command_" to execute} CHILDSTATUS 1}
  1641. X
  1642. Xcatch {exec rm -f gorp.file}
  1643. Xcatch {exec rm -f gorp.file2}
  1644. Xreturn {}
  1645. END_OF_FILE
  1646. if test 6291 -ne `wc -c <'tcl6.1/tests/exec.test'`; then
  1647.     echo shar: \"'tcl6.1/tests/exec.test'\" unpacked with wrong size!
  1648. fi
  1649. # end of 'tcl6.1/tests/exec.test'
  1650. fi
  1651. if test -f 'tcl6.1/tests/upvar.test' -a "${1}" != "-c" ; then 
  1652.   echo shar: Will not clobber existing file \"'tcl6.1/tests/upvar.test'\"
  1653. else
  1654. echo shar: Extracting \"'tcl6.1/tests/upvar.test'\" \(5410 characters\)
  1655. sed "s/^X//" >'tcl6.1/tests/upvar.test' <<'END_OF_FILE'
  1656. X# Commands covered:  upvar
  1657. X#
  1658. X# This file contains a collection of tests for one or more of the Tcl
  1659. X# built-in commands.  Sourcing this file into Tcl runs the tests and
  1660. X# generates output for errors.  No output means no errors were found.
  1661. X#
  1662. X# Copyright 1991 Regents of the University of California
  1663. X# Permission to use, copy, modify, and distribute this
  1664. X# software and its documentation for any purpose and without
  1665. X# fee is hereby granted, provided that this copyright notice
  1666. X# appears in all copies.  The University of California makes no
  1667. X# representations about the suitability of this software for any
  1668. X# purpose.  It is provided "as is" without express or implied
  1669. X# warranty.
  1670. X#
  1671. X# $Header: /sprite/src/lib/tcl/tests/RCS/upvar.test,v 1.1 91/10/03 16:47:56 ouster Exp $ (Berkeley)
  1672. X
  1673. Xif {[string compare test [info procs test]] == 1} then {source defs}
  1674. X
  1675. Xtest upvar-1.1 {reading variables with upvar} {
  1676. X    proc p1 {a b} {set c 22; set d 33; p2}
  1677. X    proc p2 {} {upvar a x1 b x2 c x3 d x4; set a abc; list $x1 $x2 $x3 $x4 $a}
  1678. X    p1 foo bar
  1679. X} {foo bar 22 33 abc}
  1680. Xtest upvar-1.2 {reading variables with upvar} {
  1681. X    proc p1 {a b} {set c 22; set d 33; p2}
  1682. X    proc p2 {} {p3}
  1683. X    proc p3 {} {upvar 2 a x1 b x2 c x3 d x4; set a abc; list $x1 $x2 $x3 $x4 $a}
  1684. X    p1 foo bar
  1685. X} {foo bar 22 33 abc}
  1686. Xtest upvar-1.3 {reading variables with upvar} {
  1687. X    proc p1 {a b} {set c 22; set d 33; p2}
  1688. X    proc p2 {} {p3}
  1689. X    proc p3 {} {
  1690. X    upvar #1 a x1 b x2 c x3 d x4
  1691. X    set a abc
  1692. X    list $x1 $x2 $x3 $x4 $a
  1693. X    }
  1694. X    p1 foo bar
  1695. X} {foo bar 22 33 abc}
  1696. Xtest upvar-1.4 {reading variables with upvar} {
  1697. X    set x1 44
  1698. X    set x2 55
  1699. X    proc p1 {} {p2}
  1700. X    proc p2 {} {
  1701. X    upvar 2 x1 x1 x2 a
  1702. X    upvar #0 x1 b
  1703. X    set c $b
  1704. X    incr b 3
  1705. X    list $x1 $a $b
  1706. X    }
  1707. X    p1
  1708. X} {47 55 47}
  1709. X
  1710. Xtest upvar-2.1 {writing variables with upvar} {
  1711. X    proc p1 {a b} {set c 22; set d 33; p2; list $a $b $c $d}
  1712. X    proc p2 {} {
  1713. X    upvar a x1 b x2 c x3 d x4
  1714. X    set x1 14
  1715. X    set x4 88
  1716. X    }
  1717. X    p1 foo bar
  1718. X} {14 bar 22 88}
  1719. Xtest upvar-2.2 {writing variables with upvar} {
  1720. X    set x1 44
  1721. X    set x2 55
  1722. X    proc p1 {x1 x2} {
  1723. X    upvar #0 x1 a
  1724. X    upvar x2 b
  1725. X    set a $x1
  1726. X    set b $x2
  1727. X    }
  1728. X    p1 newbits morebits
  1729. X    list $x1 $x2
  1730. X} {newbits morebits}
  1731. Xtest upvar-2.3 {writing variables with upvar} {
  1732. X    catch {unset x1}
  1733. X    catch {unset x2}
  1734. X    proc p1 {x1 x2} {
  1735. X    upvar #0 x1 a
  1736. X    upvar x2 b
  1737. X    set a $x1
  1738. X    set b $x2
  1739. X    }
  1740. X    p1 newbits morebits
  1741. X    list [catch {set x1} msg] $msg [catch {set x2} msg] $msg
  1742. X} {0 newbits 0 morebits}
  1743. X
  1744. Xtest upvar-3.1 {unsetting variables with upvar} {
  1745. X    proc p1 {a b} {set c 22; set d 33; p2; lsort [info vars]}
  1746. X    proc p2 {} {
  1747. X    upvar 1 a x1 d x2
  1748. X    unset x1 x2
  1749. X    }
  1750. X    p1 foo bar
  1751. X} {b c}
  1752. Xtest upvar-3.2 {unsetting variables with upvar} {
  1753. X    proc p1 {a b} {set c 22; set d 33; p2; lsort [info vars]}
  1754. X    proc p2 {} {
  1755. X    upvar 1 a x1 d x2
  1756. X    unset x1 x2
  1757. X    set x2 28
  1758. X    }
  1759. X    p1 foo bar
  1760. X} {b c d}
  1761. Xtest upvar-3.3 {unsetting variables with upvar} {
  1762. X    set x1 44
  1763. X    set x2 55
  1764. X    proc p1 {} {p2}
  1765. X    proc p2 {} {
  1766. X    upvar 2 x1 a
  1767. X    upvar #0 x2 b
  1768. X    unset a b
  1769. X    }
  1770. X    p1
  1771. X    list [info exists x1] [info exists x2]
  1772. X} {0 0}
  1773. Xtest upvar-3.4 {unsetting variables with upvar} {
  1774. X    set x1 44
  1775. X    set x2 55
  1776. X    proc p1 {} {
  1777. X    upvar x1 a x2 b
  1778. X    unset a b
  1779. X    set b 118
  1780. X    }
  1781. X    p1
  1782. X    list [info exists x1] [catch {set x2} msg] $msg
  1783. X} {0 0 118}
  1784. X
  1785. Xtest upvar-4.1 {nested upvars} {
  1786. X    set x1 88
  1787. X    proc p1 {a b} {set c 22; set d 33; p2}
  1788. X    proc p2 {} {global x1; upvar c x2; p3}
  1789. X    proc p3 {} {
  1790. X    upvar x1 a x2 b
  1791. X    list $a $b
  1792. X    }
  1793. X    p1 14 15
  1794. X} {88 22}
  1795. Xtest upvar-4.2 {nested upvars} {
  1796. X    set x1 88
  1797. X    proc p1 {a b} {set c 22; set d 33; p2; list $a $b $c $d}
  1798. X    proc p2 {} {global x1; upvar c x2; p3}
  1799. X    proc p3 {} {
  1800. X    upvar x1 a x2 b
  1801. X    set a foo
  1802. X    set b bar
  1803. X    }
  1804. X    list [p1 14 15] $x1
  1805. X} {{14 15 bar 33} foo}
  1806. X
  1807. Xproc tproc {args} {global x; set x [list $args [uplevel info vars]]}
  1808. Xtest upvar-5.1 {traces involving upvars} {
  1809. X    proc p1 {a b} {set c 22; set d 33; trace var c rw tproc; p2}
  1810. X    proc p2 {} {upvar c x1; set x1 22}
  1811. X    set x ---
  1812. X    p1 foo bar
  1813. X    set x
  1814. X} {{x1 {} w} x1}
  1815. Xtest upvar-5.2 {traces involving upvars} {
  1816. X    proc p1 {a b} {set c 22; set d 33; trace var c rw tproc; p2}
  1817. X    proc p2 {} {upvar c x1; set x1}
  1818. X    set x ---
  1819. X    p1 foo bar
  1820. X    set x
  1821. X} {{x1 {} r} x1}
  1822. Xtest upvar-5.3 {traces involving upvars} {
  1823. X    proc p1 {a b} {set c 22; set d 33; trace var c rwu tproc; p2}
  1824. X    proc p2 {} {upvar c x1; unset x1}
  1825. X    set x ---
  1826. X    p1 foo bar
  1827. X    set x
  1828. X} {{x1 {} u} x1}
  1829. X
  1830. Xtest upvar-6.1 {errors in upvar command} {
  1831. X    list [catch upvar msg] $msg
  1832. X} {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
  1833. Xtest upvar-6.2 {errors in upvar command} {
  1834. X    list [catch {upvar 1} msg] $msg
  1835. X} {1 {wrong # args: should be "upvar ?level? otherVar localVar ?otherVar localVar ...?"}}
  1836. Xtest upvar-6.3 {errors in upvar command} {
  1837. X    list [catch {upvar a b} msg] $msg
  1838. X} {1 {already at top level}}
  1839. Xtest upvar-6.4 {errors in upvar command} {
  1840. X    list [catch {upvar 1 a b} msg] $msg
  1841. X} {1 {already at top level}}
  1842. Xtest upvar-6.5 {errors in upvar command} {
  1843. X    list [catch {upvar #0 a b} msg] $msg
  1844. X} {1 {already at top level}}
  1845. Xtest upvar-6.6 {errors in upvar command} {
  1846. X    proc p1 {} {upvar a b c}
  1847. X    list [catch p1 msg] $msg
  1848. X} {1 {wrong # args: should be "a ?level? otherVar localVar ?otherVar localVar ...?"}}
  1849. Xtest upvar-6.7 {errors in upvar command} {
  1850. X    proc p1 {} {set a 33; upvar b a}
  1851. X    list [catch p1 msg] $msg
  1852. X} {1 {variable "a" already exists}}
  1853. END_OF_FILE
  1854. if test 5410 -ne `wc -c <'tcl6.1/tests/upvar.test'`; then
  1855.     echo shar: \"'tcl6.1/tests/upvar.test'\" unpacked with wrong size!
  1856. fi
  1857. # end of 'tcl6.1/tests/upvar.test'
  1858. fi
  1859. echo shar: End of archive 4 \(of 33\).
  1860. cp /dev/null ark4isdone
  1861. MISSING=""
  1862. 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
  1863.     if test ! -f ark${I}isdone ; then
  1864.     MISSING="${MISSING} ${I}"
  1865.     fi
  1866. done
  1867. if test "${MISSING}" = "" ; then
  1868.     echo You have unpacked all 33 archives.
  1869.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1870. else
  1871.     echo You still need to unpack the following archives:
  1872.     echo "        " ${MISSING}
  1873. fi
  1874. ##  End of shell archive.
  1875. exit 0
  1876.  
  1877. exit 0 # Just in case...
  1878. -- 
  1879. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1880. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1881. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1882. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1883.