summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/macintosh/mac_init.c
blob: 69f355b6e52885f330b988338ecf3af6af02373c (plain)
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
/*
 * mac_init.c --- routines to initialize and cleanup macintosh behavior
 *
 * MDLadwig <mike@twinpeaks.prc.com> --- June 1996
 */
#include "mac_config.h"
 
#ifdef __POWERPC__
#include <MacHeadersPPC>
#else
#include <MacHeaders68K>
#endif

#include <sioux.h>
#include <GUSI.h>

extern char **Args;
extern char **EnvVars, **EnvVals;
extern int ArgC;
extern int EnvC;

extern int argc;
extern char **argv;

void
macos_error_cleanup( void )
{
	Lock_Cleanup();
	RemoveConsole();		// FIXME - Ugly, but necessary until MW fixes _exit
}

void
InitializeMacToolbox( void )
{
	#ifndef __POWERPC__
	SetApplLimit(GetApplLimit() - STACK_SIZE_68K);
	#endif
	
	MaxApplZone();
	MoreMasters();
}

void
MacOS_Initialize( int *argc, char ***argv )
{
	InitializeMacToolbox();
	
	GUSISetup(GUSIwithSIOUXSockets);
	GUSISetup(GUSIwithUnixSockets);

	SIOUXSettings.showstatusline = TRUE;
	SIOUXSettings.autocloseonquit = FALSE;
	SIOUXSettings.asktosaveonclose = TRUE;
	
	#ifdef AE_IO_HANDLERS
	GetUnixCommandEnvironment( "cvs" );
	*argc = ArgC;
	*argv = Args;
	#else
	*argc = ccommand(argv);
	#endif
	
	error_set_cleanup (macos_error_cleanup);
}

void
MacOS_Cleanup ( void )
{
	RemoveConsole();		// FIXME - Ugly, but necessary until MW fixes _exit
}