Skip to content

Commit 733456f

Browse files
committed
doc pntrAddElement
1 parent 8ba2356 commit 733456f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/mmdata.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,23 @@ long pntrRevInstr(long start_position, const pntrString *string1,
849849
flag pntrEq(const pntrString *sout, const pntrString *sin);
850850

851851
/* Add a single null string element to a pntrString - faster than pntrCat */
852+
/*!
853+
* \fn temp_pntrString *pntrAddElement(const pntrString *g)
854+
* \param[in] g points to the first element of a NULL terminated array in a
855+
* \ref block.
856+
* \return a copy of \p g, the terminal NULL replaced with a \ref vstring ""
857+
* followed by NULL.
858+
* \attention
859+
* - the pointers in \p g are copied to the result. If some of them
860+
* reference allocated memory, check for possible double free, for example.
861+
* - a pointer to constant data is padded to the right. The refernced memory
862+
* must not be overwritten.
863+
* \post
864+
* - the elements of \p g are duplicated.
865+
* - a pointer to a NUL byte ("") constant is padded to the right. Make sure
866+
* the referenced memory is never overwritten.
867+
* \bug a pointer to constant data is added as a writeable void*.
868+
*/
852869
temp_pntrString *pntrAddElement(const pntrString *g);
853870

854871
/* Add a single null pntrString element to a pntrString - faster than pntrCat */

0 commit comments

Comments
 (0)