home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 10
/
aminetcdnumber101996.iso
/
Aminet
/
util
/
misc
/
chunker.lha
/
Chunker
/
source
/
machine.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-10
|
2KB
|
108 lines
/*************************************************************************
*
* Chunker/DeChunk
*
* Copyright ©1995 Lee Kindness and Evan Tuer
* cs2lk@scms.rgu.ac.uk
*
* machine.h
* Allows use of system specific functions => smaller code or just to use
* ANSI functions.
*/
#ifndef _MACHINE_H_
#define _MACHINE_H_
/* Remove to compile on a WB 1.3 Amiga */
#ifdef _AMIGA
#define AMIGA
#endif
#ifdef AMIGA
/* Lets be Amiga specific */
#include <exec/types.h>
#include <exec/memory.h>
#include <dos/dos.h>
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <pragmas/exec_sysbase_pragmas.h>
#include <pragmas/dos_pragmas.h>
extern struct ExecBase *SysBase;
extern struct DosLibrary *DOSBase;
#define mprintf Printf
typedef BPTR FILEt;
#define FILEOPEN_READ MODE_OLDFILE
#define FILEOPEN_WRITE MODE_NEWFILE
#define mfopen(F,M) Open(F,M)
#define mfgetc(F) FGetC(F)
#define mfputc(C,F) FPutC(F,C)
#define mfclose(F) Close(F)
#define mmalloc(S) AllocVec(S, 0)
#define mfree(P) FreeVec(P)
void msprintf(char *buffer, char *format, ...);
#else /* AMIGA */
/* Use ANSI functions */
#include <stdio.h>
#include <stdlib.h>
#define mprintf printf
typedef FILE *FILEt;
#define FILEOPEN_READ "rb"
#define FILEOPEN_WRITE "wb"
#define mfopen(F,M) fopen(F,M)
#define mfgetc(F) fgetc(F)
#define mfputc(C,F) fputc(C,F)
#define mfclose(F) fclose(F)
#define mmalloc(S) malloc(S)
#define mfree(P) free(P)
#define msprintf sprintf
#endif /* AMIGA */
#ifdef __TURBOC__
#pragma warn -pia
#endif /* __TURBOC__ */
struct Args
{
char *arg_Filename;
char *arg_Basename;
unsigned long arg_Size;
#ifdef AMIGA
struct RDArgs *arg_RAHandle;
#endif /* AMIGA */
};
int InitSystem( void );
void FreeSystem( void );
#ifdef __CHUNKER_H__
struct Args *GetChunkerArgs(int argc, char **argv);
void FreeChunkerArgs(struct Args *args);
#endif /* __CHUNKER_H__ */
#ifdef __DECHUNK_H__
struct Args *GetDeChunkArgs(int argc, char **argv);
void FreeDeChunkArgs(struct Args *args);
#endif /* __DECHUNK_H__ */
#endif /* _MACHINE_H_ */