~ubuntu-branches/ubuntu/feisty/perl-tk/feisty

« back to all changes in this revision

Viewing changes to pTk/mTk/tclUnix/tclAppInit.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2006-10-01 15:14:26 UTC
  • mfrom: (3.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20061001151426-8od1x69hl9a29h04
Tags: 1:804.027-7
* Urgency high due to RC bug:
  + debian/rules: Use $(CURDIR) rather than $(PWD) in prefix so files 
    are installed correctly on architectures using sudo rather than 
    fakeroot.   (Thanks to Niko Tyni. Closes: #390382)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
 
1
/*
2
2
 * tclAppInit.c --
3
3
 *
4
4
 *      Provides a default version of the main program and Tcl_AppInit
6
6
 *
7
7
 * Copyright (c) 1993 The Regents of the University of California.
8
8
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 
9
 * Copyright (c) 1998-1999 by Scriptics Corporation.
9
10
 *
10
11
 * See the file "license.terms" for information on usage and redistribution
11
12
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
13
 *
13
 
 * RCS: @(#) $Id: tclAppInit.c,v 1.4 1999/02/03 02:58:26 stanton Exp $
 
14
 * RCS: @(#) $Id: tclAppInit.c,v 1.11 2002/05/31 22:20:22 dgp Exp $
14
15
 */
15
16
 
16
 
#ifdef TCL_XT_TEST
17
 
#include <X11/Intrinsic.h>
18
 
#endif
19
 
 
20
17
#include "tcl.h"
21
18
 
22
 
/*
23
 
 * The following variable is a special hack that is needed in order for
24
 
 * Sun shared libraries to be used for Tcl.
25
 
 */
26
 
 
27
 
extern int matherr();
28
 
int *tclDummyMathPtr = (int *) matherr;
29
 
 
30
 
 
31
19
#ifdef TCL_TEST
 
20
 
 
21
#include "tclInt.h"
 
22
 
32
23
extern int              Procbodytest_Init _ANSI_ARGS_((Tcl_Interp *interp));
33
24
extern int              Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp *interp));
34
25
extern int              TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp));
35
26
extern int              Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
 
27
#ifdef TCL_THREADS
 
28
extern int              TclThread_Init _ANSI_ARGS_((Tcl_Interp *interp));
 
29
#endif
 
30
 
36
31
#endif /* TCL_TEST */
 
32
 
37
33
#ifdef TCL_XT_TEST
 
34
extern void             XtToolkitInitialize _ANSI_ARGS_((void));
38
35
extern int              Tclxttest_Init _ANSI_ARGS_((Tcl_Interp *interp));
39
36
#endif
40
 
 
 
37
 
41
38
/*
42
39
 *----------------------------------------------------------------------
43
40
 *
60
57
    int argc;                   /* Number of command-line arguments. */
61
58
    char **argv;                /* Values of command-line arguments. */
62
59
{
 
60
    /*
 
61
     * The following #if block allows you to change the AppInit
 
62
     * function by using a #define of TCL_LOCAL_APPINIT instead
 
63
     * of rewriting this entire file.  The #if checks for that
 
64
     * #define and uses Tcl_AppInit if it doesn't exist.
 
65
     */
 
66
 
 
67
#ifndef TCL_LOCAL_APPINIT
 
68
#define TCL_LOCAL_APPINIT Tcl_AppInit
 
69
#endif
 
70
    extern int TCL_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp));
 
71
 
 
72
    /*
 
73
     * The following #if block allows you to change how Tcl finds the startup
 
74
     * script, prime the library or encoding paths, fiddle with the argv,
 
75
     * etc., without needing to rewrite Tcl_Main()
 
76
     */
 
77
 
 
78
#ifdef TCL_LOCAL_MAIN_HOOK
 
79
    extern int TCL_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv));
 
80
#endif
 
81
 
63
82
#ifdef TCL_XT_TEST
64
83
    XtToolkitInitialize();
65
84
#endif
66
 
    Tcl_Main(argc, argv, Tcl_AppInit);
 
85
 
 
86
#ifdef TCL_LOCAL_MAIN_HOOK
 
87
    TCL_LOCAL_MAIN_HOOK(&argc, &argv);
 
88
#endif
 
89
 
 
90
    Tcl_Main(argc, argv, TCL_LOCAL_APPINIT);
 
91
 
67
92
    return 0;                   /* Needed only to prevent compiler warning. */
68
93
}
69
 
 
 
94
 
70
95
/*
71
96
 *----------------------------------------------------------------------
72
97
 *
78
103
 *
79
104
 * Results:
80
105
 *      Returns a standard Tcl completion code, and leaves an error
81
 
 *      message in interp->result if an error occurs.
 
106
 *      message in the interp's result if an error occurs.
82
107
 *
83
108
 * Side effects:
84
109
 *      Depends on the startup script.
108
133
    if (TclObjTest_Init(interp) == TCL_ERROR) {
109
134
        return TCL_ERROR;
110
135
    }
 
136
#ifdef TCL_THREADS
 
137
    if (TclThread_Init(interp) == TCL_ERROR) {
 
138
        return TCL_ERROR;
 
139
    }
 
140
#endif
111
141
    if (Procbodytest_Init(interp) == TCL_ERROR) {
112
142
        return TCL_ERROR;
113
143
    }
138
168
     * then no user-specific startup file will be run under any conditions.
139
169
     */
140
170
 
 
171
#ifdef DJGPP
 
172
    Tcl_SetVar(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY);
 
173
#else
141
174
    Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY);
 
175
#endif
142
176
    return TCL_OK;
143
177
}