Home > Archive > Tcl > May 2004 > using Tcl_Main in an extension shell
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
using Tcl_Main in an extension shell
|
|
| Andreas Otto 2004-05-17, 7:31 am |
|
Hi,
my need:
1. I have an extension (tclx) which provides a set of additional
commandline-args like "-s" or "-f"
2. I want to build a custom tcl-shell !and! using the Tcl API
commands Tcl_Main and Tcl_SetMainLoop to provide tclsh like
behavior with tclx like initialization and command-loop
3. I have a starting point TclX_Main which have to:
a. parsing tclx command-line options
b. setting tclx environment variables
c. setting tclx commandline-loop
d. doing some evaluation
e. finally calling Tcl_Main with !no! tclx command-line options
to do all the work
my problem:
1. I need the tcl-interpreter to do 3.b and 3.d
2. Tcl_Main does !!!NOT!!! accept an interp as argument
3. putting 3.b into Tcl_AppInitProc will work but putting
3.d into Tcl_AppInitProc will not
we need an interp argument for Tcl_Main to make the interface
complete
mfg
aotto
--
========================================
=========================
(C) Compiler-Factory, Dipl.-Ing Andreas Otto, Business Solutions
Cross-Platform System Support with "TclBase"
available on Unix(all), Windows(SFU) and Mac(OS X)
| |
| Don Porter 2004-05-17, 11:42 am |
| Andreas Otto wrote:
> we need an interp argument for Tcl_Main to make the interface
> complete
Tcl_Main() exists primarily to give a simple startup sequence to
very conventional tclsh-like embedding uses of Tcl. It is not
richly configurable.
It could be changed to accept a Tcl_Interp argument, sure, and
that might make it better suited to your intended use, but it
would also mean that every user of Tcl_Main() would have to
create and pass in a Tcl_Interp as well, rather than rely on the
current simple model that Tcl_Main() will create it for you.
I think from what you've said, the correct solution is not to
extend Tcl_Main() to accept an interp argument, but for you to
give up using Tcl_Main() and make your own calls to Tcl's lower
level routines like Tcl_FindExecutable() and Tcl_CreateInterp().
Tcl_Main() does not do anything your program cannot do for itself.
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|_______________________________________
_______________________________|
| |
| Andreas Otto 2004-05-17, 2:34 pm |
| Don Porter wrote:
> It could be changed to accept a Tcl_Interp argument, sure, and
> that might make it better suited to your intended use, but it
> would also mean that every user of Tcl_Main() would have to
> create and pass in a Tcl_Interp as well, rather than rely on the
> current simple model that Tcl_Main() will create it for you.
Hi,
if NULL is allowed as the interp argument Tcl_Main can create
the interp.
mfg
aotto
--
========================================
=========================
(C) Compiler-Factory, Dipl.-Ing Andreas Otto, Business Solutions
Cross-Platform System Support with "TclBase"
available on Unix(all), Windows(SFU) and Mac(OS X)
|
|
|
|
|