X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/5dd29cf7f83b5dd9aa2c87898e7ea57abdf99a3e..7374c7790ee32f36855e4257eb15d2fe43e277ea:/misc.c diff --git a/misc.c b/misc.c index 37ac0a18..09506de2 100644 --- a/misc.c +++ b/misc.c @@ -625,3 +625,23 @@ void debug_memdump(void *buf, int len, int L) } #endif /* def DEBUG */ + +/* + * Determine whether or not a Config structure represents a session + * which can sensibly be launched right now. + */ +int cfg_launchable(const Config *cfg) +{ + if (cfg->protocol == PROT_SERIAL) + return cfg->serline[0] != 0; + else + return cfg->host[0] != 0; +} + +char const *cfg_dest(const Config *cfg) +{ + if (cfg->protocol == PROT_SERIAL) + return cfg->serline; + else + return cfg->host; +}