/* Ultra-safe dummy for serialport on QNX - no reliance on internal types */

#include "dosbox.h"
#include "programs.h"

/* Forward declare the opaque type */
typedef void* _COMPORT;

/* Globals */
void* serialports[4] = {nullptr, nullptr, nullptr, nullptr};  /* use void* instead of CSerial* */
bool serialMouseEmulated = false;

/* Serial functions */
Bitu SERIAL_ProgramStart(Program** /*make*/) { return 0; }
void SERIAL_Init() {}
void SERIAL_EventHandler_PIC_Event(Bitu /*val*/) {}

void BIOS_Post_register_comports() {}
void BIOS_Post_register_comports_PNP() {}
int bios_post_comport_count() { return 0; }

void on_mouse_event_for_serial(int /*dx*/, int /*dy*/, unsigned char /*button*/) {}
void runSerial(const char* /*command*/) {}

/* Platform stubs */
int SERIAL_open(const char* /*port*/, _COMPORT** /*comport*/) { return 0; }
void SERIAL_close(_COMPORT* /*comport*/) {}
void SERIAL_setCommParameters(_COMPORT* /*comport*/, int, char, int, int) {}
int SERIAL_sendchar(_COMPORT* /*comport*/, char) { return 0; }
int SERIAL_getchar(_COMPORT* /*comport*/, unsigned char*, unsigned char*, bool, unsigned long) { return 0; }

/* Stub the CSerial methods that are called directly */
namespace {
    struct DummyCSerial {
        bool Putchar(uint8_t, bool, bool, Bitu) { return false; }
        bool Getchar(uint8_t*, uint8_t*, bool, Bitu) { return false; }
    };
}

DummyCSerial dummy_serial_instance;   /* not used, just to satisfy linker if needed */
