1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00
putty-source/psocks.h
Simon Tatham 3d34007889 Remove a couple of double-typedefs.
Experimenting with different compile flags pointed out two instances
of typedefing the same name twice (though benignly, with the same
definition as well). PsocksDataSink was typedefed a couple of lines
above its struct definition and then again _with_ its struct
definition; cliloop_continue_t was typedefed in unix/platform.h and
didn't need defining again in unix/psocks.c.
2023-08-27 10:45:54 +01:00

29 lines
827 B
C

typedef struct psocks_state psocks_state;
typedef struct PsocksPlatform PsocksPlatform;
typedef struct PsocksDataSink PsocksDataSink;
/* indices into PsocksDataSink arrays */
typedef enum PsocksDirection { UP, DN } PsocksDirection;
struct PsocksDataSink {
void (*free)(PsocksDataSink *);
BinarySink *s[2];
};
static inline void pds_free(PsocksDataSink *pds)
{ pds->free(pds); }
PsocksDataSink *pds_stdio(FILE *fp[2]);
struct PsocksPlatform {
PsocksDataSink *(*open_pipes)(
const char *cmd, const char *const *direction_args,
const char *index_arg, char **err);
void (*start_subcommand)(strbuf *args);
};
psocks_state *psocks_new(const PsocksPlatform *);
void psocks_free(psocks_state *ps);
void psocks_cmdline(psocks_state *ps, int argc, char **argv);
void psocks_start(psocks_state *ps);