FreeBASIC  0.91.0
dev_lpt_close.c
Go to the documentation of this file.
1 /* LPTx device */
2 
3 #include "fb.h"
4 
6 {
7  int res;
8  DEV_LPT_INFO *devInfo;
9 
10  FB_LOCK();
11 
12  devInfo = (DEV_LPT_INFO*) handle->opaque;
13  if( devInfo->uiRefCount==1 ) {
14 
15  res = fb_PrinterClose( devInfo );
16 
17  if( res==FB_RTERROR_OK ) {
18  free(devInfo->pszDevice);
19  free(devInfo);
20  }
21 
22  } else {
23  --devInfo->uiRefCount;
25  }
26 
27  FB_UNLOCK();
28 
29  return res;
30 }