35. Creating New Tcl Commands
For everyone planning on interacting with Tcl’s C API, whether through extensions to Tcl or by embedding Tcl, creating new Tcl commands is the primary means of integrating Tcl with your library or application.
Each Tcl command is implemented by a function written in C. When a Tcl command is invoked during script evaluation, Tcl calls this function to carry out the command. This chapter describes how to write command functions, how to register them in an interpreter, and how to manage the result of the command.
35.1 Functions Presented in This Chapter
• Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *
interp
,
CONST char *
cmdName
, Tcl_ObjCmdProc
proc
,
ClientData
clientData
,
...
Get Tcl and the Tk Toolkit, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.