rem: extern "C" _EXPORT BDataIO *init_transport(BMessage *msg) { if (msg != NULL && gTransport == NULL) { const char* printer_name = msg->FindString("printer_name"); if (printer_name && *printer_name != '\0') { BDirectory printer(printer_name); if (printer.InitCheck() == B_OK) { gTransport = instanciate_transport(&printer, msg); return gTransport; } } }
add: extern "C" _EXPORT BDataIO *init_transport(BMessage *msg) { if (msg == NULL || gTransport != NULL) return NULL;  const char *spool_path = msg->FindString("printer_file");  if (spool_path && *spool_path != '\0') { BDirectory printer(spool_path);  if (printer.InitCheck() == B_OK) { gTransport = instanciate_transport(&printer, msg); return gTransport; }; };
context: extern "C" _EXPORT BDataIO *init_transport(BMessage *msg) {	if (msg != NULL && gTransport == NULL) {		const char* printer_name = msg->FindString("printer_name");		if (printer_name && *printer_name != '\0') {			BDirectory printer(printer_name);			if (printer.InitCheck() == B_OK) {				gTransport = instanciate_transport(&printer, msg);				return gTransport;			}		}	}	return NULL;}