home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume26 / tclx / part05 < prev    next >
Encoding:
Text File  |  1991-11-19  |  51.4 KB  |  1,245 lines

  1. Newsgroups: comp.sources.misc
  2. From: karl@sugar.neosoft.com (Karl Lehenbauer)
  3. Subject:  v26i005:  tclx - extensions and on-line help for tcl 6.1, Part05/23
  4. Message-ID: <1991Nov19.005335.8579@sparky.imd.sterling.com>
  5. X-Md4-Signature: 21013718e86bb22fa746a43517978782
  6. Date: Tue, 19 Nov 1991 00:53:35 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: karl@sugar.neosoft.com (Karl Lehenbauer)
  10. Posting-number: Volume 26, Issue 5
  11. Archive-name: tclx/part05
  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 5 (of 23)."
  21. # Contents:  extended/src/Makefile.org extended/tcllib/buildidx.tcl
  22. #   extended/tcllib/help/commands/error
  23. #   extended/tcllib/help/commands/upvar
  24. #   extended/tcllib/help/extended/cmdtrace
  25. #   extended/tcllib/help/extended/fcntl
  26. #   extended/tcllib/help/extended/fmtclock
  27. #   extended/tcllib/help/extended/id
  28. #   extended/tcllib/help/extended/loop
  29. #   extended/tcllib/help/extended/select
  30. #   extended/tcllib/help/extended/signal extended/tcllib/help/help
  31. #   extended/tcllib/help/intro/braces
  32. #   extended/tcllib/help/intro/brackets
  33. #   extended/tcllib/help/tclshell/initialize
  34. #   extended/tcllib/help/tclshell/variables
  35. #   extended/tests/forrecur.test extended/tests/globrecur.test
  36. #   extended/tests/list.test extended/tests/math.test
  37. # Wrapped by karl@one on Wed Nov 13 21:50:15 1991
  38. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  39. if test -f 'extended/src/Makefile.org' -a "${1}" != "-c" ; then 
  40.   echo shar: Will not clobber existing file \"'extended/src/Makefile.org'\"
  41. else
  42. echo shar: Extracting \"'extended/src/Makefile.org'\" \(1639 characters\)
  43. sed "s/^X//" >'extended/src/Makefile.org' <<'END_OF_FILE'
  44. X#=======================================================================
  45. X#
  46. X#  WARNING: This macro definition section of this Makefile
  47. X#           is built by the configuration script.
  48. X#
  49. XC_FLAGS= -g
  50. XRANLIB=true
  51. XLINKFLAGS=-lc_s -lm
  52. XSTRIP=true
  53. XMCS=true
  54. XDEFAULTFILE=-DDEFAULTFILE=\"/etc/default/tcl\"
  55. X#-----------------------------------------------------------------------
  56. X
  57. X#==============================================================================
  58. X#
  59. X# Portable makefile for TCL extended commands sources.
  60. X# This section of this Makefile is extracted from Makefile.t by Configure.
  61. X#
  62. X# @(#) Makefile.t 2.3 10/2/90
  63. X#
  64. X#------------------------------------------------------------------------------
  65. X
  66. XSHELL=/bin/sh
  67. X
  68. XOBJS= \
  69. X        chmod.o        clock.o        cmdloop.o      debug.o \
  70. X    extendUtil.o   filescan.o     fmath.o        general.o      handles.o \
  71. X    id.o           iocmds.o       list.o         main.o         math.o \
  72. X    matherr.o      regexputil.o   signal.o       string.o       tclstartup.o \
  73. X    unixcmds.o
  74. X
  75. XBASEDIR= ../..
  76. X
  77. XCFLAGS= -I../../baseline ${C_FLAGS} ${GLOBAL_DEFS}
  78. X
  79. Xall: ${BASEDIR}/tcl
  80. X
  81. X${BASEDIR}/tcl:    $(BASEDIR)/libtcl.a $(OBJS) main.o
  82. X    cc ${CFLAGS} main.o ${BASEDIR}/libtcl.a ${LINKFLAGS} -o ${BASEDIR}/tcl
  83. X    $(STRIP) ${BASEDIR}/tcl
  84. X    $(MCS) ${BASEDIR}/tcl
  85. X
  86. Xmain.o: patchlevel.h Makefile
  87. X    cc -c ${CFLAGS} ${DEFAULTFILE} main.c
  88. X
  89. X${BASEDIR}/libtcl.a: $(OBJS) 
  90. X    ar cru ${BASEDIR}/libtcl.a $(OBJS)
  91. X    $(RANLIB) ${BASEDIR}/libtcl.a
  92. X
  93. X#
  94. X# This is just to test if it compiles.
  95. X#
  96. Xtcl++:
  97. X    CC -c -I../baseline tcl++.C
  98. X    -rm -f tcl++.o
  99. Xclean:
  100. X    -rm -f *.o
  101. X    -rm -f ../tcl
  102. X    -rm -f tcl++.o
  103. X
  104. Xrealclean: clean
  105. X    -rm -f Makefile
  106. X
  107. X
  108. END_OF_FILE
  109. if test 1639 -ne `wc -c <'extended/src/Makefile.org'`; then
  110.     echo shar: \"'extended/src/Makefile.org'\" unpacked with wrong size!
  111. fi
  112. # end of 'extended/src/Makefile.org'
  113. fi
  114. if test -f 'extended/tcllib/buildidx.tcl' -a "${1}" != "-c" ; then 
  115.   echo shar: Will not clobber existing file \"'extended/tcllib/buildidx.tcl'\"
  116. else
  117. echo shar: Extracting \"'extended/tcllib/buildidx.tcl'\" \(2055 characters\)
  118. sed "s/^X//" >'extended/tcllib/buildidx.tcl' <<'END_OF_FILE'
  119. X#
  120. X# Code to build Tcl package library. Defines the proc `buildpackageindex'.
  121. X#
  122. Xproc TCHSH:PutLibLine {outfp package libfile where endwhere autoprocs} {
  123. X    puts $outfp [format "TCLSH:defpkg %s %s %s %s %s" $package $libfile \
  124. X                        $where [expr {$endwhere - $where - 1}] $autoprocs]
  125. X}
  126. X
  127. X
  128. Xproc TCLSH:CreateLibIndex {libName} {
  129. X
  130. X    if {[file extension $libName] != ".tlib"} {
  131. X        error "Package library `$libName' does not have the extension `.tlib'"}
  132. X    set idxName "[file root $libName].tndx"
  133. X    if {(![file writable [file dirname $idxName]]) ||
  134. X            ([file exists $idxName] && (![file writable $idxName]))} {
  135. X        error "No write access to build package index: `$idxName'"}
  136. X    set libFH [open $libName r]
  137. X    set idxFH [open $idxName w]
  138. X
  139. X    set contectHdl [scancontext create]
  140. X
  141. X    scanmatch $contectHdl "^#@package: " {
  142. X        set size [llength $matchInfo(line)]
  143. X        if {$size < 2} {
  144. X            error [format "invalid package header \"%s\"" $matchInfo(line)]
  145. X        }
  146. X        if {[info exists pkgDefName]} {
  147. X            TCHSH:PutLibLine $idxFH $pkgDefName $libName $pkgDefWhere \
  148. X                             $matchInfo(offset) $pkgDefProcs
  149. X        }
  150. X        set pkgDefName   [lindex $matchInfo(line) 1]
  151. X        set pkgDefWhere  [tell $matchInfo(handle)]
  152. X        set pkgDefProcs  [lrange $matchInfo(line) 2 end]
  153. X    }
  154. X
  155. X    scanfile $contectHdl $libFH
  156. X
  157. X    TCHSH:PutLibLine $idxFH $pkgDefName $libName $pkgDefWhere [tell $libFH] \
  158. X                     $pkgDefProcs
  159. X    close $libFH
  160. X    close $idxFH
  161. X    
  162. X    scancontext delete $contectHdl
  163. X
  164. X    # Set mode and ownership of the index to be the same as the library.
  165. X
  166. X    file stat $libName statInfo
  167. X    chmod -i $statInfo(mode) $idxName
  168. X    chown [list $statInfo(uid) $statInfo(gid)] $idxName
  169. X
  170. X}
  171. X
  172. Xproc buildpackageindex {libfile} {
  173. X
  174. X    set status [catch {TCLSH:CreateLibIndex $libfile} errmsg]
  175. X    if {$status != 0} {
  176. X        global errorInfo errorCode
  177. X        error "building package index for `$libfile': $errmsg" $errorInfo \
  178. X              $errorCode
  179. X    }
  180. X}
  181. X
  182. END_OF_FILE
  183. if test 2055 -ne `wc -c <'extended/tcllib/buildidx.tcl'`; then
  184.     echo shar: \"'extended/tcllib/buildidx.tcl'\" unpacked with wrong size!
  185. fi
  186. # end of 'extended/tcllib/buildidx.tcl'
  187. fi
  188. if test -f 'extended/tcllib/help/commands/error' -a "${1}" != "-c" ; then 
  189.   echo shar: Will not clobber existing file \"'extended/tcllib/help/commands/error'\"
  190. else
  191. echo shar: Extracting \"'extended/tcllib/help/commands/error'\" \(2127 characters\)
  192. sed "s/^X//" >'extended/tcllib/help/commands/error' <<'END_OF_FILE'
  193. X          error message ?info? ?code?
  194. X               Returns  a  TCL_ERROR  code,   which   causes   command
  195. X               interpretation to be unwound.  Message is a string that
  196. X               is returned to the application to  indicate  what  went
  197. X               wrong.
  198. X
  199. X               If the info argument is provided and is  non-empty,  it
  200. X               is  used  to  initialize the global variable errorInfo.
  201. X               errorInfo is used to accumulate a stack trace  of  what
  202. X               was  in  progress  when  an  error  occurred; as nested
  203. X               commands unwind, the Tcl interpreter  adds  information
  204. X               to  errorInfo.   If the info argument is present, it is
  205. X               used to initialize errorInfo and the first increment of
  206. X               unwind  information  will  not  be  added  by  the  Tcl
  207. X               interpreter.  In other words,  the  command  containing
  208. X               the  error command will not appear in errorInfo; in its
  209. X               place will be info.  This feature  is  most  useful  in
  210. X               conjunction  with  the catch command: if a caught error
  211. X               cannot be handled successfully, info  can  be  used  to
  212. X               return  a  stack trace reflecting the original point of
  213. X               occurrence of the error:
  214. X
  215. X                    catch {...} errMsg
  216. X                    set savedInfo $errorInfo
  217. X                    ...
  218. X                    error $errMsg $savedInfo
  219. X
  220. X
  221. X               If the code argument is  present,  then  its  value  is
  222. X               stored in the errorCode global variable.  This variable
  223. X               is intended to hold a machine-readable  description  of
  224. X               the error in cases where such information is available;
  225. X               see  the   section   BUILT-IN   VARIABLES   below   for
  226. X               information  on the proper format for the variable.  If
  227. X               the code argument is not  present,  then  errorCode  is
  228. X               automatically  reset to ``NONE'' by the Tcl interpreter
  229. X               as part  of  processing  the  error  generated  by  the
  230. X               command.
  231. END_OF_FILE
  232. if test 2127 -ne `wc -c <'extended/tcllib/help/commands/error'`; then
  233.     echo shar: \"'extended/tcllib/help/commands/error'\" unpacked with wrong size!
  234. fi
  235. # end of 'extended/tcllib/help/commands/error'
  236. fi
  237. if test -f 'extended/tcllib/help/commands/upvar' -a "${1}" != "-c" ; then 
  238.   echo shar: Will not clobber existing file \"'extended/tcllib/help/commands/upvar'\"
  239. else
  240. echo shar: Extracting \"'extended/tcllib/help/commands/upvar'\" \(1993 characters\)
  241. sed "s/^X//" >'extended/tcllib/help/commands/upvar' <<'END_OF_FILE'
  242. X          upvar ?level? otherVar myVar ?otherVar myVar ...?
  243. X               This command arranges for one or more  local  variables
  244. X               in  the  current  procedure to refer to variables in an
  245. X               enclosing procedure call or to global variables.  Level
  246. X               may  have  any  of  the forms permitted for the uplevel
  247. X               command, and may be omitted if the first letter of  the
  248. X               first  otherVar  isn't # or a digit (it defaults to 1).
  249. X               For each otherVar argument, upvar makes the variable by
  250. X               that  name in the procedure frame given by level (or at
  251. X               global level, if level is #0) accessible in the current
  252. X               procedure  by the name given in the corresponding myVar
  253. X               argument.  The variable  named  by  otherVar  need  not
  254. X               exist  at the time of the call;  it will be created the
  255. X               first time myVar is referenced, just like  an  ordinary
  256. X               variable.   Upvar  may  only  be  invoked  from  within
  257. X               procedures.  Neither otherVar or myVar may refer to  an
  258. X               element of an array.  Upvar returns an empty string.
  259. X
  260. X               The upvar  command  simplifies  the  implementation  of
  261. X               call-by-name procedure calling and also makes it easier
  262. X               to build new control constructs as Tcl procedures.  For
  263. X               example, consider the following procedure:
  264. X
  265. X                    proc add2 name {
  266. X                        upvar $name x
  267. X                        set x [expr $x+2]
  268. X                    }
  269. X
  270. X               Add2 is invoked with an argument giving the name  of  a
  271. X               variable,  and  it  adds  two  to  the  value  of  that
  272. X               variable.  Although add2 could  have  been  implemented
  273. X               using  uplevel instead of upvar, upvar makes it simpler
  274. X               for  add2  to  access  the  variable  in  the  caller's
  275. X               procedure frame.
  276. END_OF_FILE
  277. if test 1993 -ne `wc -c <'extended/tcllib/help/commands/upvar'`; then
  278.     echo shar: \"'extended/tcllib/help/commands/upvar'\" unpacked with wrong size!
  279. fi
  280. # end of 'extended/tcllib/help/commands/upvar'
  281. fi
  282. if test -f 'extended/tcllib/help/extended/cmdtrace' -a "${1}" != "-c" ; then 
  283.   echo shar: Will not clobber existing file \"'extended/tcllib/help/extended/cmdtrace'\"
  284. else
  285. echo shar: Extracting \"'extended/tcllib/help/extended/cmdtrace'\" \(1852 characters\)
  286. sed "s/^X//" >'extended/tcllib/help/extended/cmdtrace' <<'END_OF_FILE'
  287. X
  288. X
  289. X          cmdtrace level|on [noeval] [notruncate] [flush] [filehandle]
  290. X               Print a trace statement for all commands executed at
  291. X               depth of level or below (1 is the top level).  If on is
  292. X               specified, all commands at any level are traced.  If
  293. X               noeval is specified, arguments are printed unevaluated
  294. X               -- if it is not specified, the arguments are printed
  295. X               after evaluation. If the command line is longer than 60
  296. X               characters, it is truncated to 60 and a "..." is
  297. X               postpended to indicate that there was more.  If noeval
  298. X               wasn't specified, the arguments are printed after
  299. X               evaluation.  In this case, each argument is truncated
  300. X               to 40 characters (with "..." postpended if the argument
  301. X               was longer than 40 characters) and printed. If an
  302. X               evaluated argument contains a space, the entire
  303. X               argument will be enclosed inside of braces (`{}') to
  304. X               allow the reader to visually separate the arguments
  305. X               from each other. If notruncate is specified, then the
  306. X               truncation of commands and evaluated arguments will be
  307. X               disabled. If flush is specified, then the output buffer
  308. X               will be flushed after each line is printed.  This is
  309. X               useful when tracing code that cause an application to
  310. X               abort, making it easy to narrow the problem down to the
  311. X               command that caused the abort. If filehandle is
  312. X               specified, then the trace output will be written to the
  313. X               file.
  314. X
  315. X          cmdtrace off
  316. X               Turn off all tracing.
  317. X
  318. X          cmdtrace depth
  319. X               Returns the current maximum trace level, or zero if
  320. X               trace is disabled.
  321. END_OF_FILE
  322. if test 1852 -ne `wc -c <'extended/tcllib/help/extended/cmdtrace'`; then
  323.     echo shar: \"'extended/tcllib/help/extended/cmdtrace'\" unpacked with wrong size!
  324. fi
  325. # end of 'extended/tcllib/help/extended/cmdtrace'
  326. fi
  327. if test -f 'extended/tcllib/help/extended/fcntl' -a "${1}" != "-c" ; then 
  328.   echo shar: Will not clobber existing file \"'extended/tcllib/help/extended/fcntl'\"
  329. else
  330. echo shar: Extracting \"'extended/tcllib/help/extended/fcntl'\" \(2023 characters\)
  331. sed "s/^X//" >'extended/tcllib/help/extended/fcntl' <<'END_OF_FILE'
  332. X
  333. X
  334. X          fcntl handle [attribute value]
  335. X               This command either returns a list of various boolean
  336. X               attributes controlling access to a file or set or
  337. X               clears one of the boolean attributes.  If attribute and
  338. X               value are not specified, then the list of the
  339. X               attributes that are set are return. If an attribute is
  340. X               not set, then it will not be included in the list.  The
  341. X               following attributes maybe returned:
  342. X
  343. X               RDONLY - The file is opened for reading only.
  344. X
  345. X               WRONLY - The file is opened for writing only.
  346. X
  347. X               RDWR - The file is opened for reading and writing.
  348. X
  349. X               APPEND - The file is opened for append only writes.
  350. X               All writes will be forced to the end of the file.
  351. X
  352. X               NDELAY - The file is to be accessed with non-blocking
  353. X               I/O.  See the read system call for a description of how
  354. X               it affects the behaviour of file reads
  355. X
  356. X               CLEXEC - Close the file on an process exec.  If the
  357. X               execvp command or some other mechanism causes the
  358. X               process to exec, the file will be closed.
  359. X
  360. X               NOBUF - The file is not buffered. If set, then there no
  361. X               stdio buffering for the file.
  362. X
  363. X               LINEBUF - Output the file will be line buffered. The
  364. X               buffer will be flushed when a newline is written, when
  365. X               the buffer is full, or when input is requested.
  366. X
  367. X               The APPEND, NDELAY, and CLEXEC attributes may be set or
  368. X               cleared by specifying the attribute name and a value 1
  369. X               to set the attribute and 0 to clear it.
  370. X
  371. X               The NOBUF and LINEBUF attributes may only be set (a
  372. X               value of 1) and only one of the options may be set.
  373. X               Once set, they may not be cleared. Thees option should
  374. X               be set before any I/O operations have been done on the
  375. X               file.
  376. END_OF_FILE
  377. if test 2023 -ne `wc -c <'extended/tcllib/help/extended/fcntl'`; then
  378.     echo shar: \"'extended/tcllib/help/extended/fcntl'\" unpacked with wrong size!
  379. fi
  380. # end of 'extended/tcllib/help/extended/fcntl'
  381. fi
  382. if test -f 'extended/tcllib/help/extended/fmtclock' -a "${1}" != "-c" ; then 
  383.   echo shar: Will not clobber existing file \"'extended/tcllib/help/extended/fmtclock'\"
  384. else
  385. echo shar: Extracting \"'extended/tcllib/help/extended/fmtclock'\" \(2250 characters\)
  386. sed "s/^X//" >'extended/tcllib/help/extended/fmtclock' <<'END_OF_FILE'
  387. X
  388. X
  389. X          fmtclock clockval [format] [GMT|{}]
  390. X               Convert a value returned by getclock or file to human
  391. X               readable form.  The format argument is a string that
  392. X               describes how to format the date and time.  Field
  393. X               descriptors consist of a ``%'' followed by a field
  394. X               descriptor. All other characters are copied into the
  395. X               result.  The available field descriptors are:
  396. X
  397. X                   %% - Insert a %.
  398. X                   %a - Abbreviated weekday name.
  399. X                   %A - Full weekday name
  400. X                   %b - Abbreviated month name.
  401. X                   %B - Full month name.
  402. X                   %d - Day of month (01 - 31).
  403. X                   %D - Date as %m/%d/%y.
  404. X                   %e - Day of month (1-31), no leading zeros.
  405. X                   %h - Abbreviated month name.
  406. X                   %H - Hour (00 - 23).
  407. X                   %I - Hour (00 - 12).
  408. X                   %j - Day number of year (001 - 366).
  409. X                   %m - Month number (01 - 12).
  410. X                   %M - Minute (00 - 59).
  411. X                   %n - Insert a new line.
  412. X                   %p - AM or PM.
  413. X                   %r - Time as %I:%M:%S %p.
  414. X                   %R - Time as %H:%M.
  415. X                   %S - Seconds (00 - 59).
  416. X                   %t - Insert a tab.
  417. X                   %T - Time as %H:%M:%S.
  418. X                   %U - Week number of year (01 - 52), Sunday is the first
  419. X                        day of the week.
  420. X                   %w - Weekday number (Sunday = 0).
  421. X                   %W - Week number of year (01 - 52), Monday is the first
  422. X                        day of the week.
  423. X                   %x - Local specific date format.
  424. X                   %X - Local specific time format.
  425. X                   %y - Year within century (00 - 99).
  426. X                   %Y - Year as ccyy (e.g. 1990)
  427. X                   %Z - Time zone name.
  428. X
  429. X               If format is not specified, "%a %b %d %H:%M:%S %Z %Y"
  430. X               is used.  If GMT is specified, the time will be
  431. X               formated as Greenwich Mean Time. If the argument is not
  432. X               specified or is empty, then the local timezone will be
  433. X               used as defined by the timezone environment variable.
  434. END_OF_FILE
  435. if test 2250 -ne `wc -c <'extended/tcllib/help/extended/fmtclock'`; then
  436.     echo shar: \"'extended/tcllib/help/extended/fmtclock'\" unpacked with wrong size!
  437. fi
  438. # end of 'extended/tcllib/help/extended/fmtclock'
  439. fi
  440. if test -f 'extended/tcllib/help/extended/id' -a "${1}" != "-c" ; then 
  441.   echo shar: Will not clobber existing file \"'extended/tcllib/help/extended/id'\"
  442. else
  443. echo shar: Extracting \"'extended/tcllib/help/extended/id'\" \(2128 characters\)
  444. sed "s/^X//" >'extended/tcllib/help/extended/id' <<'END_OF_FILE'
  445. X
  446. X
  447. X          id options
  448. X               This command provides a means of getting, setting and
  449. X               converting user, group and process ids.  The following
  450. X               versions of the id command are available:
  451. X
  452. X               id user [name]
  453. X
  454. X               id userid [uid]
  455. X                    Set the real and effective user ID to name or uid,
  456. X                    if the name (or uid) is valid and permissions
  457. X                    allow it.  If the name (or uid) is not specified,
  458. X                    the current name (or uid) is returned.
  459. X
  460. X               id convert userid uid
  461. X
  462. X               id convert user name
  463. X                    Convert a user ID number to a user name, or vice
  464. X                    versa.
  465. X
  466. X               id group [name]
  467. X
  468. X               id groupid [gid]
  469. X                    Set the real and effective group ID to name or
  470. X                    gid, if the name (or gid) is valid and permissions
  471. X                    allow it.  If the group name (or gid) is not
  472. X                    specified, the current group name (or gid) is
  473. X                    returned.
  474. X
  475. X               id convert groupid gid
  476. X
  477. X               id convert group name
  478. X                    Convert a group ID number to a group name, or vice
  479. X                    versa.
  480. X
  481. X               id effective user
  482. X
  483. X               id effective userid
  484. X                    Return the effective user name, or effective user
  485. X                    ID number, respectively.
  486. X
  487. X               id effective group
  488. X
  489. X               id effective groupid
  490. X                    Return the effective group name, or effective
  491. X                    group ID number, respectively.
  492. X
  493. X               id process
  494. X                    Return the process ID of the current process.
  495. X
  496. X               id process parent
  497. X                    Return the process ID of the parent of the current
  498. X                    process.
  499. X
  500. X               id process group
  501. X                    Return the process group ID of the current
  502. X                    process.
  503. X
  504. X               id process group set
  505. X                    Set the process group ID of the current process to
  506. X                    its process ID.
  507. END_OF_FILE
  508. if test 2128 -ne `wc -c <'extended/tcllib/help/extended/id'`; then
  509.     echo shar: \"'extended/tcllib/help/extended/id'\" unpacked with wrong size!
  510. fi
  511. # end of 'extended/tcllib/help/extended/id'
  512. fi
  513. if test -f 'extended/tcllib/help/extended/loop' -a "${1}" != "-c" ; then 
  514.   echo shar: Will not clobber existing file \"'extended/tcllib/help/extended/loop'\"
  515. else
  516. echo shar: Extracting \"'extended/tcllib/help/extended/loop'\" \(1682 characters\)
  517. sed "s/^X//" >'extended/tcllib/help/extended/loop' <<'END_OF_FILE'
  518. X
  519. X
  520. X          loop var first last [increment] body
  521. X               Loop is a looping command, similar in behavior to the
  522. X               Tcl for statement, except that the loop statement
  523. X               achieves substantially higher performance and is easier
  524. X               to code when the beginning and ending values of a loop
  525. X               are known and the loop variable is to be incremented by
  526. X               a known, fixed amount every time through.
  527. X
  528. X                The var argument is the name of a Tcl variable that
  529. X               will contain the loop index.  The loop index is first
  530. X               set to the value specified by first.  The Tcl
  531. X               interpreter is invoked upon body zero or more times,
  532. X               where var is incremented by increment every time
  533. X               through the loop, or by one if increment is not
  534. X               specified.  Increment can be negative in which case the
  535. X               loop will count downwards.
  536. X
  537. X               When var reaches last, the loop terminates without a
  538. X               subsequent execution of body.  For instance, if the
  539. X               original loop parameters would cause loop to terminate,
  540. X               say first was one, last was zero and increment was not
  541. X               specified or was non-negative, body is not executed at
  542. X               all and loop returns.
  543. X
  544. X               If a continue command is invoked within body then any
  545. X               remaining commands in the current execution of body are
  546. X               skipped, as in the for command.  If a break command is
  547. X               invoked within body then the loop command will return
  548. X               immediately.  Loop returns an empty string.
  549. END_OF_FILE
  550. if test 1682 -ne `wc -c <'extended/tcllib/help/extended/loop'`; then
  551.     echo shar: \"'extended/tcllib/help/extended/loop'\" unpacked with wrong size!
  552. fi
  553. # end of 'extended/tcllib/help/extended/loop'
  554. fi
  555. if test -f 'extended/tcllib/help/extended/select' -a "${1}" != "-c" ; then 
  556.   echo shar: Will not clobber existing file \"'extended/tcllib/help/extended/select'\"
  557. else
  558. echo shar: Extracting \"'extended/tcllib/help/extended/select'\" \(1961 characters\)
  559. sed "s/^X//" >'extended/tcllib/help/extended/select' <<'END_OF_FILE'
  560. X
  561. X
  562. X          select readhandles [writehandles] [excepthandles] [timeout]
  563. X               This command allows polling or blocking on multiple
  564. X               files being ready for for reading, are ready for
  565. X               writing, or have an exceptional condition pending.
  566. X               readhandles, writehandles, excepthandles are each lists
  567. X               of file handles (as returned from open) to query.  An
  568. X               empty list ({}) may be specified if a category is not
  569. X               used.
  570. X
  571. X               The readhandles files are checked to set if data is
  572. X               available for reading. The writehandles are checked if
  573. X               they are clear for writing The excepthandles are
  574. X               checked to see if an exceptional condition has occured.
  575. X               The write and exception checking is most useful on
  576. X               devices, however, the read checking is also very
  577. X               valuable when communicating with multiple processes
  578. X               through pipes.
  579. X
  580. X               Timeout is a floating point timeout number of seconds.
  581. X               If an empty list is supplied (or the parameter is
  582. X               omitted), then no timeout is set.  If the value is
  583. X               zero, then the select command functions as a poll of
  584. X               the files.
  585. X
  586. X               If the timeout period expires with none of the files
  587. X               becomming ready, then the command returns an empty
  588. X               list.  Otherwise the command returns a list of three
  589. X               elements, each of those elements is a list of the file
  590. X               handles that are ready in the read, write and exception
  591. X               classes.  If none are ready in a class, then that
  592. X               element will be the null list.  For example:
  593. X                   select {file3 file4 file5} {file6 file7} {} 10.5
  594. X
  595. X               could return
  596. X                  {file3 file4} {file6} {}
  597. X               or perhaps
  598. X                  file3 {} {}
  599. X
  600. END_OF_FILE
  601. if test 1961 -ne `wc -c <'extended/tcllib/help/extended/select'`; then
  602.     echo shar: \"'extended/tcllib/help/extended/select'\" unpacked with wrong size!
  603. fi
  604. # end of 'extended/tcllib/help/extended/select'
  605. fi
  606. if test -f 'extended/tcllib/help/extended/signal' -a "${1}" != "-c" ; then 
  607.   echo shar: Will not clobber existing file \"'extended/tcllib/help/extended/signal'\"
  608. else
  609. echo shar: Extracting \"'extended/tcllib/help/extended/signal'\" \(2040 characters\)
  610. sed "s/^X//" >'extended/tcllib/help/extended/signal' <<'END_OF_FILE'
  611. X
  612. X
  613. X          signal action siglist [command]
  614. X               Specify the action to take when a Unix signal occurs.
  615. X               Siglist is a list of either the symbolic or numeric
  616. X               Unix signal (the SIG prefix is optional).  Action is
  617. X               one of the following actions to be performed on receipt
  618. X               of the signal.
  619. X
  620. X               default - Terminate the process
  621. X
  622. X               ignore - Ignore the signal.
  623. X
  624. X               error - Generate a catchable Tcl error.  It will be as
  625. X               if the command that was running returned an error.  The
  626. X               error code will be in the form:
  627. X                   {UNIX SIG signame}
  628. X               For the death of child signal, signame will always be
  629. X               SIGCHLD, rather than SIGCLD, to allow writting protable
  630. X               code.
  631. X
  632. X               trap - When the signal occures, execute command and
  633. X               continue execution if an error is not returned by
  634. X               command.  If will be executed in the global context and
  635. X               the symbolic signal name (e.g. SIGINT) will be supplied
  636. X               in a global variable signalRecieved.  If an error is
  637. X               returned, then follow the standard Tcl error mechanism.
  638. X               Often command will just do an exit.
  639. X
  640. X               get - Retrieve the current settings of the specified
  641. X               signals.  A list will be returned with each element
  642. X               containing one of `default', `ignore', `error' or
  643. X               `trap' corresponding to each signal in siglist.
  644. X
  645. X               For all signals except SIGCLD, the signal action will
  646. X               remain enabled after the specified signal has occured.
  647. X               For SIGCLD (also known as SIGCHLD), the signal will not
  648. X               be automatically reenable. A wait must be performed
  649. X               before issuing another signal command.  Signals are not
  650. X               processed until after the completion of the Tcl command
  651. X               that is executing when the signal is recieved.
  652. END_OF_FILE
  653. if test 2040 -ne `wc -c <'extended/tcllib/help/extended/signal'`; then
  654.     echo shar: \"'extended/tcllib/help/extended/signal'\" unpacked with wrong size!
  655. fi
  656. # end of 'extended/tcllib/help/extended/signal'
  657. fi
  658. if test -f 'extended/tcllib/help/help' -a "${1}" != "-c" ; then 
  659.   echo shar: Will not clobber existing file \"'extended/tcllib/help/help'\"
  660. else
  661. echo shar: Extracting \"'extended/tcllib/help/help'\" \(1941 characters\)
  662. sed "s/^X//" >'extended/tcllib/help/help' <<'END_OF_FILE'
  663. X
  664. X
  665. X          The help facility allows for display of help files extracted
  666. X          from the standard Tcl manual pages and Tcl scripts.  Help
  667. X          files are structured in a multilevel directory tree of
  668. X          subjects and help files.  The following commands and options
  669. X          are provided with the help package:
  670. X
  671. X          help
  672. X               Help, without arguments, lists of all the top-level
  673. X               help subject directories and files.
  674. X
  675. X          help subjectdir
  676. X               Displays all of help files and lower level subject
  677. X               files (if any exist) under the directory subjectdir.
  678. X
  679. X          help subjectdir/helpfile
  680. X               Display the specified help file.  The help output is
  681. X               passed through a simple pager if output exceeds 23
  682. X               lines, pausing waiting for a return to be entered.  If
  683. X               any other character is entered, the output is
  684. X               terminated.
  685. X
  686. X          helpcd [subjectdir]
  687. X               Change the current subject directory, which is much
  688. X               like the Unix current directory.  This directory can be
  689. X               changed with the helpcd command.  If subjectdir is not
  690. X               specified, return to the top-level of the help tree.
  691. X               Help path names may also include ``..'' elements.
  692. X
  693. X          helppwd
  694. X               Displays the current help subject directory.
  695. X
  696. X          help help | ?
  697. X               Displays help on the help facility at any directory
  698. X               level.
  699. X
  700. X          apropos pattern
  701. X               This command locates subjects by searching their one-
  702. X               line descriptions for a pattern.  Apropos is useful
  703. X               when you can remember part of the name or description
  704. X               of a command, and want to search through the one-line
  705. X               summaries for matching lines.  Full regular expressions
  706. X               may be specified (see the regexp command).
  707. END_OF_FILE
  708. if test 1941 -ne `wc -c <'extended/tcllib/help/help'`; then
  709.     echo shar: \"'extended/tcllib/help/help'\" unpacked with wrong size!
  710. fi
  711. # end of 'extended/tcllib/help/help'
  712. fi
  713. if test -f 'extended/tcllib/help/intro/braces' -a "${1}" != "-c" ; then 
  714.   echo shar: Will not clobber existing file \"'extended/tcllib/help/intro/braces'\"
  715. else
  716. echo shar: Extracting \"'extended/tcllib/help/intro/braces'\" \(1919 characters\)
  717. sed "s/^X//" >'extended/tcllib/help/intro/braces' <<'END_OF_FILE'
  718. X     GROUPING ARGUMENTS WITH BRACES
  719. X          Curly braces may also be used for grouping arguments.   They
  720. X          are  similar  to  quotes except for two differences.  First,
  721. X          they nest; this makes them easier  to  use  for  complicated
  722. X          arguments  like  nested  Tcl  command  strings.  Second, the
  723. X          substitutions described below for commands,  variables,  and
  724. X          backslashes do not occur in arguments enclosed in braces, so
  725. X          braces can be used to prevent substitutions where  they  are
  726. X          undesirable.  If an argument field begins with a left brace,
  727. X          then the argument ends at the  matching  right  brace.   Tcl
  728. X          will  strip  off  the outermost layer of braces and pass the
  729. X          information between the braces to the  command  without  any
  730. X          further modification.  For example, in the command
  731. X
  732. X               set a {xyz a {b c d}}
  733. X          the set command will receive two arguments: a and xyz a {b c
  734. X          d}.
  735. X
  736. X          When braces or quotes are in effect, the matching  brace  or
  737. X          quote  need not be on the same line as the starting quote or
  738. X          brace; in this case the newline  will  be  included  in  the
  739. X          argument  field  along  with  any other characters up to the
  740. X          matching brace or quote.   For  example,  the  eval  command
  741. X          takes  one argument, which is a command string; eval invokes
  742. X          the Tcl interpreter to  execute  the  command  string.   The
  743. X          command
  744. X
  745. X               eval {
  746. X                    set a 22
  747. X                    set b 33
  748. X               }
  749. X
  750. X          will assign the value 22 to a and 33 to b.
  751. X
  752. X          If the first character of a command  field  is  not  a  left
  753. X          brace,  then neither left nor right braces in the field will
  754. X          be  treated  specially   (except   as   part   of   variable
  755. X          substitution; see below).
  756. END_OF_FILE
  757. if test 1919 -ne `wc -c <'extended/tcllib/help/intro/braces'`; then
  758.     echo shar: \"'extended/tcllib/help/intro/braces'\" unpacked with wrong size!
  759. fi
  760. # end of 'extended/tcllib/help/intro/braces'
  761. fi
  762. if test -f 'extended/tcllib/help/intro/brackets' -a "${1}" != "-c" ; then 
  763.   echo shar: Will not clobber existing file \"'extended/tcllib/help/intro/brackets'\"
  764. else
  765. echo shar: Extracting \"'extended/tcllib/help/intro/brackets'\" \(1648 characters\)
  766. sed "s/^X//" >'extended/tcllib/help/intro/brackets' <<'END_OF_FILE'
  767. X     COMMAND SUBSTITUTION WITH BRACKETS
  768. X          If an open bracket occurs in a  field  of  a  command,  then
  769. X          command  substitution  occurs (except for fields enclosed in
  770. X          braces).  All of the text up to the matching  close  bracket
  771. X          is  treated as a Tcl command and executed immediately.  Then
  772. X          the result of that command is substituted for the  bracketed
  773. X          text.  For example, consider the command
  774. X
  775. X               set a [set b]
  776. X
  777. X          When the set command has only a single argument, it  is  the
  778. X          name  of  a  variable  and  set returns the contents of that
  779. X          variable.  In this case, if variable b has  the  value  foo,
  780. X          then the command above is equivalent to the command
  781. X
  782. X               set a foo
  783. X          Brackets can be used in more complex ways.  For example,  if
  784. X          the  variable b has the value foo and the variable c has the
  785. X          value gorp, then the command
  786. X
  787. X               set a xyz[set b].[set c]
  788. X
  789. X          is equivalent to the command
  790. X
  791. X               set a xyzfoo.gorp
  792. X
  793. X          A bracketed command may contain multiple commands  separated
  794. X          by  newlines  or  semi-colons in the usual fashion.  In this
  795. X          case the value of the last command is used for substitution.
  796. X          For example, the command
  797. X
  798. X               set a x[set b 22
  799. X               expr $b+2]x
  800. X
  801. X          is equivalent to the command
  802. X
  803. X               set a x24x
  804. X
  805. X          If a field is enclosed in braces then the brackets  and  the
  806. X          characters  between them are not interpreted specially; they
  807. X          are passed through to the argument verbatim.
  808. END_OF_FILE
  809. if test 1648 -ne `wc -c <'extended/tcllib/help/intro/brackets'`; then
  810.     echo shar: \"'extended/tcllib/help/intro/brackets'\" unpacked with wrong size!
  811. fi
  812. # end of 'extended/tcllib/help/intro/brackets'
  813. fi
  814. if test -f 'extended/tcllib/help/tclshell/initialize' -a "${1}" != "-c" ; then 
  815.   echo shar: Will not clobber existing file \"'extended/tcllib/help/tclshell/initialize'\"
  816. else
  817. echo shar: Extracting \"'extended/tcllib/help/tclshell/initialize'\" \(2090 characters\)
  818. sed "s/^X//" >'extended/tcllib/help/tclshell/initialize' <<'END_OF_FILE'
  819. X
  820. X
  821. X          The standard Tcl shell initialization consists of the
  822. X          following steps:
  823. X
  824. X               Search for a default file.  The default file is a Tcl
  825. X               script that is executed to set important Tcl variables
  826. X               that govern startup, such as TCLPATH.  The Tcl default
  827. X               file is searched for using the following algorithm:
  828. X               The current Extended Tcl version, represented by $ver,
  829. X               is included in the default file naming to allow
  830. X               multiple Tcl versions to exists on a system.  Note that
  831. X               the Extended Tcl version is the standard Tcl version
  832. X               number with an alphabetic character added to indicated
  833. X               the version of Extended Tcl.  The infox version command
  834. X               will return this version number.
  835. X
  836. X                    - An environment variable, TCLDEFAULT, is checked
  837. X                    for.  If present, it is used as the name of the
  838. X                    default file.
  839. X
  840. X                    - A file, TCLDEFAULT, is looked for in the current
  841. X                    directory.
  842. X
  843. X                    - A global default file with is usually either
  844. X                    /etc/default/tcl$ver or
  845. X                    /usr/local/lib/tcldefault$ver.  (Tcl may be
  846. X                    compiled to use a different directory on some
  847. X                    systems).
  848. X
  849. X               First, Tcl executes the default file.  This file
  850. X               normally sets at least two Tcl variables: TCLPATH,
  851. X               which contains a list of directories that contain tcl
  852. X               source files, and TCLINIT, the full pathname of the Tcl
  853. X               source file that performs Tcl initialization.  Other
  854. X               site-specific variables may also be set in this file.
  855. X
  856. X               Next, tcl executes the initialization file specified by
  857. X               the Tcl variable TCLINIT.  This is normally the
  858. X               TclInit.Tcl file distributed with Tcl.  This file
  859. X               defines the Tcl environment, including standard Tcl
  860. X               procs and variables.
  861. END_OF_FILE
  862. if test 2090 -ne `wc -c <'extended/tcllib/help/tclshell/initialize'`; then
  863.     echo shar: \"'extended/tcllib/help/tclshell/initialize'\" unpacked with wrong size!
  864. fi
  865. # end of 'extended/tcllib/help/tclshell/initialize'
  866. fi
  867. if test -f 'extended/tcllib/help/tclshell/variables' -a "${1}" != "-c" ; then 
  868.   echo shar: Will not clobber existing file \"'extended/tcllib/help/tclshell/variables'\"
  869. else
  870. echo shar: Extracting \"'extended/tcllib/help/tclshell/variables'\" \(2131 characters\)
  871. sed "s/^X//" >'extended/tcllib/help/tclshell/variables' <<'END_OF_FILE'
  872. X
  873. X
  874. X          The following variables are set and/or used by the Tcl
  875. X          shell.
  876. X
  877. X          argv A list containing the arguments passed in from the
  878. X               command line, excluding arguments used by the Tcl
  879. X               shell.  The first element is the first passed argument,
  880. X               not the program name.
  881. X
  882. X          interactiveSession
  883. X               Set to 1 if Tcl shell is invoked interactively, or 0 if
  884. X               the Tcl shell is directly executing a script.
  885. X
  886. X          noAutoExec
  887. X               If this variable exists and has a value of 1, then the
  888. X               Tcl shell will not attempt to exec an non-existent
  889. X               command as a shell command.
  890. X
  891. X          programName
  892. X               The name that the Tcl shell is executing as.  All
  893. X               directory components are removed from the program name.
  894. X
  895. X          scriptName
  896. X               The name of the script that the Tcl shell is executing
  897. X               if the script was invoked on the command line.
  898. X
  899. X          TCLDEFAULT
  900. X               Name of the default file that was used to locate all
  901. X               other files used by the Tcl shell.
  902. X
  903. X          TCLENV
  904. X               Array that contains information used internally by
  905. X               various Tcl procedures that are part of the Tcl shell.
  906. X
  907. X          TCLENV(topLevelPromptHook)
  908. X               Contains code to run to generate the prompt used when
  909. X               interactively prompting for commands.  The code in this
  910. X               hook will be evaluated and the result will be used for
  911. X               the prompt.
  912. X
  913. X          TCLENV(downLevelPromptHook)
  914. X               Contains code to run to generate the prompt used when
  915. X               interactively prompting for continuation of an
  916. X               incomplete command.  The code in this hook will be
  917. X               evaluated and the result will be used for the prompt
  918. X
  919. X          TCLINIT
  920. X               The name of the file that initializes, and does startup
  921. X               processing of, Tcl.
  922. X
  923. X          TCLPATH
  924. X               Path to search to locate Tcl scripts.  Used by the load
  925. X               and demand_load procedures.
  926. END_OF_FILE
  927. if test 2131 -ne `wc -c <'extended/tcllib/help/tclshell/variables'`; then
  928.     echo shar: \"'extended/tcllib/help/tclshell/variables'\" unpacked with wrong size!
  929. fi
  930. # end of 'extended/tcllib/help/tclshell/variables'
  931. fi
  932. if test -f 'extended/tests/forrecur.test' -a "${1}" != "-c" ; then 
  933.   echo shar: Will not clobber existing file \"'extended/tests/forrecur.test'\"
  934. else
  935. echo shar: Extracting \"'extended/tests/forrecur.test'\" \(1752 characters\)
  936. sed "s/^X//" >'extended/tests/forrecur.test' <<'END_OF_FILE'
  937. X#
  938. X# forrecur.test
  939. X#
  940. X# tests for tcl.tlib for_recursive_glob routine
  941. X#---------------------------------------------------------------------------
  942. X# Copyright 1991 Karl Lehenbauer and Mark Diekhans.
  943. X#
  944. X# Permission to use, copy, modify, and distribute this software and its
  945. X# documentation for any purpose and without fee is hereby granted, provided
  946. X# that the above copyright notice appear in all copies.  Karl Lehenbauer and
  947. X# Mark Diekhans make no representations about the suitability of this
  948. X# software for any purpose.  It is provided "as is" without express or
  949. X# implied warranty.
  950. X#
  951. X
  952. X
  953. Xif {[string compare test [info procs test]] == 1} then {source defs}
  954. Xrename SAVED_UNKNOWN unknown
  955. X
  956. Xproc tcltouch {file} {
  957. X    set fp [open $file w]
  958. X    close $fp
  959. X}
  960. X
  961. X
  962. Xexec rm -rf GLOBTESTDIR
  963. Xmkdir GLOBTESTDIR
  964. Xmkdir GLOBTESTDIR/dir1
  965. Xmkdir GLOBTESTDIR/dir2
  966. X
  967. Xtcltouch GLOBTESTDIR/file1
  968. Xtcltouch GLOBTESTDIR/dir1/file1
  969. Xtcltouch GLOBTESTDIR/dir1/file2
  970. Xtcltouch GLOBTESTDIR/dir2/file1
  971. Xtcltouch GLOBTESTDIR/dir2/file2
  972. Xtcltouch GLOBTESTDIR/file2
  973. X
  974. Xset expectedResult "GLOBTESTDIR GLOBTESTDIR/dir1 GLOBTESTDIR/dir1/file1 \
  975. XGLOBTESTDIR/dir1/file2 GLOBTESTDIR/dir2 GLOBTESTDIR/dir2/file1 \
  976. XGLOBTESTDIR/dir2/file2 GLOBTESTDIR/file1 GLOBTESTDIR/file2"
  977. X
  978. Xtest for_recursive_glob-1.1 {for_recursive_glob command} {
  979. X    for_recursive_glob file GLOBTESTDIR {lappend result $file}
  980. X    lsort $result
  981. X} $expectedResult
  982. X
  983. Xunset result
  984. Xset expectedResult [lrange $expectedResult 1 end]
  985. X
  986. Xtest for_recursive-1.2 {for_recursive_glob command with list of patterns} {
  987. X    for_recursive_glob file "GLOBTEST*/dir* GLOBTEST*/file*" \
  988. X    {lappend result $file}
  989. X    lsort $result
  990. X} $expectedResult
  991. X
  992. Xexec rm -rf GLOBTESTDIR
  993. X
  994. Xunset expectedResult result
  995. X
  996. Xrename tcltouch ""
  997. Xrename unknown SAVED_UNKNOWN
  998. END_OF_FILE
  999. if test 1752 -ne `wc -c <'extended/tests/forrecur.test'`; then
  1000.     echo shar: \"'extended/tests/forrecur.test'\" unpacked with wrong size!
  1001. fi
  1002. # end of 'extended/tests/forrecur.test'
  1003. fi
  1004. if test -f 'extended/tests/globrecur.test' -a "${1}" != "-c" ; then 
  1005.   echo shar: Will not clobber existing file \"'extended/tests/globrecur.test'\"
  1006. else
  1007. echo shar: Extracting \"'extended/tests/globrecur.test'\" \(1627 characters\)
  1008. sed "s/^X//" >'extended/tests/globrecur.test' <<'END_OF_FILE'
  1009. X#
  1010. X# globrecur.test
  1011. X#
  1012. X# Tests for tcl.tlib recursive_glob routine.
  1013. X#
  1014. X#---------------------------------------------------------------------------
  1015. X# Copyright 1991 Karl Lehenbauer and Mark Diekhans.
  1016. X#
  1017. X# Permission to use, copy, modify, and distribute this software and its
  1018. X# documentation for any purpose and without fee is hereby granted, provided
  1019. X# that the above copyright notice appear in all copies.  Karl Lehenbauer and
  1020. X# Mark Diekhans make no representations about the suitability of this
  1021. X# software for any purpose.  It is provided "as is" without express or
  1022. X# implied warranty.
  1023. X#
  1024. X
  1025. Xif {[string compare test [info procs test]] == 1} then {source defs}
  1026. Xrename SAVED_UNKNOWN unknown
  1027. X
  1028. Xproc tcltouch {file} {
  1029. X    set fp [open $file w]
  1030. X    close $fp
  1031. X}
  1032. X
  1033. Xexec rm -rf GLOBTESTDIR
  1034. Xmkdir GLOBTESTDIR
  1035. Xmkdir GLOBTESTDIR/dir1
  1036. Xmkdir GLOBTESTDIR/dir2
  1037. X
  1038. Xtcltouch GLOBTESTDIR/file1
  1039. Xtcltouch GLOBTESTDIR/dir1/file1
  1040. Xtcltouch GLOBTESTDIR/dir1/file2
  1041. Xtcltouch GLOBTESTDIR/dir2/file1
  1042. Xtcltouch GLOBTESTDIR/dir2/file2
  1043. Xtcltouch GLOBTESTDIR/file2
  1044. X
  1045. Xset expectedResult "GLOBTESTDIR GLOBTESTDIR/dir1 GLOBTESTDIR/dir1/file1 \
  1046. XGLOBTESTDIR/dir1/file2 GLOBTESTDIR/dir2 GLOBTESTDIR/dir2/file1 \
  1047. XGLOBTESTDIR/dir2/file2 GLOBTESTDIR/file1 GLOBTESTDIR/file2"
  1048. X
  1049. Xtest recursive_glob-1.1 {recursive_glob command} {
  1050. X    lsort [recursive_glob GLOBTESTDIR]
  1051. X} $expectedResult
  1052. X
  1053. Xset expectedResult [lrange $expectedResult 1 end]
  1054. X
  1055. Xtest recursive-1.2 {recursive_glob command with list of patterns} {
  1056. X    lsort [recursive_glob {GLOBTEST*/dir* GLOBTEST*/file*}]
  1057. X} $expectedResult
  1058. X
  1059. Xexec rm -rf GLOBTESTDIR
  1060. X
  1061. Xunset expectedResult
  1062. X
  1063. Xrename tcltouch ""
  1064. Xrename unknown SAVED_UNKNOWN
  1065. END_OF_FILE
  1066. if test 1627 -ne `wc -c <'extended/tests/globrecur.test'`; then
  1067.     echo shar: \"'extended/tests/globrecur.test'\" unpacked with wrong size!
  1068. fi
  1069. # end of 'extended/tests/globrecur.test'
  1070. fi
  1071. if test -f 'extended/tests/list.test' -a "${1}" != "-c" ; then 
  1072.   echo shar: Will not clobber existing file \"'extended/tests/list.test'\"
  1073. else
  1074. echo shar: Extracting \"'extended/tests/list.test'\" \(1667 characters\)
  1075. sed "s/^X//" >'extended/tests/list.test' <<'END_OF_FILE'
  1076. X#
  1077. X# list.test
  1078. X#
  1079. X# Tests for the lvarpop command.
  1080. X#---------------------------------------------------------------------------
  1081. X# Copyright 1991 Karl Lehenbauer and Mark Diekhans.
  1082. X#
  1083. X# Permission to use, copy, modify, and distribute this software and its
  1084. X# documentation for any purpose and without fee is hereby granted, provided
  1085. X# that the above copyright notice appear in all copies.  Karl Lehenbauer and
  1086. X# Mark Diekhans make no representations about the suitability of this
  1087. X# software for any purpose.  It is provided "as is" without express or
  1088. X# implied warranty.
  1089. X#
  1090. Xif {[info procs test] != "test"} then {source defs}
  1091. X
  1092. Xtest list-1.1 {lvarpop tests} {
  1093. X    set a {a b c d e f g h i j}
  1094. X    list [lvarpop a 0] $a
  1095. X} {a {b c d e f g h i j}}
  1096. X
  1097. Xtest list-1.2 {lvarpop tests} {
  1098. X    set a {a bbbbbb c d e f g h i j}
  1099. X    list [lvarpop a 1] $a
  1100. X} {bbbbbb {a c d e f g h i j}}
  1101. X
  1102. Xtest list-1.3 {lvarpop tests} {
  1103. X    set a {a bbbbbb c d e f g h i j}
  1104. X    list [lvarpop a 4] $a
  1105. X} {e {a bbbbbb c d f g h i j}}
  1106. X
  1107. Xtest list-1.4 {lvarpop tests} {
  1108. X    set a {a bbbbbb c d e f g h i j}
  1109. X    list [lvarpop a 2 frobozz] $a
  1110. X} {c {a bbbbbb frobozz d e f g h i j}}
  1111. X
  1112. Xtest list-1.5 {lvarpop tests} {
  1113. X    set a {a bbbbbb frozbozz d e f g h i j}
  1114. X    list [lvarpop a 2 f] $a
  1115. X} {frozbozz {a bbbbbb f d e f g h i j}}
  1116. X
  1117. Xtest list-1.6 {lvarpop tests} {
  1118. X    set a {a bbbbbb c d e f g h i j}
  1119. X    list [lvarpop a 20 frobozz] $a
  1120. X} {{} {a bbbbbb c d e f g h i j}}
  1121. X
  1122. Xtest list-1.7 {lvarpop tests} {
  1123. X    set a {a bbbbbb c d e f g h i j}
  1124. X    list [catch {lvarpop a -5 frobozz} msg] $msg
  1125. X} {1 {expected unsigned integer but got "-5"}}
  1126. X
  1127. Xtest list-1.8 {lvarpop tests} {
  1128. X    set a {}
  1129. X    list [lvarpop a] $a
  1130. X} {{} {}}
  1131. X
  1132. X
  1133. X
  1134. END_OF_FILE
  1135. if test 1667 -ne `wc -c <'extended/tests/list.test'`; then
  1136.     echo shar: \"'extended/tests/list.test'\" unpacked with wrong size!
  1137. fi
  1138. # end of 'extended/tests/list.test'
  1139. fi
  1140. if test -f 'extended/tests/math.test' -a "${1}" != "-c" ; then 
  1141.   echo shar: Will not clobber existing file \"'extended/tests/math.test'\"
  1142. else
  1143. echo shar: Extracting \"'extended/tests/math.test'\" \(2300 characters\)
  1144. sed "s/^X//" >'extended/tests/math.test' <<'END_OF_FILE'
  1145. X#
  1146. X# math.test
  1147. X#
  1148. X# Tests for the random, min, and commands.
  1149. X#---------------------------------------------------------------------------
  1150. X# Copyright 1991 Karl Lehenbauer and Mark Diekhans.
  1151. X#
  1152. X# Permission to use, copy, modify, and distribute this software and its
  1153. X# documentation for any purpose and without fee is hereby granted, provided
  1154. X# that the above copyright notice appear in all copies.  Karl Lehenbauer and
  1155. X# Mark Diekhans make no representations about the suitability of this
  1156. X# software for any purpose.  It is provided "as is" without express or
  1157. X# implied warranty.
  1158. X#
  1159. X
  1160. Xglobal ModuleName
  1161. Xset ModuleName "Math"
  1162. Xsource testutil.tcl
  1163. X
  1164. Xrandom seed 100
  1165. X
  1166. Xfor {set i 0} {$i < 400} {set i [expr $i+1]} {
  1167. X    set a [random 10]
  1168. X    check [expr "(($a >= 0) || ($a <= 9))"] 1  1.1
  1169. X}
  1170. X
  1171. Xdo1cmd {random} msg                                     2.1
  1172. Xcheck $msg {wrong # args: random limit | seed [seedval]} 2.2
  1173. X
  1174. X# Max range varies on some machines, so don't validate that part of
  1175. X# the message.
  1176. Xset expect {random: range must be > 0 and <=}
  1177. X
  1178. Xdo1cmd {random 0} msg                                   2.3
  1179. Xcatch {set msg [lrange $msg 0 7]}
  1180. Xcheck $msg $expect                                      2.4
  1181. X
  1182. Xdo1cmd {random seed Foo} msg                            2.5
  1183. Xcheck $msg {expected integer but got "Foo"}             2.6
  1184. X
  1185. X
  1186. X# Check min and max.
  1187. X
  1188. Xset val [max 1 2 4 3]
  1189. Xcheck $val 4                                       3.1
  1190. Xset val [max -68 65537.4 2 5]
  1191. Xcheck $val 65537.4                                 3.2
  1192. Xset val [max -68.7 2100000000 2 5]
  1193. Xcheck $val 2100000000                              3.3
  1194. X
  1195. Xset val [min 1 2 4 3]
  1196. Xcheck $val 1                                       3.4
  1197. Xset val [min -68.8 64000 2 5]
  1198. Xcheck $val -68.8                                   3.5
  1199. Xset val [min -2000000000 2000000000 2 5]
  1200. Xcheck $val -2000000000                             3.6
  1201. X
  1202. Xdo1cmd {max} msg                                   3.7
  1203. Xcheck $msg {wrong # args: max num1 num2 [..numN]}  3.8
  1204. Xdo1cmd {max 1 2 3 foo} msg                         3.9
  1205. Xcheck $msg {expected floating-point number but got "foo"} 3.10
  1206. X
  1207. Xdo1cmd {min} msg                                   3.11
  1208. Xcheck $msg {wrong # args: min num1 num2 [..numN]}  3.12
  1209. Xdo1cmd {min 1 2 3 foo} msg                         3.13
  1210. Xcheck $msg {expected floating-point number but got "foo"} 3.14
  1211. X
  1212. X
  1213. X
  1214. END_OF_FILE
  1215. if test 2300 -ne `wc -c <'extended/tests/math.test'`; then
  1216.     echo shar: \"'extended/tests/math.test'\" unpacked with wrong size!
  1217. fi
  1218. # end of 'extended/tests/math.test'
  1219. fi
  1220. echo shar: End of archive 5 \(of 23\).
  1221. cp /dev/null ark5isdone
  1222. MISSING=""
  1223. 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 ; do
  1224.     if test ! -f ark${I}isdone ; then
  1225.     MISSING="${MISSING} ${I}"
  1226.     fi
  1227. done
  1228. if test "${MISSING}" = "" ; then
  1229.     echo You have unpacked all 23 archives.
  1230.     echo "Now cd to "extended", edit the makefile, then do a "make""
  1231.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1232. else
  1233.     echo You still need to unpack the following archives:
  1234.     echo "        " ${MISSING}
  1235. fi
  1236. ##  End of shell archive.
  1237. exit 0
  1238.  
  1239. exit 0 # Just in case...
  1240. -- 
  1241. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1242. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1243. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1244. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1245.