summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-01-12 23:09:29 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-01-12 23:09:29 -0800
commitac07da253415ccb8b6322feedf7969967357050e (patch)
tree20bdac2612a5ca5ee04d6e51669e71b4c60d09f1 /man
parent84f73c49db8071c06f27609ce7cc7a32a17351a9 (diff)
Add XtAsprintf() as a new exported API
Like asprintf() but using XtMalloc() to tie into the Xt memory allocation and error handling subsystems. Bumps libXt version to 1.0.99.1 so that modules can set their pkg-config dependency to libXt >= 1.0.99.1 to require XtAsprintf(). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'man')
-rw-r--r--man/Makefile.am3
-rw-r--r--man/XtAsprintf.man1
-rw-r--r--man/XtMalloc.man18
3 files changed, 21 insertions, 1 deletions
diff --git a/man/Makefile.am b/man/Makefile.am
index 005c2d5..305598d 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -330,7 +330,8 @@ XtMalloc_shadows = \
XtRealloc \
XtFree \
XtNew \
- XtNewString
+ XtNewString \
+ XtAsprintf
XtManageChildren_shadows = \
XtManageChild \
diff --git a/man/XtAsprintf.man b/man/XtAsprintf.man
new file mode 100644
index 0000000..50eaf76
--- /dev/null
+++ b/man/XtAsprintf.man
@@ -0,0 +1 @@
+.so man__libmansuffix__/XtMalloc.__libmansuffix__
diff --git a/man/XtMalloc.man b/man/XtMalloc.man
index 396218b..70183ec 100644
--- a/man/XtMalloc.man
+++ b/man/XtMalloc.man
@@ -139,6 +139,8 @@ void XtFree(char *\fIptr\fP);
\fItype\fP *XtNew(\fItype\fP);
.HP
String XtNewString(String \fIstring\fP);
+.HP
+Cardinal XtAsprintf(String *\fInew_string\fP, const char *\fIformat\fP, ...);
.SH ARGUMENTS
.IP \fInum\fP 1i
Specifies the number of bytes or array elements.
@@ -152,6 +154,10 @@ desired.
Specifies a previously declared string.
.IP \fItype\fP 1i
Specifies a previously declared data type.
+.IP \fInew_string\fP 1i
+Specifies a pointer to write a newly allocated string to.
+.IP \fIformat\fP 1i
+Specifies a formatting string as defined by sprintf(3c)
.SH DESCRIPTION
The
.ZN XtMalloc
@@ -226,6 +232,18 @@ with the following arguments specified:
.ta .5i
(strcpy(XtMalloc((unsigned) strlen(str) + 1), str))
.De
+.LP
+The
+.ZN 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,
+.ZN XtAsprintf
+calls
+.ZN XtErrorMsg .
.SH "SEE ALSO"
.br
\fI\*(xT\fP