aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.h
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2010-04-10 17:48:52 +0200
committerMatthias Andree <matthias.andree@gmx.de>2010-04-10 18:02:09 +0200
commit0c92635914becb4f6913c3f1d5a6f3756325315b (patch)
tree7c0d79a51259691a6c127dde7ed30cfabfc50995 /xmalloc.h
parentbd03e87753241dee328ead1c0c8193d1ee3750cc (diff)
downloadfetchmail-0c92635914becb4f6913c3f1d5a6f3756325315b.tar.gz
fetchmail-0c92635914becb4f6913c3f1d5a6f3756325315b.tar.bz2
fetchmail-0c92635914becb4f6913c3f1d5a6f3756325315b.zip
Add Doxygen markup for xmalloc.?.
Diffstat (limited to 'xmalloc.h')
-rw-r--r--xmalloc.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/xmalloc.h b/xmalloc.h
index e1865013..690b5741 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -1,4 +1,4 @@
-/* xmalloc.h -- split out of fetchmail.h */
+/** \file xmalloc.h -- Declarations for the fail-on-OOM string functions */
#ifndef XMALLOC_H
#define XMALLOC_H
@@ -11,9 +11,18 @@
#else
#define XMALLOCTYPE char
#endif
-XMALLOCTYPE *xmalloc(size_t);
-XMALLOCTYPE *xrealloc(/*@null@*/ XMALLOCTYPE *, size_t);
+
+/** Allocate \a n characters of memory, abort program on failure. */
+XMALLOCTYPE *xmalloc(size_t n);
+
+/** Reallocate \a n characters of memory, abort program on failure. */
+XMALLOCTYPE *xrealloc(/*@null@*/ XMALLOCTYPE *, size_t n);
+
+/** Free memory at position \a p and set pointer \a p to NULL afterwards. */
#define xfree(p) { if (p) { free(p); } (p) = 0; }
-char *xstrdup(const char *);
+
+/** Duplicate string \a src to a newly malloc()d memory region and return its
+ * pointer, abort program on failure. */
+char *xstrdup(const char *src);
#endif