Upgrade libgit2
[TortoiseGit.git] / src / TortoisePlink / console.c
blobfd3b5fb3439bcb26eb448cc01e7b4f6c25eeccde
1 /*
2 * Common pieces between the platform console frontend modules.
3 */
5 #include <stdbool.h>
6 #include <stdarg.h>
8 #include "putty.h"
9 #include "misc.h"
10 #include "console.h"
12 //const char console_abandoned_msg[] = "Connection abandoned.\n";
14 const SeatDialogPromptDescriptions *console_prompt_descriptions(Seat *seat)
16 static const SeatDialogPromptDescriptions descs = {
17 .hk_accept_action = "hit Yes",
18 .hk_connect_once_action = "hit No",
19 .hk_cancel_action = "hit Cancel",
20 .hk_cancel_action_Participle = "Hitting Cancel",
21 .weak_accept_action = "hit Yes",
22 .weak_cancel_action = "hit No",
24 return &descs;
27 bool console_batch_mode = false;
30 * Error message and/or fatal exit functions, all based on
31 * console_print_error_msg which the platform front end provides.
33 void modalfatalbox(const char *fmt, ...)
35 va_list ap;
36 char *stuff, morestuff[100];
37 va_start(ap, fmt);
38 stuff = dupvprintf(fmt, ap);
39 va_end(ap);
40 sprintf(morestuff, "%.70s Fatal Error", appname);
41 MessageBox(GetParentHwnd(), stuff, morestuff, MB_SYSTEMMODAL | MB_ICONERROR | MB_OK);
42 sfree(stuff);
43 cleanup_exit(1);
46 void nonfatal(const char *fmt, ...)
48 va_list ap;
49 char *stuff, morestuff[100];
50 va_start(ap, fmt);
51 stuff = dupvprintf(fmt, ap);
52 va_end(ap);
53 sprintf(morestuff, "%.70s Error", appname);
54 MessageBox(GetParentHwnd(), stuff, morestuff, MB_SYSTEMMODAL | MB_ICONERROR | MB_OK);
55 sfree(stuff);
58 void console_connection_fatal(Seat *seat, const char *msg)
60 char morestuff[100];
61 sprintf(morestuff, "%.70s Fatal Error", appname);
62 MessageBox(GetParentHwnd(), msg, morestuff, MB_SYSTEMMODAL | MB_ICONERROR | MB_OK);
63 cleanup_exit(1);
67 * Console front ends redo their select() or equivalent every time, so
68 * they don't need separate timer handling.
70 void timer_change_notify(unsigned long next)