home *** CD-ROM | disk | FTP | other *** search
- /* FileRequest.c -- Example program for using the ARP FileRequest()
- * function call.
- * -=+SDB+=-
- *
- * Copyright (c) 1987, Scott Ballantyne
- * Use and abuse as you please.
- *
- * Link with arp.lib
- *
- */
-
- #include <exec/types.h>
- #include "libraries/arpbase.h" /* Standard ARP header file */
- #include "arpfunctions.h" /* Predeclared functions */
-
- /* Initialize a structure for passing to the arplib's FileRequest()
- * function.
- *
- * You need to supply a file and directory buffer to FileRequest().
- *
- * You can provide both default directories and filenames by initializing
- * the arrays to a string before you submit the structure to FileRequest().
- *
- * For this example, we only initialize the directory string.
- */
-
- #define MAXPATH ( (FCHARS * 10) + DSIZE + 1) /* Size of a pathname */
-
- BYTE Filename[FCHARS + 1];
- BYTE Directory[MAXPATH] = "DF0:";
-
- struct FileRequester FR = {
- "Greetings! Click on stuff!", /* Hailing text */
- Filename, /* filename array */
- Directory, /* directory array */
- NULL, /* Window, NULL == workbench */
- NULL, /* Flags, not used in this release */
- NULL, /* Function pointers, not used in this release */
- NULL, /* "" */
- };
-
- VOID main()
- {
- char *Selection;
-
- if ( Selection = FileRequest( &FR ) )
- {
- if ( *Selection ) /* Check for valid filename */
- Printf("Filename = %s ", Filename);
- else
- Printf("No Filename selected, ");
- Printf("Directory = %s\n", Directory);
- }
- else
- Puts("User cancelled Requester!");
- }
-
-