File: Visu_Init.c

package info (click to toggle)
ftools-fv 5.5.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,072 kB
  • sloc: tcl: 50,774; ansic: 17,858; exp: 2,004; makefile: 172; cpp: 169; sh: 109; csh: 10
file content (72 lines) | stat: -rw-r--r-- 1,955 bytes parent folder | download | duplicates (5)
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
61
62
63
64
65
66
67
68
69
70
71
72
/* 
 * Visu_Init.c
 *
 *	This file contains interpreter initialization
 *	functions. After the tkUnixInit.c file in the Tk4.1 distribution.
 *
 * Copyright (c) 1995-1996 Sun Microsystems, Inc.
 * Copyright (c) 1995-1996 The Regents of the University of California
 * Copyright (c) 1996      Pierre-Louis Bossart 
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 */




#include "tkpict.h"

/* globals linked with tcl variables */
int Private_Colormap = 0;
int slice_nb = 0;
int nb_slices = 1;

/*
 * Default directory in which to look for libraries:
 */

#if !(defined(__WIN32__) || defined(macintosh))
static char defaultLibraryDir[200] = VISU_LIBRARY;
#endif

/*
 * The following string is the startup script executed in new
 * interpreters.  It looks on disk in several different directories
 * for a script "visu.tcl" that is compatible with this version
 * of Visu.  The visu.tcl script does all of the real work of
 * initialization.
 */

static char *initScript = "" ;


int Visu_Init(interp)
     Tcl_Interp *interp;		/* Interpreter for application. */
{
#if !(defined(__WIN32__) || defined(macintosh))
  const char *libDir;
#endif

#if !(defined(__WIN32__) || defined(macintosh))
  /* create pict image format */
  Tk_CreateImageType(&tkPictImageType);
  
  /* least current files first */
  
  Tcl_LinkVar(interp,"has_plb_segment",(char*)&has_plb_segment,TCL_LINK_INT);
#endif

  Tcl_LinkVar(interp,"slice_nb",(char*)&slice_nb,TCL_LINK_INT);
  Tcl_LinkVar(interp,"nb_slices",(char*)&nb_slices,TCL_LINK_INT);
  Tcl_LinkVar(interp,"Private_Colormap",(char*)&Private_Colormap,TCL_LINK_INT);

#if !(defined(__WIN32__) || defined(macintosh))
  libDir = Tcl_GetVar(interp, "visu_library", TCL_GLOBAL_ONLY);
  if (libDir == NULL) {
    Tcl_SetVar(interp, "visu_library", defaultLibraryDir, TCL_GLOBAL_ONLY);
  }
#endif
  return Tcl_Eval(interp, initScript);
}