1/* 2 * tifftcl.c -- 3 * 4 * Generic interface to XML parsers. 5 * 6 * Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net> 7 * 8 * Zveno Pty Ltd makes this software and associated documentation 9 * available free of charge for any purpose. You may make copies 10 * of the software but you must include all of this notice on any copy. 11 * 12 * Zveno Pty Ltd does not warrant that this software is error free 13 * or fit for any purpose. Zveno Pty Ltd disclaims any liability for 14 * all claims, expenses, losses, damages and costs any user may incur 15 * as a result of using, copying or modifying the software. 16 * 17 * $Id: tifftcl.c 290 2010-07-08 08:53:05Z nijtmans $ 18 * 19 */ 20 21#include "tifftcl.h" 22 23/* 24 * Declarations for externally visible functions. 25 */ 26 27extern DLLEXPORT int Tifftcl_Init(Tcl_Interp *interp); 28extern DLLEXPORT int Tifftcl_SafeInit(Tcl_Interp *interp); 29 30/* 31 * Prototypes for procedures defined later in this file: 32 */ 33 34/* 35 *---------------------------------------------------------------------------- 36 * 37 * Tifftcl_Init -- 38 * 39 * Initialisation routine for loadable module 40 * 41 * Results: 42 * None. 43 * 44 * Side effects: 45 * Creates commands in the interpreter, 46 * loads xml package. 47 * 48 *---------------------------------------------------------------------------- 49 */ 50 51int 52Tifftcl_Init (interp) 53 Tcl_Interp *interp; /* Interpreter to initialise. */ 54{ 55 extern const TifftclStubs tifftclStubs; 56 57 if (Tcl_InitStubs(interp, "8.3", 0) == NULL) { 58 return TCL_ERROR; 59 } 60 if (Tcl_PkgProvideEx(interp, PACKAGE_NAME, PACKAGE_VERSION, 61 (ClientData) &tifftclStubs) != TCL_OK) { 62 return TCL_ERROR; 63 } 64 65 return TCL_OK; 66} 67 68/* 69 *---------------------------------------------------------------------------- 70 * 71 * Tifftcl_SafeInit -- 72 * 73 * Initialisation routine for loadable module in a safe interpreter. 74 * 75 * Results: 76 * None. 77 * 78 * Side effects: 79 * Creates commands in the interpreter, 80 * loads xml package. 81 * 82 *---------------------------------------------------------------------------- 83 */ 84 85int 86Tifftcl_SafeInit (interp) 87 Tcl_Interp *interp; /* Interpreter to initialise. */ 88{ 89 return Tifftcl_Init(interp); 90} 91 92/* 93 *---------------------------------------------------------------------------- 94 * 95 * Tifftcl_XXX -- 96 * 97 * Wrappers around the zlib functionality. 98 * 99 * Results: 100 * Depends on function. 101 * 102 * Side effects: 103 * Depends on function. 104 * 105 *---------------------------------------------------------------------------- 106 */ 107 108/* 109 * No wrappers are required. Due to intelligent definition of the stub 110 * table using the function names of the libz sources the stub table 111 * contains jumps to the actual functionality. 112 */ 113