Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

pi_mem.c File Reference

#include "PI_Basic.h"
#include "PI_Mem.h"
#include "PI_Mach.h"
#include <string.h>

Go to the source code of this file.

Functions

Ptr SmartNewPtr (Size byteCount, OSErr *resultCode)
Ptr SmartNewPtrClear (Size byteCount, OSErr *resultCode)
Ptr DisposeIfPtr (Ptr thePtr)
void LH_mallocInit ()
void * LH_malloc (long a)
void LH_free (void *a)
void SetMem (void *bytePtr, size_t numBytes, unsigned char byteValue)
void BlockMove (const void *srcPtr, void *destPtr, Size byteCount)


Function Documentation

void BlockMove const void *  srcPtr,
void *  destPtr,
Size  byteCount
 

Definition at line 337 of file lh_open/pi_mem.c.

00340 { 00341 memmove(destPtr, srcPtr, byteCount); 00342 }

Ptr DisposeIfPtr Ptr  thePtr  ) 
 

Definition at line 99 of file lh_open/pi_mem.c.

00100 { 00101 if (thePtr) 00102 { 00103 LH_free(thePtr); 00104 } 00105 return NULL; 00106 }

void LH_free void *  a  ) 
 

Definition at line 276 of file lh_open/pi_mem.c.

00277 { 00278 #ifdef __MWERKS__ 00279 DisposePtr((Ptr)a); 00280 #else 00281 free(a); 00282 #endif 00283 00284 }

void* LH_malloc long  a  ) 
 

Definition at line 254 of file lh_open/pi_mem.c.

00255 { 00256 #ifdef __MWERKS__ 00257 return NewPtr(a); 00258 #else 00259 return malloc(a); 00260 #endif 00261 00262 }

void LH_mallocInit  ) 
 

Definition at line 238 of file lh_open/pi_mem.c.

00239 { 00240 }

void SetMem void *  bytePtr,
size_t  numBytes,
unsigned char  byteValue
 

Ptr SmartNewPtr Size  byteCount,
OSErr resultCode
 

Definition at line 47 of file lh_open/pi_mem.c.

00049 { 00050 Ptr aPtr; 00051 aPtr = (Ptr)LH_malloc(byteCount); 00052 if (aPtr == 0) 00053 *resultCode = notEnoughMemoryErr; 00054 else 00055 *resultCode = 0; 00056 return aPtr; 00057 }

Ptr SmartNewPtrClear Size  byteCount,
OSErr resultCode
 

Definition at line 72 of file lh_open/pi_mem.c.

00074 { 00075 Ptr ptr = NULL; 00076 00077 ptr = SmartNewPtr(byteCount, resultCode); 00078 00079 if (ptr != NULL) 00080 { 00081 memset( ptr, 0, byteCount ); 00082 } 00083 return ptr; 00084 00085 }


Generated on Sat May 15 19:45:08 2004 for test by doxygen 1.3.7