File: toglStubLib.c

package info (click to toggle)
mgltools-opengltk 1.5.7-1
  • links: PTS, VCS
  • area: non-free
  • in suites: stretch
  • size: 8,592 kB
  • ctags: 38,393
  • sloc: ansic: 98,617; python: 3,818; cpp: 1,943; sh: 1,332; tcl: 1,127; makefile: 65
file content (59 lines) | stat: -rw-r--r-- 1,309 bytes parent folder | download | duplicates (10)
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
#ifndef   USE_TCL_STUBS
#  define USE_TCL_STUBS
#endif
#undef USE_TCL_STUB_PROCS
#ifndef   USE_TK_STUBS
#  define USE_TK_STUBS
#endif
#undef USE_TK_STUB_PROCS

#include "togl.h"

ToglStubs *toglStubsPtr;

/* 
 ** Ensure that Togl_InitStubs is built as an exported symbol.  The other stub
 ** functions should be built as non-exported symbols.
 */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT

/* 
 * Togl_InitStubs --
 *
 *    Checks that the correct version of Togl is loaded and that it
 *    supports stubs.  It then initialises the stub table pointers.
 *
 * Results:
 *     The actual version of Togl that satisfies the request, or
 *     NULL to indicate that an error occurred.
 *
 * Side effects:
 *     sets the stub table pointer.
 *
 */

#ifdef Togl_InitStubs
#  undef Togl_InitStubs
#endif

const char *
Togl_InitStubs(Tcl_Interp *interp, const char *version, int exact)
{
    const char *actualVersion;

    actualVersion = Tcl_PkgRequireEx(interp, "Togl", version, exact,
            (ClientData *) &toglStubsPtr);
    if (!actualVersion) {
        return NULL;
    }

    if (!toglStubsPtr) {
        Tcl_SetResult(interp,
                "This implementation of Togl does not support stubs",
                TCL_STATIC);
        return NULL;
    }

    return actualVersion;
}