www.pudn.com > MP3+JPEG.rar > Buddy.h


//========================================================================= 
//  The information contained herein is the exclusive property of Sunplus  
//  Technology Co. And shall not be distributed, reproduced, or disclosed  
//  in whole in part without prior written permission. 
//  (C) Copyright 2003 Sunplus Technology Co. All rights reserved. 
//  The entire notice above must be reproduced on all authorized copies 
//========================================================================= 
 
//========================================================================= 
//  project  name:  	u'nSP Buddy System  
//  Project Description:u'nSP Buddy System on MiniOS 
//  Environment: 	SPL16256 with 47.9232MHz 
//					SUNPLUS u'nSPTM  IDE 1.8.1£¨or later£© 
//  Library Dependency: OS-Lib: SpOSA153.lib 
//                       
//  Author: 	wang quan   
//  Date:		2003.12.10 
//  E-mail:     unsp@sunnorth.com.cn 
//  Revision history: 
//  ------------------------------------------------------------------------ 
//  YYYY-MM-DD        Modified By               Description                   
//  ------------------------------------------------------------------------ 
//========================================================================== 
 
#ifndef	__BUDDY_h__ 
#define	__BUDDY_h__ 
//	write your header here 
 
/*************************************************/ 
//#ifndef Buddy_Debug 
//#define	Buddy_Debug  
//#endif 
 
/*************************************************/ 
 
#include 	"BuddyVar.h" 
 
/*************************************************/ 
#ifndef SUCCESS				 
#define SUCCESS 	0 
#endif 
 
/*************************************************/ 
#ifndef FALSE 
#define FALSE 		0 
#endif 
 
/*************************************************/ 
#ifndef TRUE 
#define TRUE 		1 
#endif 
 
/*************************************************/ 
#ifndef NULL 
#define NULL	0 
#endif 
 
/*************************************************/ 
extern	unsigned int  _InitMem(void); 
extern	unsigned int  _InitExtMem(void); 
 
extern	void  *_GetMem(unsigned int size); 
extern	void  _FreeMem(void *ptr); 
 
extern	unsigned long  _GetExtMem(unsigned int size); 
extern	void  _FreeExtMem(unsigned long ptr); 
 
extern	void  *Buddy_calloc(unsigned int num, unsigned int size); 
extern	void  *Buddy_realloc(void *ptr, unsigned int size); 
 
extern	unsigned long  MemBuddyAlloc(unsigned int  AllocSize); 
extern	unsigned int   MemBuddyFree(unsigned long  BuddyAdr); 
 
extern	unsigned int   GetBuddylibVersion (void); 
 
/*************************************************/ 
#ifndef MemBuddyInit 
#define	MemBuddyInit _InitMem 
#endif	 
 
#ifndef malloc 
#define	malloc _GetMem 
#endif 
 
#ifndef free 
#define	free _FreeMem 
#endif 
 
#ifndef fmalloc 
#define	fmalloc _GetExtMem 
#endif 
 
#ifndef ffree 
#define	ffree _FreeExtMem 
#endif 
 
#ifndef calloc 
#define	calloc Buddy_calloc 
#endif 
 
#ifndef realloc 
#define	realloc Buddy_realloc 
#endif 
 
/*************************************************/ 
 
#endif