comparison Mac/Python/macgetpath.c @ 3422:67f5d29d405b legacy-trunk

- Reorganized init code - Fixed serious bug in code to get options from a resource
author Jack Jansen <jack.jansen@cwi.nl>
date Wed, 28 Feb 1996 15:42:47 +0000
parents 14991c4331df
children 61f19a7b1ff1
comparison
equal deleted inserted replaced
3421:90b54312661a 3422:67f5d29d405b
41 */ 41 */
42 static char *pythonpath; 42 static char *pythonpath;
43 char *curwd; 43 char *curwd;
44 char *p, *endp; 44 char *p, *endp;
45 int newlen; 45 int newlen;
46 extern char *PyMac_GetPythonDir(); 46 staticforward char *PyMac_GetPythonDir();
47 #ifndef USE_BUILTIN_PATH 47 #ifndef USE_BUILTIN_PATH
48 extern char *PyMac_GetPythonPath(); 48 staticforward char *PyMac_GetPythonPath();
49 #endif 49 #endif
50 50
51 if ( pythonpath ) return pythonpath; 51 if ( pythonpath ) return pythonpath;
52 curwd = PyMac_GetPythonDir(); 52 curwd = PyMac_GetPythonDir();
53 #ifndef USE_BUILTIN_PATH 53 #ifndef USE_BUILTIN_PATH
87 } 87 }
88 88
89 /* 89 /*
90 ** Open/create the Python Preferences file, return the handle 90 ** Open/create the Python Preferences file, return the handle
91 */ 91 */
92 short 92 static short
93 PyMac_OpenPrefFile() 93 PyMac_OpenPrefFile()
94 { 94 {
95 AliasHandle handle; 95 AliasHandle handle;
96 FSSpec dirspec; 96 FSSpec dirspec;
97 short prefrh; 97 short prefrh;
140 } 140 }
141 141
142 /* 142 /*
143 ** Return the name of the Python directory 143 ** Return the name of the Python directory
144 */ 144 */
145 char * 145 static char *
146 PyMac_GetPythonDir() 146 PyMac_GetPythonDir()
147 { 147 {
148 static char name[256]; 148 static char name[256];
149 AliasHandle handle; 149 AliasHandle handle;
150 FSSpec dirspec; 150 FSSpec dirspec;
185 } 185 }
186 return name; 186 return name;
187 } 187 }
188 188
189 #ifndef USE_BUILTIN_PATH 189 #ifndef USE_BUILTIN_PATH
190 char * 190 static char *
191 PyMac_GetPythonPath(dir) 191 PyMac_GetPythonPath(dir)
192 char *dir; 192 char *dir;
193 { 193 {
194 FSSpec dirspec; 194 FSSpec dirspec;
195 short oldrh, prefrh = -1; 195 short oldrh, prefrh = -1;