1d009ae7 |
1 | /* |
2 | * pterm main program. |
3 | */ |
4 | |
5 | #include <stdio.h> |
3f935d5b |
6 | #include <stdlib.h> |
1d009ae7 |
7 | |
8 | #include "putty.h" |
9 | |
47e4e735 |
10 | const char *const appname = "pterm"; |
8eed910d |
11 | const int use_event_log = 0; /* pterm doesn't need it */ |
56801e3d |
12 | const int new_session = 0, saved_sessions = 0; /* or these */ |
fbcc43d3 |
13 | const int use_pty_argv = TRUE; |
47e4e735 |
14 | |
4a693cfc |
15 | Backend *select_backend(Conf *conf) |
1d009ae7 |
16 | { |
17 | return &pty_backend; |
18 | } |
19 | |
43a1c4a4 |
20 | void net_pending_errors(void) |
21 | { |
22 | /* |
23 | * Stub version of net_pending_errors(), because gtkwin.c has to |
24 | * be prepared to call it when linked into PuTTY and therefore we |
25 | * have to avoid a link failure when linking gtkwin.c in turn into |
26 | * a non-networked application. |
27 | */ |
28 | } |
29 | |
4a693cfc |
30 | int cfgbox(Conf *conf) |
1d009ae7 |
31 | { |
3e547dd8 |
32 | /* |
33 | * This is a no-op in pterm, except that we'll ensure the |
34 | * protocol is set to -1 to inhibit the useless Connection |
35 | * panel in the config box. |
36 | */ |
4a693cfc |
37 | conf_set_int(conf, CONF_protocol, -1); |
3e547dd8 |
38 | return 1; |
1d009ae7 |
39 | } |
40 | |
3f935d5b |
41 | void cleanup_exit(int code) |
42 | { |
43 | exit(code); |
44 | } |
45 | |
4a693cfc |
46 | int process_nonoption_arg(char *arg, Conf *conf, int *allow_launch) |
46a3419b |
47 | { |
48 | return 0; /* pterm doesn't have any. */ |
49 | } |
50 | |
10705014 |
51 | char *make_default_wintitle(char *hostname) |
52 | { |
53 | return dupstr("pterm"); |
54 | } |
55 | |
1d009ae7 |
56 | int main(int argc, char **argv) |
57 | { |
58 | extern int pt_main(int argc, char **argv); |
59 | extern void pty_pre_init(void); /* declared in pty.c */ |
f08a390f |
60 | int ret; |
1d009ae7 |
61 | |
46a3419b |
62 | cmdline_tooltype = TOOLTYPE_NONNETWORK; |
3e547dd8 |
63 | default_protocol = -1; |
46a3419b |
64 | |
1d009ae7 |
65 | pty_pre_init(); |
66 | |
f08a390f |
67 | ret = pt_main(argc, argv); |
68 | cleanup_exit(ret); |
69 | return ret; /* not reached, but placates optimisers */ |
1d009ae7 |
70 | } |