home *** CD-ROM | disk | FTP | other *** search
/ Amiga Dream 59 / CDDream59.ISO / BeOs / Sound / Intel / PPBeDevKit.ZIP / PLAYERPR.TAR / PlayerPRO / Source / Win-FileUtils.c < prev    next >
C/C++ Source or Header  |  1998-12-26  |  2KB  |  120 lines

  1. /********************                        ***********************/
  2. //
  3. //    Player PRO 5.0 - DRIVER SOURCE CODE -
  4. //
  5. //    Library Version 5.0
  6. //
  7. //    To use with MAD Library for Mac: Symantec, CodeWarrior and MPW
  8. //
  9. //    Antoine ROSSET
  10. //    16 Tranchees
  11. //    1206 GENEVA
  12. //    SWITZERLAND
  13. //
  14. //    COPYRIGHT ANTOINE ROSSET 1996, 1997, 1998
  15. //
  16. //    Thank you for your interest in PlayerPRO !
  17. //
  18. //    FAX:                (+41 22) 346 11 97
  19. //    PHONE:             (+41 79) 203 74 62
  20. //    Internet:     RossetAntoine@bluewin.ch
  21. //
  22. /********************                        ***********************/
  23.  
  24. #include "RDriver.h"
  25. #include "FileUtils.h"
  26.  
  27. void iFileCreate( Ptr AlienFileName, long)
  28. {
  29. }
  30.  
  31. FILE* iFileOpen( Ptr name)
  32. {
  33.     return fopen( name, "rb");
  34. }
  35.  
  36. long iGetEOF( FILE* iFileRefI)
  37. {
  38.     long curEOF;
  39.     
  40.     fseek( iFileRefI, 0, SEEK_END);
  41.     curEOF = ftell( iFileRefI);
  42.     fseek( iFileRefI, 0, 0);
  43.     
  44.     return curEOF;
  45. }
  46.  
  47. OSErr iRead( long size, Ptr dest, FILE* iFileRefI)
  48. {
  49.     fread( dest, size, 1, iFileRefI);
  50.     
  51.     return noErr;
  52. }
  53.  
  54. OSErr iSeekCur( long size, FILE* iFileRefI)
  55. {
  56.     return fseek( iFileRefI , size, SEEK_CUR);
  57. }
  58.  
  59. OSErr iWrite( long size, Ptr dest, FILE* iFileRefI)
  60. {
  61.     fwrite( dest, size, 1, iFileRefI);
  62.     
  63.     return noErr;
  64. }
  65.  
  66. void iClose( FILE* iFileRefI)
  67. {
  68.     fclose( iFileRefI);
  69. }
  70.  
  71. void MOT32( void *msg_buf)
  72. {
  73.   unsigned char     *buf = (unsigned char*) msg_buf;
  74.   unsigned long        out;
  75.   
  76.   out = ( (unsigned long) buf[0] << 24L) | ( (unsigned long) buf[1] << 16L) | ( (unsigned long) buf[ 2] << 8L) | ( (unsigned long) buf[3]);
  77.     *((unsigned long*) msg_buf) = out;
  78. }
  79.  
  80. void MOT16( void *msg_buf)
  81. {
  82.   unsigned char     *buf = (unsigned char*) msg_buf;
  83.   unsigned short    out;
  84.   
  85.   out = ((unsigned short) buf[0] << 8L) | ( (unsigned short) buf[1]);
  86.     *((unsigned short*) msg_buf) = out;
  87. }
  88.  
  89. void INT32( void *msg_buf)
  90. {
  91. }
  92.  
  93. void INT16( void *msg_buf)
  94. {
  95. }
  96.  
  97. Ptr MADstrcpy( Ptr dst, const char* src)
  98. {
  99.     long i = 0;
  100.     
  101.     do
  102.     {
  103.         dst[ i] = src[ i];
  104.     }while( src[ i++]);
  105.     
  106.     return dst;
  107. }
  108.  
  109. int MADstrcmp( const char *dst, const char* src)
  110. {
  111.     long i = 0;
  112.     
  113.     do
  114.     {
  115.         if( dst[ i] != src[ i]) return -1;
  116.     }while( src[ i++]);
  117.     
  118.     return 0;
  119. }
  120.