appletmemory.c File Reference

#include "appletdefs.h"
#include "appletmemory.h"
#include "appletstrings.h"
#include "appletsyserror.h"

Include dependency graph for appletmemory.c:

Go to the source code of this file.

Defines

#define newstringlength(bs)   ((unsigned char) (bs [0]))

Functions

void moveleft (void *psource, void *pdest, long length)
void moveright (void *psource, void *pdest, long length)
boolean equalmemory (void *v1, void *v2, long ct)
boolean equalhandles (Handle h1, Handle h2)
void fillchar (void *pfill, long ctfill, char chfill)
void clearbytes (void *pclear, long ctclear)
void disposehandle (Handle h)
long gethandlesize (Handle h)
boolean sethandlesize (Handle h, long size)
boolean getnewhandle (unsigned long ctbytes, Handle *h)
boolean newemptyhandle (Handle *h)
Handle appnewhandle (Size ctbytes)
unsigned long memavail (void)
boolean copyhandle (Handle horig, Handle *hcopy)
boolean enlargehandle (Handle hgrow, long ctgrow, void *newdata)
boolean pushathandlestart (ptrvoid pdata, long ctbytes, Handle h)
boolean loadfromhandle (Handle hload, long *ixload, long ctload, void *pdata)
boolean loadhandlefromhandle (Handle hsource, long *ixsource, long ct, Handle *hdest)
boolean newtexthandle (void *pstring, Handle *htext)
boolean pushtexthandle (void *pstring, Handle htext)
boolean pushhandleonhandle (Handle hsource, Handle hdest)
void texthandletostring (Handle htext, void *pstring)
boolean numbertotexthandle (long num, Handle *htext)
void texthandletonumber (Handle htext, long *num, boolean *flerror)
void lockhandle (Handle h)
void unlockhandle (Handle h)
boolean newclearhandle (long ctbytes, Handle *hnew)
boolean newfilledhandle (ptrvoid pdata, long ctbytes, Handle *hnew)
boolean newheapstring (ptrstring bs, hdlstring *hstring)
void copyheapstring (hdlstring hstring, void *bs)
boolean sethandlecontents (void *p, long ct, Handle h)
boolean minhandlesize (Handle h, long size)
boolean newintarray (short ct, hdlintarray *harray)
boolean setintarray (hdlintarray harray, short ix, short val)
boolean getintarray (hdlintarray harray, short ix, short *val)
void fillintarray (hdlintarray harray, short val)
boolean testheapspace (long size)
boolean popfromhandle (Handle hpop, long ctpop, ptrvoid pdata)
boolean insertinhandle (bigstring bs, Handle h, unsigned long ix)
boolean inserthandleinhandle (Handle hinsert, Handle h, unsigned long ix)
void deleteinhandle (Handle h, unsigned long ix, unsigned long ctdelete)
static unsigned char lowerchar (unsigned char ch)
boolean handlesearch (Handle h, bigstring searchfor, boolean flunicase, unsigned long *ix)
boolean handlereplaceall (Handle h, bigstring searchfor, Handle replacewith)
boolean getstringfromhandle (Handle h, unsigned long ixstart, unsigned long ixend, bigstring bs)
long handlepatternmatch (void *ppattern, Handle pstringh)

Variables

boolean usetempmemory = false


Define Documentation

#define newstringlength bs   )     ((unsigned char) (bs [0]))
 

Definition at line 324 of file appletmemory.c.

Referenced by newtexthandle().


Function Documentation

Handle appnewhandle Size  ctbytes  ) 
 

Definition at line 192 of file appletmemory.c.

References getnewhandle(), h, and nil.

Referenced by CopyDriverIcon(), finderevent(), getsafetycushion(), initcolorpopup(), largefilebuffer(), openmono(), pastecommand(), and testheapspace().

Here is the call graph for this function:

void clearbytes void *  pclear,
long  ctclear
 

Definition at line 122 of file appletmemory.c.

References fillchar().

Here is the call graph for this function:

boolean copyhandle Handle  horig,
Handle hcopy
 

Definition at line 216 of file appletmemory.c.

References gethandlesize(), GetHandleSize, getnewhandle(), memoryerror(), moveleft(), and nil.

Here is the call graph for this function:

void copyheapstring hdlstring  hstring,
void *  bs
 

Definition at line 471 of file appletmemory.c.

References copystring(), lockhandle(), nil, and unlockhandle().

Here is the call graph for this function:

void deleteinhandle Handle  h,
unsigned long  ix,
unsigned long  ctdelete
 

Definition at line 639 of file appletmemory.c.

References ct, gethandlesize(), moveleft(), and sethandlesize().

Here is the call graph for this function:

void disposehandle Handle  h  ) 
 

Definition at line 132 of file appletmemory.c.

References cttemphandles, DisposeHandle, MemError, memoryerror(), and nil.

Here is the call graph for this function:

boolean enlargehandle Handle  hgrow,
long  ctgrow,
void *  newdata
 

Definition at line 238 of file appletmemory.c.

References ct, gethandlesize(), h, insertinhandle(), MemError, moveleft(), noErr, and sethandlesize().

Here is the call graph for this function:

boolean equalhandles Handle  h1,
Handle  h2
 

Definition at line 87 of file appletmemory.c.

References comparehandles(), equalmemory(), GetHandleSize, and nil.

Here is the call graph for this function:

boolean equalmemory void *  v1,
void *  v2,
long  ct
 

Definition at line 64 of file appletmemory.c.

Referenced by equalhandles().

void fillchar void *  pfill,
long  ctfill,
char  chfill
 

Definition at line 106 of file appletmemory.c.

References assert, and ct.

void fillintarray hdlintarray  harray,
short  val
 

Definition at line 553 of file appletmemory.c.

References ct, gethandlesize(), h, and longsizeof.

Here is the call graph for this function:

long gethandlesize Handle  h  ) 
 

Definition at line 144 of file appletmemory.c.

References GetHandleSize, and nil.

boolean getintarray hdlintarray  harray,
short  ix,
short val
 

Definition at line 545 of file appletmemory.c.

boolean getnewhandle unsigned long  ctbytes,
Handle h
 

Definition at line 161 of file appletmemory.c.

References fl, NewHandle, nil, noErr, sysmemoryerror(), and usetempmemory.

Here is the call graph for this function:

boolean getstringfromhandle Handle  h,
unsigned long  ixstart,
unsigned long  ixend,
bigstring  bs
 

Definition at line 778 of file appletmemory.c.

References lenbigstring, loadfromhandle(), and setstringlength.

Here is the call graph for this function:

long handlepatternmatch void *  ppattern,
Handle  pstringh
 

Definition at line 797 of file appletmemory.c.

References GetHandleSize, i, and stringlength.

boolean handlereplaceall Handle  h,
bigstring  searchfor,
Handle  replacewith
 

Definition at line 723 of file appletmemory.c.

References ct, gethandlesize(), i, and stringlength.

Here is the call graph for this function:

boolean handlesearch Handle  h,
bigstring  searchfor,
boolean  flunicase,
unsigned long ix
 

lowerchar

Definition at line 659 of file appletmemory.c.

References alllower(), bigstring, copystring(), ct, gethandlesize(), i, lowerchar(), and stringlength.

Here is the call graph for this function:

boolean inserthandleinhandle Handle  hinsert,
Handle  h,
unsigned long  ix
 

Definition at line 619 of file appletmemory.c.

References ct, gethandlesize(), moveleft(), moveright(), nil, and sethandlesize().

Here is the call graph for this function:

boolean insertinhandle bigstring  bs,
Handle  h,
unsigned long  ix
 

Definition at line 602 of file appletmemory.c.

References ct, gethandlesize(), moveleft(), moveright(), sethandlesize(), and stringlength.

Here is the call graph for this function:

boolean loadfromhandle Handle  hload,
long ixload,
long  ctload,
void *  pdata
 

Definition at line 283 of file appletmemory.c.

References ct, gethandlesize(), h, and moveleft().

Here is the call graph for this function:

boolean loadhandlefromhandle Handle  hsource,
long ixsource,
long  ct,
Handle hdest
 

Definition at line 312 of file appletmemory.c.

References fl, and newfilledhandle().

Here is the call graph for this function:

void lockhandle Handle  h  ) 
 

Definition at line 429 of file appletmemory.c.

References HLock, and nil.

static unsigned char lowerchar unsigned char  ch  )  [static]
 

Definition at line 650 of file appletmemory.c.

Referenced by handlesearch().

unsigned long memavail void   ) 
 

Definition at line 207 of file appletmemory.c.

References FreeMem(), and usetempmemory.

Referenced by largefilebuffer(), and sysfunctionvalue().

Here is the call graph for this function:

boolean minhandlesize Handle  h,
long  size
 

Definition at line 501 of file appletmemory.c.

References gethandlesize(), MemError, noErr, and sethandlesize().

Here is the call graph for this function:

void moveleft void *  psource,
void *  pdest,
long  length
 

Definition at line 18 of file appletmemory.c.

References memmove.

void moveright void *  psource,
void *  pdest,
long  length
 

Definition at line 41 of file appletmemory.c.

References memmove.

boolean newclearhandle long  ctbytes,
Handle hnew
 

Definition at line 443 of file appletmemory.c.

References clearbytes(), clearhandle(), getnewhandle(), memoryerror(), and nil.

Here is the call graph for this function:

boolean newemptyhandle Handle h  ) 
 

Definition at line 186 of file appletmemory.c.

References getnewhandle(), and newhandle().

Here is the call graph for this function:

boolean newfilledhandle ptrvoid  pdata,
long  ctbytes,
Handle hnew
 

Definition at line 454 of file appletmemory.c.

References getnewhandle(), memoryerror(), moveleft(), and nil.

Here is the call graph for this function:

boolean newheapstring ptrstring  bs,
hdlstring hstring
 

Definition at line 465 of file appletmemory.c.

References newfilledhandle(), and stringlength.

Here is the call graph for this function:

boolean newintarray short  ct,
hdlintarray harray
 

Definition at line 512 of file appletmemory.c.

References h, longsizeof, and newclearhandle().

Here is the call graph for this function:

boolean newtexthandle void *  pstring,
Handle htext
 

Definition at line 327 of file appletmemory.c.

References getnewhandle(), moveleft(), and newstringlength.

Here is the call graph for this function:

boolean numbertotexthandle long  num,
Handle htext
 

Definition at line 409 of file appletmemory.c.

References bigstring, and newtexthandle().

Here is the call graph for this function:

boolean popfromhandle Handle  hpop,
long  ctpop,
ptrvoid  pdata
 

Definition at line 587 of file appletmemory.c.

References gethandlesize(), h, moveleft(), nil, and sethandlesize().

Here is the call graph for this function:

boolean pushathandlestart ptrvoid  pdata,
long  ctbytes,
Handle  h
 

Definition at line 268 of file appletmemory.c.

References gethandlesize(), moveleft(), moveright(), and sethandlesize().

Here is the call graph for this function:

boolean pushhandleonhandle Handle  hsource,
Handle  hdest
 

Definition at line 369 of file appletmemory.c.

References enlargehandle(), fl, gethandlesize(), lockhandle(), nil, and unlockhandle().

Here is the call graph for this function:

boolean pushtexthandle void *  pstring,
Handle  htext
 

Definition at line 354 of file appletmemory.c.

References enlargehandle(), and stringlength.

Here is the call graph for this function:

boolean sethandlecontents void *  p,
long  ct,
Handle  h
 

Definition at line 488 of file appletmemory.c.

References MemError, moveleft(), noErr, and sethandlesize().

Here is the call graph for this function:

boolean sethandlesize Handle  h,
long  size
 

Definition at line 153 of file appletmemory.c.

References MemError, memoryerror(), nil, noErr, resizehandle(), and SetHandleSize.

Here is the call graph for this function:

boolean setintarray hdlintarray  harray,
short  ix,
short  val
 

Definition at line 525 of file appletmemory.c.

References h, longsizeof, and minhandlesize().

Here is the call graph for this function:

boolean testheapspace long  size  ) 
 

Definition at line 566 of file appletmemory.c.

References appnewhandle(), haveheapspace(), memoryerror(), and nil.

Here is the call graph for this function:

void texthandletonumber Handle  htext,
long num,
boolean flerror
 

Definition at line 419 of file appletmemory.c.

References bigstring, stringtonumber(), and texthandletostring().

Here is the call graph for this function:

void texthandletostring Handle  htext,
void *  pstring
 

Definition at line 386 of file appletmemory.c.

References gethandlesize(), lenbigstring, moveleft(), nil, and setstringlength.

Here is the call graph for this function:

void unlockhandle Handle  h  ) 
 

Definition at line 436 of file appletmemory.c.

References HUnlock, and nil.


Variable Documentation

boolean usetempmemory = false
 

Definition at line 13 of file appletmemory.c.

Referenced by getnewhandle(), and memavail().


Generated on Wed May 31 21:32:25 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6