/[dtapublic]/projs/ets/trunk/src/c_tk_base_7_5_w_mods/tkstublib.c
ViewVC logotype

Diff of /projs/ets/trunk/src/c_tk_base_7_5_w_mods/tkstublib.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

projs/trunk/shared_source/tk_base/tkstublib.c revision 42 by dashley, Fri Oct 14 01:50:00 2016 UTC projs/dtats/trunk/shared_source/c_tk_base_7_5_w_mods/tkstublib.c revision 98 by dashley, Sun Dec 18 00:57:31 2016 UTC
# Line 1  Line 1 
 /* $Header: /cvsroot/esrg/sfesrg/esrgpcpj/shared/tk_base/tkstublib.c,v 1.1.1.1 2001/06/13 05:08:19 dtashley Exp $ */  
   
 /*  
  * tkStubLib.c --  
  *  
  *      Stub object that will be statically linked into extensions that wish  
  *      to access Tk.  
  *  
  * Copyright (c) 1998 Paul Duffin.  
  * Copyright (c) 1998-1999 by Scriptics Corporation.  
  *  
  * See the file "license.terms" for information on usage and redistribution  
  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.  
  *  
  * RCS: @(#) $Id: tkstublib.c,v 1.1.1.1 2001/06/13 05:08:19 dtashley Exp $  
  */  
   
 /*  
  * Because of problems with pre-compiled headers on the Mac, we need to  
  * do these includes before we add the stubs defines.  This a hack.  
  */  
   
 #ifdef MAC_TCL  
 #include "tkMacInt.h"  
 #include "tkInt.h"  
 #include "tkPort.h"  
 #endif /* MAC_TCL */  
   
 /*  
  * We need to ensure that we use the stub macros so that this file contains  
  * no references to any of the stub functions.  This will make it possible  
  * to build an extension that references Tk_InitStubs but doesn't end up  
  * including the rest of the stub functions.  
  */  
   
 #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  
   
 #ifndef MAC_TCL  
   
 #include "tkPort.h"  
 #include "tkInt.h"  
   
 #ifdef __WIN32__  
 #include "tkWinInt.h"  
 #endif  
   
 #endif /* !MAC_TCL */  
   
 #include "tkDecls.h"  
 #include "tkIntDecls.h"  
 #include "tkPlatDecls.h"  
 #include "tkIntPlatDecls.h"  
 #include "tkIntXlibDecls.h"  
   
 /*  
  * Ensure that Tk_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  
   
 TkStubs *tkStubsPtr;  
 TkPlatStubs *tkPlatStubsPtr;  
 TkIntStubs *tkIntStubsPtr;  
 TkIntPlatStubs *tkIntPlatStubsPtr;  
 TkIntXlibStubs *tkIntXlibStubsPtr;  
   
   
 /*  
  *----------------------------------------------------------------------  
  *  
  * Tk_InitStubs --  
  *  
  *      Checks that the correct version of Tk is loaded and that it  
  *      supports stubs. It then initialises the stub table pointers.  
  *  
  * Results:  
  *      The actual version of Tk that satisfies the request, or  
  *      NULL to indicate that an error occurred.  
  *  
  * Side effects:  
  *      Sets the stub table pointers.  
  *  
  *----------------------------------------------------------------------  
  */  
   
 #ifdef Tk_InitStubs  
 #undef Tk_InitStubs  
 #endif  
   
 char *  
 Tk_InitStubs(interp, version, exact)  
     Tcl_Interp *interp;  
     char *version;  
     int exact;  
 {  
     char *actualVersion;  
   
     actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact,  
                 (ClientData *) &tkStubsPtr);  
     if (!actualVersion) {  
         return NULL;  
     }  
   
     if (!tkStubsPtr) {  
         Tcl_SetResult(interp,  
                 "This implementation of Tk does not support stubs",  
                 TCL_STATIC);  
         return NULL;  
     }  
       
     tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs;  
     tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs;  
     tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs;  
     tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs;  
       
     return actualVersion;  
 }  
   
   
 /* $History: tkStubLib.c $  
  *  
  * *****************  Version 1  *****************  
  * User: Dtashley     Date: 1/02/01    Time: 3:08a  
  * Created in $/IjuScripter, IjuConsole/Source/Tk Base  
  * Initial check-in.  
  */  
   
 /* End of TKSTUBLIB.C */  
1    /* $Header$ */
2    
3    /*
4     * tkStubLib.c --
5     *
6     *      Stub object that will be statically linked into extensions that wish
7     *      to access Tk.
8     *
9     * Copyright (c) 1998 Paul Duffin.
10     * Copyright (c) 1998-1999 by Scriptics Corporation.
11     *
12     * See the file "license.terms" for information on usage and redistribution
13     * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14     *
15     * RCS: @(#) $Id: tkstublib.c,v 1.1.1.1 2001/06/13 05:08:19 dtashley Exp $
16     */
17    
18    /*
19     * Because of problems with pre-compiled headers on the Mac, we need to
20     * do these includes before we add the stubs defines.  This a hack.
21     */
22    
23    #ifdef MAC_TCL
24    #include "tkMacInt.h"
25    #include "tkInt.h"
26    #include "tkPort.h"
27    #endif /* MAC_TCL */
28    
29    /*
30     * We need to ensure that we use the stub macros so that this file contains
31     * no references to any of the stub functions.  This will make it possible
32     * to build an extension that references Tk_InitStubs but doesn't end up
33     * including the rest of the stub functions.
34     */
35    
36    #ifndef USE_TCL_STUBS
37    #define USE_TCL_STUBS
38    #endif
39    #undef USE_TCL_STUB_PROCS
40    
41    #ifndef USE_TK_STUBS
42    #define USE_TK_STUBS
43    #endif
44    #undef USE_TK_STUB_PROCS
45    
46    #ifndef MAC_TCL
47    
48    #include "tkPort.h"
49    #include "tkInt.h"
50    
51    #ifdef __WIN32__
52    #include "tkWinInt.h"
53    #endif
54    
55    #endif /* !MAC_TCL */
56    
57    #include "tkDecls.h"
58    #include "tkIntDecls.h"
59    #include "tkPlatDecls.h"
60    #include "tkIntPlatDecls.h"
61    #include "tkIntXlibDecls.h"
62    
63    /*
64     * Ensure that Tk_InitStubs is built as an exported symbol.  The other stub
65     * functions should be built as non-exported symbols.
66     */
67    
68    #undef TCL_STORAGE_CLASS
69    #define TCL_STORAGE_CLASS DLLEXPORT
70    
71    TkStubs *tkStubsPtr;
72    TkPlatStubs *tkPlatStubsPtr;
73    TkIntStubs *tkIntStubsPtr;
74    TkIntPlatStubs *tkIntPlatStubsPtr;
75    TkIntXlibStubs *tkIntXlibStubsPtr;
76    
77    
78    /*
79     *----------------------------------------------------------------------
80     *
81     * Tk_InitStubs --
82     *
83     *      Checks that the correct version of Tk is loaded and that it
84     *      supports stubs. It then initialises the stub table pointers.
85     *
86     * Results:
87     *      The actual version of Tk that satisfies the request, or
88     *      NULL to indicate that an error occurred.
89     *
90     * Side effects:
91     *      Sets the stub table pointers.
92     *
93     *----------------------------------------------------------------------
94     */
95    
96    #ifdef Tk_InitStubs
97    #undef Tk_InitStubs
98    #endif
99    
100    char *
101    Tk_InitStubs(interp, version, exact)
102        Tcl_Interp *interp;
103        char *version;
104        int exact;
105    {
106        char *actualVersion;
107    
108        actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact,
109                    (ClientData *) &tkStubsPtr);
110        if (!actualVersion) {
111            return NULL;
112        }
113    
114        if (!tkStubsPtr) {
115            Tcl_SetResult(interp,
116                    "This implementation of Tk does not support stubs",
117                    TCL_STATIC);
118            return NULL;
119        }
120        
121        tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs;
122        tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs;
123        tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs;
124        tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs;
125        
126        return actualVersion;
127    }
128    
129    /* End of tkstublib.c */

Legend:
Removed from v.42  
changed lines
  Added in v.98

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25