File: init.c

package info (click to toggle)
staden 2.0.0%2Bb11-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 21,568 kB
  • sloc: ansic: 240,605; tcl: 65,360; cpp: 12,854; makefile: 11,201; sh: 2,952; fortran: 2,033; perl: 63; awk: 46
file content (39 lines) | stat: -rw-r--r-- 961 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
#include <string.h>
#include <tcl.h>
#include <stdlib.h>

#include "tkSeqed.h"
#include "tkSeqedNames.h"
#include "nip_cmds.h"
#include "sequtils_cmds.h"

int Nip_Init(Tcl_Interp *interp) {
    char *s, c[20];

    /*
     * Set packages(name). This is done to prevent subsequent reloading
     * of this library (for efficiency reasons). The only reason that this
     * is necessary is that currently gap4 dynamically links with some
     * libraries at link time. When they're all at run time this won't
     * be necessary.
     */
    if (s = Tcl_GetVar2(interp, "packages", "nip", TCL_GLOBAL_ONLY))
	sprintf(c, "%d", atoi(s)|2);
    else
	strcpy(c, "2");
    Tcl_SetVar2(interp, "packages", "nip", c, TCL_GLOBAL_ONLY);

    if (Seqed_Init(interp) == TCL_ERROR) {
	return TCL_ERROR;
    }

    if (SeqedNames_Init(interp) == TCL_ERROR) {
	return TCL_ERROR;
    }

    if (NipCmds_Init(interp) == TCL_ERROR) {
	return TCL_ERROR;
    }

    return TCL_OK;
}