XtMalloc
NAMESYNTAX
ARGUMENTS
DESCRIPTION
SEE ALSO
NAME
XtMalloc, XtCalloc, XtRealloc, XtFree, XtNew, XtNewString − memory management functions
SYNTAX
char *XtMalloc(Cardinal size); |
||
char *XtCalloc(Cardinal num, Cardinal size); |
||
char *XtRealloc(char *ptr, Cardinal num); |
||
void XtFree(char *ptr); |
||
type *XtNew(type); |
||
String XtNewString(String string); |
ARGUMENTS
num |
Specifies the number of bytes or array elements. | ||
ptr |
Specifies a pointer to the old storage or to the block of storage that is to be freed. | ||
size |
Specifies the size of an array element (in bytes) or the number of bytes desired. | ||
string |
Specifies a previously declared string. | ||
type |
Specifies a previously declared data type. |
DESCRIPTION
The 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, XtMalloc calls XtErrorMsg.
The 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, XtCalloc calls XtErrorMsg.
The 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, XtRealloc calls XtErrorMsg. If ptr is NULL, XtRealloc allocates the new storage without copying the old contents; that is, it simply calls XtMalloc.
The XtFree function returns storage and allows it to be reused. If ptr is NULL, XtFree returns immediately.
XtNew returns a pointer to the allocated storage. If there is insufficient memory to allocate the new block, XtNew calls XtErrorMsg. XtNew is a convenience macro that calls XtMalloc with the following arguments specified:
((type *) XtMalloc((unsigned) sizeof(type))
XtNewString returns a pointer to the allocated storage. If there is insufficient memory to allocate the new block, XtNewString calls XtErrorMsg. XtNewString is a convenience macro that calls XtMalloc with the following arguments specified:
(strcpy(XtMalloc((unsigned) strlen(str) + 1), str))
SEE ALSO
X Toolkit
Intrinsics − C Language Interface
Xlib − C Language X Interface
More Linux Commands
manpages/redland-config.1.html
redland-config(1) - script to get information about the inst
redland-config is a tool that is used to determine the compile and linker flags that should be used to compile and link programs that use the Redland RDF librar
manpages/git-daemon.1.html
git-daemon(1) A really simple server for Git repositories...
A really simple TCP Git daemon that normally listens on port DEFAULT_GIT_PORT aka 9418. It waits for a connection asking for a service, and will serve that serv
manpages/tk_getSaveFile.n.html
tk_getSaveFile(n) - pop up a dialog box for the user to sele
The procedures tk_getOpenFile and tk_getSaveFile pop up a dialog box for the user to select a file to open or save. The tk_getOpenFile command is usually associ
manpages/TAP::Parser::Result::Version.3pm.html
TAP::Parser::Result::Version(3pm) - TAP syntax version token
This is a subclass of TAP::Parser::Result. A token of this class will be returned if a version line is encountered. TAP version 13 ok 1 not ok 2 The first versi
manpages/acl_copy_int.3.html
acl_copy_int(3) - copy an ACL from external to internal repr
The acl_copy_int() function copies an exportable, contiguous, persistent form of an ACL, pointed to by buf_p, to the internal representation. This function may
manpages/gnutls_pkcs12_bag_set_crt.3.html
gnutls_pkcs12_bag_set_crt(3) - API function - Linux man page
This function will insert the given certificate into the bag. This is just a wrapper over gnutls_pkcs12_bag_set_data(). RETURNS the index of the added bag on su
manpages/glTexCoord4fv.3gl.html
glTexCoord4fv(3gl) - set the current texture coordinates....
glTexCoord specifies texture coordinates in one, two, three, or four dimensions. glTexCoord1 sets the current texture coordinates to (s, 0, 0, 1); a call to glT
manpages/warnx.3.html
warnx(3) - formatted error messages - Linux manual page.....
The err() and warn() family of functions display a formatted error message on the standard error output. In all cases, the last component of the program name, a
manpages/XDeleteProperty.3.html
XDeleteProperty(3) - obtain and change window properties....
The XGetWindowProperty function returns the actual type of the property; the actual format of the property; the number of 8-bit, 16-bit, or 32-bit items transfe
manpages/setaliasent.3.html
setaliasent(3) - read an alias entry - Linux manual page....
One of the databases available with the Name Service Switch (NSS) is the aliases database, that contains mail aliases. (To find out which databases are supporte
manpages/urandom.4.html
urandom(4) - kernel random number source devices (Man Page)
The character special files /dev/random and /dev/urandom (present since Linux 1.3.30) provide an interface to the kernels random number generator. File /dev/ran
manpages/XwcTextPropertyToTextList.3.html
XwcTextPropertyToTextList(3) - convert text lists and text p
The XmbTextListToTextProperty, XwcTextListToTextProperty and Xutf8TextListToTextProperty functions set the specified XTextProperty value to a set of null-separa
