home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / reference / amiga_mail_vol2 / i-7 / simplefr.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  3KB  |  98 lines

  1. ;/* simpleFR.c - Execute me to compile me with SAS/C 6.56
  2. sc DATA=NEAR NMINC STRMERGE STREQ NOSTKCHK SAVEDS IGNORE=73 simpleFR.c
  3. slink FROM LIB:c.o,simpleFR.o TO simpleFR LIBRARY LIB:sc.lib,LIB:amiga.lib
  4. quit
  5. */
  6.  
  7. /*
  8. Copyright (c) 1991 Commodore-Amiga, Inc.
  9.  
  10. This example is provided in electronic form by Commodore-Amiga,
  11. Inc. for use with the Amiga Mail Volume II technical publication.
  12. Amiga Mail Volume II contains additional information on the correct
  13. usage of the techniques and operating system functions presented in
  14. these examples.  The source and executable code of these examples may
  15. only be distributed in free electronic form, via bulletin board or
  16. as part of a fully non-commercial and freely redistributable
  17. diskette.  Both the source and executable code (including comments)
  18. must be included, without modification, in any copy.  This example
  19. may not be published in printed form or distributed with any
  20. commercial product. However, the programming techniques and support
  21. routines set forth in these examples may be used in the development
  22. of original executable software products for Commodore Amiga
  23. computers.
  24.  
  25. All other rights reserved.
  26.  
  27. This example is provided "as-is" and is subject to change; no
  28. warranties are made.  All use is at your own risk. No liability or
  29. responsibility is assumed.
  30. */
  31.  
  32. #include <clib/asl_protos.h>
  33. #include <clib/exec_protos.h>
  34. #include <clib/alib_stdio_protos.h>
  35. #include <dos/dosasl.h>
  36. #include <exec/libraries.h>
  37.  
  38. #ifdef LATTICE
  39. int CXBRK(void) { return(0); }  /* Disable Lattice CTRL/C handling */
  40. int chkabort(void) { return(0); }  /* really */
  41. #endif
  42.  
  43. UBYTE *vers = "\0$VER: simpleFR 1.1";
  44.  
  45. void main(void);
  46.  
  47. #define MYLEFTEDGE 0
  48. #define MYTOPEDGE  0
  49. #define MYWIDTH    320
  50. #define MYHEIGHT   400
  51.  
  52. struct Library *AslBase;
  53.  
  54. struct TagItem frtags[] =
  55. {
  56.     ASL_Hail,       (ULONG)"The RKM file requester",
  57.     ASL_Height,     MYHEIGHT,
  58.     ASL_Width,      MYWIDTH,
  59.     ASL_LeftEdge,   MYLEFTEDGE,
  60.     ASL_TopEdge,    MYTOPEDGE,
  61.     ASL_OKText,     (ULONG)"O KAY",
  62.     ASL_CancelText, (ULONG)"not OK",
  63.     ASL_File,       (ULONG)"asl.library",
  64.     ASL_Dir,        (ULONG)"libs:",
  65.     TAG_DONE
  66. };
  67.  
  68.  
  69.  
  70. void main()
  71. {
  72.  
  73.     struct FileRequester *fr;
  74.  
  75.     if (AslBase = OpenLibrary("asl.library", 36L))
  76.     {
  77.         if (fr = (struct FileRequester *)
  78.             AllocAslRequest(ASL_FileRequest, frtags))
  79.         {
  80.             /* Application body, blah, blah,... */
  81.  
  82.             /* Application need a requester */
  83.             if (AslRequest(fr, 0L))
  84.                 printf("file choice = %s%s\n", fr->rf_Dir, fr->rf_File);
  85.             else
  86.                 printf("User Cancelled\n");
  87.  
  88.             /* More application body, blah, blah... */
  89.         }
  90.  
  91.         /* Don't need any more requesters, better
  92.         ** give the requester structure back.
  93.         */
  94.         FreeAslRequest(fr);
  95.     }
  96.     CloseLibrary(AslBase);
  97. }
  98.