Debian Codegraph @

unix/dltest/pkge.c

raw
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
14 #undef STATIC_BUILD
15 #include "tcl.h"
16
17 /*
18 *----------------------------------------------------------------------
19 *
20 * Pkge_Init --
21 *
22 * This is a package initialization procedure, which is called by Tcl
23 * when this package is to be added to an interpreter.
24 *
25 * Results:
26 * Returns TCL_ERROR and leaves an error message in interp->result.
27 *
28 * Side effects:
29 * None.
30 *
31 *----------------------------------------------------------------------
32 */
33
34 DLLEXPORT int
35 Pkge_Init(
36 Tcl_Interp *interp) /* Interpreter in which the package is to be
37 * made available. */
38 {
39 static const char script[] = "if 44 {open non_existent}";
40
41 if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
42 return TCL_ERROR;
43 }
44 return Tcl_EvalEx(interp, script, -1, 0);
45 }