Commits on Jan 29, 2018
  1. Break up dropt_parse

    jamesderlin committed Jan 29, 2018
    To try to improve readability, break up dropt_parse by adding a
    couple of helper functions.
Commits on Jan 28, 2018
  1. Remove package.cmd and make.cmd

    jamesderlin committed Jan 28, 2018
    I didn't really mean to commit package.cmd and make.cmd
    (nor to include them as part of the dropt distribution).
    package.cmd is a vestige from when I packaged the dropt
    source manually; now that dropt is on github, that happens
    make.cmd was meant to be an internal convenience script for
    me for building on Windows.
Commits on Jan 24, 2018
  1. Add a new field to dropt_option to store additional callback data

    jamesderlin committed Jan 24, 2018
    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.
Commits on Jan 21, 2018
  1. Update dropt to v2.0.0

    jamesderlin committed Jan 21, 2018
    Address issue #1: pass the matched dropt_option to the option handler.
    Even though this is a small change, it breaks API compatibility and
    therefore warrants a major version bump.
Commits on Jul 5, 2017
Commits on Mar 4, 2016
  1. Fix a typo in the README

    jamesderlin committed Mar 4, 2016
Commits on Feb 25, 2016
Commits on Feb 24, 2016
  1. Add a .gitignore file

    jamesderlin committed Feb 24, 2016
  2. Move dropt files up a level

    jamesderlin committed Feb 22, 2016
    This is more appropriate for standalone git repository.
  3. Change the dropt directory structure

    jamesderlin committed Mar 17, 2013
    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
  4. Update dropt to v1.1.1

    jamesderlin committed Mar 17, 2013
    * Fixed a build issue with gcc with optimizations enabled, which provides
      macro versions of some standard library functions.  This led to a naming
      conflict with dropt_context::strncmp.  The macro expansion could be
      suppresed by calling it as (strncmp)(s1, s2, n), but that seems a little
      weird and error-prone, so instead rename it to ncmpstr.
    * Changed dropt_error to be an unsigned int type instead of an enum type to
      avoid potential comparison warnings with custom error values.
    * Fixed dropt_misuse to terminate in debug builds. (I accidentally disabled
      termination in dropt 1.1.0.  Oops.)
    * Added a Makefile for clang and make the gcc and clang versions leverage a
      common .mk file.
    * Added an INSTALL file with build instructions.
    * Added a droptxx_example.cpp file as a C++ sample program.
    * Made dropt.c use stdbool.h if available.
    * Adjusted some comments in dropt_example.c.
  5. Branch dropt's Makefile.gcc into Makefile.clang and files

    jamesderlin committed Mar 17, 2013
    Branch dropt's Makefile.gcc into Makefile.clang and files.
    Makefile.gcc and Makefile.clang will be modified to leverage in an
    upcoming change.
  6. More dropt changes for v1.1.0

    jamesderlin committed May 6, 2012
    * Add some explicit safeguards against integer overflow attacks. (Previously
      overflow was safely handled implicitly, but now favor defensive paranoia.)
    * Fix a null pointer dereference if no handler data was specified for
    * In test_dropt.c:
      * Fix a sign-extension bug when using ctype.h functions.
      * Fix a printf format specifier mismatch where I passed char* string
        literals where a wchar_t* was expected in a _UNICODE build.
    * Remove a redundant case from dropt_get_help.
    * Append makefile flags instead of prepending.
    * For Windows builds, use /W4 instead of /W3.
    * Update the readme file to list secondary goals.
  7. Update dropt to v1.1.0

    jamesderlin committed Apr 28, 2012
    * For scalability, make dropt use a binary search instead of a linear
      search.  dropt will fall back to a linear search in cases of extreme
      memory pressure.
    * Change dropt_set_strncmp(NULL) to reset the default handler to
      dropt_strncmp instead of making callers perform the fallback manually.
    * Make the usage of non-NUL-terminated strings clearer by adding and using
      a char_array struct instead of passing char pointers and lengths.
  8. Minor dropt cleanup

    jamesderlin committed Jan 24, 2011
    * Adjust some wording in the README.html file.  Add a link to the bug
      tracker on Google Code.
    * Adjust some comments.
    * Adjust some formatting.
    * Rename the parseState struct to parse_state.
    * Reorder some functions.
  9. Update dropt to v1.0.4

    jamesderlin committed Sep 12, 2010
    * Replace the DROPT_HANDLER_DECL macro with a dropt_option_handler_decl
      function typedef. (Gosh, those things are actually useful for something
      after all.) I'd prefer to minimize macro definitions.  This unfortunately
      breaks compatibility, although I think the breakage should be
      sufficiently minimal and should be sufficiently easy to fix that it's
    * Also adjust some comments in dropt_example.c.
  10. Update the dropt packaging script to include the directory in archives

    jamesderlin committed Sep 12, 2010
    Apparently it's bad etiquette to let files be extracted into the current
    directory directly:
    (I personally think the opposite since users who want the opposite behavior
    can't opt out of it, but oh well.)
  11. Update dropt to v1.0.3

    jamesderlin committed Aug 8, 2010
    * Make dropt_handle_bool return dropt_error_mismatch instead of
      dropt_error_insufficient_arguments when given an empty string argument.
      Since dropt_handle_bool doesn't require an argument, I think this is less
    * Tweak the error messages in dropt_default_error_handler so that they
      consistently never end with periods. (Clients then can append periods if
  12. Minor resource adjustments

    jamesderlin committed Aug 2, 2010
    * Use DS_CENTER to center the Hibernate dialog instead of doing it
    * In usage text, show --help last to try to make it more visible.
    * Adjust the verb tense slightly in the dropt changelog.
  13. Distribute dropt in .tar.gz form too

    jamesderlin committed Jul 28, 2010
    Modify package.cmd to generate a .tar.gz file for dropt too, and change it
    to abort the script on any failure.
    Also, save README.html with Unix line-endings.
  14. Update dropt to v1.0.2

    jamesderlin committed Jul 28, 2010
    * Fix the compilation of test_dropt.c when building with _UNICODE=1.
    * Rename some variables in the makefiles.
    * Add a package.cmd script to package the distributable files.
  15. Fix dropt_handle_bool to not return dropt_error_overflow

    jamesderlin committed Jul 25, 2010
    It doesn't really make sense for dropt_handle_bool to ever return
    dropt_error_overflow, which could happen since it was built around
    dropt_handle_uint.  Make dropt_handle_bool convert this error to
    dropt_error_mismatch instead.
    Add corresponding unit tests.
  16. Update dropt to v1.0.1

    jamesderlin committed Jul 3, 2010
    * Newly initialized dropt_stringstream objects did not NUL-terminate their
      internal buffer, so immediately calling dropt_ssgetstring would return
      garbage.  Fix dropt_ssopen to NUL-terminate on construction, which
      satifies the invariant that dropt_stringstream is NUL-terminated at all
    * Make the MIN/MAX macro definitions in dropt_string.c conditionally
    * Export dropt_safe_malloc and dropt_safe_realloc publicly in
      dropt_string.h.  They might be useful for implementing certain classes of
      option handler callbacks.
  17. Make more of the dropt unit tests report the line number on failure

    jamesderlin committed Jun 27, 2010
    * Make more tests continue executing subsequent tests on failure instead of
    * Add a test to check dropt_ssprintf's return value.
    * Add a test to check dropt_stringstream's behavior with embedded NUL
    * Make some minor adjustments to some comments.

    jamesderlin committed Jun 20, 2010
    Since it doesn't always terminate the program, putting "PANIC" in the name
    seems a bit misleading.