Beispiel #1
0
/**
 * \ingroup Core_Print
 *
 * ops_text_free() frees the memory used by an ops_text_t structure
 *
 * \param text Pointer to a previously allocated structure. This structure and its contents will be freed.
 */
void ops_text_free(ops_text_t *text)
    {
    /* Strings in "known" array will be constants, so don't free them */
    list_free(&text->known);

    /* Strings in "unknown" array will be dynamically allocated, so do free them */
    list_free_strings(&text->unknown);
    list_free(&text->unknown);

    /* finally, free the text structure itself */
    free(text);
    }
Beispiel #2
0
/**
 * \ingroup Core_Print
 *
 * pgp_text_free() frees the memory used by an pgp_text_t structure
 *
 * \param text Pointer to a previously allocated structure. This structure and its contents will be freed.
 */
void
pgp_text_free(pgp_text_t *text)
{
	/* Strings in "known" array will be constants, so don't free them */
	list_free(&text->known);

	/*
	 * Strings in "unknown" array will be dynamically allocated, so do
	 * free them
	 */
	list_free_strings(&text->unknown);
	list_free(&text->unknown);

	free(text);
}