home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
- * Copyright (C) 1994 Charles P. Peterson *
- * 4007 Enchanted Sun, San Antonio, Texas 78244-1254 *
- * Email: Charles_P_Peterson@fcircus.sat.tx.us *
- * *
- * This is free software with NO WARRANTY. *
- * See gfft.c, or run program itself, for details. *
- * Support is available for a fee. *
- ***************************************************************************
- *
- * Program: gfft--General FFT analysis
- * File: wbfilerq.c
- * Purpose: file requestor
- * Author: Charles Peterson (CPP)
- * History: 11-Dec-1993 CPP; Created.
- * 8-Aug-94 CPP (1.10); force string to generic for now
- * Comments: Workbench GUI. Amiga Dependent! AmigaDOS 2.0+ required!
- * This is based on techniques from the Amiga RKRM examples
- * distributed freely by Commodore Amiga. I thank them.
- */
-
- #ifdef AMIGA
-
- #include <stdio.h>
- #include <string.h>
- /*
- * Amiga includes
- */
- #include <exec/types.h>
- #include <exec/libraries.h>
- #include <libraries/asl.h>
- #include <clib/exec_protos.h>
- #include <clib/asl_protos.h>
- #include <clib/dos_protos.h> /* DOS AddPart() */
-
- #include "gfft.h"
- #include "errcodes.h"
-
- #define FR_LEFTEDGE 0
- #define FR_TOPEDGE 0
- #define FR_WIDTH 420
- #define FR_HEIGHT 400
-
-
- struct Library *AslBase = NULL; /* prevents startup from loading it */
- /* which is very bad if running 1.3 */
-
- struct FileRequester *File_Requesterp = NULL;
- #define FRP File_Requesterp /* short alias here for long expressions */
-
- struct TagItem frtags[] =
- {
- ASL_Hail, (ULONG) NULL, /* This gets filled in later */
- ASL_Height, FR_HEIGHT,
- ASL_Width, FR_WIDTH,
- ASL_LeftEdge, FR_LEFTEDGE,
- ASL_TopEdge, FR_TOPEDGE,
- TAG_DONE
- };
-
- char *file_requestor (char *hail_message)
- {
- ULONG blen = 0;
- unsigned char *buffer = NullString;
-
- /*
- * Hail message doesn't change
- * Fix next time, for now, just use a neutral message
- */
-
- frtags[0].ti_Data = (ULONG) "Select File";
-
- if (!AslBase)
- {
- if (!(AslBase = OpenLibrary("asl.library", 37L)))
- {
- error_message (NO_FILE_REQSTR);
- return (char *) buffer;
- }
- }
-
- if (!FRP)
- {
- if (!(FRP = (struct FileRequester *)
- AllocAslRequest(ASL_FileRequest, frtags)))
- {
- error_message (OUT_OF_MEMORY);
- return (char *) buffer;
- }
- }
-
- if (AslRequest(FRP, NULL))
- {
- blen = strlen (FRP->rf_Dir) + strlen (FRP->rf_File) + 10;
- buffer = gmalloc (blen, NOTHING_SPECIAL);
- strcpy (buffer, FRP->rf_Dir);
- AddPart (buffer, FRP->rf_File, blen);
- }
- return (char *) buffer;
- }
-
- #endif /* ifdef AMIGA */
-