X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/4683b9b61410e3cb14e944f68e238b147c67f907..4e6d40912e43afdde39744815e30dd425a4849d3:/dialog.h diff --git a/dialog.h b/dialog.h index 6b9f5e38..fc1dd414 100644 --- a/dialog.h +++ b/dialog.h @@ -646,6 +646,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. */