diff --git a/misc.c b/misc.c index 25ed8636..4e8764fb 100644 --- a/misc.c +++ b/misc.c @@ -1258,7 +1258,6 @@ bool strendswith(const char *s, const char *t) char *buildinfo(const char *newline) { strbuf *buf = strbuf_new(); - extern const char commitid[]; /* in commitid.c */ strbuf_catf(buf, "Build platform: %d-bit %s", (int)(CHAR_BIT * sizeof(void *)), diff --git a/putty.h b/putty.h index fdef2801..0f4ab6db 100644 --- a/putty.h +++ b/putty.h @@ -1709,6 +1709,7 @@ void ser_setup_config_box(struct controlbox *b, bool midsession, * Exports from version.c. */ extern const char ver[]; +extern const char commitid[]; /* * Exports from unicode.c. @@ -1853,6 +1854,9 @@ void conf_filesel_handler(union control *ctrl, dlgparam *dlg, void *data, int event); void conf_fontsel_handler(union control *ctrl, dlgparam *dlg, void *data, int event); +/* Much more special-purpose function needed by sercfg.c */ +void config_protocolbuttons_handler(union control *, dlgparam *, void *, int); + void setup_config_box(struct controlbox *b, bool midsession, int protocol, int protcfginfo); diff --git a/sercfg.c b/sercfg.c index 2c1682f5..a5a3e3f4 100644 --- a/sercfg.c +++ b/sercfg.c @@ -132,8 +132,6 @@ void ser_setup_config_box(struct controlbox *b, bool midsession, if (!midsession) { int i; - extern void config_protocolbuttons_handler(union control *, dlgparam *, - void *, int); /* * Add the serial back end to the protocols list at the diff --git a/ssh.h b/ssh.h index c657bca4..da98b7c8 100644 --- a/ssh.h +++ b/ssh.h @@ -185,6 +185,12 @@ void share_setup_x11_channel(ssh_sharing_connstate *cs, share_channel *chan, int protomajor, int protominor, const void *initial_data, int initial_len); +/* Per-application overrides for what roles we can take in connection + * sharing, regardless of user configuration (e.g. pscp will never be + * an upstream) */ +extern const bool share_can_be_downstream; +extern const bool share_can_be_upstream; + struct X11Display; struct X11FakeAuth; @@ -418,6 +424,8 @@ struct ec_point { bool infinity; }; +/* A couple of ECC functions exported for use outside sshecc.c */ +struct ec_point *ecp_mul(const struct ec_point *a, const Bignum b); void ec_point_free(struct ec_point *point); /* Weierstrass form curve */ diff --git a/ssh2connection.c b/ssh2connection.c index 0be08aa6..f1135309 100644 --- a/ssh2connection.c +++ b/ssh2connection.c @@ -325,13 +325,6 @@ static bool ssh2_connection_filter_queue(struct ssh2_connection_state *s) ChanopenResult chanopen_result; PacketProtocolLayer *ppl = &s->ppl; /* for ppl_logevent */ - /* Cross-reference to ssh2transport.c to handle the common packets - * between login and connection: DISCONNECT, DEBUG and IGNORE. If - * we have an instance of ssh2transport below us, then those - * messages won't come here anyway, but they could if we're - * running in bare ssh2-connection mode. */ - extern bool ssh2_common_filter_queue(PacketProtocolLayer *ppl); - while (1) { if (ssh2_common_filter_queue(&s->ppl)) return true; diff --git a/sshecdsag.c b/sshecdsag.c index 7523fa7a..09d2eba3 100644 --- a/sshecdsag.c +++ b/sshecdsag.c @@ -4,9 +4,6 @@ #include "ssh.h" -/* Forward reference from sshecc.c */ -struct ec_point *ecp_mul(const struct ec_point *a, const Bignum b); - int ec_generate(struct ec_key *key, int bits, progfn_t pfn, void *pfnparam) { diff --git a/sshppl.h b/sshppl.h index 5069f871..80be9d14 100644 --- a/sshppl.h +++ b/sshppl.h @@ -134,6 +134,13 @@ void ssh_ppl_user_output_string_and_free(PacketProtocolLayer *ppl, char *text); ptrlen ssh2_transport_get_session_id(PacketProtocolLayer *ssh2_transport_ptr); void ssh2_transport_notify_auth_done(PacketProtocolLayer *ssh2_transport_ptr); +/* Shared method between ssh2 layers (defined in ssh2transport.c) to + * handle the common packets between login and connection: DISCONNECT, + * DEBUG and IGNORE. Those messages are handled by the ssh2transport + * layer if we have one, but in bare ssh2-connection mode they have to + * be handled by ssh2connection. */ +bool ssh2_common_filter_queue(PacketProtocolLayer *ppl); + /* Methods for ssh1login to pass protocol flags to ssh1connection */ void ssh1_connection_set_protoflags( PacketProtocolLayer *ppl, int local, int remote); diff --git a/sshrand.c b/sshrand.c index 63211693..cde35eef 100644 --- a/sshrand.c +++ b/sshrand.c @@ -9,9 +9,6 @@ /* Collect environmental noise every 5 minutes */ #define NOISE_REGULAR_INTERVAL (5*60*TICKSPERSEC) -void noise_get_heavy(void (*func) (void *, int)); -void noise_get_light(void (*func) (void *, int)); - /* * `pool' itself is a pool of random data which we actually use: we * return bytes from `pool', at position `poolpos', until `poolpos' diff --git a/sshshare.c b/sshshare.c index 48a0ca36..664a622e 100644 --- a/sshshare.c +++ b/sshshare.c @@ -1968,11 +1968,6 @@ static int share_listen_accepting(Plug *plug, return 0; } -/* Per-application overrides for what roles we can take (e.g. pscp - * will never be an upstream) */ -extern const bool share_can_be_downstream; -extern const bool share_can_be_upstream; - /* * Decide on the string used to identify the connection point between * upstream and downstream (be it a Windows named pipe or a diff --git a/terminal.c b/terminal.c index ae0f3917..013fcbc2 100644 --- a/terminal.c +++ b/terminal.c @@ -1051,7 +1051,6 @@ static void null_line_error(Terminal *term, int y, int lineno, tree234 *whichtree, int treeindex, const char *varname) { - extern const char commitid[]; /* in version.c */ modalfatalbox("%s==NULL in terminal.c\n" "lineno=%d y=%d w=%d h=%d\n" "count(scrollback=%p)=%d\n" diff --git a/unix/gtkapp.c b/unix/gtkapp.c index 70dc7d3c..e7f49df5 100644 --- a/unix/gtkapp.c +++ b/unix/gtkapp.c @@ -107,8 +107,6 @@ void session_window_closed(void) {} void window_setup_error(const char *errmsg) {} #else /* GTK_CHECK_VERSION(3,0,0) */ -extern const bool use_event_log; - static void startup(GApplication *app, gpointer user_data) { GMenu *menubar, *menu, *section; @@ -216,7 +214,6 @@ GtkWidget *make_gtk_toplevel_window(GtkFrontend *frontend) void launch_duplicate_session(Conf *conf) { - extern const bool dup_check_launchable; assert(!dup_check_launchable || conf_launchable(conf)); g_application_hold(G_APPLICATION(app)); new_session_window(conf_copy(conf), NULL); @@ -315,15 +312,11 @@ int main(int argc, char **argv) { int status; - { - /* Call the function in ux{putty,pterm}.c to do app-type - * specific setup */ - extern void setup(bool); - setup(false); /* false means we are not a one-session process */ - } + /* Call the function in ux{putty,pterm}.c to do app-type + * specific setup */ + setup(false); /* false means we are not a one-session process */ if (argc > 1) { - extern char *pty_osx_envrestore_prefix; pty_osx_envrestore_prefix = argv[--argc]; } diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index 1d88d7fc..84f9774f 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -3189,15 +3189,7 @@ GtkWidget *create_config_box(const char *title, Conf *conf, dp->retval = -1; dp->window = window; - { - /* in gtkwin.c */ - extern void set_window_icon(GtkWidget *window, - const char *const *const *icon, - int n_icon); - extern const char *const *const cfg_icon[]; - extern const int n_cfg_icon; - set_window_icon(window, cfg_icon, n_cfg_icon); - } + set_window_icon(window, cfg_icon, n_cfg_icon); #if !GTK_CHECK_VERSION(2,0,0) gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(treescroll), @@ -3860,8 +3852,6 @@ static void eventlog_list_handler(union control *ctrl, dlgparam *dp, if (gtk_selection_owner_set(es->window, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME)) { - extern GdkAtom compound_text_atom; - gtk_selection_add_target(es->window, GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 1); gtk_selection_add_target(es->window, GDK_SELECTION_PRIMARY, diff --git a/unix/gtkmain.c b/unix/gtkmain.c index e51b5c43..6a3d25ed 100644 --- a/unix/gtkmain.c +++ b/unix/gtkmain.c @@ -47,9 +47,6 @@ static char *progname, **gtkargvstart; static int ngtkargs; -extern char **pty_argv; /* declared in pty.c */ -extern bool use_pty_argv; - static const char *app_name = "pterm"; char *x_get_default(const char *key) @@ -590,12 +587,9 @@ int main(int argc, char **argv) setlocale(LC_CTYPE, ""); - { - /* Call the function in ux{putty,pterm}.c to do app-type - * specific setup */ - extern void setup(bool); - setup(true); /* true means we are a one-session process */ - } + /* Call the function in ux{putty,pterm}.c to do app-type + * specific setup */ + setup(true); /* true means we are a one-session process */ progname = argv[0]; @@ -626,8 +620,6 @@ int main(int argc, char **argv) block_signal(SIGPIPE, true); if (argc > 1 && !strncmp(argv[1], "---", 3)) { - extern const bool dup_check_launchable; - read_dupsession_data(conf, argv[1]); /* Splatter this argument so it doesn't clutter a ps listing */ smemclr(argv[1], strlen(argv[1])); diff --git a/unix/gtkwin.c b/unix/gtkwin.c index c4269dd5..369e9942 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -5468,11 +5468,7 @@ void new_session_window(Conf *conf, const char *geometry_string) #endif ); - { - extern const char *const *const main_icon[]; - extern const int n_main_icon; - set_window_icon(inst->window, main_icon, n_main_icon); - } + set_window_icon(inst->window, main_icon, n_main_icon); gtk_widget_show(inst->window); @@ -5484,7 +5480,6 @@ void new_session_window(Conf *conf, const char *geometry_string) { GtkWidget *menuitem; char *s; - extern const bool use_event_log, new_session, saved_sessions; inst->menu = gtk_menu_new(); diff --git a/unix/unix.h b/unix/unix.h index 1ce587bd..1a74492a 100644 --- a/unix/unix.h +++ b/unix/unix.h @@ -189,7 +189,14 @@ enum MenuAction { }; void app_menu_action(GtkFrontend *frontend, enum MenuAction); -/* Things gtkdlg.c needs from pterm.c */ +/* Arrays of pixmap data used for GTK window icons. (main_icon is for + * the process's main window; cfg_icon is the modified icon used for + * its config box.) */ +extern const char *const *const main_icon[]; +extern const char *const *const cfg_icon[]; +extern const int n_main_icon, n_cfg_icon; + +/* Things gtkdlg.c needs from gtkwin.c */ #ifdef MAY_REFER_TO_GTK_IN_HEADERS enum DialogSlot { DIALOG_SLOT_RECONFIGURE, @@ -202,9 +209,12 @@ enum DialogSlot { GtkWidget *gtk_seat_get_window(Seat *seat); void register_dialog(Seat *seat, enum DialogSlot slot, GtkWidget *dialog); void unregister_dialog(Seat *seat, enum DialogSlot slot); +void set_window_icon(GtkWidget *window, const char *const *const *icon, + int n_icon); +extern GdkAtom compound_text_atom; #endif -/* Things pterm.c needs from gtkdlg.c */ +/* Things gtkwin.c needs from gtkdlg.c */ #ifdef MAY_REFER_TO_GTK_IN_HEADERS GtkWidget *create_config_box(const char *title, Conf *conf, bool midsession, int protcfginfo, @@ -247,18 +257,52 @@ GtkWidget *create_message_box( post_dialog_fn_t after, void *afterctx); #endif -/* Things pterm.c needs from {ptermm,uxputty}.c */ +/* Things gtkwin.c needs from {ptermm,uxputty}.c */ char *make_default_wintitle(char *hostname); -/* pterm.c needs this special function in xkeysym.c */ +/* gtkwin.c needs this special function in xkeysym.c */ int keysym_to_unicode(int keysym); -/* Things uxstore.c needs from pterm.c */ +/* Things uxstore.c needs from gtkwin.c */ char *x_get_default(const char *key); -/* Things uxstore.c provides to pterm.c */ +/* Things uxstore.c provides to gtkwin.c */ void provide_xrm_string(char *string); +/* Function that {gtkapp,gtkmain}.c needs from ux{pterm,putty}.c. Does + * early process setup that varies between applications (e.g. + * pty_pre_init or sk_init), and is passed a boolean by the caller + * indicating whether this is an OS X style multi-session monolithic + * process or an ordinary Unix one-shot. */ +void setup(bool single_session_in_this_process); + +/* + * Per-application constants that affect behaviour of shared modules. + */ +/* Do we need an Event Log menu item? (yes for PuTTY, no for pterm) */ +extern const bool use_event_log; +/* Do we need a New Session menu item? (yes for PuTTY, no for pterm) */ +extern const bool new_session; +/* Do we need a Saved Sessions menu item? (yes for PuTTY, no for pterm) */ +extern const bool saved_sessions; +/* When we Duplicate Session, do we need to double-check that the Conf + * is in a launchable state? (no for pterm, because conf_launchable + * returns an irrelevant answer, since we'll force use of the pty + * backend which ignores all the relevant settings) */ +extern const bool dup_check_launchable; +/* In the Duplicate Session serialised data, do we send/receive an + * argv array after the main Conf? (yes for pterm, no for PuTTY) */ +extern const bool use_pty_argv; + +/* + * OS X environment munging: this is the prefix we expect to find on + * environment variable names that were changed by osxlaunch. + * Extracted from the command line of the OS X pterm main binary, and + * used in uxpty.c to restore the original environment before + * launching its subprocess. + */ +extern char *pty_osx_envrestore_prefix; + /* Things provided by uxcons.c */ struct termios; void stderr_tty_init(void); @@ -360,4 +404,25 @@ Socket *make_fd_socket(int infd, int outfd, int inerrfd, Plug *plug); #define DEFAULT_GTK_FONT "server:fixed" #endif -#endif +/* + * uxpty.c. + */ +void pty_pre_init(void); /* pty+utmp setup before dropping privilege */ +/* Pass in the argv[] for an instance of the pty backend created by + * the standard vtable constructor. Only called from (non-OSX) pterm, + * which will construct exactly one such instance, and initialises + * this from the command line. */ +extern char **pty_argv; + +/* + * gtkask.c. + */ +char *gtk_askpass_main(const char *display, const char *wintitle, + const char *prompt, bool *success); + +/* + * uxsftpserver.c. + */ +extern const SftpServerVtable unix_live_sftpserver_vt; + +#endif /* PUTTY_UNIX_H */ diff --git a/unix/uxpgnt.c b/unix/uxpgnt.c index 42ce7ba5..907e69a4 100644 --- a/unix/uxpgnt.c +++ b/unix/uxpgnt.c @@ -349,10 +349,6 @@ static char *askpass_gui(const char *prompt) char *passphrase; bool success; - /* in gtkask.c */ - char *gtk_askpass_main(const char *display, const char *wintitle, - const char *prompt, bool *success); - passphrase = gtk_askpass_main( display, "Pageant passphrase prompt", prompt, &success); if (!success) { diff --git a/unix/uxpterm.c b/unix/uxpterm.c index 1be68f50..27738a3d 100644 --- a/unix/uxpterm.c +++ b/unix/uxpterm.c @@ -43,8 +43,6 @@ char *make_default_wintitle(char *hostname) void setup(bool single) { - extern void pty_pre_init(void); /* declared in pty.c */ - cmdline_tooltype = TOOLTYPE_NONNETWORK; default_protocol = -1; diff --git a/unix/uxserver.c b/unix/uxserver.c index 7b9ab0f0..470e34d6 100644 --- a/unix/uxserver.c +++ b/unix/uxserver.c @@ -355,8 +355,6 @@ static bool longoptarg(const char *arg, const char *expected, return false; } -extern const SftpServerVtable unix_live_sftpserver_vt; - int main(int argc, char **argv) { int *fdlist; diff --git a/unix/uxshare.c b/unix/uxshare.c index a7d7fc12..d11d6bb8 100644 --- a/unix/uxshare.c +++ b/unix/uxshare.c @@ -23,12 +23,6 @@ #define SALT_FILENAME "salt" #define SALT_SIZE 64 -/* - * Functions provided by uxnet.c to help connection sharing. - */ -SockAddr *unix_sock_addr(const char *path); -Socket *new_unix_listener(SockAddr *listenaddr, Plug *plug); - static char *make_parentdir_name(void) { char *username, *parent; diff --git a/windows/windlg.c b/windows/windlg.c index 4019b9a3..16abe3ff 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -49,8 +49,6 @@ static char *events_initial[LOGEVENT_INITIAL_MAX]; static char *events_circular[LOGEVENT_CIRCULAR_MAX]; static int ninitial = 0, ncircular = 0, circular_first = 0; -extern Conf *conf; /* defined in window.c */ - #define PRINTER_DISABLED_STRING "None (printing disabled)" void force_normal(HWND hwnd) @@ -799,7 +797,6 @@ static void win_gui_eventlog(LogPolicy *lp, const char *string) static void win_gui_logging_error(LogPolicy *lp, const char *event) { - extern Seat win_seat[1]; /* Send 'can't open log file' errors to the terminal window. * (Marked as stderr, although terminal.c won't care.) */ seat_stderr(win_seat, event, strlen(event)); diff --git a/windows/window.c b/windows/window.c index 31b1cbe5..913e453d 100644 --- a/windows/window.c +++ b/windows/window.c @@ -152,8 +152,6 @@ struct wm_netevent_params { LPARAM lParam; }; -Conf *conf; /* exported to windlg.c */ - static void conf_cache_data(void); int cursor_type; int vtmode; @@ -349,7 +347,8 @@ static const SeatVtable win_seat_vt = { nullseat_get_windowid, win_seat_get_window_pixel_size, }; -Seat win_seat[1] = {{ &win_seat_vt }}; +static Seat win_seat_impl = { &win_seat_vt }; +Seat *const win_seat = &win_seat_impl; static void start_backend(void) { diff --git a/windows/winnet.c b/windows/winnet.c index 459d584a..bf91634f 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -839,8 +839,6 @@ static void sk_net_set_frozen(Socket *s, bool is_frozen); static const char *sk_net_socket_error(Socket *s); static SocketPeerInfo *sk_net_peer_info(Socket *s); -extern char *do_select(SOCKET skt, bool startup); - static const SocketVtable NetSocket_sockvt = { sk_net_plug, sk_net_close, @@ -1790,7 +1788,7 @@ SOCKET next_socket(int *state) return s ? s->s : INVALID_SOCKET; } -extern bool socket_writable(SOCKET skt) +bool socket_writable(SOCKET skt) { NetSocket *s = find234(sktree, (void *)skt, cmpforsearch); diff --git a/windows/winnpc.c b/windows/winnpc.c index 31906e0d..4fcb9e26 100644 --- a/windows/winnpc.c +++ b/windows/winnpc.c @@ -15,9 +15,6 @@ #include "winsecur.h" -Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H, - Plug *plug, bool overlapped); - Socket *new_named_pipe_client(const char *pipename, Plug *plug) { HANDLE pipehandle; diff --git a/windows/winnps.c b/windows/winnps.c index d355a90a..fa1d804b 100644 --- a/windows/winnps.c +++ b/windows/winnps.c @@ -15,9 +15,6 @@ #include "winsecur.h" -Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H, - Plug *plug, bool overlapped); - typedef struct NamedPipeServerSocket { /* Parameters for (repeated) creation of named pipe objects */ PSECURITY_DESCRIPTOR psd; @@ -120,12 +117,6 @@ static Socket *named_pipe_accept(accept_ctx_t ctx, Plug *plug) return make_handle_socket(conn, conn, NULL, plug, true); } -/* - * Dummy SockAddr *type which just holds a named pipe address. Only - * used for calling plug_log from named_pipe_accept_loop() here. - */ -SockAddr *sk_namedpipe_addr(const char *pipename); - static void named_pipe_accept_loop(NamedPipeServerSocket *ps, bool got_one_already) { diff --git a/windows/winpgen.c b/windows/winpgen.c index 6d5c244b..833ef393 100644 --- a/windows/winpgen.c +++ b/windows/winpgen.c @@ -137,8 +137,6 @@ static void progress_update(void *param, int action, int phase, int iprogress) } } -extern const char ver[]; - struct PassphraseProcStruct { char **passphrase; char *comment; diff --git a/windows/winpgnt.c b/windows/winpgnt.c index f8320f4a..bf84e863 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -50,8 +50,6 @@ #define APPNAME "Pageant" -extern const char ver[]; - static HWND keylist; static HWND aboutbox; static HMENU systray_menu, session_menu; diff --git a/windows/winplink.c b/windows/winplink.c index 493db000..1f47dd9b 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -530,7 +530,6 @@ int main(int argc, char **argv) } else if (n == WAIT_OBJECT_0 + nhandles) { WSANETWORKEVENTS things; SOCKET socket; - extern SOCKET first_socket(int *), next_socket(int *); int i, socketstate; /* diff --git a/windows/winproxy.c b/windows/winproxy.c index 73b77d42..909af2f1 100644 --- a/windows/winproxy.c +++ b/windows/winproxy.c @@ -12,9 +12,6 @@ #include "network.h" #include "proxy.h" -Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H, - Plug *plug, bool overlapped); - Socket *platform_new_connection(SockAddr *addr, const char *hostname, int port, bool privport, bool oobinline, bool nodelay, bool keepalive, diff --git a/windows/winsftp.c b/windows/winsftp.c index 7d0adde5..f9f6222c 100644 --- a/windows/winsftp.c +++ b/windows/winsftp.c @@ -535,7 +535,6 @@ int do_eventsel_loop(HANDLE other_event) } else if (netindex >= 0 && n == WAIT_OBJECT_0 + netindex) { WSANETWORKEVENTS things; SOCKET socket; - extern SOCKET first_socket(int *), next_socket(int *); int i, socketstate; /* diff --git a/windows/winshare.c b/windows/winshare.c index 5d98cc17..6498cc4e 100644 --- a/windows/winshare.c +++ b/windows/winshare.c @@ -115,9 +115,6 @@ static char *make_name(const char *prefix, const char *name) return retname; } -Socket *new_named_pipe_client(const char *pipename, Plug *plug); -Socket *new_named_pipe_listener(const char *pipename, Plug *plug); - int platform_ssh_share(const char *pi_name, Conf *conf, Plug *downplug, Plug *upplug, Socket **sock, char **logtext, char **ds_err, char **us_err, diff --git a/windows/winstuff.h b/windows/winstuff.h index 4d735af1..cd128156 100644 --- a/windows/winstuff.h +++ b/windows/winstuff.h @@ -235,13 +235,16 @@ void quit_help(HWND hwnd); /* * The terminal and logging context are notionally local to the * Windows front end, but they must be shared between window.c and - * windlg.c. Likewise the Seat structure for the Windows GUI. + * windlg.c. Likewise the Seat structure for the Windows GUI, and the + * Conf for the main session.. */ GLOBAL Terminal *term; GLOBAL LogContext *logctx; +GLOBAL Conf *conf; /* - * GUI seat methods in windlg.c. + * GUI seat methods in windlg.c, so that the vtable definition in + * window.c can refer to them. */ int win_seat_verify_ssh_host_key( Seat *seat, const char *host, int port, @@ -254,6 +257,12 @@ int win_seat_confirm_weak_cached_hostkey( Seat *seat, const char *algname, const char *betteralgs, void (*callback)(void *ctx, int result), void *ctx); +/* + * The Windows GUI seat object itself, so that its methods can be + * called outside window.c. + */ +extern Seat *const win_seat; + /* * Windows-specific clipboard helper function shared with windlg.c, * which takes the data string in the system code page instead of @@ -303,7 +312,17 @@ void write_aclip(int clipboard, char *, int, bool); /* * Exports from winnet.c. */ -extern void select_result(WPARAM, LPARAM); +/* Report an event notification from WSA*Select */ +void select_result(WPARAM, LPARAM); +/* Enumerate all currently live OS-level SOCKETs */ +SOCKET first_socket(int *); +SOCKET next_socket(int *); +/* Ask winnet.c whether we currently want to try to write to a SOCKET */ +bool socket_writable(SOCKET skt); +/* Force a refresh of the SOCKET list by re-calling do_select for each one */ +void socket_reselect_all(void); +/* Make a SockAddr which just holds a named pipe address. */ +SockAddr *sk_namedpipe_addr(const char *pipename); /* * winnet.c dynamically loads WinSock 2 or WinSock 1 depending on @@ -331,9 +350,19 @@ DECL_WINDOWS_FUNCTION(GLOBAL, int, select, fd_set FAR *, const struct timeval FAR *)); #endif -extern bool socket_writable(SOCKET skt); +/* + * Provided by each client of winnet.c, and called by winnet.c to turn + * on or off WSA*Select for a given socket. + */ +char *do_select(SOCKET skt, bool startup); -extern void socket_reselect_all(void); +/* + * Network-subsystem-related functions provided in other Windows modules. + */ +Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H, + Plug *plug, bool overlapped); /* winhsock */ +Socket *new_named_pipe_client(const char *pipename, Plug *plug); /* winnpc */ +Socket *new_named_pipe_listener(const char *pipename, Plug *plug); /* winnps */ /* * Exports from winctrls.c.