#include "postgres_fe.h"
#include "private.h"
Go to the source code of this file.
Define Documentation
#define nonzero |
( |
|
n |
) |
(((n) == 0) ? 1 : (n)) |
Function Documentation
char* icalloc |
( |
int |
nelem, |
|
|
int |
elsize | |
|
) |
| | |
Definition at line 23 of file ialloc.c.
References calloc.
{
if (nelem == 0 || elsize == 0)
nelem = elsize = 1;
return calloc((size_t) nelem, (size_t) elsize);
}
char* icatalloc |
( |
char * |
old, |
|
|
const char * |
new | |
|
) |
| | |
Definition at line 39 of file ialloc.c.
References irealloc(), and NULL.
Referenced by icpyalloc().
{
char *result;
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;
}
char* icpyalloc |
( |
const char * |
string |
) |
|
void* irealloc |
( |
void * |
pointer, |
|
|
int |
size | |
|
) |
| | |