Functions | |
| void * | cpl_malloc (size_t nbytes) |
| Allocate nbytes bytes. | |
| void * | cpl_calloc (size_t natoms, size_t nbytes) |
| Allocate memory for natoms elements of size size. | |
| void * | cpl_realloc (void *memblk, size_t nbytes) |
| Change the size of a memory block. | |
| void | cpl_free (void *memblk) |
| Memory block deallocation. | |
| char * | cpl_strdup (const char *string) |
| Duplicate a string. | |
| char * | cpl_vsprintf (const char *format, va_list arglist) |
| Create a string and fill it in an vsprintf()-like manner. | |
| char * | cpl_sprintf (const char *format,...) |
| Create a string and fill it in an sprintf()-like manner. | |
| int | cpl_memory_is_empty (void) |
| Tell if there is some memory allocated. | |
| void | cpl_memory_dump (void) |
| Display the memory status. | |
|
||||||||||||
|
Allocate memory for natoms elements of size size.
|
|
|
Memory block deallocation.
|
|
|
Allocate nbytes bytes.
|
|
|
Display the memory status.
|
|
|
Tell if there is some memory allocated.
|
|
||||||||||||
|
Change the size of a memory block.
NULL the call to cpl_realloc() is equivalent to cpl_malloc(), and if nbytes is 0 the call is equivalent to cpl_free(). Unless memblk is NULL, it must have been returned by a previous call to cpl_malloc(), cpl_calloc(), or cpl_realloc().
|
|
||||||||||||
|
Create a string and fill it in an sprintf()-like manner.
Example of usage: int error; char * cp_cmd = cpl_sprintf("cp %s %s/%s", long_file, new_dir, new_file); assert( cp_cmd != NULL); error = system(cp_cmd); assert(!error); cpl_free(cp_cmd); |
|
|
Duplicate a string.
|
|
||||||||||||
|
Create a string and fill it in an vsprintf()-like manner.
|
1.3.9.1