diff --git a/src/qmckl_context.org b/src/qmckl_context.org index 1aba050..f2f8951 100644 --- a/src/qmckl_context.org +++ b/src/qmckl_context.org @@ -90,6 +90,27 @@ qmckl_context qmckl_context_copy(qmckl_context context) { } #+END_SRC +** =qmckl_context_delete= + + To delete a new context, use =qmckl_context_delete()=. 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_delete(qmckl_context context); + #+END_SRC + + #+BEGIN_SRC C :tangle qmckl_context.c +qmckl_context qmckl_context_delete(qmckl_context context) { + + if (context == NULL) { + return (qmckl_context) 0; + } + + free(context); + return (qmckl_context) 1; +} + #+END_SRC * Precision