mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Add the ability to allocate extra per-dialog-instance private data
in the portable dialog interface. This has allowed me to remove `ssd->savedsession' in config.c, which was (I believe) the only out-of-place piece of per-instance data in the dialog template stuff. Now we should actually be able to run more than one config box in the same process at the same time (for platforms that'll find that useful). [originally from svn r2925]
This commit is contained in:
15
dialog.h
15
dialog.h
@ -645,6 +645,21 @@ int dlg_coloursel_results(union control *ctrl, void *dlg,
|
||||
*/
|
||||
void dlg_refresh(union control *ctrl, void *dlg);
|
||||
|
||||
/*
|
||||
* It's perfectly possible that individual controls might need to
|
||||
* allocate or store per-dialog-instance data, so here's a
|
||||
* mechanism.
|
||||
*
|
||||
* `dlg_get_privdata' and `dlg_set_privdata' allow the user to get
|
||||
* and set a void * pointer associated with the control in
|
||||
* question. `dlg_alloc_privdata' will allocate memory, store a
|
||||
* pointer to that memory in the private data field, and arrange
|
||||
* for it to be automatically deallocated on dialog cleanup.
|
||||
*/
|
||||
void *dlg_get_privdata(union control *ctrl, void *dlg);
|
||||
void dlg_set_privdata(union control *ctrl, void *dlg, void *ptr);
|
||||
void *dlg_alloc_privdata(union control *ctrl, void *dlg, size_t size);
|
||||
|
||||
/*
|
||||
* Standard helper functions for reading a controlbox structure.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user