memalloc.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stackmark

Defines

#define stackblock()   stacknxt
#define stackblocksize()   stacknleft
#define STARTSTACKSTR(p)   p = stackblock(), sstrnleft = stackblocksize()
#define STPUTC(c, p)   (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), *p++ = (c)))
#define CHECKSTRSPACE(n, p)   if (sstrnleft < n) p = makestrspace(); else
#define USTPUTC(c, p)   (--sstrnleft, *p++ = (c))
#define STACKSTRNUL(p)   (sstrnleft == 0? (p = growstackstr(), *p = '\0') : (*p = '\0'))
#define STUNPUTC(p)   (++sstrnleft, --p)
#define STTOPC(p)   p[-1]
#define STADJUST(amount, p)   (p += (amount), sstrnleft -= (amount))
#define grabstackstr(p)   stalloc(stackblocksize() - sstrnleft)
#define ckfree(p)   free((pointer)(p))

Functions

pointer ckmalloc ()
pointer ckrealloc ()
void free ()
char * savestr ()
pointer stalloc ()
void stunalloc ()
void setstackmark ()
void popstackmark ()
void growstackblock ()
void grabstackblock ()
char * growstackstr ()
char * makestrspace ()
void ungrabstackstr ()

Variables

char * stacknxt
int stacknleft
int sstrnleft
int herefd


Define Documentation

#define CHECKSTRSPACE n,
p   )     if (sstrnleft < n) p = makestrspace(); else
 

Definition at line 87 of file memalloc.h.

Referenced by readtoken1().

#define ckfree p   )     free((pointer)(p))
 

Definition at line 95 of file memalloc.h.

Referenced by clear_traps(), clearcmdentry(), delete_cmd_entry(), deletefuncs(), expandarg(), freejob(), freeparam(), freestdout(), popfile(), poplocalvars(), popstackmark(), shiftcmd(), shprocvar(), and updatepwd().

#define grabstackstr p   )     stalloc(stackblocksize() - sstrnleft)
 

Definition at line 93 of file memalloc.h.

Referenced by casematch(), evalcmd(), expandarg(), and expbackq().

 
#define stackblock  )     stacknxt
 

Definition at line 83 of file memalloc.h.

Referenced by docd(), evalvar(), expandhere(), expbackq(), growstackstr(), makestrspace(), padvance(), and updatepwd().

 
#define stackblocksize  )     stacknleft
 

Definition at line 84 of file memalloc.h.

Referenced by growstackstr(), makestrspace(), and padvance().

#define STACKSTRNUL p   )     (sstrnleft == 0? (p = growstackstr(), *p = '\0') : (*p = '\0'))
 

Definition at line 89 of file memalloc.h.

Referenced by evalvar(), and updatepwd().

#define STADJUST amount,
p   )     (p += (amount), sstrnleft -= (amount))
 

Definition at line 92 of file memalloc.h.

Referenced by evalvar().

#define STARTSTACKSTR p   )     p = stackblock(), sstrnleft = stackblocksize()
 

Definition at line 85 of file memalloc.h.

Referenced by casematch(), evalcmd(), expandarg(), readcmd(), readtoken1(), and updatepwd().

#define STPUTC c,
p   )     (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), *p++ = (c)))
 

Definition at line 86 of file memalloc.h.

Referenced by argstr(), casematch(), evalcmd(), evalvar(), expandarg(), updatepwd(), and varvalue().

#define STTOPC p   )     p[-1]
 

Definition at line 91 of file memalloc.h.

#define STUNPUTC p   )     (++sstrnleft, --p)
 

Definition at line 90 of file memalloc.h.

Referenced by updatepwd().

#define USTPUTC c,
p   )     (--sstrnleft, *p++ = (c))
 

Definition at line 88 of file memalloc.h.

Referenced by readtoken1().


Function Documentation

pointer ckmalloc  ) 
 

pointer ckrealloc  ) 
 

void free  ) 
 

void grabstackblock  ) 
 

void growstackblock  ) 
 

Definition at line 201 of file memalloc.c.

References bcopy, ckrealloc(), INTOFF, INTON, MINSIZE, p, sp, stack_block::space, stackbase, stacknleft, stacknxt, stackp, and stalloc().

Referenced by growstackstr(), makestrspace(), and padvance().

char* growstackstr  ) 
 

Definition at line 257 of file memalloc.c.

References growstackblock(), herefd, sstrnleft, stackblock, stackblocksize, and xwrite().

char* makestrspace  ) 
 

Definition at line 275 of file memalloc.c.

References growstackblock(), sstrnleft, stackblock, and stackblocksize.

void popstackmark  ) 
 

char* savestr  ) 
 

void setstackmark  ) 
 

pointer stalloc  ) 
 

void stunalloc  ) 
 

void ungrabstackstr  ) 
 


Variable Documentation

int herefd
 

Definition at line 117 of file memalloc.c.

Referenced by evalvar(), expandhere(), expbackq(), and growstackstr().

int sstrnleft
 

Definition at line 116 of file memalloc.c.

Referenced by growstackstr(), makestrspace(), and ungrabstackstr().

int stacknleft
 

Definition at line 115 of file memalloc.c.

Referenced by grabstackblock(), growstackblock(), popstackmark(), setstackmark(), stalloc(), stunalloc(), and ungrabstackstr().

char* stacknxt
 

Definition at line 114 of file memalloc.c.

Referenced by grabstackblock(), growstackblock(), popstackmark(), setstackmark(), stalloc(), stunalloc(), and ungrabstackstr().


Generated on Fri Apr 14 22:58:54 2006 for minix by  doxygen 1.4.6