tcl+C function with pointer function argument? 
Author Message
 tcl+C function with pointer function argument?

suppose a "public C function"  :  pubCFunc( void (*func)(void)  )

possible call pubCFunc with Tcl???
  {I thinks is not possible because Tcl is an "interpreter" language (not
compiled code) ... ? }
confirm ?

example:
----------------------------------------------------------------------------
-------
load CFuncLib.dll

proc myFunc {} {

  ... tcl code ...

Quote:
}

pubCFunc myFunc

----------------------------------------------------------------------------
------
* whrere pubCFunc is into DLL "CFuncLib"

Thanks

i.e. true context, interface GLUT openGL function with SWIG
     example: glutDisplayFunc(...)



Fri, 20 Apr 2001 03:00:00 GMT  
 tcl+C function with pointer function argument?

Quote:

> suppose a "public C function"  :  pubCFunc( void (*func)(void)  )

> possible call pubCFunc with Tcl???
>   {I thinks is not possible because Tcl is an "interpreter" language (not
> compiled code) ... ? }
> confirm ?

Yes it's possible:

http://psg.com/%7Ejoem/tcl/faq.html#TclandC

and

http://www.swig.org/

should give you a good head start.

Quote:
> i.e. true context, interface GLUT openGL function with SWIG
>      example: glutDisplayFunc(...)

Hmmmm.. Check out part 4 and part 5 of Larry's FAQ. There may already be an
OpenGL extension for Tk.

http://www.purl.org/NET/Tcl-FAQ/part4.html

--
Laurent Duperval - CGI
5 Place Ville Marie, Suite 1600 South, Montreal H3B 2G2
Tel: (514) 870-0879  Fax: (514) 391-2212



Sat, 21 Apr 2001 03:00:00 GMT  
 tcl+C function with pointer function argument?
my request is:

   possible pass a tcl procedure to C procedure for execution

   if I write a script procedure
   --------------------------------------
   proc myTclProc {} {
       code
   }
   --------------------------------------
   compile it with tclsh (or wish), and
   call a DLL procedure with myProc for argument

   DLLfunc(myTclProc)



Quote:

> > suppose a "public C function"  :  pubCFunc( void (*func)(void)  )

> > possible call pubCFunc with Tcl???
> >   {I thinks is not possible because Tcl is an "interpreter" language
(not
> > compiled code) ... ? }
> > confirm ?

> Yes it's possible:

> http://psg.com/%7Ejoem/tcl/faq.html#TclandC

> and

> http://www.swig.org/

> should give you a good head start.

> > i.e. true context, interface GLUT openGL function with SWIG
> >      example: glutDisplayFunc(...)

> Hmmmm.. Check out part 4 and part 5 of Larry's FAQ. There may already be
an
> OpenGL extension for Tk.

> http://www.purl.org/NET/Tcl-FAQ/part4.html

> --
> Laurent Duperval - CGI
> 5 Place Ville Marie, Suite 1600 South, Montreal H3B 2G2
> Tel: (514) 870-0879  Fax: (514) 391-2212




Mon, 23 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Tip 27: CONST qualifiers on pointer array arguments to TCL functions

2. Calling dll functions which need pointers to be passed as an argument

3. C2F and function pointer arguments

4. result of pointer function as argument

5. F77-C: Passing Fortran FUNCTION as an argument for a C Function

6. Passing array valued functions as argument to function.

7. Intrinsoc function as argument to intrinsic function question

8. F95: array-returning function as argument to another function

9. Function pointer as function parameter

10. Multiple arguments, structured arguments [ LONG ] (was Re: dyadic functions)

11. passing functions with variable number of arguments as procedure arguments

12. Returning Pointer To Pointer From Function

 

 
Powered by phpBB® Forum Software