mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-12-22 12:23:56 +01:00
Merge pull request #1 from v1j4y/patch-1
Added a delete function to clear the qmckl_context instance.
This commit is contained in:
commit
688411769f
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user