home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Dream 59
/
CDDream59.ISO
/
BeOs
/
Sound
/
Intel
/
PPBeDevKit.ZIP
/
PLAYERPR.TAR
/
PlayerPRO
/
Source
/
Mac-FileUtils.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-26
|
2KB
|
130 lines
/******************** ***********************/
//
// Player PRO 5.0 - DRIVER SOURCE CODE -
//
// Library Version 5.0
//
// To use with MAD Library for Mac: Symantec, CodeWarrior and MPW
//
// Antoine ROSSET
// 16 Tranchees
// 1206 GENEVA
// SWITZERLAND
//
// COPYRIGHT ANTOINE ROSSET 1996, 1997, 1998
//
// Thank you for your interest in PlayerPRO !
//
// FAX: (+41 22) 346 11 97
// PHONE: (+41 79) 203 74 62
// Internet: RossetAntoine@bluewin.ch
//
/******************** ***********************/
#include "FileUtils.h"
short iFileOpen( Ptr name)
{
short temp;
OSErr iErr;
c2pstr( name);
iErr = FSOpen( (unsigned char*) name, 0, &temp);
p2cstr( (unsigned char*) name);
if( iErr) return 0;
else return temp;
}
long iGetEOF( short iFileRefI)
{
long curEOF;
GetEOF( iFileRefI, &curEOF);
return curEOF;
}
OSErr iRead( long size, Ptr dest, short iFileRefI)
{
return FSRead( iFileRefI, &size, dest);
}
OSErr iSeekCur( long size, short iFileRefI)
{
return SetFPos( iFileRefI, fsFromMark, size);
}
void iFileCreate( Ptr name, long type)
{
c2pstr( name);
FSDelete( (unsigned char*)name, 0L);
Create( (unsigned char*) name, 0, 'SNPL', type);
p2cstr( (unsigned char*) name);
}
OSErr iWrite( long size, Ptr dest, short iFileRefI)
{
return FSWrite( iFileRefI, &size, dest);
}
void iClose( short iFileRefI)
{
FSClose( iFileRefI);
}
/////////////////////////////////
void MOT32( void *msg_buf)
{
}
void MOT16( void *msg_buf)
{
}
/////////////////////////////////
void INT32( void *msg_buf)
{
unsigned char *buf = (unsigned char*) msg_buf;
unsigned long out;
out = ( (unsigned long) buf[3] << 24) | ( (unsigned long) buf[2] << 16) | ( (unsigned long) buf[ 1] << 8) | ( (unsigned long) buf[0]);
*((unsigned long*) msg_buf) = out;
}
void INT16( void *msg_buf)
{
unsigned char *buf = (unsigned char*) msg_buf;
short out;
out = ( (short) buf[1] << 8) | ( (short) buf[0]);
*((short*) msg_buf) = out;
}
/////////////////////////////////
Ptr MADstrcpy( Ptr dst, const char* src)
{
long i = 0;
do
{
dst[ i] = src[ i];
}while( src[ i++]);
return dst;
}
int MADstrcmp( const char *dst, const char* src)
{
long i = 0;
do
{
if( dst[ i] != src[ i]) return -1;
}while( src[ i++]);
return 0;
}