1 /*
2  * jpegtcl.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  */
18 
19 #include <jpeglib.h>
20 
21 /*
22  *----------------------------------------------------------------------------
23  *
24  * Jpegtcl_Init --
25  *
26  *  Initialisation routine for loadable module
27  *
28  * Results:
29  *  None.
30  *
31  * Side effects:
32  *  Creates commands in the interpreter,
33  *  loads xml package.
34  *
35  *----------------------------------------------------------------------------
36  */
37 
38 int
Jpegtcl_Init(interp)39 Jpegtcl_Init (interp)
40       Tcl_Interp *interp; /* Interpreter to initialise. */
41 {
42   extern const JpegtclStubs jpegtclStubs;
43 
44   if (Tcl_InitStubs(interp, "8.3", 0) == NULL) {
45     return TCL_ERROR;
46   }
47   /* DO NOT USE PACKAGE_VERSION, USE INFO FROM jpegtcl.h INSTEAD */
48   if (Tcl_PkgProvideEx(interp, PACKAGE_NAME, JPEGTCL_VERSION,
49 		       (ClientData) &jpegtclStubs) != TCL_OK) {
50     return TCL_ERROR;
51   }
52 
53   return TCL_OK;
54 }
55 
56 /*
57  *----------------------------------------------------------------------------
58  *
59  * Jpegtcl_SafeInit --
60  *
61  *  Initialisation routine for loadable module in a safe interpreter.
62  *
63  * Results:
64  *  None.
65  *
66  * Side effects:
67  *  Creates commands in the interpreter,
68  *  loads xml package.
69  *
70  *----------------------------------------------------------------------------
71  */
72 
73 int
Jpegtcl_SafeInit(interp)74 Jpegtcl_SafeInit (interp)
75       Tcl_Interp *interp; /* Interpreter to initialise. */
76 {
77     return Jpegtcl_Init(interp);
78 }
79