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

  1. Newsgroups: comp.sources.misc
  2. From: karl@sugar.neosoft.com (Karl Lehenbauer)
  3. Subject:  v26i007:  tclx - extensions and on-line help for tcl 6.1, Part07/23
  4. Message-ID: <1991Nov19.005419.8717@sparky.imd.sterling.com>
  5. X-Md4-Signature: b0f6e51527b163ecfbf19de749b1016f
  6. Date: Tue, 19 Nov 1991 00:54:19 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: karl@sugar.neosoft.com (Karl Lehenbauer)
  10. Posting-number: Volume 26, Issue 7
  11. Archive-name: tclx/part07
  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 7 (of 23)."
  21. # Contents:  extended/src/clock.c extended/src/main.c
  22. #   extended/tcllib/help/commands/array
  23. #   extended/tcllib/help/commands/errorCode
  24. #   extended/tcllib/help/commands/exec
  25. #   extended/tcllib/help/commands/proc
  26. #   extended/tcllib/help/intro/backslash
  27. #   extended/tcllib/help/intro/dollar
  28. #   extended/tcllib/help/intro/results
  29. #   extended/tcllib/help/misc/memory
  30. #   extended/tcllib/help/tclshell/packagelib
  31. #   extended/tests/chartype.test
  32. # Wrapped by karl@one on Wed Nov 13 21:50:18 1991
  33. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  34. if test -f 'extended/src/clock.c' -a "${1}" != "-c" ; then 
  35.   echo shar: Will not clobber existing file \"'extended/src/clock.c'\"
  36. else
  37. echo shar: Extracting \"'extended/src/clock.c'\" \(3222 characters\)
  38. sed "s/^X//" >'extended/src/clock.c' <<'END_OF_FILE'
  39. X/* 
  40. X * clock.c --
  41. X *
  42. X *      Contains the TCL time and date related commands.
  43. X *---------------------------------------------------------------------------
  44. X * Copyright 1991 Karl Lehenbauer and Mark Diekhans.
  45. X *
  46. X * Permission to use, copy, modify, and distribute this software and its
  47. X * documentation for any purpose and without fee is hereby granted, provided
  48. X * that the above copyright notice appear in all copies.  Karl Lehenbauer and
  49. X * Mark Diekhans make no representations about the suitability of this
  50. X * software for any purpose.  It is provided "as is" without express or
  51. X * implied warranty.
  52. X */
  53. X
  54. X#include "tclExtdInt.h"
  55. X
  56. X/*
  57. X * These should be take from an include file, but it got to be such a mess
  58. X * to get the include files right that they are here for good measure.
  59. X */
  60. Xstruct tm *gmtime ();
  61. Xstruct tm *localtime ();
  62. X
  63. X
  64. X/*
  65. X *----------------------------------------------------------------------
  66. X *
  67. X * Tcl_GetclockCmd --
  68. X *     Implements the TCL getclock command:
  69. X *         getclock
  70. X *
  71. X * Results:
  72. X *     Standard TCL results.
  73. X *
  74. X *----------------------------------------------------------------------
  75. X */
  76. Xint
  77. XTcl_GetclockCmd (clientData, interp, argc, argv)
  78. X    ClientData  clientData;
  79. X    Tcl_Interp *interp;
  80. X    int         argc;
  81. X    char      **argv;
  82. X{
  83. X    if (argc != 1) {
  84. X        Tcl_AppendResult (interp, "wrong # args: ", argv[0], 
  85. X                          (char *) NULL);
  86. X        return TCL_ERROR;
  87. X    }
  88. X    sprintf (interp->result, "%ld", time ((char *)NULL));
  89. X    return TCL_OK;
  90. X}
  91. X
  92. X/*
  93. X *----------------------------------------------------------------------
  94. X *
  95. X * Tcl_FmtclockCmd --
  96. X *     Implements the TCL fmtclock command:
  97. X *         fmtclock clockval [format] [GMT|{}]
  98. X *
  99. X * Results:
  100. X *     Standard TCL results.
  101. X *
  102. X *----------------------------------------------------------------------
  103. X */
  104. Xint
  105. XTcl_FmtclockCmd (clientData, interp, argc, argv)
  106. X    ClientData  clientData;
  107. X    Tcl_Interp *interp;
  108. X    int         argc;
  109. X    char      **argv;
  110. X{
  111. X    int              useGMT = FALSE;
  112. X    long             ClockVal;
  113. X    char            *format;
  114. X    struct tm       *timeDataPtr;
  115. X    int              fmtError;
  116. X
  117. X    if ((argc < 2) || (argc > 4)) {
  118. X        Tcl_AppendResult (interp, "wrong # args: ", argv [0], 
  119. X                          " clockval [format] [GMT|{}]", (char *) NULL);
  120. X        return TCL_ERROR;
  121. X    }
  122. X
  123. X    if (Tcl_GetLong (interp, argv[1], &ClockVal) != TCL_OK)
  124. X        return TCL_ERROR;
  125. X    if ((argc == 4) && (argv [3][0] != '\0')) {
  126. X        if (!STREQU (argv [3], "GMT")) {
  127. X            Tcl_AppendResult (interp, "expected \"GMT\" or {} got \"",
  128. X                              argv [3], "\"", (char *) NULL);
  129. X            return TCL_ERROR;
  130. X        }
  131. X        useGMT = TRUE;
  132. X    }
  133. X
  134. X    if ((argc >= 3) && (argv [2][0] != '\0'))
  135. X        format = argv[2];
  136. X    else
  137. X        format = "%a %b %d %X %Z %Y";
  138. X
  139. X    if (useGMT)
  140. X        timeDataPtr = gmtime (&ClockVal);
  141. X    else    
  142. X        timeDataPtr = localtime (&ClockVal);
  143. X
  144. X    fmtError = strftime (interp->result, TCL_RESULT_SIZE, format, 
  145. X                         timeDataPtr) < 0;
  146. X    if (fmtError) {
  147. X        Tcl_AppendResult (interp, "error formating time", (char *) NULL);
  148. X        return TCL_ERROR;
  149. X    }
  150. X    return TCL_OK;
  151. X}
  152. END_OF_FILE
  153. if test 3222 -ne `wc -c <'extended/src/clock.c'`; then
  154.     echo shar: \"'extended/src/clock.c'\" unpacked with wrong size!
  155. fi
  156. # end of 'extended/src/clock.c'
  157. fi
  158. if test -f 'extended/src/main.c' -a "${1}" != "-c" ; then 
  159.   echo shar: Will not clobber existing file \"'extended/src/main.c'\"
  160. else
  161. echo shar: Extracting \"'extended/src/main.c'\" \(3938 characters\)
  162. sed "s/^X//" >'extended/src/main.c' <<'END_OF_FILE'
  163. X/* 
  164. X * main.c --
  165. X *
  166. X * Main to run the Tcl shell.  This file is a useful template for custom
  167. X * applications that wish to have Tcl as the top level command language.
  168. X *---------------------------------------------------------------------------
  169. X * Copyright 1991 Karl Lehenbauer and Mark Diekhans.
  170. X *
  171. X * Permission to use, copy, modify, and distribute this software and its
  172. X * documentation for any purpose and without fee is hereby granted, provided
  173. X * that the above copyright notice appear in all copies.  Karl Lehenbauer and
  174. X * Mark Diekhans make no representations about the suitability of this
  175. X * software for any purpose.  It is provided "as is" without express or
  176. X * implied warranty.
  177. X */
  178. X
  179. X#include "tclExtdInt.h"
  180. X#include "patchlevel.h"
  181. X
  182. Xextern errno;
  183. X
  184. X/*
  185. X * These globals are used by the infox command.
  186. X */
  187. X
  188. Xextern char *tclxVersion;        /* Extended Tcl version number.            */
  189. Xextern char *tclxPatchlevel;     /* Extended Tcl patch level.               */
  190. X
  191. Xextern char *tclAppName;         /* Application name                        */
  192. Xextern char *tclAppLongname;     /* Long, natural language application name */
  193. Xextern char *tclAppVersion;      /* Version number of the application       */
  194. X
  195. X/*
  196. X * If set to be a pointer to the procedure Tcl_RecordAndEval, will link in
  197. X * history
  198. X */
  199. Xextern int (*tclShellCmdEvalProc) ();
  200. X
  201. Xint
  202. Xmain(argc, argv)
  203. X    int     argc;
  204. X    char  **argv;
  205. X{
  206. X    Tcl_Interp *interp;
  207. X    char       *defaultFile;
  208. X
  209. X
  210. X    /*
  211. X     * Set values to return from the infox command.
  212. X     */
  213. X    tclxVersion = ckalloc (strlen (TCL_VERSION) + 
  214. X                           strlen (TCL_EXTD_VERSION_SUFFIX) + 1);
  215. X    strcpy (tclxVersion, TCL_VERSION);
  216. X    strcat (tclxVersion, TCL_EXTD_VERSION_SUFFIX);
  217. X
  218. X    tclxPatchlevel = "PATCHLEVEL";
  219. X
  220. X    /*
  221. X     * Path name for default file.  A version number is normally appended.
  222. X     *        >>>> MAYBE MODIFIED FOR a specific application <<<
  223. X     */
  224. X
  225. X    defaultFile = ckalloc (strlen (TCL_DEFAULT) + strlen (TCL_VERSION) +
  226. X                           strlen (TCL_EXTD_VERSION_SUFFIX) + 1);
  227. X    strcpy (defaultFile, TCL_DEFAULT);
  228. X    strcat (defaultFile, TCL_VERSION);
  229. X    strcat (defaultFile, TCL_EXTD_VERSION_SUFFIX);
  230. X
  231. X    /*
  232. X     * Set application specific values to return from the infox command.
  233. X     *        >>>> MAYBE MODIFIED FOR a specific application <<<
  234. X     */
  235. X    tclAppName = "TclX";
  236. X    tclAppLongname = "Extended Tcl Shell";
  237. X    tclAppVersion = tclxVersion;
  238. X
  239. X    /*
  240. X     * If history is to be used, then set the eval procedure pointer that
  241. X     * Tcl_CommandLoop so that history will be recorded.  This reference
  242. X     * also brings in history from Tcl.a.
  243. X     */
  244. X#ifndef TCL_NOHISTORY
  245. X     tclShellCmdEvalProc = Tcl_RecordAndEval;
  246. X#endif
  247. X
  248. X    /* 
  249. X     * Create a Tcl interpreter for the session, with all extended commands
  250. X     * initialized.  This can be replaced with Tcl_CreateInterp followed
  251. X     * by a subset of the extended command initializaton procedures if 
  252. X     * desired.
  253. X     */
  254. X    interp = Tcl_CreateExtendedInterp();
  255. X
  256. X    /*
  257. X     *   >>>>>> INITIALIZE APPLICATION SPECIFIC COMMANDS HERE <<<<<<
  258. X     */
  259. X
  260. X    /*
  261. X     * Load the tcl startup code, this should pull in all of the tcl
  262. X     * procs, paths, command line processing, autoloads, packages, etc.
  263. X     * If Tcl was invoked interactively, Tcl_Startup will give it
  264. X     * a command loop .
  265. X     */
  266. X
  267. X    Tcl_Startup (interp, argc, argv, defaultFile);
  268. X
  269. X    /* 
  270. X     * Delete the interpreter (not neccessary under Unix, but we do
  271. X     * it if TCL_MEM_DEBUG is set to better enable us to catch memory
  272. X     * corruption problems)
  273. X     */
  274. X
  275. X#ifdef TCL_MEM_DEBUG
  276. X    Tcl_DeleteInterp(interp);
  277. X    ckfree (defaultFile);
  278. X    ckfree (tclxVersion);
  279. X#endif
  280. X
  281. X#ifdef TCL_SHELL_MEM_LEAK
  282. X    printf (" >>> Dumping active memory list to mem.lst <<<\n");
  283. X    if (Tcl_DumpActiveMemory ("mem.lst") != TCL_OK)
  284. X        panic ("error accessing `mem.lst': %s", strerror (errno));
  285. X#endif
  286. X
  287. X    exit(0);
  288. X}
  289. X
  290. END_OF_FILE
  291. if test 3938 -ne `wc -c <'extended/src/main.c'`; then
  292.     echo shar: \"'extended/src/main.c'\" unpacked with wrong size!
  293. fi
  294. # end of 'extended/src/main.c'
  295. fi
  296. if test -f 'extended/tcllib/help/commands/array' -a "${1}" != "-c" ; then 
  297.   echo shar: Will not clobber existing file \"'extended/tcllib/help/commands/array'\"
  298. else
  299. echo shar: Extracting \"'extended/tcllib/help/commands/array'\" \(3520 characters\)
  300. sed "s/^X//" >'extended/tcllib/help/commands/array' <<'END_OF_FILE'
  301. X          array option arrayName ?arg arg ...?
  302. X               This command performs one of several operations on  the
  303. X               variable  given  by  arrayName.   ArrayName must be the
  304. X               name  of  an  existing  array  variable.   The   option
  305. X               argument  determines  what action is carried out by the
  306. X               command.  The legal options (which may be  abbreviated)
  307. X               are:
  308. X
  309. X               array anymore arrayName searchId
  310. X                    Returns  1  if there are any more elements left to
  311. X                    be processed in an array search, 0 if all elements
  312. X                    have  already  been  returned.  SearchId indicates
  313. X                    which search on arrayName to check, and must  have
  314. X                    been  the  return value from a previous invocation
  315. X                    of array startsearch.  This option is particularly
  316. X                    useful  if  an  array has an element with an empty
  317. X                    name,  since   the   return   value   from   array
  318. X                    nextelement  won't indicate whether the search has
  319. X                    been completed.
  320. X
  321. X               array donesearch arrayName searchId
  322. X                    This   command  terminates  an  array  search  and
  323. X                    destroys  all  the  state  associated  with   that
  324. X                    search.    SearchId   indicates  which  search  on
  325. X                    arrayName to  destroy,  and  must  have  been  the
  326. X                    return  value  from a previous invocation of array
  327. X                    startsearch.  Returns an empty string.
  328. X
  329. X               array names arrayName
  330. X                    Returns  a list containing the names of all of the
  331. X                    elements in the array.  If there are  no  elements
  332. X                    in the array then an empty string is returned.
  333. X
  334. X               array nextelement arrayName searchId
  335. X                    Returns the name of the next element in arrayName,
  336. X                    or an empty string if all  elements  of  arrayName
  337. X                    have  already  been  returned in this search.  The
  338. X                    searchId argument identifies the search, and  must
  339. X                    have been the return value of an array startsearch
  340. X                    command.  Warning:  if elements are  added  to  or
  341. X                    deleted  from  the  array,  then  all searches are
  342. X                    automatically  terminated   just   as   if   array
  343. X                    donesearch had been invoked; this will cause array
  344. X                    nextelement operations to fail for those searches.
  345. X
  346. X               array size arrayName
  347. X                    Returns  a  decimal  string  giving  the number of
  348. X                    elements in the array.
  349. X
  350. X               array startsearch arrayName
  351. X                    This  command  initializes  an  element-by-element
  352. X                    search through the array given by arrayName,  such
  353. X                    that  invocations of the array nextelement command
  354. X                    will return the names of the  individual  elements
  355. X                    in the array.  When the search has been completed,
  356. X                    the array donesearch command  should  be  invoked.
  357. X                    The  return value is a search identifier that must
  358. X                    be used in array nextelement and array  donesearch
  359. X                    commands;   it  allows  multiple  searches  to  be
  360. X                    underway simultaneously for the same array.
  361. END_OF_FILE
  362. if test 3520 -ne `wc -c <'extended/tcllib/help/commands/array'`; then
  363.     echo shar: \"'extended/tcllib/help/commands/array'\" unpacked with wrong size!
  364. fi
  365. # end of 'extended/tcllib/help/commands/array'
  366. fi
  367. if test -f 'extended/tcllib/help/commands/errorCode' -a "${1}" != "-c" ; then 
  368.   echo shar: Will not clobber existing file \"'extended/tcllib/help/commands/errorCode'\"
  369. else
  370. echo shar: Extracting \"'extended/tcllib/help/commands/errorCode'\" \(3886 characters\)
  371. sed "s/^X//" >'extended/tcllib/help/commands/errorCode' <<'END_OF_FILE'
  372. X          errorCode
  373. X               After  an error has occurred, this variable will be set
  374. X               to hold additional information about  the  error  in  a
  375. X               form  that is easy to process with programs.  errorCode
  376. X               consists of a Tcl list with one or more elements.   The
  377. X               first element of the list identifies a general class of
  378. X               errors, and determines the format of the  rest  of  the
  379. X               list.   The following formats for errorCode are used by
  380. X               the  Tcl  core;  individual  applications  may   define
  381. X               additional formats.
  382. X
  383. X               CHILDKILLED pid sigName msg
  384. X                    This  format is used when a child process has been
  385. X                    killed because of a signal.  The second element of
  386. X                    errorCode  will  be  the  process's identifier (in
  387. X                    decimal).  The third element will be the  symbolic
  388. X                    name  of  the  signal  that  caused the process to
  389. X                    terminate; it will be one of the  names  from  the
  390. X                    include  file  signal.h,  such  as  SIGPIPE.   The
  391. X                    fourth element  will  be  a  short  human-readable
  392. X                    message  describing the signal, such as ``write on
  393. X                    pipe with no readers'' for SIGPIPE.
  394. X
  395. X               CHILDSTATUS pid code
  396. X                    This  format  is  used  when  a  child process has
  397. X                    exited with a non-zero exit  status.   The  second
  398. X                    element   of   errorCode  will  be  the  process's
  399. X                    identifier (in decimal) and the third element will
  400. X                    be  the exit code returned by the process (also in
  401. X                    decimal).
  402. X
  403. X               CHILDSUSP pid code
  404. X                    This  format is used when a child process has been
  405. X                    suspended because of a signal.  The second element
  406. X                    of  errorCode will be the process's identifier, in
  407. X                    decimal.  The third element will be  the  symbolic
  408. X                    name  of  the  signal  that  caused the process to
  409. X                    suspend; this will be one of the  names  from  the
  410. X                    include  file  signal.h,  such  as  SIGTTIN.   The
  411. X                    fourth element  will  be  a  short  human-readable
  412. X                    message    describing    the   signal,   such   as
  413. X                    ``background tty read'' for SIGTTIN.
  414. X
  415. X               NONE
  416. X                    This format is used for errors where no additional
  417. X                    information is available for an error besides  the
  418. X                    message  returned  with the error.  In these cases
  419. X                    errorCode will consist  of  a  list  containing  a
  420. X                    single element whose contents are NONE.
  421. X
  422. X               UNIX errName msg
  423. X                    If  the  first  element of errorCode is UNIX, then
  424. X                    the error occurred during a UNIX kernel call.  The
  425. X                    second  element  of  the  list  will  contain  the
  426. X                    symbolic name of the error that occurred, such  as
  427. X                    ENOENT;  this will be one of the values defined in
  428. X                    the include file errno.h.  The  third  element  of
  429. X                    the   list   will   be  a  human-readable  message
  430. X                    corresponding to errName, such as ``no  such  file
  431. X                    or directory'' for the ENOENT case.
  432. X
  433. X               To  set  errorCode,  applications  should  use  library
  434. X               procedures  such as Tcl_SetErrorCode and Tcl_UnixError,
  435. X               or they may invoke the error command.  If one of  these
  436. X               methods hasn't been used, then the Tcl interpreter will
  437. X               reset the variable to NONE after the next error.
  438. END_OF_FILE
  439. if test 3886 -ne `wc -c <'extended/tcllib/help/commands/errorCode'`; then
  440.     echo shar: \"'extended/tcllib/help/commands/errorCode'\" unpacked with wrong size!
  441. fi
  442. # end of 'extended/tcllib/help/commands/errorCode'
  443. fi
  444. if test -f 'extended/tcllib/help/commands/exec' -a "${1}" != "-c" ; then 
  445.   echo shar: Will not clobber existing file \"'extended/tcllib/help/commands/exec'\"
  446. else
  447. echo shar: Extracting \"'extended/tcllib/help/commands/exec'\" \(3730 characters\)
  448. sed "s/^X//" >'extended/tcllib/help/commands/exec' <<'END_OF_FILE'
  449. X          exec arg ?arg ...?
  450. X               This command treats its arguments as the  specification
  451. X               of   one   or   more   UNIX   commands  to  execute  as
  452. X               subprocesses.  The commands take the form of a standard
  453. X               shell  pipeline;  ``|''  arguments separate commands in
  454. X               the pipeline and cause standard output of the preceding
  455. X               command  to  be  piped  into standard input of the next
  456. X               command.
  457. X
  458. X               Under normal conditions the result of the exec  command
  459. X               consists  of  the  standard output produced by the last
  460. X               command in the pipeline.  If any of the commands in the
  461. X               pipeline  exit  abnormally  or are killed or suspended,
  462. X               then exec will return an error and  the  error  message
  463. X               will  include  the  pipeline's output followed by error
  464. X               messages  describing  the  abnormal  terminations;  the
  465. X               errorCode  variable will contain additional information
  466. X               about the last abnormal  termination  encountered.   If
  467. X               any  of the commands writes to its standard error file,
  468. X               then exec will return an error, and the  error  message
  469. X               will   include   the  pipeline's  output,  followed  by
  470. X               messages about abnormal terminations (if any), followed
  471. X               by the standard error output.
  472. X
  473. X               If the last character of the result or error message is
  474. X               a  newline  then  that  character  is  deleted from the
  475. X               result or error message for consistency with normal Tcl
  476. X               return values.
  477. X
  478. X               If an arg  has  the  value  ``>''  then  the  following
  479. X               argument  is  taken  as  the  name  of  a  file and the
  480. X               standard output of the last command in the pipeline  is
  481. X               redirected  to  the  file.  In this situation exec will
  482. X               normally return an empty string.
  483. X
  484. X               If an arg  has  the  value  ``<''  then  the  following
  485. X               argument  is  taken  as  the  name of a file to use for
  486. X               standard input to the first command  in  the  pipeline.
  487. X               If  an argument has the value ``<<'' then the following
  488. X               argument is taken as an immediate value to be passed to
  489. X               the  first  command  as standard input.  If there is no
  490. X               ``<'' or ``<<'' argument then the  standard  input  for
  491. X               the  first  command  in  the pipeline is taken from the
  492. X               application's current standard input.
  493. X
  494. X               If the last arg is  ``&''  then  the  command  will  be
  495. X               executed  in  background.   In  this  case the standard
  496. X               output from the last command in the pipeline will go to
  497. X               the  application's standard output unless redirected in
  498. X               the command, and error output from all the commands  in
  499. X               the  pipeline  will  go  to  the application's standard
  500. X               error file.
  501. X
  502. X               Each arg becomes one word for  a  command,  except  for
  503. X               ``|'',  ``<'',  ``<<'', ``>'', and ``&'' arguments, and
  504. X               the arguments that follow  ``<'',  ``<<'',  and  ``>''.
  505. X               The  first word in each command is taken as the command
  506. X               name; tilde-substitution is performed on  it,  and  the
  507. X               directories   in  the  PATH  environment  variable  are
  508. X               searched for an  executable  by  the  given  name.   No
  509. X               ``glob''  expansion  or  other shell-like substitutions
  510. X               are performed on the arguments to commands.
  511. X
  512. END_OF_FILE
  513. if test 3730 -ne `wc -c <'extended/tcllib/help/commands/exec'`; then
  514.     echo shar: \"'extended/tcllib/help/commands/exec'\" unpacked with wrong size!
  515. fi
  516. # end of 'extended/tcllib/help/commands/exec'
  517. fi
  518. if test -f 'extended/tcllib/help/commands/proc' -a "${1}" != "-c" ; then 
  519.   echo shar: Will not clobber existing file \"'extended/tcllib/help/commands/proc'\"
  520. else
  521. echo shar: Extracting \"'extended/tcllib/help/commands/proc'\" \(3180 characters\)
  522. sed "s/^X//" >'extended/tcllib/help/commands/proc' <<'END_OF_FILE'
  523. X          proc name args body
  524. X               The proc command creates a new Tcl  command  procedure,
  525. X               name,  replacing  any  existing  command there may have
  526. X               been  by  that  name.   Whenever  the  new  command  is
  527. X               invoked,  the  contents of body will be executed by the
  528. X               Tcl interpreter.  Args specifies the  formal  arguments
  529. X               to  the  procedure.   It  consists  of a list, possibly
  530. X               empty, each of whose elements specifies  one  argument.
  531. X               Each  argument specifier is also a list with either one
  532. X               or two fields.  If there is only a single field in  the
  533. X               specifier,  then  it  is  the  name of the argument; if
  534. X               there are two fields, then the first  is  the  argument
  535. X               name  and  the second is its default value.  braces and
  536. X               backslashes may be used in the  usual  way  to  specify
  537. X               complex default values.
  538. X
  539. X               When name is invoked, a local variable will be  created
  540. X               for  each of the formal arguments to the procedure; its
  541. X               value will be the value of  corresponding  argument  in
  542. X               the  invoking  command or the argument's default value.
  543. X               Arguments with default values need not be specified  in
  544. X               a  procedure invocation.  However, there must be enough
  545. X               actual arguments for  all  the  formal  arguments  that
  546. X               don't  have  defaults,  and there must not be any extra
  547. X               actual arguments.  There is one special case to  permit
  548. X               procedures  with variable numbers of arguments.  If the
  549. X               last formal argument has the name args, then a call  to
  550. X               the  procedure  may  contain more actual arguments than
  551. X               the procedure has formals.  In this case,  all  of  the
  552. X               actual  arguments  starting  at  the  one that would be
  553. X               assigned to args are combined into a list  (as  if  the
  554. X               list  command  had  been  used); this combined value is
  555. X               assigned to the local variable args.
  556. X
  557. X               When body is being executed,  variable  names  normally
  558. X               refer   to   local   variables,   which   are   created
  559. X               automatically when  referenced  and  deleted  when  the
  560. X               procedure returns.  One local variable is automatically
  561. X               created for each of the procedure's arguments.   Global
  562. X               variables  can  only be accessed by invoking the global
  563. X               command.
  564. X
  565. X               The proc command  returns  the  null  string.   When  a
  566. X               procedure  is  invoked, the procedure's return value is
  567. X               the value  specified  in  a  return  command.   If  the
  568. X               procedure  doesn't execute an explicit return, then its
  569. X               return value is the value of the last command  executed
  570. X               in  the  procedure's  body.   If  an error occurs while
  571. X               executing the procedure body, then the  procedure-as-a-
  572. X               whole will return that same error.
  573. END_OF_FILE
  574. if test 3180 -ne `wc -c <'extended/tcllib/help/commands/proc'`; then
  575.     echo shar: \"'extended/tcllib/help/commands/proc'\" unpacked with wrong size!
  576. fi
  577. # end of 'extended/tcllib/help/commands/proc'
  578. fi
  579. if test -f 'extended/tcllib/help/intro/backslash' -a "${1}" != "-c" ; then 
  580.   echo shar: Will not clobber existing file \"'extended/tcllib/help/intro/backslash'\"
  581. else
  582. echo shar: Extracting \"'extended/tcllib/help/intro/backslash'\" \(3691 characters\)
  583. sed "s/^X//" >'extended/tcllib/help/intro/backslash' <<'END_OF_FILE'
  584. X     BACKSLASH SUBSTITUTION
  585. X          Backslashes may be used to  insert  non-printing  characters
  586. X          into  command  fields  and also to insert special characters
  587. X          like braces and brackets  into  fields  without  them  being
  588. X          interpreted  specially  as  described  above.  The backslash
  589. X          sequences understood  by  the  Tcl  interpreter  are  listed
  590. X          below.   In each case, the backslash sequence is replaced by
  591. X          the given character:
  592. X
  593. X          \b                  Backspace (0x8).
  594. X
  595. X          \f                  Form feed (0xc).
  596. X
  597. X          \n                  Newline (0xa).
  598. X
  599. X          \r                  Carriage-return (0xd).
  600. X
  601. X          \t                  Tab (0x9).
  602. X
  603. X          \v                  Vertical tab (0xb).
  604. X
  605. X          \{                  Left brace (``{'').
  606. X
  607. X          \}                  Right brace (``}'').
  608. X
  609. X          \[                  Open bracket (``['').
  610. X
  611. X          \]                  Close bracket (``]'').
  612. X
  613. X          \$                  Dollar sign (``$'').
  614. X
  615. X          \<space>            Space   (``   ''):   doesn't   terminate
  616. X                              argument.
  617. X
  618. X          \;                  Semi-colon: doesn't terminate command.
  619. X
  620. X          \"                  Double-quote.
  621. X
  622. X          \<newline>          Nothing:  this joins two lines  together
  623. X                              into  a  single  line.   This  backslash
  624. X                              feature is unique in  that  it  will  be
  625. X                              applied  even  when  the sequence occurs
  626. X                              within braces.
  627. X
  628. X          \\                  Backslash (``\'').
  629. X
  630. X          \ddd                The digits ddd (one, two,  or  three  of
  631. X                              them)   give  the  octal  value  of  the
  632. X                              character.  Null characters may  not  be
  633. X                              embedded  in  command  fields; if ddd is
  634. X                              zero  then  the  backslash  sequence  is
  635. X                              ignored   (i.e.  it  maps  to  an  empty
  636. X                              string).
  637. X
  638. X          For example, in the command
  639. X
  640. X               set a \{x\[\ yz\141
  641. X
  642. X          the second argument to set will be ``{x[ yza''.
  643. X
  644. X          If a backslash is followed by something other  than  one  of
  645. X          the   options   described   above,  then  the  backslash  is
  646. X          transmitted  to  the  argument  field  without  any  special
  647. X          processing,  and the Tcl scanner continues normal processing
  648. X          with the next character.  For example, in the command
  649. X
  650. X               set \*a \\\{foo
  651. X          The first argument  to  set  will  be  \*a  and  the  second
  652. X          argument will be \{foo.
  653. X
  654. X          If  an  argument  is  enclosed  in  braces,  then  backslash
  655. X          sequences inside the argument are parsed but no substitution
  656. X          occurs  (except  for  backslash-newline):    the   backslash
  657. X          sequence  is  passed  through to the argument as is, without
  658. X          making any special interpretation of the characters  in  the
  659. X          backslash  sequence.   In particular, backslashed braces are
  660. X          not counted  in  locating  the  matching  right  brace  that
  661. X          terminates the argument.  For example, in the command
  662. X
  663. X               set a {\{abc}
  664. X
  665. X          the second argument to set will be \{abc.
  666. X
  667. X          This backslash  mechanism  is  not  sufficient  to  generate
  668. X          absolutely  any  argument structure; it only covers the most
  669. X          common cases.  To produce particularly complicated arguments
  670. X          it  is probably easiest to use the format command along with
  671. X          command substitution.
  672. END_OF_FILE
  673. if test 3691 -ne `wc -c <'extended/tcllib/help/intro/backslash'`; then
  674.     echo shar: \"'extended/tcllib/help/intro/backslash'\" unpacked with wrong size!
  675. fi
  676. # end of 'extended/tcllib/help/intro/backslash'
  677. fi
  678. if test -f 'extended/tcllib/help/intro/dollar' -a "${1}" != "-c" ; then 
  679.   echo shar: Will not clobber existing file \"'extended/tcllib/help/intro/dollar'\"
  680. else
  681. echo shar: Extracting \"'extended/tcllib/help/intro/dollar'\" \(3336 characters\)
  682. sed "s/^X//" >'extended/tcllib/help/intro/dollar' <<'END_OF_FILE'
  683. X     VARIABLE SUBSTITUTION WITH $
  684. X          The dollar sign ($) may be used as a special shorthand  form
  685. X          for  substituting  variable  values.   If  $  appears  in an
  686. X          argument  that  isn't  enclosed  in  braces  then   variable
  687. X          substitution  will occur.  The characters after the $, up to
  688. X          the  first  character  that  isn't  a  number,  letter,   or
  689. X          underscore,  are  taken  as  a  variable name and the string
  690. X          value of that variable is substituted  for  the  name.   For
  691. X          example,  if  variable  foo  has  the  value  test, then the
  692. X          command                                                     
  693. X
  694. X               set a $foo.c                                           
  695. X
  696. X          is equivalent to the command                                
  697. X
  698. X               set a test.c                                           
  699. X
  700. X
  701. X          There are two special forms for variable  substitution.   If
  702. X          the next character after the name of the variable is an open
  703. X          parenthesis, then the variable is assumed  to  be  an  array
  704. X          name, and all of the characters between the open parenthesis
  705. X          and the next close parenthesis are taken as  an  index  into
  706. X          the array.  Command substitutions and variable substitutions
  707. X          are performed on the  information  between  the  parentheses
  708. X          before it is used as an index.  For example, if the variable
  709. X          x is an array with one element named first and value 87  and
  710. X          another element named 14 and value more, then the command   
  711. X
  712. X               set a xyz$x(first)zyx                                  
  713. X          is equivalent to the command                                
  714. X
  715. X               set a xyz87zyx                                         
  716. X
  717. X          If the variable index has the value 14, then the command    
  718. X
  719. X               set a xyz$x($index)zyx                                 
  720. X          is equivalent to the command                                
  721. X
  722. X               set a xyzmorezyx                                       
  723. X
  724. X          For more information on arrays,  see  VARIABLES  AND  ARRAYS
  725. X          below.                                                      
  726. X
  727. X          The second special form for variables occurs when the dollar
  728. X          sign  is  followed by an open curly brace.  In this case the
  729. X          variable name consists of all the characters up to the  next
  730. X          curly  brace.   Array  references  are  not possible in this
  731. X          form:  the name between braces is  assumed  to  refer  to  a
  732. X          scalar variable.  For example, if variable foo has the value
  733. X          test, then the command                                      
  734. X
  735. X               set a abc${foo}bar                                     
  736. X          is equivalent to the command                                
  737. X
  738. X               set a abctestbar                                       
  739. X
  740. X          Variable substitution does not occur in arguments  that  are
  741. X          enclosed  in  braces:  the dollar sign and variable name are
  742. X          passed through to the argument verbatim.
  743. X
  744. X          The dollar sign abbreviation is simply a shorthand form.  $a
  745. X          is  completely  equivalent  to  [set a]; it is provided as a
  746. X          convenience to reduce typing.
  747. END_OF_FILE
  748. if test 3336 -ne `wc -c <'extended/tcllib/help/intro/dollar'`; then
  749.     echo shar: \"'extended/tcllib/help/intro/dollar'\" unpacked with wrong size!
  750. fi
  751. # end of 'extended/tcllib/help/intro/dollar'
  752. fi
  753. if test -f 'extended/tcllib/help/intro/results' -a "${1}" != "-c" ; then 
  754.   echo shar: Will not clobber existing file \"'extended/tcllib/help/intro/results'\"
  755. else
  756. echo shar: Extracting \"'extended/tcllib/help/intro/results'\" \(3867 characters\)
  757. sed "s/^X//" >'extended/tcllib/help/intro/results' <<'END_OF_FILE'
  758. X     COMMAND RESULTS
  759. X          Each command produces two results:  a  code  and  a  string.
  760. X          The   code   indicates   whether   the   command   completed
  761. X          successfully  or  not,  and  the  string  gives   additional
  762. X          information.  The valid codes are defined in tcl.h, and are:
  763. X
  764. X               TCL_OK              This is the normal return code, and
  765. X                                   indicates    that    the    command
  766. X                                   completed successfully.  The string
  767. X                                   gives the command's return value.
  768. X
  769. X               TCL_ERROR           Indicates that an  error  occurred;
  770. X                                   the    string   gives   a   message
  771. X                                   describing the error.  In  additon,
  772. X                                   the  global variable errorInfo will
  773. X                                   contain human-readable  information
  774. X                                   describing   which   commands   and
  775. X                                   procedures were being executed when
  776. X                                   the  error occurred, and the global
  777. X                                   variable  errorCode  will   contain
  778. X                                   machine-readable  details about the
  779. X                                   error, if they are available.   See
  780. X                                   the   section   BUILT-IN  VARIABLES
  781. X                                   below for more information.
  782. X
  783. X               TCL_RETURN          Indicates that the  return  command
  784. X                                   has  been  invoked,  and  that  the
  785. X                                   current  procedure  (or   top-level
  786. X                                   command  or  source command) should
  787. X                                   return  immediately.   The   string
  788. X                                   gives  the  return  value  for  the
  789. X                                   procedure or command.
  790. X
  791. X               TCL_BREAK           Indicates that  the  break  command
  792. X                                   has  been invoked, so the innermost
  793. X                                   loop should abort immediately.  The
  794. X                                   string should always be empty.
  795. X
  796. X               TCL_CONTINUE        Indicates that the continue command
  797. X                                   has  been invoked, so the innermost
  798. X                                   loop  should  go  on  to  the  next
  799. X                                   iteration.    The   string   should
  800. X                                   always be empty.
  801. X          Tcl programmers do not normally need to think  about  return
  802. X          codes,  since TCL_OK is almost always returned.  If anything
  803. X          else is returned by a  command,  then  the  Tcl  interpreter
  804. X          immediately  stops  processing  commands  and returns to its
  805. X          caller.  If there are several nested invocations of the  Tcl
  806. X          interpreter  in  progress,  then  each  nested  command will
  807. X          usually return the error to its caller, until eventually the
  808. X          error  is  reported  to the top-level application code.  The
  809. X          application will then display  the  error  message  for  the
  810. X          user.
  811. X
  812. X          In a few cases, some commands will handle certain  ``error''
  813. X          conditions  themselves  and  not  return  them upwards.  For
  814. X          example, the for command checks for the TCL_BREAK  code;  if
  815. X          it occurs, then for stops executing the body of the loop and
  816. X          returns TCL_OK to its caller.  The for command also  handles
  817. X          TCL_CONTINUE  codes  and  the  procedure interpreter handles
  818. X          TCL_RETURN codes.  The catch command allows Tcl programs  to
  819. X          catch  errors  and  handle  them  without  aborting  command
  820. X          interpretation any further.
  821. END_OF_FILE
  822. if test 3867 -ne `wc -c <'extended/tcllib/help/intro/results'`; then
  823.     echo shar: \"'extended/tcllib/help/intro/results'\" unpacked with wrong size!
  824. fi
  825. # end of 'extended/tcllib/help/intro/results'
  826. fi
  827. if test -f 'extended/tcllib/help/misc/memory' -a "${1}" != "-c" ; then 
  828.   echo shar: Will not clobber existing file \"'extended/tcllib/help/misc/memory'\"
  829. else
  830. echo shar: Extracting \"'extended/tcllib/help/misc/memory'\" \(3618 characters\)
  831. sed "s/^X//" >'extended/tcllib/help/misc/memory' <<'END_OF_FILE'
  832. X
  833. X
  834. X          memory options
  835. X               The Tcl memory command gives the Tcl developer control
  836. X               of Tcl's memory debugging capabilities.  The memory
  837. X               command has several suboptions, which are described
  838. X               below.  It is only available when Tcl has been compiled
  839. X               with memory debugging enabled.
  840. X
  841. X          memory info
  842. X               Produces a report containing the total allocations and
  843. X               frees since Tcl began, the current packets allocated
  844. X               (the current number of calls to ckalloc not met by a
  845. X               corresponding call to ckfree), the current bytes
  846. X               allocated, and the maximum number of packets and bytes
  847. X               allocated.
  848. X
  849. X          memory trace [on|off]
  850. X               Turns memory tracing on or off.  When memory tracing is
  851. X               on, every call to ckalloc causes a line of trace
  852. X               information to be written to stderr, consisting of the
  853. X               word ckalloc, followed by the address returned, the
  854. X               amount of memory allocated, and the C filename and line
  855. X               number of the code performing the allocation, for
  856. X               example...
  857. X
  858. X                  ckalloc 40e478 98 tclProc.c 1406
  859. X
  860. X               Calls to ckfree are traced in the same manner, except
  861. X               that the word ckalloc is replaced by the word ckfree.
  862. X
  863. X          memory validate [on|off]
  864. X               Turns memory vaidation on or off.  When memory
  865. X               validation is enabled, on every call to ckalloc or
  866. X               ckfree, the guard zones are checked for every piece of
  867. X               memory currently in existence that was allocated by
  868. X               ckalloc.  This has a large performance impact and
  869. X               should only be used when overwrite problems are
  870. X               strongly suspected.  The advantage of enabling memory
  871. X               validation is that a guard zone overwrite can be
  872. X               detected on the first call to ckalloc or ckfree after
  873. X               the overwrite occurred, rather than when the specific
  874. X               memory with the overwritten guard zone(s) is freed,
  875. X               which may occur long after the overwrite occurred.
  876. X
  877. X          memory trace_on_at_malloc nnn
  878. X               Enable memory tracing after nnn ckallocs have been
  879. X               performed.  For example, if you enter memory
  880. X               trace_on_at_malloc 100, after the 100th call to
  881. X               ckalloc, memory trace information will begin being
  882. X               displayed for all allocations and frees.  Since there
  883. X               can be a lot of memory activity before a problem
  884. X               occurs, judicious use of this option can reduce the
  885. X               slowdown caused by tracing (and the amount of trace
  886. X               information produced), if you can identify a number of
  887. X               allocations that occur before the problem sets in.  The
  888. X               current number of memory allocations that have occured
  889. X               since Tcl started is printed on a guard zone failure.
  890. X
  891. X          memory break_on_malloc nnn
  892. X               After the nnn allocations have been performed, ckallocs
  893. X               output a message to this effect and that it is now
  894. X               attempting to enter the C debugger.  Tcl will then
  895. X               issue a SIGINT signal against itself.  If you are
  896. X               running Tcl under a C debugger, it should then enter
  897. X               the debugger command mode.
  898. X
  899. X          memory display file
  900. X               Write a list of all currently allocated memory to the
  901. X               specified file.
  902. END_OF_FILE
  903. if test 3618 -ne `wc -c <'extended/tcllib/help/misc/memory'`; then
  904.     echo shar: \"'extended/tcllib/help/misc/memory'\" unpacked with wrong size!
  905. fi
  906. # end of 'extended/tcllib/help/misc/memory'
  907. fi
  908. if test -f 'extended/tcllib/help/tclshell/packagelib' -a "${1}" != "-c" ; then 
  909.   echo shar: Will not clobber existing file \"'extended/tcllib/help/tclshell/packagelib'\"
  910. else
  911. echo shar: Extracting \"'extended/tcllib/help/tclshell/packagelib'\" \(3287 characters\)
  912. sed "s/^X//" >'extended/tcllib/help/tclshell/packagelib' <<'END_OF_FILE'
  913. X
  914. X
  915. X     PACKAGE LIBRARIES
  916. X          Package libraries work like autoload, except that a package
  917. X          library file can contain multiple independent Tcl packages.
  918. X          A package is a collection of related Tcl procedures.
  919. X
  920. X          The package library file is just a regular Unix text file,
  921. X          editable with your favorite text editor, containing packages
  922. X          of Tcl source code. The package library must end in .tlib,
  923. X          an index file with the suffix .tndx will be built
  924. X          corresponding to the package library.  The start of a
  925. X          package is delimited by:
  926. X
  927. X               #@package: package_name proc1 [..procN]
  928. X
  929. X          These lines must start in column one.  Everything between
  930. X          the package keyword and the next package keyword, or the end
  931. X          of the file, becomes part of the named package. The
  932. X          specified procedures, proc1..procN, are the entry points of
  933. X          the package.  When a command named in a package command is
  934. X          executed and detected as an unknown command, all code in the
  935. X          specified package will be sourced.  This package should
  936. X          define all of the procedures named on the package line,
  937. X          define any support procedures required by the package and do
  938. X          any package-specific initialization.
  939. X
  940. X          For example, in a package source file, the presence of the
  941. X          following line:
  942. X
  943. X               #@package: directory_stack pushd popd dirs
  944. X
  945. X          says that the text lines following that line in the package
  946. X          file up to the next package line or the end of the file is a
  947. X          package named directory_stack and that an attempt to execute
  948. X          either pushd, popd or dirs when the routine is not already
  949. X          defined will cause the directory_stack portion of the
  950. X          package file to be loaded.
  951. X
  952. X     PACKAGE INDEX FILES
  953. X          A package library file has associated with it an index file
  954. X          called a .tndx file.  The .tndx file contains the names of
  955. X          the packages in the .tlib file, their addresses and lengths
  956. X          within the .tlib file and the functions that are to cause
  957. X          the different packages to be autoloaded when an attempt is
  958. X          made to execute them.
  959. X
  960. X          The first time Tcl tries to execute a procedure where the
  961. X          procedure doesn't exist and isn't an autoload, Tcl will
  962. X          search along TCLPATH looking for any files ending in .tlib.
  963. X          For each one it finds, it checks to see if there is a
  964. X          corresponding file in the same directory ending in .tndx.
  965. X          If the .tndx file doesn't exist, or if its date of last
  966. X          modification is older than that of the .tlib file, the .tndx
  967. X          is automatically (re)generated if possible.  If Tcl can't
  968. X          regenerate the file (most likely due to file or directory
  969. X          permission problems), an error occurs.
  970. X
  971. X          Demand loading is also supported from indexes build by the
  972. X          mkindex.tcl program, supplied with standard Tcl.  However,
  973. X          init.tcl is not loaded.  Note that the info library command
  974. X          is not used to locate libraries by this shell; the TCLPATH
  975. X          variable is set by the default file and is used to locate
  976. X          the libraries.
  977. END_OF_FILE
  978. if test 3287 -ne `wc -c <'extended/tcllib/help/tclshell/packagelib'`; then
  979.     echo shar: \"'extended/tcllib/help/tclshell/packagelib'\" unpacked with wrong size!
  980. fi
  981. # end of 'extended/tcllib/help/tclshell/packagelib'
  982. fi
  983. if test -f 'extended/tests/chartype.test' -a "${1}" != "-c" ; then 
  984.   echo shar: Will not clobber existing file \"'extended/tests/chartype.test'\"
  985. else
  986. echo shar: Extracting \"'extended/tests/chartype.test'\" \(3606 characters\)
  987. sed "s/^X//" >'extended/tests/chartype.test' <<'END_OF_FILE'
  988. X#
  989. X# chartype.test
  990. X#
  991. X# Tests for the ctype command.
  992. X#---------------------------------------------------------------------------
  993. X# Copyright 1991 Karl Lehenbauer and Mark Diekhans.
  994. X#
  995. X# Permission to use, copy, modify, and distribute this software and its
  996. X# documentation for any purpose and without fee is hereby granted, provided
  997. X# that the above copyright notice appear in all copies.  Karl Lehenbauer and
  998. X# Mark Diekhans make no representations about the suitability of this
  999. X# software for any purpose.  It is provided "as is" without express or
  1000. X# implied warranty.
  1001. X#
  1002. X
  1003. Xif {[info procs test] != "test"} then {source defs}
  1004. X
  1005. Xtest chartype-1.1 {ctype tests} {
  1006. X    ctype digit 01234567
  1007. X} {1}
  1008. X
  1009. Xtest chartype-1.2 {ctype tests} {
  1010. X    ctype digit abc123cd
  1011. X} {0}
  1012. X
  1013. Xtest chartype-1.3 {ctype tests} {
  1014. X    ctype xdigit 01234567abcdefABCDEF
  1015. X} {1}
  1016. X
  1017. Xtest chartype-1.4 {ctype tests} {
  1018. X    ctype xdigit XMc123cd
  1019. X} {0}
  1020. X
  1021. Xtest chartype-1.5 {ctype tests} {
  1022. X    ctype lower abcdefgh
  1023. X} {1}
  1024. X
  1025. Xtest chartype-1.6 {ctype tests} {
  1026. X    ctype lower abcDeFgh
  1027. X} {0}
  1028. X
  1029. Xtest chartype-1.7 {ctype tests} {
  1030. X    ctype upper ABCDEFGH
  1031. X} {1}
  1032. X
  1033. Xtest chartype-1.8 {ctype tests} {
  1034. X    ctype upper abcDeFgh
  1035. X} {0}
  1036. X
  1037. Xtest chartype-1.9 {ctype tests} {
  1038. X    ctype alpha abcdXYZ
  1039. X} {1}
  1040. X
  1041. Xtest chartype-1.10 {ctype tests} {
  1042. X    ctype alpha abc123cd
  1043. X} {0}
  1044. X
  1045. Xtest chartype-1.11 {ctype tests} {
  1046. X    ctype alnum 0123ABC7
  1047. X} {1}
  1048. X
  1049. Xtest chartype-1.12 {ctype tests} {
  1050. X    ctype alnum ab.%23cd
  1051. X} {0}
  1052. X
  1053. Xtest chartype-1.13 {ctype tests} {
  1054. X    ctype space " \t\n "
  1055. X} {1}
  1056. X
  1057. Xtest chartype-1.14 {ctype tests} {
  1058. X    ctype space "ab \t z"
  1059. X} {0}
  1060. X
  1061. Xtest chartype-1.15 {ctype tests} {
  1062. X    ctype cntrl "[ctype char 7][ctype char 15][ctype char 20]"
  1063. X} {1}
  1064. X
  1065. Xtest chartype-1.16 {ctype tests} {
  1066. X    ctype cntrl "[ctype char 7]abcd"
  1067. X} {0}
  1068. X
  1069. Xtest chartype-1.17 {ctype tests} {
  1070. X    ctype punct ".,:;"
  1071. X} {1}
  1072. X
  1073. Xtest chartype-1.18 {ctype tests} {
  1074. X    ctype punct ".,:;ab"
  1075. X} {0}
  1076. X
  1077. X
  1078. Xtest chartype-1.19 {ctype tests} {
  1079. X    ctype print "01 :;.567"
  1080. X} {1}
  1081. X
  1082. Xtest chartype-1.20 {ctype tests} {
  1083. X    ctype print "[ctype char 7][ctype char 15]abc"
  1084. X} {0}
  1085. X
  1086. X
  1087. Xtest chartype-1.21 {ctype tests} {
  1088. X    ctype graph "ab.zxy"
  1089. X} {1}
  1090. X
  1091. Xtest chartype-1.22 {ctype tests} {
  1092. X    ctype graph "abc 3cd"
  1093. X} {0}
  1094. X
  1095. Xtest chartype-1.23 {ctype tests} {
  1096. X    ctype ascii 01234567
  1097. X} {1}
  1098. X
  1099. Xtest chartype-1.24 {ctype tests} {
  1100. X    ctype ascii "[ctype char 220][ctype char 126]123cd"
  1101. X} {0}
  1102. X
  1103. Xtest chartype-1.25 {ctype tests} {
  1104. X    list [catch {ctype ascii} msg] $msg
  1105. X} {1 {wrong # args: ctype class string}}
  1106. X
  1107. Xtest chartype-1.26 {ctype tests} {
  1108. X    list [catch {ctype ascbb foo} msg] $msg
  1109. X} {1 {unrecognized class specification: "ascbb", expected one of: alnum, alpha, ascii, char, cntrl, digit, graph, lower, ord, print, punct, space, upper or xdigit}}
  1110. X
  1111. X
  1112. Xtest chartype-1.27 {ctype char tests} {
  1113. X    ctype char 65
  1114. X} {A}
  1115. X
  1116. Xtest chartype-1.28 {ctype char tests} {
  1117. X    ctype char 97
  1118. X} {a}
  1119. X
  1120. Xtest chartype-1.29 {ctype char tests} {
  1121. X    ctype char 57
  1122. X} {9}
  1123. X
  1124. Xtest chartype-1.30 {ctype char tests} {
  1125. X    ctype char 35
  1126. X} {#}
  1127. X
  1128. Xtest chartype-1.31 {ctype char tests} {
  1129. X    list [catch {ctype char 256} msg] $msg
  1130. X} {1 {number must be in the range 0..255}}
  1131. X
  1132. Xtest chartype-1.32 {ctype ord tests} {
  1133. X    ctype ord A
  1134. X} {65}
  1135. X
  1136. Xtest chartype-1.33 {ctype ord tests} {
  1137. X    ctype ord a
  1138. X} {97}
  1139. X
  1140. Xtest chartype-1.34 {ctype ord tests} {
  1141. X    ctype ord 9
  1142. X} {57}
  1143. X
  1144. Xtest chartype-1.35 {ctype ord tests} {
  1145. X    ctype ord "#"
  1146. X} {35}
  1147. X
  1148. Xtest chartype-1.36 {ctype ord tests} {
  1149. X    list [catch {ctype ord} msg] $msg
  1150. X} {1 {wrong # args: ctype class string}}
  1151. X
  1152. Xtest chartype-1.37 {ctype ord tests} {
  1153. X    list [catch {ctype ord ""} msg] $msg
  1154. X} {1 {string to convert must be only one character}}
  1155. X
  1156. X
  1157. END_OF_FILE
  1158. if test 3606 -ne `wc -c <'extended/tests/chartype.test'`; then
  1159.     echo shar: \"'extended/tests/chartype.test'\" unpacked with wrong size!
  1160. fi
  1161. # end of 'extended/tests/chartype.test'
  1162. fi
  1163. echo shar: End of archive 7 \(of 23\).
  1164. cp /dev/null ark7isdone
  1165. MISSING=""
  1166. 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
  1167.     if test ! -f ark${I}isdone ; then
  1168.     MISSING="${MISSING} ${I}"
  1169.     fi
  1170. done
  1171. if test "${MISSING}" = "" ; then
  1172.     echo You have unpacked all 23 archives.
  1173.     echo "Now cd to "extended", edit the makefile, then do a "make""
  1174.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1175. else
  1176.     echo You still need to unpack the following archives:
  1177.     echo "        " ${MISSING}
  1178. fi
  1179. ##  End of shell archive.
  1180. exit 0
  1181.  
  1182. exit 0 # Just in case...
  1183. -- 
  1184. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1185. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1186. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1187. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1188.