mirror of
https://gitlab.com/gnuwget/wget2.git
synced 2025-08-16 17:37:56 +00:00
Add docs for memory functions
* libwget/xalloc.c: Convert GTK-DOC format into Doxygen * docs/Makefile.am: Add rule for man pages
This commit is contained in:
@ -5,13 +5,15 @@ man3_MANS =\
|
||||
$(builddir)/man/man3/libwget-hash.3\
|
||||
$(builddir)/man/man3/libwget-io.3\
|
||||
$(builddir)/man/man3/libwget-utils.3\
|
||||
$(builddir)/man/man3/libwget-random.3
|
||||
$(builddir)/man/man3/libwget-random.3\
|
||||
$(builddir)/man/man3/libwget-xalloc.3
|
||||
|
||||
$(builddir)/man/man3/libwget-list.3: doxy.stamp
|
||||
$(builddir)/man/man3/libwget-hash.3: doxy.stamp
|
||||
$(builddir)/man/man3/libwget-io.3: doxy.stamp
|
||||
$(builddir)/man/man3/libwget-utils.3: doxy.stamp
|
||||
$(builddir)/man/man3/libwget-random.3: doxy.stamp
|
||||
$(builddir)/man/man3/libwget-xalloc.3: doxy.stamp
|
||||
|
||||
doxy.stamp:
|
||||
$(DOXYGEN) $(builddir)/libwget.doxy
|
||||
|
@ -35,11 +35,10 @@
|
||||
#include "private.h"
|
||||
|
||||
/**
|
||||
* SECTION:libwget-xalloc
|
||||
* @short_description: Memory allocation functions
|
||||
* @title: libwget-xalloc
|
||||
* @stability: stable
|
||||
* @include: libwget.h
|
||||
* \file
|
||||
* \brief Memory allocation functions
|
||||
* \defgroup libwget-xalloc Memory allocation functions
|
||||
* @{
|
||||
*
|
||||
* The provided memory allocation functions are used by explicit libwget memory
|
||||
* allocations.
|
||||
@ -70,8 +69,7 @@ static _GL_INLINE void G_GNUC_WGET_NORETURN _no_memory(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* wget_set_oomfunc:
|
||||
* @oom_callback: Pointer to your custom out-of-memory function.
|
||||
* \param[in] oom_callback Pointer to your custom out-of-memory function
|
||||
*
|
||||
* Set a custom out-of-memory function.
|
||||
*/
|
||||
@ -81,14 +79,12 @@ void wget_set_oomfunc(void (*oom_callback)(void))
|
||||
}
|
||||
|
||||
/**
|
||||
* wget_malloc:
|
||||
* @size: Number of bytes to allocate.
|
||||
* \param[in] size Number of bytes to allocate
|
||||
* \return A pointer to the allocated (uninitialized) memory
|
||||
*
|
||||
* Like the standard malloc(), except that it doesn't return %NULL values.
|
||||
* If an out-of-memory condition occurs the oom callback function is called (if set).
|
||||
* Thereafter the application is terminated by exit(%EXIT_FAILURE);
|
||||
*
|
||||
* Return: A pointer to the allocated (uninitialized) memory.
|
||||
*/
|
||||
void *wget_malloc(size_t size)
|
||||
{
|
||||
@ -99,15 +95,13 @@ void *wget_malloc(size_t size)
|
||||
}
|
||||
|
||||
/**
|
||||
* wget_calloc:
|
||||
* @nmemb: Number of elements (each of size @size) to allocate.
|
||||
* @size: Size of element.
|
||||
* \param[in] nmemb Number of elements (each of size \p size) to allocate
|
||||
* \param[in] size Size of element
|
||||
* \return A pointer to the allocated (initialized) memory
|
||||
*
|
||||
* Like the standard calloc(), except that it doesn't return %NULL values.
|
||||
* If an out-of-memory condition occurs the oom callback function is called (if set).
|
||||
* Thereafter the application is terminated by exit(%EXIT_FAILURE);
|
||||
*
|
||||
* Return: A pointer to the allocated (initialized) memory.
|
||||
*/
|
||||
void *wget_calloc(size_t nmemb, size_t size)
|
||||
{
|
||||
@ -118,15 +112,13 @@ void *wget_calloc(size_t nmemb, size_t size)
|
||||
}
|
||||
|
||||
/**
|
||||
* wget_realloc:
|
||||
* @ptr: Pointer to old memory area.
|
||||
* @size: Number of bytes to allocate for the new memory area.
|
||||
* \param[in] ptr Pointer to old memory area
|
||||
* \param[in] size Number of bytes to allocate for the new memory area
|
||||
* \return A pointer to the new memory area
|
||||
*
|
||||
* Like the standard realloc(), except that it doesn't return %NULL values.
|
||||
* If an out-of-memory condition occurs the oom callback function is called (if set).
|
||||
* Thereafter the application is terminated by exit(%EXIT_FAILURE);
|
||||
*
|
||||
* Return: A pointer to the new memory area.
|
||||
*/
|
||||
void *wget_realloc(void *ptr, size_t size)
|
||||
{
|
||||
@ -143,3 +135,5 @@ void *wget_realloc(void *ptr, size_t size)
|
||||
*p = NULL;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**@}*/
|
||||
|
Reference in New Issue
Block a user