Diff
Not logged in

Differences From Artifact [92efb75fc4]:

To Artifact [2410a46290]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* 
 * tclMacBGMain.c --
 *
 *	Main program for Macintosh Background Only Application shells.
 *
 * Copyright (c) 1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * SCCS: @(#) tclMacBOAMain.c 1.1 97/11/03 17:06:22
 */

#include "tcl.h"
#include "tclInt.h"
#include "tclMacInt.h"
#include <Resources.h>
#include <Notification.h>










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* 
 * tclMacBGMain.c --
 *
 *	Main program for Macintosh Background Only Application shells.
 *
 * Copyright (c) 1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * SCCS: @(#) tclMacBOAMain.c 1.3 97/12/19 10:42:08
 */

#include "tcl.h"
#include "tclInt.h"
#include "tclMacInt.h"
#include <Resources.h>
#include <Notification.h>
143
144
145
146
147
148
149
150

151
152
153
154
155
156

157
158
159
160
161
162
163
164
	    ((fileName == NULL) && tty) ? "1" : "0", TCL_GLOBAL_ONLY);
    
    /*
     * Invoke application-specific initialization.
     */

    if ((*appInitProc)(interp) != TCL_OK) {
	    Tcl_DString errStr;

	    Tcl_DStringInit(&errStr);
	    Tcl_DStringAppend(&errStr,
		    "application-specific initialization failed: \n", -1);
	    Tcl_DStringAppend(&errStr, interp->result, -1);
	    Tcl_DStringAppend(&errStr, "\n", 1);
	    TclMacDoNotification(Tcl_DStringValue(&errStr));

	    goto done;
    }

    /*
     * Install the BGNotify command:
     */
    
    if ( Tcl_CreateObjCommand(interp, "bgnotify", Tcl_MacBGNotifyObjCmd, NULL,







|
>
|
|
|
|
|
|
>
|







143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
	    ((fileName == NULL) && tty) ? "1" : "0", TCL_GLOBAL_ONLY);
    
    /*
     * Invoke application-specific initialization.
     */

    if ((*appInitProc)(interp) != TCL_OK) {
	Tcl_DString errStr;

	Tcl_DStringInit(&errStr);
	Tcl_DStringAppend(&errStr,
		"application-specific initialization failed: \n", -1);
	Tcl_DStringAppend(&errStr, Tcl_GetStringResult(interp), -1);
	Tcl_DStringAppend(&errStr, "\n", 1);
	TclMacDoNotification(Tcl_DStringValue(&errStr));
	Tcl_DStringFree(&errStr);
	goto done;
    }

    /*
     * Install the BGNotify command:
     */
    
    if ( Tcl_CreateObjCommand(interp, "bgnotify", Tcl_MacBGNotifyObjCmd, NULL,
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
	if (code != TCL_OK) {
            Tcl_DString errStr;
            
            Tcl_DStringInit(&errStr);
            Tcl_DStringAppend(&errStr, " Error sourcing resource or file: ", -1);
            Tcl_DStringAppend(&errStr, fileName, -1);
            Tcl_DStringAppend(&errStr, "\n\nError was: ", -1);
            Tcl_DStringAppend(&errStr, interp->result, -1);
                        
            TclMacDoNotification(Tcl_DStringValue(&errStr));
                        
        }
	goto done;
    }


    /*
     * Rather than calling exit, invoke the "exit" command so that







|
<

|







190
191
192
193
194
195
196
197

198
199
200
201
202
203
204
205
206
	if (code != TCL_OK) {
            Tcl_DString errStr;
            
            Tcl_DStringInit(&errStr);
            Tcl_DStringAppend(&errStr, " Error sourcing resource or file: ", -1);
            Tcl_DStringAppend(&errStr, fileName, -1);
            Tcl_DStringAppend(&errStr, "\n\nError was: ", -1);
            Tcl_DStringAppend(&errStr, Tcl_GetStringResult(interp), -1);

            TclMacDoNotification(Tcl_DStringValue(&errStr));
	    Tcl_DStringFree(&errStr);
        }
	goto done;
    }


    /*
     * Rather than calling exit, invoke the "exit" command so that
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
    resultPtr = Tcl_GetObjResult(interp);
    
    if ( objc != 2 ) {
        Tcl_WrongNumArgs(interp, 1, objv, "message");
        return TCL_ERROR;
    }
    
    TclMacDoNotification(Tcl_GetStringFromObj(objv[1], (int *) NULL));
    return TCL_OK;
           
}


/*
 *----------------------------------------------------------------------







|







309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
    resultPtr = Tcl_GetObjResult(interp);
    
    if ( objc != 2 ) {
        Tcl_WrongNumArgs(interp, 1, objv, "message");
        return TCL_ERROR;
    }
    
    TclMacDoNotification(Tcl_GetString(objv[1]));
    return TCL_OK;
           
}


/*
 *----------------------------------------------------------------------