Memory functions



afree ()
     Description:
       Frees a block and sets it's pointer to zero.
       The same as "free(*p); *(p)=NULL;".

     Syntax:
	 void afree ( void **p );

     Parameters:
	 p           A pointer to the block.

     Returns:
	 -



clear_type ()
     Description:
	 Sets a pointer with a certain size to zero.

     Syntax:
	 clear_type(p,s)

     Parameters:
	 p           The pointer to set
	 s           Size of the pointer.

     Returns:
	 -



copy_type ()
     Description:
	 Allocates new memory with a certain size and copies 
	 the contents of "what" into this memory.

     Syntax:
	 void*  copy_type ( void *what, l_long size );

     Parameters:
	 what        The type to be copied.
	 size        Memory of the type

     Returns:
	 Pointer to the new contents of "what".



_strdup ()
     Description:
	 Duplicates a string. Allocates memory for the copy 
	 and copies the original into this memory.

     Syntax:
	 l_text  _strdup ( l_text str )

     Parameters:
	 str         The string to be copied.

     Returns:
	 The duplicated string.



_malloc ()
     Description:
	 Allocates memory. Same as "malloc()" but compatible
	 with future versions. 

     Syntax:
	 void  *_malloc ( size_t size )

     Parameters:
	 size        Size of the memory to allocate.

     Returns:
	 -



_realloc ()
     Description:
       Reallocate memory. Same as "realloc()" but compatible 
	 with future versions.

     Syntax:
       void  *_realloc ( void *ptr, size_t size )

     Parameters:
       ptr         Pointer to the memory.
	 size        Size of the memory.

     Returns:
       -



_calloc ()
     Description:
	 Allocates memory in a certain size for each element.
	 Same as "calloc()" but compatible with future versions.

     Syntax:
	 void  *_calloc ( size_t num_elements, size_t size )

     Parameters:
	 num_elements   Number of elements.
       size           Size of each element.

     Returns:
	 -



_free ()
     Description:
       Frees memory. Same as "free()" but compatible with future
	 versions.

     Syntax:
       void   _free ( void *ptr )

     Parameters:
       ptr         Pointer to the memory to free.

     Returns:
       -



_cfree ()
     Description:
       Frees memory previously allocated by _calloc() function. 
	 Same as "cfree()" but compatible with future versions.

     Syntax:
       void  _cfree ( void *ptr )

     Parameters:
       ptr         Pointer to the memory to free.

     Returns:
       -