File: jpegtclStubLib.c

package info (click to toggle)
libtk-img 1%3A2.0.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 47,852 kB
  • sloc: ansic: 224,696; sh: 20,589; tcl: 8,921; makefile: 2,272; cpp: 1,933; ada: 1,681; pascal: 1,139; cs: 879; awk: 794; asm: 587; python: 542; xml: 95
file content (60 lines) | stat: -rwxr-xr-x 1,524 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 * jpegtclStubLib.c --
 *
 * Stub object that will be statically linked into extensions that wish
 * to access the JPEGTCL 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.
 */

#ifndef USE_TCL_STUBS
#define USE_TCL_STUBS
#endif

#include "jpegtcl.h"

const JpegtclStubs *jpegtclStubsPtr;

/*
 *----------------------------------------------------------------------
 *
 * Jpegtcl_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 Jpegtcl_InitStubs
#undef Jpegtcl_InitStubs
#endif

MODULE_SCOPE const char *
Jpegtcl_InitStubs(
    Tcl_Interp *interp,
    const char *version,
    int exact)
{
    const char *result;
    ClientData data;

    result = Tcl_PkgRequireEx(interp, PACKAGE_NAME, version, exact, &data);
    if (!result || !data) {
        return NULL;
    }

    jpegtclStubsPtr = (const JpegtclStubs *) data;
    return result;
}