Mercurial > cpython-lru_cache-weakref
annotate Mac/Python/gusiconfig.cpp @ 12357:5b59ea41db4e legacy-trunk
Install the docs (with fewer rules).
Add descriptions for the system variables.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 10 Apr 2000 19:36:27 +0000 |
| parents | 51c0c3b6d919 |
| children | e367ad3ea59a |
| rev | line source |
|---|---|
|
12281
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
1 /* |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
2 * Generated with the GUSIConfig application and then hand-modified by jack. |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
3 */ |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
4 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
5 #define GUSI_SOURCE |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
6 #include <GUSIConfig.h> |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
7 #include <sys/cdefs.h> |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
8 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
9 #include "Python.h" |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
10 #include "macglue.h" |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
11 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
12 static void |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
13 PyMac_GUSISpin(bool wait) |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
14 { |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
15 static Boolean inForeground = true; |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
16 int maxsleep = 6; /* 6 ticks is "normal" sleeptime */ |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
17 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
18 if (PyMac_ConsoleIsDead) return; |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
19 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
20 if ( !wait ) |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
21 maxsleep = 0; |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
22 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
23 PyMac_DoYield(maxsleep, 0); /* XXXX or is it safe to call python here? */ |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
24 } |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
25 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
26 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
27 /* Declarations of Socket Factories */ |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
28 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
29 __BEGIN_DECLS |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
30 void GUSIwithInetSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
31 void GUSIwithLocalSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
32 void GUSIwithMTInetSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
33 void GUSIwithMTTcpSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
34 void GUSIwithMTUdpSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
35 void GUSIwithOTInetSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
36 void GUSIwithOTTcpSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
37 void GUSIwithOTUdpSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
38 void GUSIwithPPCSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
39 void GUSISetupFactories(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
40 __END_DECLS |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
41 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
42 /* Configure Socket Factories */ |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
43 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
44 void GUSISetupFactories() |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
45 { |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
46 #ifdef GUSISetupFactories_BeginHook |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
47 GUSISetupFactories_BeginHook |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
48 #endif |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
49 GUSIwithInetSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
50 #ifdef GUSISetupFactories_EndHook |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
51 GUSISetupFactories_EndHook |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
52 #endif |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
53 } |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
54 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
55 /* Declarations of File Devices */ |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
56 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
57 __BEGIN_DECLS |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
58 void GUSIwithDConSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
59 void GUSIwithNullSockets(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
60 void GUSISetupDevices(); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
61 __END_DECLS |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
62 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
63 /* Configure File Devices */ |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
64 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
65 void GUSISetupDevices() |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
66 { |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
67 #ifdef GUSISetupDevices_BeginHook |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
68 GUSISetupDevices_BeginHook |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
69 #endif |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
70 #ifdef GUSISetupDevices_EndHook |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
71 GUSISetupDevices_EndHook |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
72 #endif |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
73 } |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
74 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
75 #ifndef __cplusplus |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
76 #error GUSISetupConfig() needs to be written in C++ |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
77 #endif |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
78 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
79 GUSIConfiguration::FileSuffix sSuffices[] = { |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
80 "", '????', '????' |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
81 }; |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
82 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
83 extern "C" void GUSISetupConfig() |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
84 { |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
85 GUSIConfiguration * config = |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
86 GUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
87 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
88 config->ConfigureDefaultTypeCreator('TEXT', 'TEXT'); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
89 config->ConfigureSuffices( |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
90 sizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
91 config->ConfigureAutoInitGraf(false); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
92 config->ConfigureAutoSpin(false); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
93 config->ConfigureHandleAppleEvents(false); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
94 config->ConfigureSigInt(false); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
95 config->ConfigureSigPipe(true); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
96 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
97 GUSISetHook(GUSI_SpinHook, (GUSIHook)PyMac_GUSISpin); |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
98 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
99 } |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
100 |
|
51c0c3b6d919
Started on GUSI2 and threading support.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff
changeset
|
101 /**************** END GUSI CONFIGURATION *************************/ |
