Integration w/unchangeable C functions 
Author Message
 Integration w/unchangeable C functions

Quote:

> Here's the deal:  I need to integrate some C functions written long, long
> ago with my new TCL/Tk script WITHOUT MODIFYING the C functions.
> Obviously these functions weren't written with TCL/Tk in mind.
> Am I out of luck?  Surely there's some way of patching the two together...

ya, you try to write *other* C functions to glue the existing C with
Tcl's guts.  it's been done lots of times; for instance, several of us
have done interfaces to Mini SQL (mine's at
        <URL: http://www.*-*-*.com/ %7Ehclsmith/tcltk/msql/>
if memory serves - no tarball there, you can look right at the code).
currently i'm hooking LifeLines into Tcl, but unlike Mini SQL it was
not designed for such abuse and is not nearly as straightforward.

Quote:
> THANK YOU for your help in advance!  Oh.. and remember, no big words.  I'm
> a BEGINNER. :)

how beginner?  i hope you know C pretty well.  Tcl's insides are very elegant
(at least up to 7.6; i haven't yet tackled the objects and namespaces of 8.0)
but they are very definitely C.  (if you have an inkling what i mean by that,
you're probably ready :)

Quote:
> -Julie

--
Hume dot Smith at Dess dot Tallships dot iStar dot CA


Mon, 20 Mar 2000 03:00:00 GMT  
 Integration w/unchangeable C functions

Quote:

> Here's the deal:  I need to integrate some C functions written long, long
> ago with my new TCL/Tk script WITHOUT MODIFYING the C functions.
> Obviously these functions weren't written with TCL/Tk in mind.

> Am I out of luck?  Surely there's some way of patching the two together...

Have a look at SWIG which should do (most of) the sort of thing you
want.  Or at least give you a head start...

Donal.
--
Donal K. Fellows   http://r8h.cs.man.ac.uk:8000/    Boing!  Boing!  Boing!

--
The at symbol in my email address may have been shifted one word right
to deter spam-bots.  Sorry for any inconvenience this causes you.
--
I don't buy from or respond to spammers.  Ever.  Do you?



Mon, 20 Mar 2000 03:00:00 GMT  
 Integration w/unchangeable C functions

Quote:

>Here's the deal:  I need to integrate some C functions written long, long
>ago with my new TCL/Tk script WITHOUT MODIFYING the C functions.

Yes, this is possible in Tcl, you just have to write C wrapper functions
to interface the Tcl and C.  SWIG might be worth looking into, but I
don't know if it will work in your case.

Basically, you just need to write functions that have the proper Tcl
interface specs, and then call your C function from within that.  You
might look at the example at:
        ftp://ftp.sunlabs.com/pub/tcl/example.tar.gz
And see where your code would fit in.

--
    Jeffrey Hobbs               "I'm really just a Tcl-bot"
    jeff.hobbs at acm.org | Jeffrey.Hobbs at oen.siemens.de



Mon, 20 Mar 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Unchangeable changes

2. to CS: or not to CS: in F-PC assembler

3. Integration of Wordprocessor function with Clipper 5.2

4. Multidimensional integration of complex vector functions over real intervals

5. passing parameters to function used in Integration module

6. integration function

7. Fast integration FORTRAAN code for one-dimensional function?

8. SYSTEM INTEGRATION ENGINEER(IX, JAVA, Automated Integration, Clearcase, JPython)

9. VC++ calling fortran function and fortran function calling a c++ function

10. Calling functions from functions from functions ...

11. Camp Smalltalk (CS 6) registration

12. APL as First Language for CS

 

 
Powered by phpBB® Forum Software