summaryrefslogtreecommitdiffstats
path: root/tkimg/zlib/zlibtclStubLib.c
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 20:28:26 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 20:28:26 (GMT)
commitb184baa1234c2143e488d1796ae98afab118b891 (patch)
tree686b0a47b272296205c7fa2bc789f62a03d20df6 /tkimg/zlib/zlibtclStubLib.c
parentf7560d0a451a793441216d76eb4d9475aab61740 (diff)
parent5aad878400425d3af44433a47c13824385689e1d (diff)
downloadblt-b184baa1234c2143e488d1796ae98afab118b891.zip
blt-b184baa1234c2143e488d1796ae98afab118b891.tar.gz
blt-b184baa1234c2143e488d1796ae98afab118b891.tar.bz2
Merge commit '5aad878400425d3af44433a47c13824385689e1d' as 'tkimg'
Diffstat (limited to 'tkimg/zlib/zlibtclStubLib.c')
-rw-r--r--tkimg/zlib/zlibtclStubLib.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/tkimg/zlib/zlibtclStubLib.c b/tkimg/zlib/zlibtclStubLib.c
new file mode 100644
index 0000000..e065240
--- /dev/null
+++ b/tkimg/zlib/zlibtclStubLib.c
@@ -0,0 +1,62 @@
+/*
+ * zlibtclStubLib.c --
+ *
+ * Stub object that will be statically linked into extensions that wish
+ * to access the ZLIBTCL API.
+ *
+ * Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+ * Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id: zlibtclStubLib.c,v 1.1.1.1 2016/01/25 21:20:47 joye Exp $
+ */
+
+#ifndef USE_TCL_STUBS
+#define USE_TCL_STUBS
+#endif
+
+#include "zlibtcl.h"
+
+const ZlibtclStubs *zlibtclStubsPtr;
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Zlibtcl_InitStubs --
+ *
+ * Checks that the correct version of Blt is loaded and that it
+ * supports stubs. It then initialises the stub table pointers.
+ *
+ * Results:
+ * The actual version of BLT that satisfies the request, or
+ * NULL to indicate that an error occurred.
+ *
+ * Side effects:
+ * Sets the stub table pointers.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifdef Zlibtcl_InitStubs
+#undef Zlibtcl_InitStubs
+#endif
+
+MODULE_SCOPE const char *
+Zlibtcl_InitStubs(
+ Tcl_Interp *interp,
+ const char *version,
+ int exact
+) {
+ const char *result;
+ void *data;
+
+ result = Tcl_PkgRequireEx(interp, PACKAGE_NAME, (CONST84 char *) version, exact, &data);
+ if (!result || !data) {
+ return NULL;
+ }
+
+ zlibtclStubsPtr = data;
+ return result;
+}