Questions tagged [tcl-api]

The Tcl API (also called' Tcl library' or' Tcl C interface') is a huge set of C functions which can be used to create binary extensions to the Tcl language.

5 questions
2
votes
1 answer

Tcl C++ API - how to type safe convert a void pointer

I am using Tcl_CreateObjCommand(interp, cmdName, proc, clientData, deleteProc) in my code and passing in a DerivedClass pointer to the clientData parameter. In the callback function, I want to type safe convert (dynamic_cast) the clientData back to…
Stan
  • 37,207
  • 50
  • 124
  • 185
1
vote
1 answer

tcl "open" command not working when replacing Tcl_Filesystem with a duplicate

I'm trying to write a custom filesystem for Tcl using the Tclapi (it's work related, won't go into details), but I'm stuck trying to figure out why this is not working. In this code segment I'm getting the original/native Tcl_Filesystem, copying…
lennoxho
  • 21
  • 2
1
vote
1 answer

Tcl scripts non-instrumenting debugger using Tcl Library and/or Tcl internals?

I would like to know if it is possible to build tcl scripts debugger using Tcl Library API and/or Tcl internal interfaces (I mean if they contain sufficient data to do so). I've noticed that existing tcl debuggers instrument tcl scripts and work…
Bogdan
  • 984
  • 8
  • 16
1
vote
1 answer

C++ Application using TCL API to enable package autoloading

I want to have my C++ application to enable package autoloading for all ActiveTcl packages in C:\Tcl\lib. I pass below tcl command to Tcl_Eval() in my C++ code. And expect "package require " will automatically find the package and load…
Stan
  • 37,207
  • 50
  • 124
  • 185
0
votes
2 answers

Tcl_Eval to return call stacks when error

When using Tcl C++ API Tcl_Eval, if it returns TCL_ERROR, the error message can be retrieved from Tcl_GetStringResult(interp). However, when executing a bunch of tcl script, the error message doesn't indicate which line the script fails. Eg: can't…
Stan
  • 37,207
  • 50
  • 124
  • 185