summaryrefslogtreecommitdiff
path: root/man/XtMalloc.man
diff options
context:
space:
mode:
authorWalter Harms <wharms@bfs.de>2019-04-16 13:20:42 +0200
committerWalter Harms <wharms@bfs.de>2019-04-16 13:20:42 +0200
commit2b26e9a5473e399c81ae11b98d1f0b38393dbd8c (patch)
treec62b25afc2ec470d02c9d63545adc213d870b6a3 /man/XtMalloc.man
parent4b446ce8b20b1de1488c73e1841dafbd25ca949f (diff)
parent965bc251c1d8391e672f277686254299627d4e3c (diff)
downloadxorg-lib-libXt-2b26e9a5473e399c81ae11b98d1f0b38393dbd8c.tar.gz
Merge branch 'master' of ssh://gitlab.freedesktop.org/xorg/lib/libxt
Conflicts: man/XtManageChildren.man
Diffstat (limited to 'man/XtMalloc.man')
-rw-r--r--man/XtMalloc.man42
1 files changed, 23 insertions, 19 deletions
diff --git a/man/XtMalloc.man b/man/XtMalloc.man
index c53fa74..e3525a0 100644
--- a/man/XtMalloc.man
+++ b/man/XtMalloc.man
@@ -92,84 +92,88 @@ Specifies a pointer to write a newly allocated string to.
Specifies a formatting string as defined by sprintf(3c)
.SH DESCRIPTION
The
-.BR XtMalloc
+.B XtMalloc
functions returns a pointer to a block of storage of at least
the specified size bytes.
If there is insufficient memory to allocate the new block,
-.BR XtMalloc
+.B XtMalloc
calls
.BR XtErrorMsg .
.LP
The
-.BR XtCalloc
+.B XtCalloc
function allocates space for the specified number of array elements
of the specified size and initializes the space to zero.
If there is insufficient memory to allocate the new block,
-.BR XtCalloc
+.B XtCalloc
calls
.BR XtErrorMsg .
.LP
The
-.BR XtRealloc
+.B XtRealloc
function changes the size of a block of storage (possibly moving it).
Then, it copies the old contents (or as much as will fit) into the new block
and frees the old block.
If there is insufficient memory to allocate the new block,
-.BR XtRealloc
+.B XtRealloc
calls
.BR XtErrorMsg .
If ptr is NULL,
-.BR XtRealloc
+.B XtRealloc
allocates the new storage without copying the old contents;
that is, it simply calls
.BR XtMalloc .
.LP
The
-.BR XtFree
+.B XtFree
function returns storage and allows it to be reused.
If ptr is NULL,
-.BR XtFree
+.B XtFree
returns immediately.
.LP
-.BR XtNew
+.B XtNew
returns a pointer to the allocated storage.
If there is insufficient memory to allocate the new block,
-.BR XtNew
+.B XtNew
calls
.BR XtErrorMsg .
-.BR XtNew
+.B XtNew
is a convenience macro that calls
-.BR XtMalloc
+.B XtMalloc
with the following arguments specified:
.LP
.RS .5i
+.ft CW
((type *) XtMalloc((unsigned) sizeof(type))
+.ft R
.RE
.LP
-.BR XtNewString
+.B XtNewString
returns a pointer to the allocated storage.
If there is insufficient memory to allocate the new block,
-.BR XtNewString
+.B XtNewString
calls
.BR XtErrorMsg .
-.BR XtNewString
+.B XtNewString
is a convenience macro that calls
-.BR XtMalloc
+.B XtMalloc
with the following arguments specified:
.LP
.RS .5i
+.ft CW
(strcpy(XtMalloc((unsigned) strlen(str) + 1), str))
+.ft R
.RE
.LP
The
-.BR XtAsprintf
+.B XtAsprintf
function allocates space for a string large enough to hold the string
specified by the sprintf(3c) format pattern when used with the remaining
arguments, and fills it with the formatted results.
The address of the allocated string is placed into the pointer passed as ret.
The length of the string (not including the terminating null byte) is returned.
If there is insufficient memory to allocate the new block,
-.BR XtAsprintf
+.B XtAsprintf
calls
.BR XtErrorMsg .
.SH "SEE ALSO"