| Rev | Line |   | 
|---|
| [25] | 1 | /* | 
|---|
 | 2 |  * pkge.c -- | 
|---|
 | 3 |  * | 
|---|
 | 4 |  *      This file contains a simple Tcl package "pkge" that is intended for | 
|---|
 | 5 |  *      testing the Tcl dynamic loading facilities. Its Init procedure returns | 
|---|
 | 6 |  *      an error in order to test how this is handled. | 
|---|
 | 7 |  * | 
|---|
 | 8 |  * Copyright (c) 1995 Sun Microsystems, Inc. | 
|---|
 | 9 |  * | 
|---|
 | 10 |  * See the file "license.terms" for information on usage and redistribution of | 
|---|
 | 11 |  * this file, and for a DISCLAIMER OF ALL WARRANTIES. | 
|---|
 | 12 |  * | 
|---|
 | 13 |  * RCS: @(#) $Id: pkge.c,v 1.10 2007/12/13 15:28:43 dgp Exp $ | 
|---|
 | 14 |  */ | 
|---|
 | 15 |  | 
|---|
 | 16 | #include "tcl.h" | 
|---|
 | 17 |  | 
|---|
 | 18 |  | 
|---|
 | 19 | /* | 
|---|
 | 20 |  *---------------------------------------------------------------------- | 
|---|
 | 21 |  * | 
|---|
 | 22 |  * Pkge_Init -- | 
|---|
 | 23 |  * | 
|---|
 | 24 |  *      This is a package initialization procedure, which is called by Tcl | 
|---|
 | 25 |  *      when this package is to be added to an interpreter. | 
|---|
 | 26 |  * | 
|---|
 | 27 |  * Results: | 
|---|
 | 28 |  *      Returns TCL_ERROR and leaves an error message in interp->result. | 
|---|
 | 29 |  * | 
|---|
 | 30 |  * Side effects: | 
|---|
 | 31 |  *      None. | 
|---|
 | 32 |  * | 
|---|
 | 33 |  *---------------------------------------------------------------------- | 
|---|
 | 34 |  */ | 
|---|
 | 35 |  | 
|---|
 | 36 | int | 
|---|
 | 37 | Pkge_Init( | 
|---|
 | 38 |     Tcl_Interp *interp)         /* Interpreter in which the package is to be | 
|---|
 | 39 |                                  * made available. */ | 
|---|
 | 40 | { | 
|---|
 | 41 |     static char script[] = "if 44 {open non_existent}"; | 
|---|
 | 42 |  | 
|---|
 | 43 |     if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { | 
|---|
 | 44 |         return TCL_ERROR; | 
|---|
 | 45 |     } | 
|---|
 | 46 |     return Tcl_Eval(interp, script); | 
|---|
 | 47 | } | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.