Skip to content

Commit cdf507c

Browse files
committed
Update dropt to v2.0.1
Primary motivation is updating the email address in the source code. Also adjust some wording in README.md.
1 parent c1c991e commit cdf507c

10 files changed

+28
-21
lines changed

LICENSE

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
dropt
2-
Copyright (C) 2006-2012 James D. Lin <[email protected]>
1+
Copyright (C) 2006-2019 James D. Lin <[email protected]>
32

43
This software is provided 'as-is', without any express or implied
54
warranty. In no event will the authors be held liable for any damages
@@ -18,5 +17,3 @@ freely, subject to the following restrictions:
1817
misrepresented as being the original software.
1918

2019
3. This notice may not be removed or altered from any source distribution.
21-
22-
<https://opensource.org/licenses/Zlib>

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ Specifically, this includes:
3838
* **Flexibility.** dropt is designed to be callback-based. This allows it to
3939
handle arbitrary arguments to command-line options. All types are
4040
considered equal. Even basic types such as integers or strings are handled
41-
by callbacks; dropt provides standard handlers for them. Exposing the
42-
handlers for basic types also allows custom handlers to leverage them.
41+
by callbacks; dropt provides built-in handlers for them. Exposing the
42+
handlers for basic types also allows custom handlers to leverage them via
43+
composition.
4344

4445
Secondary goals include being secure, performant, maintainable, and
4546
extensible; minimizing memory usage; and gracefully failing if memory is
@@ -99,12 +100,15 @@ There's no formal documentation yet. In the meantime, [`dropt_example.c`] or
99100
Download
100101
--------
101102

102-
* [`dropt-2.0.0.zip`](https://github.com/jamesderlin/dropt/archive/v2.0.0.zip)
103-
* [`dropt-2.0.0.tar.gz`](https://github.com/jamesderlin/dropt/archive/v2.0.0.tar.gz)
103+
* [`dropt-2.0.1.zip`](https://github.com/jamesderlin/dropt/archive/v2.0.1.zip)
104+
* [`dropt-2.0.1.tar.gz`](https://github.com/jamesderlin/dropt/archive/v2.0.1.tar.gz)
104105

105106

106107
Version History
107108
---------------
109+
* 2.0.1 (2019-07-10)
110+
* Fixed contact information and other minor comment and documentation tweaks.
111+
* Minor code refactoring.
108112
* 2.0.0 (2018-01-24)
109113
* Modified the signature for option handlers to accept a pointer to the
110114
matched `dropt_option` entry. Custom option handlers will need to be
@@ -178,7 +182,7 @@ Version History
178182

179183
Questions? Comments? Bugs? I welcome feedback. [Contact me].
180184

181-
Copyright © 2010–2018 James D. Lin
185+
Copyright © 2010–2019 James D. Lin
182186
<http://www.taenarum.com/software/>
183187

184188

include/dropt.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Version 2.0.0
66
*
7-
* Copyright (C) 2006-2018 James D. Lin <jameslin@cal.berkeley.edu>
7+
* Copyright (C) 2006-2018 James D. Lin <jamesdlin@berkeley.edu>
88
*
99
* The latest version of this file can be downloaded from:
1010
* <http://www.taenarum.com/software/dropt/>

include/dropt_string.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* String routines for dropt.
44
*
5-
* Copyright (C) 2006-2010 James D. Lin <jameslin@cal.berkeley.edu>
5+
* Copyright (C) 2006-2010 James D. Lin <jamesdlin@berkeley.edu>
66
*
77
* The latest version of this file can be downloaded from:
88
* <http://www.taenarum.com/software/dropt/>
@@ -30,11 +30,8 @@
3030
#define DROPT_STRING_H
3131

3232
#include <stdarg.h>
33-
#include "dropt.h"
3433

35-
#ifdef __cplusplus
36-
extern "C" {
37-
#endif
34+
#include "dropt.h"
3835

3936
#ifdef DROPT_USE_WCHAR
4037
#define dropt_strlen wcslen
@@ -58,6 +55,11 @@ extern "C" {
5855
#define dropt_fputs fputs
5956
#endif
6057

58+
59+
#ifdef __cplusplus
60+
extern "C" {
61+
#endif
62+
6163
void* dropt_safe_malloc(size_t numElements, size_t elementSize);
6264
void* dropt_safe_realloc(void* p, size_t numElements, size_t elementSize);
6365

include/droptxx.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* A C++ wrapper for dropt.
44
*
5-
* Copyright (C) 2008-2018 James D. Lin <jameslin@cal.berkeley.edu>
5+
* Copyright (C) 2008-2018 James D. Lin <jamesdlin@berkeley.edu>
66
*
77
* The latest version of this file can be downloaded from:
88
* <http://www.taenarum.com/software/dropt/>
@@ -31,6 +31,7 @@
3131

3232
#include <string>
3333
#include <iostream>
34+
3435
#include "dropt.h"
3536

3637

src/dropt.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* A deliberately rudimentary command-line option parser.
44
*
5-
* Copyright (C) 2006-2018 James D. Lin <jameslin@cal.berkeley.edu>
5+
* Copyright (C) 2006-2018 James D. Lin <jamesdlin@berkeley.edu>
66
*
77
* The latest version of this file can be downloaded from:
88
* <http://www.taenarum.com/software/dropt/>
@@ -59,6 +59,7 @@
5959

6060
#define OPTION_TAKES_ARG(option) ((option)->arg_description != NULL)
6161

62+
6263
enum
6364
{
6465
default_help_indent = 2,
@@ -1401,6 +1402,8 @@ dropt_parse(dropt_context* context,
14011402
* PARAMETERS:
14021403
* IN options : The list of option specifications.
14031404
* Must not be `NULL`.
1405+
* The list is *not* copied and must outlive the dropt
1406+
* context.
14041407
*
14051408
* RETURNS:
14061409
* An allocated dropt context. The caller is responsible for freeing

src/dropt_handlers.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Default type handlers for dropt.
44
*
5-
* Copyright (C) 2006-2018 James D. Lin <jameslin@cal.berkeley.edu>
5+
* Copyright (C) 2006-2018 James D. Lin <jamesdlin@berkeley.edu>
66
*
77
* The latest version of this file can be downloaded from:
88
* <http://www.taenarum.com/software/dropt/>

src/dropt_string.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* String routines for dropt.
44
*
5-
* Copyright (C) 2006-2018 James D. Lin <jameslin@cal.berkeley.edu>
5+
* Copyright (C) 2006-2018 James D. Lin <jamesdlin@berkeley.edu>
66
*
77
* The latest version of this file can be downloaded from:
88
* <http://www.taenarum.com/software/dropt/>

src/droptxx.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* A C++ wrapper for dropt.
44
*
5-
* Copyright (C) 2008-2018 James D. Lin <jameslin@cal.berkeley.edu>
5+
* Copyright (C) 2008-2018 James D. Lin <jamesdlin@berkeley.edu>
66
*
77
* The latest version of this file can be downloaded from:
88
* <http://www.taenarum.com/software/dropt/>

src/test_dropt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Unit tests for dropt.
44
*
5-
* Copyright (C) 2007-2018 James D. Lin <jameslin@cal.berkeley.edu>
5+
* Copyright (C) 2007-2018 James D. Lin <jamesdlin@berkeley.edu>
66
*
77
* This software is provided 'as-is', without any express or implied
88
* warranty. In no event will the authors be held liable for any damages

0 commit comments

Comments
 (0)