Next | Prev | Up | Top | Contents | Index
Developing a New Library
After you write code for new procedures as described in Ousterhout's Tcl book, you then need to write an initialization routine that adds the new commands to the interpreter using Tcl_CreateCommand. By convention this routine is named module-name_Init where module-name is a short acronym for your extension library, such as Tk, TclX, or Tm. This routine takes a Tcl_Interp pointer as its only argument.
Build and install your new shared object as described in the section above. To test your library, run this command:
sgitcl>dlopen libname.so init init-routine
This should print the string returned by your initialization routine. Your new commands should be added to the interpreter and you can begin testing them.
Next | Prev | Up | Top | Contents | Index