xref: /haiku/src/add-ons/print/transports/lpr/Lpr.cpp (revision 1214ef1b2100f2b3299fc9d8d6142e46f70a4c3f)
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 	if (msg)
30 		msg->what = 'okok';
31 
32 	DBGMSG(("< init_transport\n"));
33 	return transport;
34 }
35