summaryrefslogtreecommitdiffstats
path: root/Mac/Python/macglue.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1997-05-23 15:35:14 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1997-05-23 15:35:14 (GMT)
commita39f1b0ce293652874cb70529cd3c92c919f3210 (patch)
tree6d65d42910a000ed660b6a06c9f1eea244eea642 /Mac/Python/macglue.c
parent570e4b7ad12031745316c019247c577b5f143b22 (diff)
downloadcpython-a39f1b0ce293652874cb70529cd3c92c919f3210.zip
cpython-a39f1b0ce293652874cb70529cd3c92c919f3210.tar.gz
cpython-a39f1b0ce293652874cb70529cd3c92c919f3210.tar.bz2
- Added Py_GetProgramFullPath
- Added PyMac_StopGUSISpin and have it called at exit time (fixes crash when exiting with sockets open) - Added PLstr... funcs needed by gusi: those provided by StdCLib are broken under cfm68k
Diffstat (limited to 'Mac/Python/macglue.c')
-rw-r--r--Mac/Python/macglue.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c
index cc55d08..480b741 100644
--- a/Mac/Python/macglue.c
+++ b/Mac/Python/macglue.c
@@ -215,7 +215,57 @@ PyMac_SetGUSISpin() {
GUSISetHook(GUSI_SpinHook, (GUSIHook)PyMac_GUSISpin);
}
-#endif
+/* Called at exit() time thru atexit(), to stop event processing */
+void
+PyMac_StopGUSISpin() {
+ PyMac_ConsoleIsDead = 1;
+}
+
+/*
+** Replacement routines for the PLstr... functions so we don't need
+** StdCLib. Moreover, that implementation is broken under cfm68k...
+*/
+void
+PLstrcpy(to, fr)
+ unsigned char *to, *fr;
+{
+ memcpy(to, fr, fr[0]+1);
+}
+
+int
+PLstrcmp(s1, s2)
+ unsigned char *s1, *s2;
+{
+ int res;
+ int l = s1[0] < s2[0] ? s1[0] : s2[0];
+
+ res = memcmp(s1+1, s2+1, l);
+ if ( res != 0 )
+ return res;
+
+ if ( s1 < s2 )
+ return -1;
+ else if ( s1 > s2 )
+ return 1;
+ else
+ return 0;
+}
+
+unsigned char *
+PLstrrchr(str, chr)
+ unsigned char *str;
+ unsigned char chr;
+{
+ unsigned char *ptr = 0;
+ unsigned char *p;
+
+ for(p=str+1; p<str+str[0]; p++)
+ if ( *p == chr )
+ ptr = p;
+ return ptr;
+}
+
+#endif /* USE_GUSI */
/* Convert C to Pascal string. Returns pointer to static buffer. */