Please sign in to comment.
Add a new field to dropt_option to store additional callback data
Add a new field to dropt_option to store additional callback data. This can be used to allow option handlers to store predefined values to option variables (i.e., to offer functionality equivalent to store_const from Python's argparse module). Unfortunately, this warranted renaming the existing handler_data member, so this might require adjusting any existing code that initialized dropt_option members by name. Since I'm already breaking API compatibility for 2.0, I might as well do this now. Since C does not guarantee that integers may be converted to pointers and back, for maximum flexibility, the new member should be a uintptr_t instead of a void*. However, for compatibility with C89, we can't use uintptr_t directly and must fall back to size_t. Alas.
- Loading branch information...
Showing with 182 additions and 68 deletions.
Oops, something went wrong.