Chapter 47. C Library Overview
This chapter provides a bird's eye view of the facilities in the Tcl and Tk C libraries. For details of the APIs, you will need to consult the on-line reference material.
C libraries provide comprehensive access to the Tcl and Tk implementation. You have complete control over the Tcl script environment, plus you can extend Tcl and Tk by writing new features in C. You can implement new commands, I/O channels, event sources, widgets, canvas items, image types, and geometry managers. The platform-independent I/O subsystem and the event loop are available for use from C. This chapter provides an overview of the Tcl and Tk C libraries.
For serious C programming you need to consult the on-line reference material. The manual pages describe groups of related C procedures. For example, Tcl_CreateCommand and Tcl_DeleteCommand are described in the CrtCommand man page. On UNIX, you can run man on individual procedures and see the documentation for the whole group of related procedures:
The Windows Help and HTML versions are indexed by procedure. You can find the HTML on the CD-ROM and the Web:
The Tcl and Tk sources are also excellent reference material. The code is well written with a consistent style that encourages lots of comments. Virtually all the exported APIs are used by Tcl and Tk themselves, so you can the source code to see how the APIs are used. The Tcl and Tk sources are on the CD-ROM in tcl8.2 and tk8.2 directories. Chapter 45 describes the source directory structure and how to build Tcl from the source code.