CloseBindery
Closes the bindery (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWCloseBindery)
#include <\nlm\nit\nwbindry.h>
int CloseBindery (void);
The bindery files are normally kept open and locked so that they cannot be directly accessed. bindery files need to be closed when archiving or restoring.
While the bindery is closed, most functions of the network are disabled. Therefore, the time that the bindery is closed should be kept to a minimum.
Only the supervisor or a bindery object that is security-equivalent to the supervisor can close the bindery.
If an application closes the bindery, an open bindery needs to follow before an end-of-job (EOJ) occurs. This is because most functions of the network are disabled after a bindery is closed and that can include being able to run another application to reopen the bindery.
#include <stdio.h>
#include <\nlm\nit\nwbindry.h>
main()
{
int completionCode;
/*
NOTE: When the bindery is closed, most network functions
are disabled. Use the CloseBindery function with care.
Also, be sure to call OpenBindery before an endofjob
(EOJ) occurs.
*/
completionCode = CloseBindery ();
printf ("completionCode = %d\n", completionCode);
/*
At this point, perform the steps you need (such as backing
up a networked system); then reopen the bindery before an
endofjob (EOJ) occurs.
*/
completionCode = OpenBindery ();
printf ("completionCode from Open bindery = %d\n", completionCode);
}