blob: c69498f00be51392b2c3bafd37a5eebd7662b322 [file] [log] [blame]
Jack Jansen2d1306b2000-04-07 09:10:49 +00001/*
2 * Generated with the GUSIConfig application and then hand-modified by jack.
3 */
4
5#define GUSI_SOURCE
6#include <GUSIConfig.h>
7#include <sys/cdefs.h>
8
9#include "Python.h"
10#include "macglue.h"
11
12static void
13PyMac_GUSISpin(bool wait)
14{
15 static Boolean inForeground = true;
16 int maxsleep = 6; /* 6 ticks is "normal" sleeptime */
17
18 if (PyMac_ConsoleIsDead) return;
19
20 if ( !wait )
21 maxsleep = 0;
22
23 PyMac_DoYield(maxsleep, 0); /* XXXX or is it safe to call python here? */
24}
25
26
27/* Declarations of Socket Factories */
28
29__BEGIN_DECLS
30void GUSIwithInetSockets();
31void GUSIwithLocalSockets();
32void GUSIwithMTInetSockets();
33void GUSIwithMTTcpSockets();
34void GUSIwithMTUdpSockets();
35void GUSIwithOTInetSockets();
36void GUSIwithOTTcpSockets();
37void GUSIwithOTUdpSockets();
38void GUSIwithPPCSockets();
39void GUSISetupFactories();
40__END_DECLS
41
42/* Configure Socket Factories */
43
44void GUSISetupFactories()
45{
46#ifdef GUSISetupFactories_BeginHook
47 GUSISetupFactories_BeginHook
48#endif
49 GUSIwithInetSockets();
50#ifdef GUSISetupFactories_EndHook
51 GUSISetupFactories_EndHook
52#endif
53}
54
55/* Declarations of File Devices */
56
57__BEGIN_DECLS
58void GUSIwithDConSockets();
59void GUSIwithNullSockets();
60void GUSISetupDevices();
61__END_DECLS
62
63/* Configure File Devices */
64
65void GUSISetupDevices()
66{
67#ifdef GUSISetupDevices_BeginHook
68 GUSISetupDevices_BeginHook
69#endif
70#ifdef GUSISetupDevices_EndHook
71 GUSISetupDevices_EndHook
72#endif
73}
74
75#ifndef __cplusplus
76#error GUSISetupConfig() needs to be written in C++
77#endif
78
79GUSIConfiguration::FileSuffix sSuffices[] = {
80 "", '????', '????'
81};
82
83extern "C" void GUSISetupConfig()
84{
85 GUSIConfiguration * config =
86 GUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource);
87
88 config->ConfigureDefaultTypeCreator('TEXT', 'TEXT');
89 config->ConfigureSuffices(
90 sizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices);
91 config->ConfigureAutoInitGraf(false);
92 config->ConfigureAutoSpin(false);
93 config->ConfigureHandleAppleEvents(false);
94 config->ConfigureSigInt(false);
95 config->ConfigureSigPipe(true);
96
97 GUSISetHook(GUSI_SpinHook, (GUSIHook)PyMac_GUSISpin);
98
99}
100
101/**************** END GUSI CONFIGURATION *************************/