f



about using tclapp wrap tcl and c program

Hi, all
My program is developed with tcl/tk and c, in which I use Tk_Main() and
Tcl_AppInit() function to customize my main code. in C function it will
execute tcl script by Tcl_Eval(), and in Tcl script it will
call the command procedure registered by Tcl_CreateCommand().

Now, I want to use tclapp to wrap my program to one starpack, could you
tell me how to do this?

Alternatively, the c code can be made one library, then load this
library in tcl script. In this case, tclapp will add the base runtime
envirnment of tcl/tk, but my c library depends on libtcl84.so and
libtk84.so, need I add and wrap these two library repeatedly? Is any
method to reduce the size of output. and what I need is starpack not
starkit.

Best Regards!
Tony

0
1/11/2007 7:51:43 AM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

0 Replies
466 Views

Similar Articles

[PageSpeed] 38

Reply:

Similar Artilces:

about wrap tcl and c using tclapp
Hi, all My program is developed with tcl/tk and c, in which I use Tk_Main() and Tcl_AppInit() function to customize the main code. in c code it will execute tcl scripts by Tcl_Eval(), and in tcl scripts it will call the command procedure registerd by Tcl_CreateCommand(). now, I want to wrap my program to one standalone executable file. Could you tell me how to do this by tclapp? Alternatively, the c code may need to be made one tcl extension library, and then load it in tcl script. In this case, tclapp will add the base runtime envirment of tcl/tk, and the library depends on tcl84.so and tk84.so, need I add and wrap these two library repeatedly? Best Regards! Tony ...

about using tclapp wrap tcl/tk and c problem
Hi, all I know there are two methods to develop program using tcl/tk and c, the first method is by calling Tcl_Main, Tcl_AppInit to customize the main program and include tcl scripts; the other method is to make c library and then load the library in tcl script. Is there any method to use tclapp wrap the program developed by the first method? Could you tell me how to do this? now, I make my c program to a libmylib.so, and my tcl script will load it. libmylib.so depends on some other library, such as libtcl84.so and libtk84.so. now I wrap my tcl script and libmylib.so to a starpack. Tclapp will add base tcl runtime envirnment automatically, but, the libmylib.so depends on libtcl84.so and libtk84.so, need I add and wrap these library repeatedly? Is there any method to wrap my program but reduce the size of starpack? Best Regards! Tony O/H sunnyboyGuo@gmail.com έγραψε: > Hi, all > I know there are two methods to develop program using tcl/tk and c, the > first method is by calling Tcl_Main, Tcl_AppInit to customize the main > program and include tcl scripts; the other method is to make c library > and then load the library in tcl script. > Is there any method to use tclapp wrap the program developed by the > first method? Could you tell me how to do this? > > now, I make my c program to a libmylib.so, and my tcl script will load > it. libmylib.so depends on some other library, such as libtcl84.so and > libtk84.so. now I wrap my tcl script ...

l'C program executing from a tcl script with pipe opened using open command in Tcl
Hi all, I wanted to communicate with a C program from a Tcl script.. The test code i have written is below Both the 'C' program and Tcl script are located in the same directory. The 'C' program is below. I have named it CTCL.C #include<stdio.h> #include<string.h> int main() { int i; char c[30]; printf("Reading..."); scanf("%s",c); printf("String read is :%s\n",c); fflush(stdout); return 0; } I have compiled the program with the command cc CTCL.C -o ctcl So the executable was generated with the name 'ctcl' The Tcl script I have written is. I have named it TCLPIPETEST.tcl #!/usr/add-on/exptools/bin/tclsh set fd [open "|./ctcl" r+] gets $fd tmp1 puts "tmp1 = $tmp1" set stat 0 set tmp2 "Default value... " if { ![catch { puts $fd "abcdef" } res]} { if { ![catch { flush $fd } res] } { if { ![catch { gets $fd tmp2} res ] } { set stat 1 } else { puts "Error 'gets' from pipe : $res" } } else { puts "Error 'flush' from pipe:$res " } } else { puts "Error 'puts' from pipe:$res " } if { $stat == 1 } { puts "Success......:$tmp2 :)" } else { puts "Failure......:$tmp2 :(" } I have given all permissions for both the files above. When i execute the Tcl script My aim is to open a pipe with the 'C' executable 'ctcl', initially read so...

Opening a TCL program from within another TCL program in ANSYS Tcl-Tk
Hi everyone, I have been pulling my hair with this one for a couple of days and still have not found a fix. I'm working within ANSYS Tcl-Tk implementation. I created a Tcl-Tk script that generates a simple window with three buttons. Each button opens another window which is created in a separate Tcl file. The second window have a lot of text entries, variables, procedures, etc. I can open the second Tcl file by itself and everything works as supposed, but when I open it using the button in the first window, it opens but any procedure called by the widgets on the second window are not found... Here's the deal... Since I'm working within the ANSYS implementation of Tcl-Tk, I'm actually using an ANSYS command to open the second window. The command I use is: ### ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' ### It actually sends a command back to ANSYS telling it to execute a Tcl command... I know this is not pretty but its the only way i was able to make it at least show the window. ############################## #Main Tcl (excerpt): ############################## namespace eval Tools { proc IBRCambpell {} { #source O:/mad_projects_2/ANSYS/Macros/IBR_CAS.tcl ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' } proc viewManager {} { ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ ViewManager.tcl' } proc powerAnnotation {} { ans_sendcommand ~eui,'source ...

In Tcl and C++ code, how to use Tcl Command, such as exit?
In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control all input and output from Tcl, but i want to use some of Tcl' Commands, such as, exit. I used Tcl_Eval() then, but the Tcl command seem invisible in my code, I typed a string in command prompt, such as "AAAAA", and Enter, got nothing feedback. How can i do to get these Tcl Commands work? Thanx! vian1381@china.com.cn wrote: > In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control > all input and output from Tcl, but i want to use some of Tcl' Commands, > such as, exit. > > I used Tcl_Eval() then, but the Tcl command seem invisible in my code, > I typed a string in command prompt, such as "AAAAA", and Enter, got > nothing feedback. Your questions are hard to understand, but they suggest that you believe that setting a custom stdin channel will do some magic to establsh a prompt/read/eval loop. That is not the case. > How can i do to get these Tcl Commands work? Start with something that works, like the source code for tclsh, and adapt to your needs. Or post a followup and include more code examples to explain what you're doing and how it doesn't do what you expect. -- | Don Porter Mathematical and Computational Sciences Division | | donald.porter@nist.gov Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |_____________________________________...

adding events to tcl queue, or using variables and traces (C and TCL)
I'm writing simple testing framework for embedded application. The application is written on C language and runs on microchip PIC microcontroller normally. To test application I made the following: * hardware depended code was picked out from main source and written to separate source files (module_hal.c for example); * two build mode for program: for microchip PIC, using *_hal.c files dealing with real hardware, or for PC, where *_hal.c files contain hardware simulation code and bindings to TCL-commands. Then program was build for PC, I can using TCL commands change input signal states for simulated hardware, for example, or view output signal states. But I need some method to call tcl callback procedure when output signal changes state. I see two methods to achieve this: * map signal state to variable, and then use 'trace' command to bind tcl-scripts to state change events; * add new events to tcl event queue, as described here: http://wiki.tcl.tk/17195 Which method can be more preferable and why? In case if signal state changes too fast, and if I use variable trace, my callback will be called on every state change -- I think it is serious drawback of first method. With second method I can add only one event to queue, and add second only if first event is processed. But as I see, second method requires more complex code in C (now I wrote this code and see it as serious drawback too). May be exists some other methods to call tcl-callbacks on even...

TCL/TCL combined with Java/C/C++, Any Recommendations?
Hi, I have an application that I wrote in TCL/TK. It has to work with big files +5GB. The parsing performace is not where I would like and some of the data manipulations are taking considerable amount of time due to the data size. Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time. I am trying to figure out which language will be easier to merge with TCL in an application. For C I know that I can compile and generate a .so or .dll and create a TCL package and load it. I believe this is done with SWIG but I have not done it. In Java I saw some info on Jacl and TclBlend. The application will be "compiled" into a TCL "executable". I know I can compile my TCL code into Byte code to protect the IP. I am not sure about Java. Any recommendations or pointers will be greatly appreciated. Thanks in advance, Frank Frank <kranfg@gmail.com> writes: > Hi, > > I have an application that I wrote in TCL/TK. It has to work with big files +5GB. > > The parsing performace is not where I would like and some of the data manipulations are taking considerable amount of time due to the data size. > > Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time. > > I am trying to figure out which language will be easier to ...

How to use tcl to write a GUI to control a C program
I writed a programe (using C) to control two objects: keyboard A-------to make the small object rotate keyboard Y-------to make the large object rotate Now, I want to write a *graph user interface* using Tcl to control the objects.It should be combined with the C code. how can I do it? this is the C code section: #include <gl/glut.h> #include <stdlib.h> #include <stdio.h> static int year=0,day=0,month=0; void init(void) { glClearColor(0.0,0.0,0.0,0.0); glShadeModel(GL_FLAT); } void display(void) { glClear(GL_COLOR_BUFFER_BIT); glColor3f(0.0,1.0,0); glPushMatrix(); ...

Using Tcl/Tk as a user interface in a C program
Hi, i thought this question would come up every day, but i read this NG for a while and haven't seen it since. What i'd like to do is use Tcl/Tk in a standalone (linked against Tcl and/or Tk libs) C program. I'd like to open Windows and call Tcl scripts from C that handle the windows. I wouldn't like to have external scripts called, but i'd like to embed it in the C program. Has anybody got a short example for that (Linux / Windows)? Thanks for any hints, Torsten. MkTclApp is your friend: http://www.hwaci.com/sw/mktclapp/index.html Pretty simple, really. On T...

YouTube Playlist: Tcl/Tk Object Oriented Programming Using Itcl (incr Tcl) Lessons
Hi. Like I promised you hours ago.. The playlist in English : https://www.youtube.com/playlist?list=PLsAEIIjTPIo_1qeuc-rYwk0nxWAM38Dl_ The same playlist in Arabic : https://www.youtube.com/playlist?list=PLsAEIIjTPIo_91kA-iUz_5XGNmHzivHBG Enjoy! On Saturday, January 17, 2015 at 4:04:21 PM UTC+2, Rani Ahmad wrote: > Hi. > > Like I promised you hours ago.. > > The playlist in English : > > https://www.youtube.com/playlist?list=PLsAEIIjTPIo_1qeuc-rYwk0nxWAM38Dl_ > > The same playlist in Arabic : > > https://www.youtube.com/playli...

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature
Hi, TCL has a command execution syntax like this: [<tcl cmd>] Anything inside the 3rd bracket will be executed as a Tcl command by the Tcl interprater. Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? In other words, my Tcl interprator should print "[32]" for tcl command puts "[32]" It should not try to treat [] as a special character. Is this any way possible while extending Tcl in C with tcl.h? Thank you, Arijit * arijit79@gmail.com | puts "[32]" | | It should not try to treat [] as a special character. Check out the TCL quoting rules. http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M10 http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M15 Any of puts {[32]} puts "\[32\]" will do the trick. R' On May 8, 3:14 am, ariji...@gmail.com wrote: > Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? By doing this, you would disable the primary functionality of Tcl. I'm certain you could go into the tcl source and stop it - but why not talk about what you are really trying to do. Perhaps someone can give you a better way of doing what you are wanting to do. ...

tcl as library of c/c++/java program
Hi, All tcl books I know talking how tcl can dynamically load c library. Is any source out there talking about WHO A C/C++/JAVA PROGRAM TO USE TCL AS LIBRARY? Thank, alex "tak" <tak416@yahoo.com> wrote > All tcl books I know talking how tcl can dynamically load c library. > Is any source out there talking about WHO A C/C++/JAVA > PROGRAM TO USE TCL AS LIBRARY? Start with http://phaseit.net/claird/comp.lang.tcl/HowToC.html but some people think that you can choose a better overall architecture. http://mini.net/tcl/9303 If you choose to use Tcl libraries "the o...

Connecting a C program with a tcl program with a socket
Dear readers, Several threads on this newsgroup mentioned communication between external programs and a tcl program, or controlling an external program with by a tcl program. In essence, the basic means to do this relatively gracefull is to open a socket (or pipe) connection between the two, and let them communicate over it using messages. Just for those who asked for it or with an interest, not in this case as well throughwrought result of many tests, but an example of how this principle can work in practice, at least it did for me, and did so long in the past, using no all to speci...

How to use Tcl for c code testing using VxWorks
This is Harika. I would like to know how to use tcl in c for testing, in VxWorks operating system. If possible give me example. I have written for unit level testing but iam getting error saying that interep is not found. But i have to do for automation absolutely. Let me know does Expect is necessary for automation. I didn't get Explore Expect book in chennai.I would be so thank full if any one do favour for me. Awaiting for the reply, Thanking you. In article <1176120872.799611.271860@d57g2000hsg.googlegroups.com>, Harika <harika.it@gmail.com> wrote: >This is Harika. I would like to know how to use tcl in c for testing, >in VxWorks operating system. If possible give me example. I have >written for unit level testing but iam getting error saying that >interep is not found. But i have to do for automation absolutely. Let >me know does Expect is necessary for automation. I didn't get Explore >Expect book in chennai.I would be so thank full if any one do favour >for me. . . . Tcl is quite handy for testing <URL: http://wiki.tcl.tk/testing >. While Expect is widely used in testing, and has been very successful in that role, it is not necessary, as the URL above will explain. For unit testing of the sort you seem to be targetting, SWIG <URL: http://wiki.tcl.tk/swig > might be helpful. ...

Writing new tcl command using c or c++?
Can anyone help me to write new command that can be used in tcl shell using c or c++ code. Himanshu Gupta <himanshulkce@gmail.com> wrote: > Can anyone help me to write new command that can be used in tcl shell > using c or c++ code. Start here: http://wiki.tcl.tk/9849 and here: http://wiki.tcl.tk/21007, read these and then follow and read the links to the other pages from the above two. On Monday, 5 January 2015 14:12:44 UTC+5:30, Himanshu Gupta wrote: > Can anyone help me to write new command that can be used in tcl shell using c or c++ code. Thankyou... On M...

Using TCL with C#
I am trying to call TCL from my C# application and found some useful help on the Wiki website http://wiki.tcl.tk/9563 (as shown below). using System.Runtime.InteropServices; using System; namespace TclWrap { public class TclAPI { [DllImport("tcl84.DLL")] public static extern IntPtr Tcl_CreateInterp(); [DllImport("tcl84.Dll")] public static extern int Tcl_Eval(IntPtr interp,string skript); [DllImport("tcl84.Dll")] public static extern IntPtr Tcl_GetObjResult(IntPtr interp); [DllImport("tcl84.Dll")] public static extern string T...

Using Tcl/Tk 8.4.7 from C/C++
Hi, I just discovered Tcl/Tk and fairly excited about it :) I'm interested in using both Tcl/Tk on one c++ project and only Tk on another c++ project. 1. C++ Tk only project: I'm interested in using Tk within my c/c++ project. The project only has 5-6 dialogs using just the standard widgets. Is it fairly common to use Tk directly from c/c++--and is it fairly easy? 2. C++ Tcl/Tk only project: I'm interested in using both Tcl and Tk from within a c/c++ application. Is maketclapp the best way to go or are there better ways? Maketclapp doesn't seem to have been up...

Tcl Book that explains tcl C API?
Hi! I am looking for material that explains the tcl C API in order to: - Embed Tcl into a C application. - Extend Tcl to add new commands in C. Does Tcl and Tk Toolkit (2nd Edition) by Ken Jones and John Ousterhout do a good job explain these topics in depth? Thanks! Asif wrote: > Hi! > > I am looking for material that explains the tcl C API in order to: > > - Embed Tcl into a C application. > - Extend Tcl to add new commands in C. > > Does Tcl and Tk Toolkit (2nd Edition) by Ken Jones and John Ousterhout do > a good job explain these topics in depth? > > Thanks! can help you cheap:; http://freecomputerbooks.com/langTclBooks.html -- -- -- What's on Shortwave guide: choose an hour, go! http://shortwave.tk 700+ Radio Stations on SW http://swstations.tk 300+ languages on SW http://radiolanguages.tk marc wrote: > Asif wrote: > >> Hi! >> >> I am looking for material that explains the tcl C API in order to: >> >> - Embed Tcl into a C application. >> - Extend Tcl to add new commands in C. >> >> Does Tcl and Tk Toolkit (2nd Edition) by Ken Jones and John Ousterhout do >> a good job explain these topics in depth? >> >> Thanks! > > > can help you cheap:; > http://freecomputerbooks.com/langTclBooks.html Would you really trust a site which *PRESUMES* the whole world uses their preferred settings and the heck with the visually imperfect. The resu...

Tcl+incr Tcl debuggers to use on command line?
Hi, Does anyone know of incr Tcl supported debuggers that work on command line? That is, without needing bundling with IDEs? Thanks On 10/11/14, 9:46 PM, kenneth.bull@gmail.com wrote: > Hi, > > Does anyone know of incr Tcl supported debuggers that work on command line? > That is, without needing bundling with IDEs? Well, the debugger in ActiveState's TDK does not need a bundled IDE and it works with [incr Tcl] -- but it is a GUI application not a command line one. -- +------------------------------------------------------------------------+ | Gerald W. L...

Using C function in tcl
All, Sorry if this is a repeat post. I didn't find quite good answers to my questions. I would like to call a C function ( written by me ) in tcl. After googling a lot I only found half-baked instructions and didn't take me anywhere. Here is my situation: - Have tcl - Have cc and aCC on HPUX environment - Cannot use any external tools. - Cannot re-compile TCL - Cannot use a binary ( as exec ) in tcl. All I know is to write a c function ( with some TCL wrappers ) in a .c file and compile as a .so and use a "load myfile.so" to load the module and use the function in tcl. I also would like to have the command line to compile a shared library. Is this correct? cc -shared -o myshare.so myshare.c Thanks in advance for all the help regards Blr On Mar 27, 12:40=A0am, blrmaani <blrma...@gmail.com> wrote: > - Cannot use a binary ( as exec ) in tcl. Can you explain why ? -Alex On Mar 26, 7:44 pm, Alexandre Ferrieux <alexandre.ferri...@gmail.com> wrote: > On Mar 27, 12:40 am, blrmaani <blrma...@gmail.com> wrote: > > > - Cannot use a binary ( as exec ) in tcl. > > Can you explain why ? > > -Alex Actually I know how to use binary and also it is the requirement from other group. blrmaani wrote: > All, > Sorry if this is a repeat post. I didn't find quite good answers to > my questions. > I would like to call a C function ( written by me ) in tcl. After > googling a lot I only > found half-ba...

Tcl interface to C program
I am developing a program (a game) that has two main states: one is the actual game which is a low-level full screen C program that must be very optimized; the other is a textual interface where the player sets options like difficulty, save games, colors, etc. For example, while playing the game the user can press Esc to pause the game and go into the text interface. I was thinking of using Tcl as the text interface. Does anyone have any pointers on how to do this? I would like to design it so the main() part of the program is Tcl, with a command lets the user switch into the full screen C game (which would be like a module). How does that work? Can it all be combined into one executable file? Any help would be appreciated. bluejolts@gmail.com schrieb: > I am developing a program (a game) that has two main states: one is > the actual game which is a low-level full screen C program that must > be very optimized; the other is a textual interface where the player > sets options like difficulty, save games, colors, etc. For example, > while playing the game the user can press Esc to pause the game and go > into the text interface. text interface aka tty on unix or dos console on windows? Another option would be to use Tk for a gui. > > I was thinking of using Tcl as the text interface. Does anyone have > any pointers on how to do this? For tty's look at the tcllib term package, which does ansi escape sequences and cursor movement stuff in ansi...

tcl-gaul: Genetic Algorithms for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-gaul Tcl-gaul is a Tcl extension for genetic/evolutionary algorithm processing.It relies on the GAUL library: http://gaul.sourceforge.net/ * A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. They are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. For an introduction to genetic algorithms visit: http://gaul.sourceforge.net/intro.html Platform: Linux (GAUL library dependency) Home page: http://sourceforge.net/projects/tcl-gaul/ Man page: http://tcl-gaul.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-pam: PAM authentication for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-pam Tcl-pam is a Tcl interface to the PAM* service of Linux. It provides a Tcl package that allows Tcl scripts to use PAM to authenticate users and programs. It relies on linux-pam library: http://www.kernel.org/pub/linux/libs/pam/ * PAM (Pluggable Authentication Modules): A mechanism to integrate multiple low−level authentication schemes into a high−level application programming interface (API). This enables programs that rely on authentication to be written independently of the underlying authentication scheme. Platform: Linux Home page: http://sourceforge.net/projects/tcl-pam/ Man page: http://tcl-pam.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Will tcl 9 use epoll or kqueue for tcl?
curious http://luvit.io/ also check this out for web stuff done in lua but perhaps tcl can steal nice ideas On Wednesday, January 2, 2013 3:22:02 PM UTC-8, gavino_himself wrote: > curious > > > > http://luvit.io/ also check this out for web stuff done in lua but perhaps tcl can steal nice ideas cherokee uses them so gota be ast for events and cherokee outperforms nginx ...

Web resources about - about using tclapp wrap tcl and c program - comp.lang.tcl

Program - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

$2.7 billion dental program likely to get the chop, say dentists
Federal Health Minister Sussan Ley is very likely to scrap the $2.7 billion child dental health program in the next budget, warn dentists.

Why Safe Schools program must be kept
Farrah Tomazin explains why keeping the Safe Schools program is a no-brainer.

Clive Palmer opens up about Queensland Nickel on ABC TV’s Insiders program - The Courier-Mail Search ...
CLUELESS Clive Palmer has no idea what approvals he needs to keep his Townsville refinery afloat and is dodging calls from State Government officials, ...

Bezos unveils his plans for space program
KENT, Wash. — Long before he ever conceived of the idea to sell books on the Internet, he was obsessed with space. It started at age 5 when he ...

Kasich, Cruz, Rubio Talk Tough on Foreign Workers Programs
Kasich, Cruz, Rubio Talk Tough on Foreign Workers Programs

An AI expert says Google's Go-playing program is missing 1 key feature of human intelligence
For the first time in history, a computer program is poised to beat one of the world's best human players at the 2,500-year-old game of Go — ...

Josh Duggar has left his faith-based sex rehab program after six months
... Josh’s general and specific awfulness. The Duggar family released a statement too: Josh has completed his residential rehabilitation program. ...

Top Republican unveils $98B in cuts to social programs
WASHINGTON (AP) — A senior House Republican is seeking to cut child tax credits for immigrants working in the U.S. illegally.

CSO50 2016: UN development program provides cybersecurity assistance
The CSO50 recognizes 50 security projects, taken on by 45 organizations, that demonstrate outstanding thought leadership and business value. ...

Resources last updated: 3/13/2016 2:54:10 PM