// given a native file spec (FSSpec for MacOS, and C string for WinOS, fill in a XFILENAME void XConvertNativeFileToXFILENAME(void *file, XFILENAME *xfile) { if (xfile) { XSetMemory(xfile, (INT32)sizeof(XFILENAME), 0); } if (file) { #if USE_HAE_EXTERNAL_API == TRUE { void *dest;
// private variables. Zero out before calling functions INT32 fileValidID; XBOOL resourceFile;
XPTR pResourceData; // if file is memory based INT32 resMemLength; // length of memory resource file INT32 resMemOffset; // current offset of memory resource file XBOOL readOnly; // TRUE then file is read only XBOOL allowMemCopy; // if TRUE, when a memory based resource is // read, a copy will be created otherwise // its just a pointer into the larger memory resource // file XFILE_CACHED_ITEM memoryCacheEntry; XFILERESOURCECACHE *pCache; // if file has been cached this will point to it }; typedef struct XFILENAME XFILENAME; typedef void * XFILE;
// standard strcpy // Copies C string src into dest char * XStrCpy(char *dest, char *src) { char *sav;
sav = dest; if (src == NULL) { src = “”; } if (dest) { while (*src) { *dest++ = *src++; } *dest = 0; } return sav; }