|
| 1 | +/* |
| 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 | + |
| 12 | +static void |
| 13 | +PyMac_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 |
| 30 | +void GUSIwithInetSockets(); |
| 31 | +void GUSIwithLocalSockets(); |
| 32 | +void GUSIwithMTInetSockets(); |
| 33 | +void GUSIwithMTTcpSockets(); |
| 34 | +void GUSIwithMTUdpSockets(); |
| 35 | +void GUSIwithOTInetSockets(); |
| 36 | +void GUSIwithOTTcpSockets(); |
| 37 | +void GUSIwithOTUdpSockets(); |
| 38 | +void GUSIwithPPCSockets(); |
| 39 | +void GUSISetupFactories(); |
| 40 | +__END_DECLS |
| 41 | + |
| 42 | +/* Configure Socket Factories */ |
| 43 | + |
| 44 | +void 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 |
| 58 | +void GUSIwithDConSockets(); |
| 59 | +void GUSIwithNullSockets(); |
| 60 | +void GUSISetupDevices(); |
| 61 | +__END_DECLS |
| 62 | + |
| 63 | +/* Configure File Devices */ |
| 64 | + |
| 65 | +void 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 | + |
| 79 | +GUSIConfiguration::FileSuffix sSuffices[] = { |
| 80 | + "", '????', '????' |
| 81 | +}; |
| 82 | + |
| 83 | +extern "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 *************************/ |
0 commit comments