While looking through apps/e/src looking for the proper way to do this, I found two things.
There are many different styles used, so getting a consensus from the code is hard. I'll just pick one I like. B-) Passing back an opaque pointer from the _add(), which you pass to the _del(), which then sets a delete_me flag looks like a good way to do this. Then the callback can be actually deleted when it is safest to do so. An alternative I have seen is to check if it's safe, then delete if safe, or set the delete_me flag if it's unsafe. On the other hand, if it is always safe to delete, then screw the delete_me flag business and just nuke the sucker. The other thing I found is E_Int_Menu_Augmentation. Looks like someone did a less general version a long time ago. The randr module uses it to add it's menu to the main configuration menu.
pgpRc5pIZ8o62.pgp
Description: PGP signature
