home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / tcl / tclx7_31.z / tclx7_31 / tcldev / tclX7.3a-p1 / src / tclXcmdInit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-23  |  10.4 KB  |  293 lines

  1. /*
  2.  * tclXcmdInit.c
  3.  *
  4.  * Function to add the Extented Tcl command into an interpreter.  The TclX
  5.  * library commands are not added here, to make it easier to build applications
  6.  * that don't use the extended libraries.
  7.  *-----------------------------------------------------------------------------
  8.  * Copyright 1991-1993 Karl Lehenbauer and Mark Diekhans.
  9.  *
  10.  * Permission to use, copy, modify, and distribute this software and its
  11.  * documentation for any purpose and without fee is hereby granted, provided
  12.  * that the above copyright notice appear in all copies.  Karl Lehenbauer and
  13.  * Mark Diekhans make no representations about the suitability of this
  14.  * software for any purpose.  It is provided "as is" without express or
  15.  * implied warranty.
  16.  *-----------------------------------------------------------------------------
  17.  * $Id: tclXcmdInit.c,v 3.1 1994/01/23 17:00:28 markd Exp $
  18.  *-----------------------------------------------------------------------------
  19.  */
  20.  
  21. #include "tclExtdInt.h"
  22. #include "tclXpatchl.h"
  23.  
  24.  
  25. /*
  26.  *-----------------------------------------------------------------------------
  27.  *
  28.  * TclXCmd_Init --
  29.  *
  30.  *   Add the Extended Tcl commands to the specified interpreter (except for
  31.  * the library commands that override that standard Tcl procedures).  This
  32.  * does no other startup.
  33.  *-----------------------------------------------------------------------------
  34.  */
  35. int
  36. TclXCmd_Init (interp)
  37.     Tcl_Interp *interp;
  38. {
  39.     /*
  40.      * Initialized the variables used by infox, these can be overriden later.
  41.      */
  42.     tclxVersion = ckalloc (strlen (TCL_VERSION) + 
  43.                            strlen (TCL_EXTD_VERSION_SUFFIX) + 1);
  44.     strcpy (tclxVersion, TCL_VERSION);
  45.     strcat (tclxVersion, TCL_EXTD_VERSION_SUFFIX);
  46.  
  47.     tclxPatchlevel = TCLX_PATCHLEVEL;
  48.     if (tclAppName == NULL)
  49.         tclAppName = "TclX";
  50.     if (tclAppLongname == NULL)
  51.         tclAppLongname = "Extended Tcl";
  52.     if (tclAppVersion == NULL) {
  53.         tclAppVersion = tclxVersion;
  54.         tclAppPatchlevel = tclxPatchlevel;
  55.     }
  56.  
  57.     /*
  58.      * from tclCkalloc.c (now part of the UCB Tcl).
  59.      */
  60. #ifdef TCL_MEM_DEBUG    
  61.     Tcl_InitMemory (interp);
  62. #endif
  63.  
  64.     /*
  65.      * from tclXbsearch.c
  66.      */
  67.     Tcl_CreateCommand (interp, "bsearch", Tcl_BsearchCmd, 
  68.                       (ClientData) NULL, (void (*)()) NULL);
  69.  
  70.     /*
  71.      * from tclXchmod.c
  72.      */
  73.     Tcl_CreateCommand (interp, "chgrp", Tcl_ChgrpCmd,
  74.                        (ClientData) NULL, (void (*)()) NULL);
  75.     Tcl_CreateCommand (interp, "chmod", Tcl_ChmodCmd,
  76.                        (ClientData) NULL, (void (*)()) NULL);
  77.     Tcl_CreateCommand (interp, "chown", Tcl_ChownCmd,
  78.                        (ClientData) NULL, (void (*)()) NULL);
  79.  
  80.     /*
  81.      * from tclXclock.c
  82.      */
  83.     Tcl_CreateCommand (interp, "getclock", Tcl_GetclockCmd, 
  84.                       (ClientData) NULL, (void (*)()) NULL);
  85.     Tcl_CreateCommand (interp, "fmtclock", Tcl_FmtclockCmd, 
  86.                       (ClientData) NULL, (void (*)()) NULL);
  87.  
  88.     /*
  89.      * from tclXcnvdate.c
  90.      */
  91.     Tcl_CreateCommand (interp, "convertclock", Tcl_ConvertclockCmd,
  92.                       (ClientData) NULL, (void (*)()) NULL);
  93.  
  94.     /*
  95.      * from tclXcmdloop.c
  96.      */
  97.     Tcl_CreateCommand (interp, "commandloop", Tcl_CommandloopCmd, 
  98.                       (ClientData) NULL, (void (*)()) NULL);
  99.  
  100.     /*
  101.      * from tclXdebug.c
  102.      */
  103.     Tcl_InitDebug (interp);
  104.  
  105.     /*
  106.      * from tclXdup.c
  107.      */
  108.     Tcl_CreateCommand (interp, "dup",  Tcl_DupCmd, 
  109.                        (ClientData) NULL, (void (*)()) NULL);
  110.     /*
  111.      * from tclXtclXfcntl.c
  112.      */
  113.     Tcl_CreateCommand (interp, "fcntl", Tcl_FcntlCmd,
  114.                        (ClientData) NULL, (void (*)()) NULL);
  115.  
  116.     /*
  117.      * from tclXfilecmds.c
  118.      */
  119.     Tcl_CreateCommand (interp, "pipe", Tcl_PipeCmd,
  120.                        (ClientData) NULL, (void (*)()) NULL);
  121.     Tcl_CreateCommand (interp, "copyfile", Tcl_CopyfileCmd,
  122.                        (ClientData) NULL, (void (*)()) NULL);
  123.     Tcl_CreateCommand (interp, "lgets", Tcl_LgetsCmd,
  124.                        (ClientData) NULL, (void (*)()) NULL);
  125.     Tcl_CreateCommand (interp, "frename", Tcl_FrenameCmd,
  126.                        (ClientData) NULL, (void (*)()) NULL);
  127.     Tcl_CreateCommand (interp, "readdir", Tcl_ReaddirCmd,
  128.                        (ClientData) NULL, (void (*)()) NULL);
  129.  
  130.     /*
  131.      * from tclXfstat.c
  132.      */
  133.     Tcl_CreateCommand (interp, "fstat", Tcl_FstatCmd,
  134.                        (ClientData) NULL, (void (*)()) NULL);
  135.  
  136.     /*
  137.      * from tclXflock.c
  138.      */
  139.     Tcl_CreateCommand (interp, "flock", Tcl_FlockCmd,
  140.                        (ClientData) NULL, (void (*)()) NULL);
  141.     Tcl_CreateCommand (interp, "funlock", Tcl_FunlockCmd,
  142.                        (ClientData) NULL, (void (*)()) NULL);
  143.  
  144.     /*
  145.      * from tclXfilescan.c
  146.      */
  147.     Tcl_InitFilescan (interp);
  148.  
  149.     /*
  150.      * from tclXgeneral.c
  151.      */
  152.     Tcl_CreateCommand(interp, "echo", Tcl_EchoCmd, 
  153.                      (ClientData) NULL, (void (*)()) NULL);
  154.     Tcl_CreateCommand(interp, "infox", Tcl_InfoxCmd, 
  155.                      (ClientData) NULL, (void (*)()) NULL);
  156.     Tcl_CreateCommand(interp, "loop", Tcl_LoopCmd, 
  157.                      (ClientData) NULL, (void (*)()) NULL);
  158.  
  159.     /*
  160.      * from tclXid.c
  161.      */
  162.     Tcl_CreateCommand (interp, "id", Tcl_IdCmd,
  163.                        (ClientData) NULL, (void (*)()) NULL);
  164.  
  165.     /*
  166.      * from tclXkeylist.c
  167.      */
  168.     Tcl_CreateCommand(interp, "keyldel", Tcl_KeyldelCmd,
  169.                      (ClientData) NULL, (void (*)()) NULL);
  170.     Tcl_CreateCommand(interp, "keylget", Tcl_KeylgetCmd,
  171.                      (ClientData) NULL, (void (*)()) NULL);
  172.     Tcl_CreateCommand(interp, "keylkeys", Tcl_KeylkeysCmd,
  173.                      (ClientData) NULL, (void (*)()) NULL);
  174.     Tcl_CreateCommand(interp, "keylset", Tcl_KeylsetCmd,
  175.                      (ClientData) NULL, (void (*)()) NULL);
  176.  
  177.     /*
  178.      * from tclXlist.c
  179.      */
  180.     Tcl_CreateCommand(interp, "lvarcat", Tcl_LvarcatCmd, 
  181.                      (ClientData) NULL, (void (*)()) NULL);
  182.     Tcl_CreateCommand(interp, "lvarpop", Tcl_LvarpopCmd, 
  183.                      (ClientData) NULL, (void (*)()) NULL);
  184.     Tcl_CreateCommand(interp, "lvarpush", Tcl_LvarpushCmd, 
  185.                      (ClientData) NULL, (void (*)()) NULL);
  186.     Tcl_CreateCommand(interp, "lempty", Tcl_LemptyCmd, 
  187.                      (ClientData) NULL, (void (*)()) NULL);
  188.     Tcl_CreateCommand(interp, "lassign", Tcl_LassignCmd, 
  189.                      (ClientData) NULL, (void (*)()) NULL);
  190.     Tcl_CreateCommand(interp, "lmatch", Tcl_LmatchCmd, 
  191.                      (ClientData) NULL, (void (*)()) NULL);
  192.  
  193.     /*
  194.      * from tclXmath.c
  195.      */
  196.     Tcl_CreateCommand (interp, "max", Tcl_MaxCmd,
  197.                        (ClientData) NULL, (void (*)()) NULL);
  198.     Tcl_CreateCommand (interp, "min", Tcl_MinCmd,
  199.                        (ClientData) NULL, (void (*)()) NULL);
  200.     Tcl_CreateCommand (interp, "random", Tcl_RandomCmd,
  201.                        (ClientData) NULL, (void (*)()) NULL);
  202.  
  203.     /*
  204.      * from tclXmsgcat.c
  205.      */
  206.     Tcl_InitMsgCat (interp);
  207.  
  208.     /*
  209.      * from tclXprocess.c
  210.      */
  211.     Tcl_CreateCommand (interp, "execl", Tcl_ExeclCmd,
  212.                        (ClientData) NULL, (void (*)()) NULL);
  213.     Tcl_CreateCommand (interp, "fork", Tcl_ForkCmd,
  214.                        (ClientData) NULL, (void (*)()) NULL);
  215.     Tcl_CreateCommand (interp, "wait", Tcl_WaitCmd,
  216.                        (ClientData) NULL, (void (*)()) NULL);
  217.  
  218.     /*
  219.      * from tclXprofile.c
  220.      */
  221.     Tcl_InitProfile (interp);
  222.  
  223.     /*
  224.      * from tclXselect.c
  225.      */
  226.     Tcl_CreateCommand (interp, "select", Tcl_SelectCmd,
  227.                        (ClientData) NULL, (void (*)()) NULL);
  228.  
  229.     /*
  230.      * from tclXsignal.c
  231.      */
  232.     Tcl_InitSignalHandling (interp);
  233.  
  234.     /*
  235.      * from tclXstring.c
  236.      */
  237.     Tcl_CreateCommand(interp, "cindex", Tcl_CindexCmd, 
  238.                      (ClientData) NULL, (void (*)()) NULL);
  239.     Tcl_CreateCommand(interp, "clength", Tcl_ClengthCmd, 
  240.                      (ClientData) NULL, (void (*)()) NULL);
  241.     Tcl_CreateCommand(interp, "crange", Tcl_CrangeCmd, 
  242.                      (ClientData) NULL, (void (*)()) NULL);
  243.     Tcl_CreateCommand(interp, "csubstr", Tcl_CrangeCmd, 
  244.                      (ClientData) NULL, (void (*)()) NULL);
  245.     Tcl_CreateCommand(interp, "replicate", Tcl_ReplicateCmd, 
  246.                      (ClientData) NULL, (void (*)()) NULL);
  247.     Tcl_CreateCommand (interp, "translit", Tcl_TranslitCmd,
  248.                        (ClientData) NULL, (void (*)()) NULL);
  249.     Tcl_CreateCommand (interp, "ctype", Tcl_CtypeCmd,
  250.                        (ClientData) NULL, (void (*)()) NULL);
  251.     Tcl_CreateCommand (interp, "ctoken", Tcl_CtokenCmd,
  252.                        (ClientData) NULL, (void (*)()) NULL);
  253.     Tcl_CreateCommand (interp, "cexpand", Tcl_CexpandCmd,
  254.                        (ClientData) NULL, (void (*)()) NULL);
  255.     Tcl_CreateCommand (interp, "cequal", Tcl_CequalCmd,
  256.                        (ClientData) NULL, (void (*)()) NULL);
  257.  
  258.     /*
  259.      * from tclXunixcmds.c
  260.      */
  261.     Tcl_CreateCommand (interp, "alarm", Tcl_AlarmCmd,
  262.                        (ClientData) NULL, (void (*)()) NULL);
  263.     Tcl_CreateCommand (interp, "chroot", Tcl_ChrootCmd,
  264.                        (ClientData) NULL, (void (*)()) NULL);
  265.     Tcl_CreateCommand (interp, "nice", Tcl_NiceCmd,
  266.                        (ClientData) NULL, (void (*)()) NULL);
  267.     Tcl_CreateCommand (interp, "sleep", Tcl_SleepCmd,
  268.                        (ClientData) NULL,(void (*)()) NULL);
  269.     Tcl_CreateCommand (interp, "sync", Tcl_SyncCmd,
  270.                        (ClientData) NULL,(void (*)()) NULL);
  271.     Tcl_CreateCommand (interp, "system", Tcl_SystemCmd,
  272.                        (ClientData) NULL, (void (*)()) NULL);
  273.     Tcl_CreateCommand (interp, "times", Tcl_TimesCmd,
  274.                        (ClientData) NULL, (void (*)()) NULL);
  275.     Tcl_CreateCommand (interp, "umask", Tcl_UmaskCmd,
  276.                        (ClientData) NULL, (void (*)()) NULL);
  277.     Tcl_CreateCommand (interp, "link", Tcl_LinkCmd,
  278.                        (ClientData) NULL, (void (*)()) NULL);
  279.     Tcl_CreateCommand (interp, "unlink", Tcl_UnlinkCmd,
  280.                        (ClientData) NULL, (void (*)()) NULL);
  281.     Tcl_CreateCommand (interp, "mkdir", Tcl_MkdirCmd,
  282.                        (ClientData) NULL, (void (*)()) NULL);
  283.     Tcl_CreateCommand (interp, "rmdir", Tcl_RmdirCmd,
  284.                        (ClientData) NULL, (void (*)()) NULL);
  285.  
  286.     /*
  287.      * from tclXserver.c
  288.      */
  289.     Tcl_CreateCommand (interp, "server_open", Tcl_ServerOpenCmd,
  290.                        (ClientData) NULL, (void (*)()) NULL);
  291.     return TCL_OK;
  292. }
  293.