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

Support for Windows PuTTY connecting straight to a local serial port

in place of making a network connection. This has involved a couple
of minor infrastructure changes:
 - New dlg_label_change() function in the dialog.h interface, which
   alters the label on a control. Only used, at present, to switch
   the Host Name and Port boxes into Serial Line and Speed, which
   means that any platform not implementing serial connections (i.e.
   currently all but Windows) does not need to actually do anything
   in this function. Yet.
 - New small piece of infrastructure: cfg_launchable() determines
   whether a Config structure describes a session ready to be
   launched. This was previously determined by seeing if it had a
   non-empty host name, but it has to check the serial line as well
   so there's a centralised function for it. I haven't gone through
   all front ends and arranged for this function to be used
   everywhere it needs to be; so far I've only checked Windows.
 - Similarly, cfg_dest() returns the destination of a connection
   (host name or serial line) in a text format suitable for putting
   into messages such as `Unable to connect to %s'.

[originally from svn r6815]
This commit is contained in:
Simon Tatham
2006-08-28 10:35:12 +00:00
parent 38f003dbe9
commit 34f747421d
23 changed files with 1056 additions and 43 deletions

20
misc.c
View File

@ -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;
}