summaryrefslogtreecommitdiffstats
path: root/tkimg/base/tkimgStubLib.c
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-01-03 21:52:18 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-01-03 21:52:18 (GMT)
commit4302a869f0212a3e4878e66a7260b434f6584476 (patch)
treee6976e66edf648406e32b092395121e045301692 /tkimg/base/tkimgStubLib.c
parenta780057cc1b51dd3a557549c3cf2431f09136c0d (diff)
parent60d692811c12788ed4468d5ff680633304e8f641 (diff)
downloadblt-4302a869f0212a3e4878e66a7260b434f6584476.zip
blt-4302a869f0212a3e4878e66a7260b434f6584476.tar.gz
blt-4302a869f0212a3e4878e66a7260b434f6584476.tar.bz2
Merge commit '60d692811c12788ed4468d5ff680633304e8f641' as 'tkimg'
Diffstat (limited to 'tkimg/base/tkimgStubLib.c')
-rwxr-xr-xtkimg/base/tkimgStubLib.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/tkimg/base/tkimgStubLib.c b/tkimg/base/tkimgStubLib.c
new file mode 100755
index 0000000..984d53f
--- /dev/null
+++ b/tkimg/base/tkimgStubLib.c
@@ -0,0 +1,58 @@
+/*
+ * tkimgStubLib.c --
+ *
+ * Stub object that will be statically linked into extensions that wish
+ * to access the TKIMG 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: tkimgStubLib.c 274 2010-06-28 13:23:34Z nijtmans $
+ */
+
+#ifndef USE_TCL_STUBS
+# define USE_TCL_STUBS
+#endif
+
+#include "tkimg.h"
+
+const TkimgStubs *tkimgStubsPtr;
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tkimg_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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE const char *
+Tkimg_InitStubs(
+ Tcl_Interp *interp,
+ const char *version,
+ int exact
+) {
+ const char *result;
+ void *data;
+
+ result = Tcl_PkgRequireEx(interp, PACKAGE_TCLNAME, (CONST84 char *) version, exact, &data);
+ if (!result || !data) {
+ return NULL;
+ }
+
+ tkimgStubsPtr = (const TkimgStubs *) data;
+ return result;
+}