1 /* GET FULL PATHNAME OF A FILE.
2 ** Original by Guido, modified by Jack to handle FSSpecs
11 /* Mac file system parameters */
12 #define MAXPATH 256 /* Max path name length+1 */
13 #define SEP ':' /* Separator in path names */
15 /* Macro to find out whether we can do HFS-only calls: */
16 #define FSFCBLen (* (short *) 0x3f6)
17 #define hfsrunning() (FSFCBLen > 0)
20 nfullpath(fsp
, retbuf
)
31 unsigned char namebuf
[MAXPATH
];
35 char *next
= cwd
+ sizeof cwd
- 1;
44 /* Stuff the filename into the buffer */
48 memcpy(next
, fsp
->name
+1, len
);
50 while (dirid
!= fsRtParID
) {
51 pb
.d
.ioNamePtr
= namebuf
;
53 pb
.d
.ioFDirIndex
= -1;
54 pb
.d
.ioDrDirID
= dirid
;
55 err
= PBGetCatInfo((CInfoPBPtr
)&pb
.d
, 0);
60 if ( len
+ strlen(next
) >= MAXPATH
)
63 memcpy(next
, (char *)namebuf
+1, len
);
64 dirid
= pb
.d
.ioDrParID
;
70 next
= strchr(retbuf
, '\0');