home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <intuition/intuition.h>
- #include <string.h>
- #include <libraries/asl.h>
-
- #include <proto/asl.h>
-
- extern struct FileRequester *MyFileReqStruct;
-
- extern struct Window *gWindow;
-
- struct TagItem RequestTags[] =
- {
- {ASL_Hail,NULL},
- {ASL_Window,NULL},
- {ASL_File,NULL},
- {ASL_Dir,NULL},
- {ASL_Pattern,NULL},
- {ASL_FuncFlags,FILF_PATGAD},
- {ASL_TopEdge, 1},
- {ASL_LeftEdge,0},
- {ASL_Height,199},
- {ASL_Width,300},
- {TAG_DONE,NULL}
- };
-
- char *getFilename(char *file, char *dir, char *title, char *ext)
- {
- static char fullname[81];
- BOOL ret;
- RequestTags[0].ti_Data = (ULONG)title;
- RequestTags[1].ti_Data = (ULONG)gWindow;
- RequestTags[2].ti_Data = (ULONG)file;
- RequestTags[3].ti_Data = (ULONG)dir;
- RequestTags[4].ti_Data = (ULONG)ext;
-
- MyFileReqStruct = AllocAslRequest(ASL_FileRequest, RequestTags);
- if(MyFileReqStruct==NULL) return(NULL);
-
- ret = AslRequest(MyFileReqStruct,RequestTags);
- if(!ret) {FreeAslRequest(MyFileReqStruct);return(NULL);}
-
- strcpy(file,MyFileReqStruct->rf_File);
- strcpy(dir,MyFileReqStruct->rf_Dir);
- strcpy(fullname,dir);
- FreeAslRequest(MyFileReqStruct);
-
- if(fullname[strlen(fullname)-1] != ':')
- strcat(fullname,"/");
- strcat(fullname,file);
- return(fullname);
-
- }
-