home *** CD-ROM | disk | FTP | other *** search
- #ifdef THINK_C
- # include "unixlibproto.h"
- #endif THINK_C
-
- #include "host.h"
- #ifndef NULL
- #define NULL 0L
- #endif
-
- /* canonical name conversion routines
-
- importpath canonical -> host
- exportpath host -> canonical
-
- host your local pathname format
- canonical unix style
- */
-
- importpath( host, canon )
- char * host;
- char * canon;
- {
- int i;
- strcpy(host, canon);
- }
-
- exportpath( canon, host )
- char * host;
- char * canon;
- {
- /* copy the string replacing ":" by "/" */
- register char *h = host,
- *c = canon;
-
- while (*c = *h++) {
- if (*c == ':') *c = '/';
- c++;
- }
- }
-
- /* converts Unix path to Mac path syntax */
- /* Permit full Mac-style "diskname:dir:dir:...:file" specifications... dplatt */
- cnvMac (upath, mpath)
- char * upath,
- * mpath;
- {
- register char *u = upath,
- *m = mpath;
- int vRef, len;
-
- if (*u == SEPCHAR) {
- /* put volume name on the front */
- (void)GetVol((StringPtr)m, &vRef);
- len = (int)(m[0]);
- PtoCstr(m);
- m += len;
- }
- else if (strchr(u, DIRCHAR) == NULL) {
- *m++ = ':';
- }
-
- while ( *m = *u++ ) {
- if (*m == SEPCHAR) *m = ':';
- m++;
- }
- }
-
-
-
-