1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Pass the BackendVtable pointer to backend_init.

Now I can have multiple BackendVtable structures sharing all their
function pointers, and still tell which is which when init is setting
things up.
This commit is contained in:
Simon Tatham
2020-02-16 11:43:20 +00:00
parent 91c2e6b4d5
commit 0a09c12edc
9 changed files with 50 additions and 47 deletions

View File

@ -191,9 +191,9 @@ static const char *serial_configure(Serial *serial, HANDLE serport, Conf *conf)
* Also places the canonical host name into `realhost'. It must be
* freed by the caller.
*/
static const char *serial_init(Seat *seat, Backend **backend_handle,
LogContext *logctx, Conf *conf,
const char *host, int port,
static const char *serial_init(const BackendVtable *vt, Seat *seat,
Backend **backend_handle, LogContext *logctx,
Conf *conf, const char *host, int port,
char **realhost, bool nodelay, bool keepalive)
{
Serial *serial;
@ -209,7 +209,7 @@ static const char *serial_init(Seat *seat, Backend **backend_handle,
serial->out = serial->in = NULL;
serial->bufsize = 0;
serial->break_in_progress = false;
serial->backend.vt = &serial_backend;
serial->backend.vt = vt;
*backend_handle = &serial->backend;
serial->seat = seat;