From d50e4e1c544aae822fe50d1a4f953f6329dfc827 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 18 Jan 1995 13:58:04 +0000 Subject: [PATCH] More Pstring() stuff and some cosmetics --- Mac/Include/macdefs.h | 3 +++ Mac/Modules/macmodule.c | 17 ++++++++++++++++- Mac/Python/macguesstabsize.c | 2 -- Mac/Python/macsetfiletype.c | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Mac/Include/macdefs.h b/Mac/Include/macdefs.h index 6a5682f8b62..b64a47e6929 100644 --- a/Mac/Include/macdefs.h +++ b/Mac/Include/macdefs.h @@ -17,6 +17,9 @@ #include #include +/* We may be able to use a std routine in think, don't know */ +unsigned char *Pstring(char *); + /* Macro to find out whether we can do HFS-only calls: */ #define FSFCBLen (* (short *) 0x3f6) #define hfsrunning() (FSFCBLen > 0) diff --git a/Mac/Modules/macmodule.c b/Mac/Modules/macmodule.c index 8db0cea426c..fbb408b5b7c 100644 --- a/Mac/Modules/macmodule.c +++ b/Mac/Modules/macmodule.c @@ -447,6 +447,18 @@ mac_write(self, args) } #endif /* !__MWERKS__ */ +#ifdef MALLOC_DEBUG +static object * +mac_mstats(self, args) + object*self; + object *args; +{ + mstats("python"); + INCREF(None); + return None; +} +#endif MALLOC_DEBUG + static struct methodlist mac_methods[] = { {"chdir", mac_chdir}, #ifndef __MWERKS__ @@ -477,6 +489,9 @@ static struct methodlist mac_methods[] = { #ifndef __MWERKS__ {"write", mac_write}, #endif +#ifdef MALLOC_DEBUG + {"mstats", mac_mstats}, +#endif {NULL, NULL} /* Sentinel */ }; @@ -485,7 +500,7 @@ static struct methodlist mac_methods[] = { void initmac() { - object *m, *d, *v; + object *m, *d; m = initmodule("mac", mac_methods); d = getmoduledict(m); diff --git a/Mac/Python/macguesstabsize.c b/Mac/Python/macguesstabsize.c index 56b39a15214..70314f6bbc2 100644 --- a/Mac/Python/macguesstabsize.c +++ b/Mac/Python/macguesstabsize.c @@ -17,14 +17,12 @@ guesstabsize(path) s[0] = strlen(path); memcpy(s+1, path, s[0]); refnum = OpenResFile(s); -/* printf("%s --> refnum=%d\n", path, refnum); */ if (refnum == -1) return 0; UseResFile(refnum); h = GetIndResource('ETAB', 1); if (h != 0) { tabsize = (*(short**)h)[1]; -/* printf("tabsize=%d\n", tabsize); */ } CloseResFile(refnum); return tabsize; diff --git a/Mac/Python/macsetfiletype.c b/Mac/Python/macsetfiletype.c index 70647b92c36..328f02290db 100644 --- a/Mac/Python/macsetfiletype.c +++ b/Mac/Python/macsetfiletype.c @@ -14,7 +14,7 @@ long creator, type; FInfo info; unsigned char *pname; - pname = (StringPtr) c2pstr(name); + pname = (StringPtr) Pstring(name); if ( GetFInfo(pname, 0, &info) < 0 ) return -1; info.fdType = type;