mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
c5895ec292
This is another cleanup I felt a need for while I was doing boolification. If you define a function or variable in one .c file and declare it extern in another, then nothing will check you haven't got the types of the two declarations mismatched - so when you're _changing_ the type, it's a pain to make sure you've caught all the copies of it. It's better to put all those extern declarations in header files, so that the declaration in the header is also in scope for the definition. Then the compiler will complain if they don't match, which is what I want.
52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
/*
|
|
* pterm main program.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "putty.h"
|
|
|
|
const char *const appname = "pterm";
|
|
const bool use_event_log = false; /* pterm doesn't need it */
|
|
const bool new_session = false, saved_sessions = false; /* or these */
|
|
const bool dup_check_launchable = false; /* no need to check host name
|
|
* in conf */
|
|
const bool use_pty_argv = true;
|
|
|
|
const struct BackendVtable *select_backend(Conf *conf)
|
|
{
|
|
return &pty_backend;
|
|
}
|
|
|
|
void initial_config_box(Conf *conf, post_dialog_fn_t after, void *afterctx)
|
|
{
|
|
/*
|
|
* This is a no-op in pterm, except that we'll ensure the protocol
|
|
* is set to -1 to inhibit the useless Connection panel in the
|
|
* config box. So we do that and then just immediately call the
|
|
* post-dialog function with a positive result.
|
|
*/
|
|
conf_set_int(conf, CONF_protocol, -1);
|
|
after(afterctx, 1);
|
|
}
|
|
|
|
void cleanup_exit(int code)
|
|
{
|
|
exit(code);
|
|
}
|
|
|
|
char *make_default_wintitle(char *hostname)
|
|
{
|
|
return dupstr("pterm");
|
|
}
|
|
|
|
void setup(bool single)
|
|
{
|
|
cmdline_tooltype = TOOLTYPE_NONNETWORK;
|
|
default_protocol = -1;
|
|
|
|
if (single)
|
|
pty_pre_init();
|
|
}
|