1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -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

@ -279,10 +279,10 @@ static const char *serial_configure(Serial *serial, 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, char **realhost,
bool nodelay, bool keepalive)
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;
const char *err;
@ -292,7 +292,7 @@ static const char *serial_init(Seat *seat, Backend **backend_handle,
seat_set_trust_status(seat, false);
serial = snew(Serial);
serial->backend.vt = &serial_backend;
serial->backend.vt = vt;
*backend_handle = &serial->backend;
serial->seat = seat;