Back to index

glibc  2.9
Defines | Functions | Variables
ialloc.c File Reference
#include "private.h"

Go to the source code of this file.

Defines

#define nonzero(n)   (((n) == 0) ? 1 : (n))

Functions

char * imalloc (int n) const
char * icalloc (int nelem, int elsize)
void * irealloc (void *const pointer, const int size)
char * icatalloc (char *const old, const char *const new)
char * icpyalloc (char *const string) const
void ifree (char *const p)
void icfree (char *const p)

Variables

static char elsieid [] = "@(#)ialloc.c 8.30"

Define Documentation

#define nonzero (   n)    (((n) == 0) ? 1 : (n))

Definition at line 16 of file ialloc.c.


Function Documentation

char* icalloc ( int  nelem,
int  elsize 
)

Definition at line 26 of file ialloc.c.

{
       if (nelem == 0 || elsize == 0)
              nelem = elsize = 1;
       return calloc((size_t) nelem, (size_t) elsize);
}

Here is the call graph for this function:

char* icatalloc ( char * const  old,
const char * const  new 
)

Definition at line 46 of file ialloc.c.

{
       register char *      result;
       register int  oldsize, newsize;

       newsize = (new == NULL) ? 0 : strlen(new);
       if (old == NULL)
              oldsize = 0;
       else if (newsize == 0)
              return old;
       else   oldsize = strlen(old);
       if ((result = irealloc(old, oldsize + newsize + 1)) != NULL)
              if (new != NULL)
                     (void) strcpy(result + oldsize, new);
       return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void icfree ( char * const  p)

Definition at line 81 of file ialloc.c.

{
       if (p != NULL)
              (void) free(p);
}
char* icpyalloc ( char * const  string) const

Definition at line 66 of file ialloc.c.

{
       return icatalloc((char *) NULL, string);
}

Here is the call graph for this function:

void ifree ( char * const  p)

Definition at line 73 of file ialloc.c.

{
       if (p != NULL)
              (void) free(p);
}

Here is the caller graph for this function:

char* imalloc ( int  n) const

Definition at line 19 of file ialloc.c.

{
       return malloc((size_t) nonzero(n));
}

Here is the caller graph for this function:

void* irealloc ( void * const  pointer,
const int  size 
)

Definition at line 36 of file ialloc.c.

{
       if (pointer == NULL)
              return imalloc(size);
       return realloc((void *) pointer, (size_t) nonzero(size));
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char elsieid[] = "@(#)ialloc.c 8.30" [static]

Definition at line 8 of file ialloc.c.