xref: /haiku/src/add-ons/print/transports/lpr/Lpr.cpp (revision 51978af14a173e7fae0563b562be5603bc652aeb)
1 // Sun, 18 Jun 2000
2 // Y.Takagi
3 
4 #include "LprTransport.h"
5 #include "DbgMsg.h"
6 
7 LprTransport *transport = NULL;
8 
9 extern "C" _EXPORT void exit_transport()
10 {
11 	DBGMSG(("> exit_transport\n"));
12 	if (transport) {
13 		delete transport;
14 		transport = NULL;
15 	}
16 	DBGMSG(("< exit_transport\n"));
17 }
18 
19 extern "C" _EXPORT BDataIO *init_transport(BMessage *msg)
20 {
21 	DBGMSG(("> init_transport\n"));
22 
23 	transport = new LprTransport(msg);
24 
25 	if (transport->fail()) {
26 		exit_transport();
27 	}
28 
29 	DBGMSG(("< init_transport\n"));
30 	return transport;
31 }
32