File: init.c

package info (click to toggle)
staden 2.0.0%2Bb11-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 21,556 kB
  • sloc: ansic: 240,603; tcl: 65,360; cpp: 12,854; makefile: 11,201; sh: 2,952; fortran: 2,033; perl: 63; awk: 46
file content (76 lines) | stat: -rw-r--r-- 1,619 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
73
74
75
76
#include <tcl.h>

#include "tkEditor.h"
#include "tkEdNames.h"
#include "tkSheet.h"
#include "contigEditor.h"
#include "newgap_cmds.h"
#include "gap-tcl.h"
#include "active_tags.h"

/*
#ifndef _WIN32
#  define TRAP_SIGNALS
#endif
*/

#ifdef TRAP_SIGNALS
#include <signal.h>
#include "gap-error.h"
#endif

#ifdef TRAP_SIGNALS
void trap_signals(void) {
    /*
     * Use the BSD signal() command to trap probable program crashes.
     * This then adds a debug message to make sure that we tell people
     * to email us.
     */
#if defined(SIGBUS) /* 11/1/99 johnt - SIGBUS not defined on WINNT */
    signal(SIGBUS,  error_sig);
#endif
    signal(SIGSEGV, error_sig);
    signal(SIGILL,  error_sig);
    signal(SIGFPE,  error_sig);
    signal(SIGINT,  error_sig);
#if defined(SIGQUIT)
    signal(SIGQUIT, error_sig);
#endif
#if defined(SIGSYS)
    signal(SIGSYS,  error_sig);
#endif /* SIGSYS */
}
#endif /* TRAP_SIGNALS */

int Gap_Init(Tcl_Interp *interp) {
#ifdef TRAP_SIGNALS
    trap_signals();
#endif

    Editor_Init(interp);
    EdNames_Init(interp);
    Sheet_Init(interp);
    Ced_Init(interp);
    NewGap_Init(interp);
    Db_Init(interp);

    get_tag_types();

    return Tcl_PkgProvide(interp, "gap4", "1.0");
}

int Gap_SafeInit(Tcl_Interp *interp) {
    return Gap_Init(interp);
}

int Gap_Unload(Tcl_Interp *interp, int flags) {
    Tcl_SetResult(interp, "Pkg_Unload() function not implemented",
		  TCL_STATIC);
    return TCL_ERROR;
}

int Gap_SafeUnload(Tcl_Interp *interp, int flags) {
    Tcl_SetResult(interp, "Pkg_SafeUnload() function not implemented",
		  TCL_STATIC);
    return TCL_ERROR;
}