home *** CD-ROM | disk | FTP | other *** search
-
-
-
- XXXXttttMMMMaaaalllllllloooocccc((((3333XXXXtttt)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666)))) XXXXttttMMMMaaaalllllllloooocccc((((3333XXXXtttt))))
-
-
-
- NNNNAAAAMMMMEEEE
- XtMalloc, XtCalloc, XtRealloc, XtFree, XtNew, XtNewString -
- memory management functions
-
- SSSSYYYYNNNNTTTTAAAAXXXX
- char *XtMalloc(_s_i_z_e);
- Cardinal _s_i_z_e;
-
- char *XtCalloc(_n_u_m, _s_i_z_e);
- Cardinal _n_u_m;
- Cardinal _s_i_z_e;
-
- char *XtRealloc(_p_t_r, _n_u_m);
- char *_p_t_r;
- Cardinal _n_u_m;
-
- void XtFree(_p_t_r);
- char *_p_t_r;
-
- _t_y_p_e *XtNew(_t_y_p_e);
- _t_y_p_e;
-
- String XtNewString(_s_t_r_i_n_g);
- String _s_t_r_i_n_g;
-
- AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
- _n_u_m Specifies the number of bytes or array elements.
-
- _p_t_r Specifies a pointer to the old storage or to the
- block of storage that is to be freed.
-
- _s_i_z_e Specifies the size of an array element (in bytes)
- or the number of bytes desired.
-
- _s_t_r_i_n_g Specifies a previously declared string.
-
- _t_y_p_e Specifies a previously declared data type.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The _X_t_M_a_l_l_o_c 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, _X_t_M_a_l_l_o_c
- calls _X_t_E_r_r_o_r_M_s_g.
-
- The _X_t_C_a_l_l_o_c 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, _X_t_C_a_l_l_o_c calls _X_t_E_r_r_o_r_M_s_g.
-
- The _X_t_R_e_a_l_l_o_c 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
-
-
-
- Page 1 (printed 10/3/02)
-
-
-
-
-
-
- XXXXttttMMMMaaaalllllllloooocccc((((3333XXXXtttt)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666)))) XXXXttttMMMMaaaalllllllloooocccc((((3333XXXXtttt))))
-
-
-
- frees the old block. If there is insufficient memory to
- allocate the new block, _X_t_R_e_a_l_l_o_c calls _X_t_E_r_r_o_r_M_s_g. If ptr
- is NULL, _X_t_R_e_a_l_l_o_c allocates the new storage without copying
- the old contents; that is, it simply calls _X_t_M_a_l_l_o_c.
-
- The _X_t_F_r_e_e function returns storage and allows it to be
- reused. If ptr is NULL, _X_t_F_r_e_e returns immediately.
-
- _X_t_N_e_w returns a pointer to the allocated storage. If there
- is insufficient memory to allocate the new block, _X_t_N_e_w
- calls _X_t_E_r_r_o_r_M_s_g. _X_t_N_e_w is a convenience macro that calls
- _X_t_M_a_l_l_o_c with the following arguments specified:
-
- ((type *) XtMalloc((unsigned) sizeof(type))
-
- _X_t_N_e_w_S_t_r_i_n_g returns a pointer to the allocated storage. If
- there is insufficient memory to allocate the new block,
- _X_t_N_e_w_S_t_r_i_n_g calls _X_t_E_r_r_o_r_M_s_g. _X_t_N_e_w_S_t_r_i_n_g is a convenience
- macro that calls _X_t_M_a_l_l_o_c with the following arguments
- specified:
-
- (strcpy(XtMalloc((unsigned) strlen(str) + 1), str))
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- _X _T_o_o_l_k_i_t _I_n_t_r_i_n_s_i_c_s - _C _L_a_n_g_u_a_g_e _I_n_t_e_r_f_a_c_e
- _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 2 (printed 10/3/02)
-
-
-
-