home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 573a.lha / AT_copy_v2.22 / FileRequester / manx.test.c < prev    next >
C/C++ Source or Header  |  1991-06-29  |  1KB  |  63 lines

  1.  
  2. /*
  3.  *  kd_freq.library Test
  4.  *
  5.  *  Tested on Manx 3.60a.
  6.  */
  7.  
  8. #include "KDBase.h"
  9.  
  10. UBYTE directory[128];
  11. UBYTE filename[32];
  12. UBYTE pattern[32];
  13.  
  14. /* for Manx.. we don't need any parsing */
  15. void  _wb_parse() {}
  16. void _cli_parse() {}
  17.  
  18. struct Library *KD_FReqBase, *OpenLibrary();
  19.  
  20. struct ExtraData extras;
  21.  
  22. main()
  23.     {
  24.     KD_FReqBase = OpenLibrary(KLIBNAME,KLIBVERSION);
  25.  
  26.     if (KD_FReqBase) 
  27.         {
  28.         /* Make sure that all default strings are zero'd out. */
  29.         directory[0] = filename[0] = pattern[0] = 0;
  30.  
  31.         /* Set default wildcard pattern */
  32.         /* strcpy(pattern,"#?.?"); */
  33.  
  34.         /* Call file requester */
  35.  
  36.         if (FReq(NULL,
  37.             "Test of 'kd_freq.library'", 
  38.             filename,directory,pattern, 
  39.             FR_AUTOPOSITION | FR_AUTOSIZE | FR_NOINFO | FR_SCREENFONT
  40.             | FR_INVERTLOOK | FR_EXTENDEDSELECT
  41.             ,NULL))
  42.             {    
  43.             /* You can immediately strcat(directory,filename); since
  44.                 directory will contain the valid file seperator (either
  45.                 \ or : at the end of the directory name
  46.             */
  47.  
  48.             puts(directory);
  49.             puts(filename);
  50.             }
  51.         else
  52.             {
  53.             puts("Requester Cancelled!");
  54.             }
  55.  
  56.         CloseLibrary(KD_FReqBase);
  57.             }
  58.      else 
  59.         {
  60.         puts("Can't Open 'kd_freq.library'.  Make sure it is in LIBS:");
  61.         }
  62.     }
  63.