More Pstring() stuff and some cosmetics
This commit is contained in:
parent
48d071d302
commit
d50e4e1c54
|
@ -17,6 +17,9 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
/* 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: */
|
/* Macro to find out whether we can do HFS-only calls: */
|
||||||
#define FSFCBLen (* (short *) 0x3f6)
|
#define FSFCBLen (* (short *) 0x3f6)
|
||||||
#define hfsrunning() (FSFCBLen > 0)
|
#define hfsrunning() (FSFCBLen > 0)
|
||||||
|
|
|
@ -447,6 +447,18 @@ mac_write(self, args)
|
||||||
}
|
}
|
||||||
#endif /* !__MWERKS__ */
|
#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[] = {
|
static struct methodlist mac_methods[] = {
|
||||||
{"chdir", mac_chdir},
|
{"chdir", mac_chdir},
|
||||||
#ifndef __MWERKS__
|
#ifndef __MWERKS__
|
||||||
|
@ -477,6 +489,9 @@ static struct methodlist mac_methods[] = {
|
||||||
#ifndef __MWERKS__
|
#ifndef __MWERKS__
|
||||||
{"write", mac_write},
|
{"write", mac_write},
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MALLOC_DEBUG
|
||||||
|
{"mstats", mac_mstats},
|
||||||
|
#endif
|
||||||
|
|
||||||
{NULL, NULL} /* Sentinel */
|
{NULL, NULL} /* Sentinel */
|
||||||
};
|
};
|
||||||
|
@ -485,7 +500,7 @@ static struct methodlist mac_methods[] = {
|
||||||
void
|
void
|
||||||
initmac()
|
initmac()
|
||||||
{
|
{
|
||||||
object *m, *d, *v;
|
object *m, *d;
|
||||||
|
|
||||||
m = initmodule("mac", mac_methods);
|
m = initmodule("mac", mac_methods);
|
||||||
d = getmoduledict(m);
|
d = getmoduledict(m);
|
||||||
|
|
|
@ -17,14 +17,12 @@ guesstabsize(path)
|
||||||
s[0] = strlen(path);
|
s[0] = strlen(path);
|
||||||
memcpy(s+1, path, s[0]);
|
memcpy(s+1, path, s[0]);
|
||||||
refnum = OpenResFile(s);
|
refnum = OpenResFile(s);
|
||||||
/* printf("%s --> refnum=%d\n", path, refnum); */
|
|
||||||
if (refnum == -1)
|
if (refnum == -1)
|
||||||
return 0;
|
return 0;
|
||||||
UseResFile(refnum);
|
UseResFile(refnum);
|
||||||
h = GetIndResource('ETAB', 1);
|
h = GetIndResource('ETAB', 1);
|
||||||
if (h != 0) {
|
if (h != 0) {
|
||||||
tabsize = (*(short**)h)[1];
|
tabsize = (*(short**)h)[1];
|
||||||
/* printf("tabsize=%d\n", tabsize); */
|
|
||||||
}
|
}
|
||||||
CloseResFile(refnum);
|
CloseResFile(refnum);
|
||||||
return tabsize;
|
return tabsize;
|
||||||
|
|
|
@ -14,7 +14,7 @@ long creator, type;
|
||||||
FInfo info;
|
FInfo info;
|
||||||
unsigned char *pname;
|
unsigned char *pname;
|
||||||
|
|
||||||
pname = (StringPtr) c2pstr(name);
|
pname = (StringPtr) Pstring(name);
|
||||||
if ( GetFInfo(pname, 0, &info) < 0 )
|
if ( GetFInfo(pname, 0, &info) < 0 )
|
||||||
return -1;
|
return -1;
|
||||||
info.fdType = type;
|
info.fdType = type;
|
||||||
|
|
Loading…
Reference in New Issue