summaryrefslogtreecommitdiffstats
path: root/tcl8.6/unix/dltest/pkge.c
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-10-17 19:52:11 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-10-17 19:52:11 (GMT)
commitda0aaf36f00f649cd910b1bcb972b4ad476cd5fd (patch)
tree3d5215355c39587ed375451b86b7f9962f739a5f /tcl8.6/unix/dltest/pkge.c
parent9bfb1e415c87790341c6a3520b081292fcdb058b (diff)
parentc8bc058c566bbcbcd23e732197d64fecc739008f (diff)
downloadblt-da0aaf36f00f649cd910b1bcb972b4ad476cd5fd.zip
blt-da0aaf36f00f649cd910b1bcb972b4ad476cd5fd.tar.gz
blt-da0aaf36f00f649cd910b1bcb972b4ad476cd5fd.tar.bz2
Merge commit 'c8bc058c566bbcbcd23e732197d64fecc739008f' as 'tcl8.6'
Diffstat (limited to 'tcl8.6/unix/dltest/pkge.c')
-rw-r--r--tcl8.6/unix/dltest/pkge.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/tcl8.6/unix/dltest/pkge.c b/tcl8.6/unix/dltest/pkge.c
new file mode 100644
index 0000000..395cd0e
--- /dev/null
+++ b/tcl8.6/unix/dltest/pkge.c
@@ -0,0 +1,54 @@
+/*
+ * pkge.c --
+ *
+ * This file contains a simple Tcl package "pkge" that is intended for
+ * testing the Tcl dynamic loading facilities. Its Init procedure returns
+ * an error in order to test how this is handled.
+ *
+ * Copyright (c) 1995 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#undef STATIC_BUILD
+#include "tcl.h"
+
+/*
+ * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
+ * Pkge_Init declaration is in the source file itself, which is only
+ * accessed when we are building a library.
+ */
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Pkge_Init --
+ *
+ * This is a package initialization procedure, which is called by Tcl
+ * when this package is to be added to an interpreter.
+ *
+ * Results:
+ * Returns TCL_ERROR and leaves an error message in interp->result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+EXTERN int
+Pkge_Init(
+ Tcl_Interp *interp) /* Interpreter in which the package is to be
+ * made available. */
+{
+ static const char script[] = "if 44 {open non_existent}";
+
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ return TCL_ERROR;
+ }
+ return Tcl_EvalEx(interp, script, -1, 0);
+}