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

@ -482,8 +482,8 @@ struct Backend {
const BackendVtable *vt;
};
struct BackendVtable {
const char *(*init) (Seat *seat, Backend **backend_out,
LogContext *logctx, Conf *conf,
const char *(*init) (const BackendVtable *vt, Seat *seat,
Backend **backend_out, LogContext *logctx, Conf *conf,
const char *host, int port,
char **realhost, bool nodelay, bool keepalive);
@ -525,7 +525,7 @@ struct BackendVtable {
static inline const char *backend_init(
const BackendVtable *vt, Seat *seat, Backend **out, LogContext *logctx,
Conf *conf, const char *host, int port, char **rhost, bool nd, bool ka)
{ return vt->init(seat, out, logctx, conf, host, port, rhost, nd, ka); }
{ return vt->init(vt, seat, out, logctx, conf, host, port, rhost, nd, ka); }
static inline void backend_free(Backend *be)
{ be->vt->free(be); }
static inline void backend_reconfig(Backend *be, Conf *conf)