home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / musik / MIDIFP21 / SOURCES / INCLUDE / DISKFILE.PIF < prev    next >
Encoding:
Text File  |  1996-08-22  |  2.7 KB  |  87 lines

  1. /**************************************************************
  2. *
  3. *                DISKFILE.PIF
  4. *
  5. **************************************************************/
  6.  
  7. /*** general ********************************************************/
  8.  
  9. #define filename_length 128  /* max. 127 characters for a file name   */
  10. #define pathname_length 256  /* max. 255 characters for complete path */
  11.  
  12. /********************************************************************/
  13.  
  14.  
  15.  
  16. /*******************************************************************
  17. */
  18.     int load_file( 
  19.         char path[],     /* IN: full path of file to be loaded */
  20.         long *filesize,  /* OUT: size of file in RAM */
  21.         void **RAM_file  /* begin address of file in RAM */
  22.     ) ;
  23. /*
  24. *  Load a file from disk into RAM. 
  25. *
  26. * RETURN:  
  27. */
  28.     #define file_loaded              0 /* all right */
  29.     #define path_not_found           1 
  30.     #define no_more_handle           2 
  31.     #define access_denied            3 
  32.     #define file_too_large           4
  33.     #define file_not_closed          5 /* severe error ! */
  34. /*
  35. *******************************************************************/
  36.  
  37.  
  38. /*******************************************************************
  39. */
  40.     void unload_file(
  41.         void *RAM_file    /* begin address of file in RAM */
  42.     ) ;
  43. /*
  44. *  Frees the memory occupied by load_file().
  45. *******************************************************************/
  46.  
  47.  
  48. /*******************************************************************
  49. */
  50.     unsigned int get_file_name(
  51.         char whole_path[], /* OUT: path + filename */
  52.         char path[],       /* IN:  initial search path for files, incl. search mask 
  53.                               OUT: path selected by user, incl. search mask */
  54.         char file[],       /* OUT: file selected by user */
  55.         char title[]       /* IN:  TOS >= 1.04 title in the file selector box 
  56.                                    TOS < 1.04 extra title in an alert box, the alert 
  57.                                    is shown only, if title is not empty */
  58.     ) ;
  59. /*
  60. *  Opens the file select box and gets the file name from that dialog. 
  61. * RETURN:  
  62. */
  63.     #define valid_file_selected      0 /* all right */
  64.     #define no_file_selected         1
  65.     #define file_select_error        2 /* severe error ! */
  66. /* 
  67. *******************************************************************/
  68.  
  69.  
  70. /*******************************************************************
  71. */
  72.     int Fcopy(
  73.         char *output_name, /* IN: name of destination file */
  74.         char *input_name   /* IN: name of source file */
  75.     ) ;
  76. /*
  77. *  copies a file using a RAM buffer.
  78. * OUTPUT:  new file on disk
  79. * RETURN:  -1 if no success, 0 else
  80. *******************************************************************/
  81.  
  82.