TclXInit



TclXInit

NAME
SYNOPSIS
DESCRIPTION
DYNAMIC LOADING OF TCLX
INTEGRATING TCLX WITH OTHER EXTENSIONS AND APPLICATIONS

NAME

Tclx_Init, Tclxcmd_Init, TclX_Main, Tkx_Init, TkX_Main - Extended Tcl initialization.

SYNOPSIS

-ltclx -ltcl

#include "tclExtend.h"

int
Tclx_Init (Tcl_Interp *interp);

int
Tclxcmd_Init (Tcl_Interp *interp);

int
void
TclX_Main (int               argc,
           char            **argv,
           Tcl_AppInitProc  *appInitProc);

int
Tkx_Init (Tcl_Interp *interp);

void
TkX_Main (int               argc,
          char            **argv,
          Tcl_AppInitProc  *appInitProc);


void
TclX_SetAppInfo (int   defaultValues,
                 char *appName,
                 char *appLongName,
                 char *appVersion,
                 int   appPatchlevel);

DESCRIPTION

These functions are used to initialize Extended Tcl and applications based on Extended Tcl. This manual page also discusses various issues and approaches of integrating TclX into other applications.

Tclx_Init
Initializes Extended Tcl, adding the extended command set to the interpreter. This is called from Tcl_AppInit. This function must be called after the Tcl_Init function. In addition to the standard command set, it enables use of tlib packages libraries and makes the standard TclX library available.

Parameters

o interp - A pointer to the interpreter to add the commands to.

Returns:

TCL_OK if all is ok, TCL_ERROR if an error occurred.

Tclxcmd_Init
Add the TclX command set to the interpreter, with the exception of the TclX library management commands. This is normally called by Tclx_Init and should only be used if you don’t want the TclX library handling.

Parameters

o interp - A pointer to the interpreter to add the commands to.

Returns:

TCL_OK if all is ok, TCL_ERROR if an error occurred.

TclX_Main
This function parses the command line according to the TclX shell specification (Unix shell compatible). It creates an interpreter and calls the specified function appInitProc to initialize any application specific commands. It then either evaluates the command of script specified on the command line or enters an interactive command loop. This procedure never returns, it exits the process when it’s done. Using the TclX shell also gives you SIGINT handling in interactive shells.

Tkx_Init
Initializes Extended Tcl Tk environment. This is called from Tcl_AppInit after the Tk_Init function.

Parameters

o interp - A pointer to the interpreter to add the commands to.

Returns:

TCL_OK if all is ok, TCL_ERROR if an error occurred.

TkX_Main
This function parses the command line according to the wish shell specification. It creates an interpreter and calls the specified function appInitProc to initialize any application specific commands. It then either evaluates the command of script specified on the command line or enters an interactive command loop. This procedure never returns, it exits the process when it’s done. Using the TclX wish shell gives you SIGINT handling in interactive shells, otherwise it is identical to standard wish.

TclX_SetAppInfo
Store the application information returned by infox.

Parameters

o defaultValues - If true, then the values are assigned only if they are not already defined (defaulted). If false, the values are always set.
o
appName - Application symbolic name.
o
appLongName - Long, natural language application name.
o
appVersion - Version number of the application.
o
appPatchlevel - Patch level of the application. If less than zero, don’t change.

String pointers are saved without copying, don’t release the memory. If the arguments are NULL, don’t change the values.

DYNAMIC LOADING OF TCLX

TclX can be dynamically loaded on systems that support shared libraries and the load command. This can be done using either the load or the package require commands. If package require is to be used, a pkgIndex,tcl must be constructed. The pkg_mkIndex does not generate a pkgIndex.tcl file that works with TclX. Instead a command similar to

package ifneeded Tclx 7.5.0 "load $dir/libtclx.so"

should be placed in the directory containing the TclX shared library. A prototype pkgIndex,tcl file is build by TclX and is installed in the run time directory under the name pkgIndex,proto. This file can’t be used as-is, but should be renamed and copied or combined with an existing pkgIndex,tcl in the directory containing the shared library.

There is no need to dynamically load libtkx.so, since it only contains support for wishx.

INTEGRATING TCLX WITH OTHER EXTENSIONS AND APPLICATIONS

The main aspects to integrating TclX with into an application is to decide if the application is based on the standard Tcl/Tk shells or the TclX shells. If the standard shells are desired, then all that is necessary is to call Tclx_Init after Tcl_Init and
Tkx_Init
after Tk_Init. This functionality may also be dynamically loaded.

To get the TclX shell in a Tcl only application, with the tcl command functionality, call TclX_Main from the main function instead of Tcl_Main. This shell has arguments conforming to other Unix shells and SIGINT signal handling when interactive,.

To get the Tclx shell in a Tk application, with the wishx command functionality, call TkX_Main from the main function instead of Tk_Main. This shell has SIGINT signal handling when interactive,






Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.