home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 14217 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  2.4 KB

  1. Path: sparky!uunet!ogicse!decwrl!world!aep
  2. From: aep@world.std.com (Andrew E Page)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Directory Scanning Code (non-sys7) Interface req
  5. Message-ID: <Bt8ttI.Jn3@world.std.com>
  6. Date: 19 Aug 92 18:24:53 GMT
  7. Article-I.D.: world.Bt8ttI.Jn3
  8. References: <Bt8Guu.308@world.std.com>
  9. Organization: The World Public Access UNIX, Brookline, MA
  10. Lines: 62
  11.  
  12.  
  13.   Here are some of the prototypes so far.  And I'd like some feedback
  14. on whether or not this suits your needs.  I'm trying to make it do
  15. sort of an emulation of _SFGetFile in its use of a typelist and
  16. a filter function.  If I do everything correctly you should be able
  17. to use any filter that you've concocted before for _SFGetFile with
  18. this scanning function.  
  19.  
  20. Ptr StartScan(int vRef, int numTypes, SFTypeList, typeList, FileFilterProcPtr filter) ;
  21. /*
  22. *    StartScan starts the directory scan.  It will return 0L if the call failed
  23. *       or a pointer to be used in subsequent calls.  
  24. *
  25. *
  26. *     vRef      Volume/Directory where scan is to start.
  27. *
  28. *     numTypes  Number of types to limit scan too.
  29. *               -1 indicates to scan all types.  
  30. *
  31. *     typeList  Array of OSTypes with numTypes elements.  
  32. *               Pass 0L if numTypes is -1
  33. *
  34. *     filter    Filter proc of the variety used by SFGetFile.  
  35. *               Pass 0L for no filtering.                 
  36. *
  37. *               pascal Boolean MyFilter(fileParamPtr *f) ;
  38. *                  MyFilter returns TRUE if file is to be excluded.
  39. *                    or FALSE if it isn't.   
  40. */
  41.  
  42.  
  43. OSErr GetNextScanFile(Ptr scanPtr, char *fName, short *vRef) ;
  44. /*
  45. *     Each call to GetNextScanFile will retreive the next file in the
  46. *      directory tree.  GetNextScanFile will return a fnfErr when the
  47. *      scan is completed.  
  48. *
  49. *
  50. *  scanPtr     Ptr returned from StartScan
  51. *
  52. *  fName       string space for returned file name  (recommened length 64)
  53. *
  54. *  vRef        Pointer to short where Volume/Directory reference for 
  55. *              that file is to be placed.  
  56. */
  57.  
  58. OSErr StopScan(Ptr scanPtr) ;
  59.  
  60. /*
  61. *    Terminates the scan started by Start scan.  
  62. *
  63. *
  64. *     scanPtr    Ptr returned by StartScan.  
  65. *
  66. *
  67. */
  68.  
  69. DoD# 0581   1990 Suzuki VX800   MSF Intro Class Aug 1990
  70. -- 
  71. Andrew E. Page CTO(Warrior Poet)|   Decision and Effort The Archer and Arrow
  72. DSP Ironworks                   |     The difference between what we are
  73. Macintosh and DSP Technology    |           and what we want to be.
  74.