/* * zlibStubLib.c -- * * This file contains stubs init code for the zlib extension. * * Shamelessly copied from http://wiki.tcl.tk/3358 * Copyright (c) 2005 by Pascal Scheffers * Copyright (c) 2005 Unitas Software B.V. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id$ */ #include "tcl.h" #ifndef USE_TCL_STUBS #define USE_TCL_STUBS #endif #undef USE_TCL_STUB_PROCS #include "tclZlib.h" #include "zlibDecls.h" #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT ZlibStubs *zlibStubsPtr; /* **---------------------------------------------------------------------- ** ** Zlib_InitStubs -- ** ** Checks that the correct version of dict is loaded and that it ** supports stubs. It then initialises the stub table pointers. ** ** Results: ** The actual version of zlib that satisfies the request, or ** NULL to indicate that an error occurred. ** ** Side effects: ** Sets the stub table pointers. ** **---------------------------------------------------------------------- */ CONST char * Zlib_InitStubs (Tcl_Interp *interp, CONST char *version, int exact) { char *actualVersion; actualVersion = Tcl_PkgRequireEx(interp, "zlib", version, exact, (ClientData *) &zlibStubsPtr); if (!actualVersion) { return NULL; } if (!zlibStubsPtr) { Tcl_SetResult(interp, "This implementation of zlib does not support stubs", TCL_STATIC); return NULL; } return actualVersion; }