diff --git a/src/qmckl_context.org b/src/qmckl_context.org index 5d1f510..b24f7f0 100644 --- a/src/qmckl_context.org +++ b/src/qmckl_context.org @@ -90,6 +90,27 @@ qmckl_context qmckl_context_copy(const qmckl_context context) { } #+END_SRC +** =qmckl_context_destroy= + + To delete a new context, use =qmckl_context_destroy()=. If the deletion + failed, the function returns =0=. On success, the function returns =1= + implying that the context has been freed. + + #+BEGIN_SRC C :tangle qmckl_context.h +qmckl_context qmckl_context_destroy(qmckl_context context); + #+END_SRC + + #+BEGIN_SRC C :tangle qmckl_context.c +qmckl_context qmckl_context_destroy(qmckl_context context) { + + if (context == NULL) { + return (qmckl_context) 0; + } + + free(context); + return (qmckl_context) 1; +} + #+END_SRC * Precision