diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2000-04-07 09:10:49 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2000-04-07 09:10:49 (GMT) |
commit | 2d1306b7cf4a85290ffbd90a15fed6115a522310 (patch) | |
tree | 01dc9d71385f7659ba36bd2b27f4ca2c3d3a1154 /Mac/Python/gusiconfig.cpp | |
parent | 5c21420772a94846ce7dd077d10a2575da15e84e (diff) | |
download | cpython-2d1306b7cf4a85290ffbd90a15fed6115a522310.zip cpython-2d1306b7cf4a85290ffbd90a15fed6115a522310.tar.gz cpython-2d1306b7cf4a85290ffbd90a15fed6115a522310.tar.bz2 |
Started on GUSI2 and threading support.
Diffstat (limited to 'Mac/Python/gusiconfig.cpp')
-rw-r--r-- | Mac/Python/gusiconfig.cpp | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/Mac/Python/gusiconfig.cpp b/Mac/Python/gusiconfig.cpp new file mode 100644 index 0000000..c69498f --- /dev/null +++ b/Mac/Python/gusiconfig.cpp @@ -0,0 +1,101 @@ +/* + * Generated with the GUSIConfig application and then hand-modified by jack. + */ + +#define GUSI_SOURCE +#include <GUSIConfig.h> +#include <sys/cdefs.h> + +#include "Python.h" +#include "macglue.h" + +static void +PyMac_GUSISpin(bool wait) +{ + static Boolean inForeground = true; + int maxsleep = 6; /* 6 ticks is "normal" sleeptime */ + + if (PyMac_ConsoleIsDead) return; + + if ( !wait ) + maxsleep = 0; + + PyMac_DoYield(maxsleep, 0); /* XXXX or is it safe to call python here? */ +} + + +/* Declarations of Socket Factories */ + +__BEGIN_DECLS +void GUSIwithInetSockets(); +void GUSIwithLocalSockets(); +void GUSIwithMTInetSockets(); +void GUSIwithMTTcpSockets(); +void GUSIwithMTUdpSockets(); +void GUSIwithOTInetSockets(); +void GUSIwithOTTcpSockets(); +void GUSIwithOTUdpSockets(); +void GUSIwithPPCSockets(); +void GUSISetupFactories(); +__END_DECLS + +/* Configure Socket Factories */ + +void GUSISetupFactories() +{ +#ifdef GUSISetupFactories_BeginHook + GUSISetupFactories_BeginHook +#endif + GUSIwithInetSockets(); +#ifdef GUSISetupFactories_EndHook + GUSISetupFactories_EndHook +#endif +} + +/* Declarations of File Devices */ + +__BEGIN_DECLS +void GUSIwithDConSockets(); +void GUSIwithNullSockets(); +void GUSISetupDevices(); +__END_DECLS + +/* Configure File Devices */ + +void GUSISetupDevices() +{ +#ifdef GUSISetupDevices_BeginHook + GUSISetupDevices_BeginHook +#endif +#ifdef GUSISetupDevices_EndHook + GUSISetupDevices_EndHook +#endif +} + +#ifndef __cplusplus +#error GUSISetupConfig() needs to be written in C++ +#endif + +GUSIConfiguration::FileSuffix sSuffices[] = { + "", '????', '????' +}; + +extern "C" void GUSISetupConfig() +{ + GUSIConfiguration * config = + GUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource); + + config->ConfigureDefaultTypeCreator('TEXT', 'TEXT'); + config->ConfigureSuffices( + sizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices); + config->ConfigureAutoInitGraf(false); + config->ConfigureAutoSpin(false); + config->ConfigureHandleAppleEvents(false); + config->ConfigureSigInt(false); + config->ConfigureSigPipe(true); + + GUSISetHook(GUSI_SpinHook, (GUSIHook)PyMac_GUSISpin); + +} + +/**************** END GUSI CONFIGURATION *************************/ |