#include #define IGNORED_STRING "\p" #define NIL_FILE_FILTER 0L #define NIL_DIALOG_HOOK 0L GetFileName(replyPtr,opentype) SFReply *replyPtr; char *opentype; { Point myPoint; SFTypeList typeList; int numTypes; myPoint.h = 100; myPoint.v = 100; typeList[0] = 'TEXT'; if (!strcmp(opentype,"rb")) typeList[0] = '????'; numTypes = 1; SFGetFile(myPoint, IGNORED_STRING, NIL_FILE_FILTER, numTypes, &typeList, NIL_DIALOG_HOOK, replyPtr); } FILE *macopen(long *refid,char *opentype) { int i; SFReply reply; FILE *f; printf("\n"); GetFileName(&reply,opentype); if (reply.good) { *refid = reply.vRefNum; /* sigh, nothing to do with this !! */ PtoCstr((char *) reply.fName); printf("Input commands found in %s\n", reply.fName); f = fopen((char *)reply.fName,opentype); if (!f) { printf("Program should be run from the same directory as this file (sigh).\n"); exit(1); } return f; } else { printf("Thanks anyway. Have a good day.\n"); exit(1); } }