1 /*
2  * tkgeomap.c --
3  *
4  *	This file defines the structures and functions that implement the
5  *	tkgeomap extension to Tcl, which adds the ability to display
6  *	geographic data in Tcl.
7  *
8  * Copyright (c) 2004 Gordon D. Carrie. All rights reserved.
9  *
10  * Licensed under the Open Software License version 2.1
11  *
12  * Please address questions and feedback to user0@tkgeomap.org
13  *
14  * @( *) $Id: tkgeomap.c,v 1.4 2004/09/22 21:23:25 tkgeomap Exp $
15  *
16  **********************************************************************
17  *
18  */
19 
20 #include "tkgeomap.h"
21 #include "tkgeomapInt.h"
22 
23 
24 /*
25  *------------------------------------------------------------------------
26  *
27  * Tkgeomap_Init --
28  *
29  * 	This procedure initializes the Tkgeomap interface and provides
30  * 	the tkgeomap package.
31  *
32  * Results:
33  *	A standard Tcl result.
34  *
35  * Side effects:
36  * 	Initializes other interfaces.
37  *
38  *------------------------------------------------------------------------
39  */
40 
41 int
Tkgeomap_Init(interp)42 Tkgeomap_Init(interp)
43     Tcl_Interp *interp;			/* Current interpreter */
44 {
45     static int loaded;			/* If true, package is loaded */
46 
47     if (loaded) {
48 	return TCL_OK;
49     }
50 #ifdef USE_TCL_STUBS
51     if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
52 	return TCL_ERROR;
53     }
54 #endif
55 #ifdef USE_TK_STUBS
56     if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
57 	return TCL_ERROR;
58     }
59 #endif
60     if (Tclgeomap_Init(interp) != TCL_OK) {
61 	return TCL_ERROR;
62     }
63     if (TkgeomapLnArrInit(interp) != TCL_OK) {
64 	return TCL_ERROR;
65     }
66     if (TkgeomapPlaceInit(interp) != TCL_OK) {
67 	return TCL_ERROR;
68     }
69     Tcl_PkgProvide(interp, "tkgeomap", TKGEOMAP_VERSION);
70     loaded = 1;
71     return TCL_OK;
72 }
73