Tags: jamesderlin/dropt
Tags
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.
Change the dropt directory structure Move header files into a separate "include" directory and most of the source files into a "src" directory. (I made an exception for the example files which currently remain in the main dropt directory.) Also, I had forgotten to add most of the new files from r469 to the packaging script.