sl@0: /* sl@0: * tclMacTclCode.r -- sl@0: * sl@0: * This file creates resources from the Tcl code that is sl@0: * usually stored in the TCL_LiBRARY sl@0: * sl@0: * Copyright (c) 1996-1997 Sun Microsystems, Inc. sl@0: * sl@0: * See the file "license.terms" for information on usage and redistribution sl@0: * of this file, and for a DISCLAIMER OF ALL WARRANTIES. sl@0: * sl@0: * SCCS: @(#) tclMacTclCode.r 1.1 98/01/21 22:22:38 sl@0: */ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #define TCL_LIBRARY_RESOURCES 2000 sl@0: sl@0: /* sl@0: * The mechanisim below loads Tcl source into the resource fork of the sl@0: * application. The example below creates a TEXT resource named sl@0: * "Init" from the file "init.tcl". This allows applications to use sl@0: * Tcl to define the behavior of the application without having to sl@0: * require some predetermined file structure - all needed Tcl "files" sl@0: * are located within the application. To source a file for the sl@0: * resource fork the source command has been modified to support sl@0: * sourcing from resources. In the below case "source -rsrc {Init}" sl@0: * will load the TEXT resource named "Init". sl@0: */ sl@0: sl@0: read 'TEXT' (TCL_LIBRARY_RESOURCES, "init", purgeable) "::library:init.tcl"; sl@0: read 'TEXT' (TCL_LIBRARY_RESOURCES + 1, "auto", purgeable) "::library:auto.tcl"; sl@0: read 'TEXT' (TCL_LIBRARY_RESOURCES + 2, "package", purgeable,preload) "::library:package.tcl"; sl@0: read 'TEXT' (TCL_LIBRARY_RESOURCES + 3, "history", purgeable) "::library:history.tcl"; sl@0: read 'TEXT' (TCL_LIBRARY_RESOURCES + 4, "word", purgeable,preload) "::library:word.tcl"; sl@0: read 'TEXT' (TCL_LIBRARY_RESOURCES + 5, "parray", purgeable,preload) "::library:parray.tcl";