home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / directx / fastfile / readme.txt < prev   
Text File  |  1997-07-14  |  2KB  |  55 lines

  1. FastFile
  2. --------
  3. FastFile provides a way to create a very fast way to access large numbers
  4. of files.
  5.  
  6. You use FFCREATE.EXE to create a single flat file.   Just run FFCREATE in
  7. the directory that contains all of the files you wish to access.   A file
  8. will be created at the root (RESULT.FF) that is the FastFile.  (you can 
  9. specify a filename on the command line to override the default of RESULT.FF;
  10. if you do so, make sure that the result file is NOT generated in the
  11. current directory).
  12.  
  13. Once you have created your FastFile, you can use the FastFile routines to
  14. access it:
  15.  
  16. BOOL FastFileInit( LPSTR fname, int max_handles ):
  17. Call to initialize access to a FastFile.
  18.     fname      : name of FastFile
  19.     max_handles: maximum number of file handles you want to have open at the
  20.          same time.
  21.     returns TRUE if succeeds, FALSE otherwise
  22.  
  23. void FastFileFini( void ):
  24. Call when you are finished accessing your FastFile
  25.  
  26. HFASTFILE FastFileOpen( LPSTR name ):
  27. Call to open an individual file in a FastFile (read-only access is supported)
  28.     name: name if individual file
  29.     returns a handle, or NULL if fail
  30.     
  31. BOOL FastFileClose( HFASTFILE hff ):
  32. Call to close an individual file 
  33.     hff: handle to an individual file
  34.     returns TRUE if succeeded, FALSE otherwise
  35.     
  36. BOOL FastFileRead( HFASTFILE hff, LPVOID ptr, int size )
  37. Call to read from an individual file
  38.     hff:  handle to an individual file
  39.     ptr:  buffer to copy data
  40.     size: size of data to copy
  41.     returns TRUE if succeeded, FALSE otherwise
  42.     
  43. BOOL FastFileSeek( HFASTFILE hff, int off, int type )
  44. Call to seek to an offset in an individual file
  45.     hff:  handle to an individual file
  46.     off:  offset to seek to
  47.     type: seek type: SEEK_SET (from start), SEEK_CUR (from current pos),
  48.           or SEEK_END (from end)
  49.     returns TRUE if succeeded, FALSE otherwise
  50.     
  51. long FastFileTell( HFASTFILE hff )
  52. Call to get the current position in an individual file
  53.     hff:  handle to an individual file
  54.     returns current position if succeeded, -1 otherwise
  55.