mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 11:02:48 -05:00
Add asynchronous callback capability to the askappend() alert box.
This was harder than verify_ssh_host_key() and askalg() put together, because: (a) askappend() can be called at any time, since it's a side effect of data-logging functions. Therefore there can be an unfinished askappend() alert at any time, and hence the OS X front end has to be prepared to _queue_ other alerts which occur during that time. (b) logging.c has to do something with data that comes in while it's waiting for an answer to askappend(). It buffers it until it knows what the user wants done with it. This involved something of a reorganisation of logging.c. [originally from svn r5344]
This commit is contained in:
@ -2753,7 +2753,8 @@ void logevent_dlg(void *estuff, const char *string)
|
||||
es->nevents++;
|
||||
}
|
||||
|
||||
int askappend(void *frontend, Filename filename)
|
||||
int askappend(void *frontend, Filename filename,
|
||||
void (*callback)(void *ctx, int result), void *ctx)
|
||||
{
|
||||
static const char msgtemplate[] =
|
||||
"The session log file \"%.*s\" already exists. "
|
||||
|
@ -198,7 +198,8 @@ int askalg(void *frontend, const char *algtype, const char *algname,
|
||||
* Ask whether to wipe a session log file before writing to it.
|
||||
* Returns 2 for wipe, 1 for append, 0 for cancel (don't log).
|
||||
*/
|
||||
int askappend(void *frontend, Filename filename)
|
||||
int askappend(void *frontend, Filename filename,
|
||||
void (*callback)(void *ctx, int result), void *ctx)
|
||||
{
|
||||
static const char msgtemplate[] =
|
||||
"The session log file \"%.*s\" already exists.\n"
|
||||
|
Reference in New Issue
Block a user