1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-28 01:07:08 -05:00

Move SessionSpecial definitions into their own header.

This will allow me to re-include it elsewhere, to make an array of the
specials' names for diagnostic purposes.
This commit is contained in:
Simon Tatham 2023-03-04 12:56:24 +00:00
parent b5645f79dd
commit fd43ff6e27
2 changed files with 57 additions and 53 deletions

58
putty.h
View File

@ -296,59 +296,11 @@ void init_ucs_generic(Conf *conf, struct unicode_data *ucsdata);
* session, separately from the byte stream of ordinary session data.
*/
typedef enum {
/*
* Commands that are generally useful in multiple backends.
*/
SS_BRK, /* serial-line break */
SS_EOF, /* end-of-file on session input */
SS_NOP, /* transmit data with no effect */
SS_PING, /* try to keep the session alive (probably, but not
* necessarily, implemented as SS_NOP) */
/*
* Commands specific to Telnet.
*/
SS_AYT, /* Are You There */
SS_SYNCH, /* Synch */
SS_EC, /* Erase Character */
SS_EL, /* Erase Line */
SS_GA, /* Go Ahead */
SS_ABORT, /* Abort Process */
SS_AO, /* Abort Output */
SS_IP, /* Interrupt Process */
SS_SUSP, /* Suspend Process */
SS_EOR, /* End Of Record */
SS_EOL, /* Telnet end-of-line sequence (CRLF, as opposed to CR
* NUL that escapes a literal CR) */
/*
* Commands specific to SSH.
*/
SS_REKEY, /* trigger an immediate repeat key exchange */
SS_XCERT, /* cross-certify another host key ('arg' indicates which) */
/*
* Send a POSIX-style signal. (Useful in SSH and also pterm.)
*
* We use the master list in ssh/signal-list.h to define these enum
* values, which will come out looking like names of the form
* SS_SIGABRT, SS_SIGINT etc.
*/
#define SIGNAL_MAIN(name, text) SS_SIG ## name,
#define SIGNAL_SUB(name) SS_SIG ## name,
#include "ssh/signal-list.h"
#undef SIGNAL_MAIN
#undef SIGNAL_SUB
/*
* These aren't really special commands, but they appear in the
* enumeration because the list returned from
* backend_get_specials() will use them to specify the structure
* of the GUI specials menu.
*/
SS_SEP, /* Separator */
SS_SUBMENU, /* Start a new submenu with specified name */
SS_EXITMENU, /* Exit current submenu, or end of entire specials list */
/* The list of enum constants is defined in a separate header so
* they can be reused in other contexts */
#define SPECIAL(x) SS_ ## x,
#include "specials.h"
#undef SPECIAL
} SessionSpecialCode;
/*

52
specials.h Normal file
View File

@ -0,0 +1,52 @@
/*
* Commands that are generally useful in multiple backends.
*/
SPECIAL(BRK) /* serial-line break */
SPECIAL(EOF) /* end-of-file on session input */
SPECIAL(NOP) /* transmit data with no effect */
SPECIAL(PING) /* try to keep the session alive (probably, but not
* necessarily, implemented as SS_NOP) */
/*
* Commands specific to Telnet.
*/
SPECIAL(AYT) /* Are You There */
SPECIAL(SYNCH) /* Synch */
SPECIAL(EC) /* Erase Character */
SPECIAL(EL) /* Erase Line */
SPECIAL(GA) /* Go Ahead */
SPECIAL(ABORT) /* Abort Process */
SPECIAL(AO) /* Abort Output */
SPECIAL(IP) /* Interrupt Process */
SPECIAL(SUSP) /* Suspend Process */
SPECIAL(EOR) /* End Of Record */
SPECIAL(EOL) /* Telnet end-of-line sequence (CRLF, as opposed to
* CR NUL that escapes a literal CR) */
/*
* Commands specific to SSH.
*/
SPECIAL(REKEY) /* trigger an immediate repeat key exchange */
SPECIAL(XCERT) /* cross-certify another host key ('arg' indicates which) */
/*
* Send a POSIX-style signal. (Useful in SSH and also pterm.)
*
* We use the master list in ssh/signal-list.h to define these enum
* values, which will come out looking like names of the form
* SS_SIGABRT, SS_SIGINT etc.
*/
#define SIGNAL_MAIN(name, text) SPECIAL(SIG ## name)
#define SIGNAL_SUB(name) SPECIAL(SIG ## name)
#include "ssh/signal-list.h"
#undef SIGNAL_MAIN
#undef SIGNAL_SUB
/*
* These aren't really special commands, but they appear in the
* enumeration because the list returned from backend_get_specials()
* will use them to specify the structure of the GUI specials menu.
*/
SPECIAL(SEP) /* Separator */
SPECIAL(SUBMENU) /* Start a new submenu with specified name */
SPECIAL(EXITMENU) /* Exit current submenu, or end of entire specials list */