152a38012Sejakowatz // Sun, 18 Jun 2000 252a38012Sejakowatz // Y.Takagi 352a38012Sejakowatz 452a38012Sejakowatz #include "LprTransport.h" 552a38012Sejakowatz #include "DbgMsg.h" 652a38012Sejakowatz 752a38012Sejakowatz 8*3d9c7baaSMichael Pfeiffer static LprTransport *gTransport = NULL; 9*3d9c7baaSMichael Pfeiffer 10*3d9c7baaSMichael Pfeiffer 11*3d9c7baaSMichael Pfeiffer extern "C" void exit_transport()12*3d9c7baaSMichael Pfeifferexit_transport() 1352a38012Sejakowatz { 1452a38012Sejakowatz DBGMSG(("> exit_transport\n")); 15*3d9c7baaSMichael Pfeiffer delete gTransport; 16*3d9c7baaSMichael Pfeiffer gTransport = NULL; 1752a38012Sejakowatz DBGMSG(("< exit_transport\n")); 1852a38012Sejakowatz } 1952a38012Sejakowatz 20*3d9c7baaSMichael Pfeiffer 21*3d9c7baaSMichael Pfeiffer extern "C" BDataIO * init_transport(BMessage * msg)22*3d9c7baaSMichael Pfeifferinit_transport(BMessage *msg) 2352a38012Sejakowatz { 2452a38012Sejakowatz DBGMSG(("> init_transport\n")); 2552a38012Sejakowatz 26*3d9c7baaSMichael Pfeiffer gTransport = new LprTransport(msg); 2752a38012Sejakowatz 28*3d9c7baaSMichael Pfeiffer if (gTransport->fail()) { 2952a38012Sejakowatz exit_transport(); 3052a38012Sejakowatz } 3152a38012Sejakowatz 32bc333ea2SPhilippe Houdoin if (msg) 33bc333ea2SPhilippe Houdoin msg->what = 'okok'; 34bc333ea2SPhilippe Houdoin 3552a38012Sejakowatz DBGMSG(("< init_transport\n")); 36*3d9c7baaSMichael Pfeiffer return gTransport; 3752a38012Sejakowatz } 38