1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12: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:
Simon Tatham
2005-02-18 18:33:31 +00:00
parent 775fe9eb31
commit f73fcb0424
10 changed files with 338 additions and 176 deletions

11
putty.h
View File

@ -916,7 +916,16 @@ int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
*/
int askalg(void *frontend, const char *algtype, const char *algname,
void (*callback)(void *ctx, int result), void *ctx);
int askappend(void *frontend, Filename filename);
/*
* askappend can return four values:
*
* - 2 means overwrite the log file
* - 1 means append to the log file
* - 0 means cancel logging for this session
* - -1 means please wait.
*/
int askappend(void *frontend, Filename filename,
void (*callback)(void *ctx, int result), void *ctx);
/*
* Exports from console.c (that aren't equivalents to things in