STRING: provide function for deleting strings
This commit is contained in:
parent
4dbfe1e663
commit
ff3967f932
@ -37,7 +37,8 @@ endif
|
||||
LIBS += -L. -lgmp -lmpfr -lm
|
||||
|
||||
# objects
|
||||
PQC_OBJS = poly.o mem.o encrypt.o decrypt.o keypair.o ascii_poly.o file.o
|
||||
PQC_OBJS = poly.o mem.o encrypt.o decrypt.o keypair.o ascii_poly.o file.o \
|
||||
ntru_string.o
|
||||
PQC_HEADERS = err.h poly.h context.h encrypt.h decrypt.h keypair.h \
|
||||
ascii_poly.h common.h file.h ntru_string.h
|
||||
# CUNIT_OBJS = cunit.o
|
||||
|
@ -25,3 +25,13 @@
|
||||
* like C strings and provides operations on it.
|
||||
* @brief string type and operations
|
||||
*/
|
||||
|
||||
#include "ntru_string.h"
|
||||
|
||||
|
||||
void
|
||||
string_delete(string *del_string)
|
||||
{
|
||||
free(del_string->ptr);
|
||||
free(del_string);
|
||||
}
|
||||
|
@ -51,4 +51,16 @@ struct string {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Delete the inner structure
|
||||
* of the string and frees the string
|
||||
* itself from the heap. Must not be
|
||||
* called on stack variables.
|
||||
*
|
||||
* @param del_string the string to delete
|
||||
*/
|
||||
void
|
||||
string_delete(string *del_string);
|
||||
|
||||
|
||||
#endif /* NTRU_STRING_H */
|
||||
|
Loading…
Reference in New Issue
Block a user