item2
Next»

contents

 

Introduction - 1

History - 2

Overview - 3

Advanced features - 4

Work in progress - 5

One possibility - 6

Conclusion - 7

 

References

Appendix 1 - blowfish

Appendix 2 - tkspline

4.1 - Checking C Code

With more complicated extensions - especially Tk extensions - it is often necessary to check for platform specific features.

For example, the busy widget has been extracted from George Howlett's BLT library [10] and built as a separate  stubs-enabled package using CriTcl.  Here is a code fragment from busy.tcl:

   if {[critcl::check "#include <limits.h>"]}{
      critcl::cheaders -DHAVE_LIMITS_H
   }  

The critcl::check procedure invokes the C compiler on the supplied C code, and returns true if the code compiles without errors. In this case,  we are just testing for the existence of the limits.h header file.

Using the C compiler in this way is perhaps less efficient that the more traditional approaches (such as autoconf). But it does have some key advantages - primarily simplicity and familiarity. Knowing C does not imply a knowledge of any particular compiler tool chain, especially as more people come to Tcl from the Windows and Mac worlds.

see also

• Critcl Home Page

• Tclkit Home Page

• Starkit Home Page

• Wikit Home Page

• Tclers' Wiki

• Steve's Website

• Jean-Claude's Website

Paper by S. Landers & J.C. Wippler, as presented at Tcl/Tk 2002 conference - see also original PDF.

Papers & Presentations