From: Harlan Stenn Date: Sun, 6 Jan 2013 10:17:07 +0000 (-0500) Subject: Libopts-5.17.1pre14 update X-Git-Tag: NTP_4_2_7P346~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=644bb6e721d2ef4dd64889ffcfa1df7a566075d5;p=thirdparty%2Fntp.git Libopts-5.17.1pre14 update bk: 50e94f23T0ZhsRN5botsMhrFTUtfYg --- diff --git a/sntp/libopts/COPYING.gplv3 b/sntp/libopts/COPYING.gplv3 index f22cdbb20..e9bf0ffd1 100644 --- a/sntp/libopts/COPYING.gplv3 +++ b/sntp/libopts/COPYING.gplv3 @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + Copyright (C) 1992-2013 by Bruce Korb - all rights reserved Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - copyright (c) by Bruce Korb - all rights reserved + Copyright (C) by Bruce Korb - all rights reserved This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - copyright (c) by Bruce Korb - all rights reserved + Copyright (C) by Bruce Korb - all rights reserved This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/sntp/libopts/COPYING.lgplv3 b/sntp/libopts/COPYING.lgplv3 index a1bc40ddf..b8a3768e3 100644 --- a/sntp/libopts/COPYING.lgplv3 +++ b/sntp/libopts/COPYING.lgplv3 @@ -1,7 +1,7 @@ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + Copyright (C) 1992-2013 by Bruce Korb - all rights reserved Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. diff --git a/sntp/libopts/Makefile.am b/sntp/libopts/Makefile.am index 81e01943c..102de235d 100644 --- a/sntp/libopts/Makefile.am +++ b/sntp/libopts/Makefile.am @@ -7,7 +7,7 @@ noinst_LTLIBRARIES = libopts.la endif libopts_la_SOURCES = libopts.c libopts_la_CPPFLAGS = -I$(top_srcdir) -libopts_la_LDFLAGS = -version-info 37:0:12 +libopts_la_LDFLAGS = -version-info 37:1:12 EXTRA_DIST = \ COPYING.gplv3 COPYING.lgplv3 COPYING.mbsd \ MakeDefs.inc README ag-char-map.h \ @@ -15,8 +15,8 @@ EXTRA_DIST = \ autoopts/options.h autoopts/usage-txt.h autoopts/project.h \ autoopts.c autoopts.h boolean.c \ check.c compat/pathfind.c compat/snprintf.c \ - compat/strchr.c compat/windows-config.h compat/compat.h \ - compat/strdup.c configfile.c cook.c \ + compat/strchr.c compat/windows-config.h compat/strdup.c \ + compat/compat.h configfile.c cook.c \ enum.c env.c file.c \ find.c genshell.c genshell.h \ gettext.h init.c load.c \ diff --git a/sntp/libopts/README b/sntp/libopts/README index 0d9ac649f..184473d85 100644 --- a/sntp/libopts/README +++ b/sntp/libopts/README @@ -115,7 +115,7 @@ These macros work as follows: LICENSING: -This material is Copyright (c) 1992-2012 by Bruce Korb. You are +This material is Copyright (C) 1992-2013 by Bruce Korb. You are licensed to use this under the terms of either the GNU Lesser General Public License (see: COPYING.lgpl), or, at your option, the modified Berkeley Software Distribution License (see: COPYING.mbsd). Both of diff --git a/sntp/libopts/ag-char-map.h b/sntp/libopts/ag-char-map.h index a8f45b492..ff8e2dc52 100644 --- a/sntp/libopts/ag-char-map.h +++ b/sntp/libopts/ag-char-map.h @@ -1,6 +1,6 @@ /* * 29 bits for 46 character classifications - * generated by char-mapper on 12/27/12 at 12:58:59 + * generated by char-mapper on 01/04/13 at 16:15:42 * * This file contains the character classifications * used by AutoGen and AutoOpts for identifying tokens. @@ -8,7 +8,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/alias.c b/sntp/libopts/alias.c index bd4c57bf2..a4d44b651 100644 --- a/sntp/libopts/alias.c +++ b/sntp/libopts/alias.c @@ -8,7 +8,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/ao-strs.c b/sntp/libopts/ao-strs.c index 7b6db5311..d6b7acc1c 100644 --- a/sntp/libopts/ao-strs.c +++ b/sntp/libopts/ao-strs.c @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (ao-strs.c) * - * It has been AutoGen-ed December 27, 2012 at 12:58:59 PM by AutoGen 5.17.0pre12 + * It has been AutoGen-ed January 4, 2013 at 04:15:42 PM by AutoGen 5.17.1pre14 * From the definitions ao-strs.def * and the template file strings * diff --git a/sntp/libopts/ao-strs.h b/sntp/libopts/ao-strs.h index 588a910ae..d1f27b967 100644 --- a/sntp/libopts/ao-strs.h +++ b/sntp/libopts/ao-strs.h @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (ao-strs.h) * - * It has been AutoGen-ed December 27, 2012 at 12:58:59 PM by AutoGen 5.17.0pre12 + * It has been AutoGen-ed January 4, 2013 at 04:15:42 PM by AutoGen 5.17.1pre14 * From the definitions ao-strs.def * and the template file strings * diff --git a/sntp/libopts/autoopts.c b/sntp/libopts/autoopts.c index 3786c3803..c9e380b2d 100644 --- a/sntp/libopts/autoopts.c +++ b/sntp/libopts/autoopts.c @@ -9,7 +9,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/autoopts.h b/sntp/libopts/autoopts.h index 88daff4d2..c4bf544cb 100644 --- a/sntp/libopts/autoopts.h +++ b/sntp/libopts/autoopts.h @@ -7,7 +7,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/boolean.c b/sntp/libopts/boolean.c index 8e27fed13..cf3b116c3 100644 --- a/sntp/libopts/boolean.c +++ b/sntp/libopts/boolean.c @@ -9,7 +9,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/check.c b/sntp/libopts/check.c index ef4f25aad..9860df1ea 100644 --- a/sntp/libopts/check.c +++ b/sntp/libopts/check.c @@ -8,7 +8,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/configfile.c b/sntp/libopts/configfile.c index cd7415189..b08169e0f 100644 --- a/sntp/libopts/configfile.c +++ b/sntp/libopts/configfile.c @@ -5,7 +5,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/cook.c b/sntp/libopts/cook.c index 8ddcc7f79..98ce81ce2 100644 --- a/sntp/libopts/cook.c +++ b/sntp/libopts/cook.c @@ -6,7 +6,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -84,13 +84,17 @@ ao_string_cook_escape_char(char const * pzIn, char * pRes, uint_t nl) case 'x': case 'X': /* HEX Escape */ if (IS_HEX_DIGIT_CHAR(*pzIn)) { - char z[4], *pz = z; + char z[4]; + unsigned int ct = 0; - do *(pz++) = *(pzIn++); - while (IS_HEX_DIGIT_CHAR(*pzIn) && (pz < z + 2)); - *pz = NUL; + do { + z[ct] = pzIn[ct]; + if (++ct >= 2) + break; + } while (IS_HEX_DIGIT_CHAR(pzIn[ct])); + z[ct] = NUL; *pRes = (char)strtoul(z, NULL, 16); - res += (unsigned int)(pz - z); + return ct + 1; } break; @@ -99,24 +103,29 @@ ao_string_cook_escape_char(char const * pzIn, char * pRes, uint_t nl) { /* * IF the character copied was an octal digit, - * THEN set the output character to an octal value + * THEN set the output character to an octal value. + * The 3 octal digit result might exceed 0xFF, so check it. */ - char z[4], *pz = z + 1; + char z[4]; unsigned long val; - z[0] = *pRes; + unsigned int ct = 0; - while (IS_OCT_DIGIT_CHAR(*pzIn) && (pz < z + 3)) - *(pz++) = *(pzIn++); - *pz = NUL; + z[ct++] = *--pzIn; + while (IS_OCT_DIGIT_CHAR(pzIn[ct])) { + z[ct] = pzIn[ct]; + if (++ct >= 3) + break; + } + + z[ct] = NUL; val = strtoul(z, NULL, 8); if (val > 0xFF) val = 0xFF; *pRes = (char)val; - res = (unsigned int)(pz - z); - break; + return ct; } - default: ; + default: /* quoted character is result character */; } return res; diff --git a/sntp/libopts/enum.c b/sntp/libopts/enum.c index a483bbe31..f1f70ea50 100644 --- a/sntp/libopts/enum.c +++ b/sntp/libopts/enum.c @@ -9,7 +9,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/env.c b/sntp/libopts/env.c index f3fa3465f..3167a1500 100644 --- a/sntp/libopts/env.c +++ b/sntp/libopts/env.c @@ -9,7 +9,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/file.c b/sntp/libopts/file.c index 72a0cc5e9..a14ca315d 100644 --- a/sntp/libopts/file.c +++ b/sntp/libopts/file.c @@ -4,7 +4,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/find.c b/sntp/libopts/find.c index 24d14eec2..4d70bf8cd 100644 --- a/sntp/libopts/find.c +++ b/sntp/libopts/find.c @@ -8,7 +8,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/genshell.c b/sntp/libopts/genshell.c index 1deee37a6..9e81af090 100644 --- a/sntp/libopts/genshell.c +++ b/sntp/libopts/genshell.c @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (genshell.c) * - * It has been AutoGen-ed December 27, 2012 at 12:59:02 PM by AutoGen 5.17.0pre12 + * It has been AutoGen-ed January 4, 2013 at 04:15:46 PM by AutoGen 5.17.1pre14 * From the definitions genshell.def * and the template file options * - * Generated from AutoOpts 37:0:12 templates. + * Generated from AutoOpts 37:1:12 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen diff --git a/sntp/libopts/genshell.h b/sntp/libopts/genshell.h index e158cd161..c6ae4ed75 100644 --- a/sntp/libopts/genshell.h +++ b/sntp/libopts/genshell.h @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (genshell.h) * - * It has been AutoGen-ed December 27, 2012 at 12:59:02 PM by AutoGen 5.17.0pre12 + * It has been AutoGen-ed January 4, 2013 at 04:15:46 PM by AutoGen 5.17.1pre14 * From the definitions genshell.def * and the template file options * - * Generated from AutoOpts 37:0:12 templates. + * Generated from AutoOpts 37:1:12 templates. * * AutoOpts is a copyrighted work. This header file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen @@ -55,7 +55,7 @@ * tolerable version is at least as old as what was current when the header * template was released. */ -#define AO_TEMPLATE_VERSION 151552 +#define AO_TEMPLATE_VERSION 151553 #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) # error option template version mismatches autoopts/options.h header diff --git a/sntp/libopts/gettext.h b/sntp/libopts/gettext.h index 151ba4f67..e059b2099 100644 --- a/sntp/libopts/gettext.h +++ b/sntp/libopts/gettext.h @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2012 Free Software + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2013 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/sntp/libopts/init.c b/sntp/libopts/init.c index dab2060a0..17bd87bb7 100644 --- a/sntp/libopts/init.c +++ b/sntp/libopts/init.c @@ -5,7 +5,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/load.c b/sntp/libopts/load.c index 82680b5ed..48fb03ae5 100644 --- a/sntp/libopts/load.c +++ b/sntp/libopts/load.c @@ -7,7 +7,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/makeshell.c b/sntp/libopts/makeshell.c index 2d355fe94..28710f8cc 100644 --- a/sntp/libopts/makeshell.c +++ b/sntp/libopts/makeshell.c @@ -7,7 +7,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/nested.c b/sntp/libopts/nested.c index 0f37e2347..257ce8440 100644 --- a/sntp/libopts/nested.c +++ b/sntp/libopts/nested.c @@ -6,7 +6,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/numeric.c b/sntp/libopts/numeric.c index a2256a509..6b7a0b7e1 100644 --- a/sntp/libopts/numeric.c +++ b/sntp/libopts/numeric.c @@ -4,7 +4,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/option-value-type.c b/sntp/libopts/option-value-type.c index aa56333dd..06e32e5d4 100644 --- a/sntp/libopts/option-value-type.c +++ b/sntp/libopts/option-value-type.c @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (stdin.c) * - * It has been AutoGen-ed December 27, 2012 at 12:59:01 PM by AutoGen 5.17.0pre12 + * It has been AutoGen-ed January 4, 2013 at 04:15:45 PM by AutoGen 5.17.1pre14 * From the definitions stdin * and the template file str2enum * diff --git a/sntp/libopts/option-value-type.h b/sntp/libopts/option-value-type.h index becaa13e1..ac1fb9e4d 100644 --- a/sntp/libopts/option-value-type.h +++ b/sntp/libopts/option-value-type.h @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (stdin.h) * - * It has been AutoGen-ed December 27, 2012 at 12:59:01 PM by AutoGen 5.17.0pre12 + * It has been AutoGen-ed January 4, 2013 at 04:15:45 PM by AutoGen 5.17.1pre14 * From the definitions stdin * and the template file str2enum * diff --git a/sntp/libopts/option-xat-attribute.c b/sntp/libopts/option-xat-attribute.c index 85e475676..f5374716d 100644 --- a/sntp/libopts/option-xat-attribute.c +++ b/sntp/libopts/option-xat-attribute.c @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (stdin.c) * - * It has been AutoGen-ed December 27, 2012 at 12:59:00 PM by AutoGen 5.17.0pre12 + * It has been AutoGen-ed January 4, 2013 at 04:15:43 PM by AutoGen 5.17.1pre14 * From the definitions stdin * and the template file str2enum * diff --git a/sntp/libopts/option-xat-attribute.h b/sntp/libopts/option-xat-attribute.h index 19d705a88..11204161a 100644 --- a/sntp/libopts/option-xat-attribute.h +++ b/sntp/libopts/option-xat-attribute.h @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (stdin.h) * - * It has been AutoGen-ed December 27, 2012 at 12:59:00 PM by AutoGen 5.17.0pre12 + * It has been AutoGen-ed January 4, 2013 at 04:15:43 PM by AutoGen 5.17.1pre14 * From the definitions stdin * and the template file str2enum * diff --git a/sntp/libopts/parse-duration.c b/sntp/libopts/parse-duration.c index c763a8ac1..5f4496dbc 100644 --- a/sntp/libopts/parse-duration.c +++ b/sntp/libopts/parse-duration.c @@ -1,5 +1,5 @@ /* Parse a time duration and return a seconds count - Copyright (C) 2008-2012 Free Software Foundation, Inc. + Copyright (C) 2008-2013 Free Software Foundation, Inc. Written by Bruce Korb , 2008. This program is free software: you can redistribute it and/or modify @@ -113,7 +113,7 @@ parse_hr_min_sec (time_t start, cch_t * pz) if (errno != 0) return BAD_TIME; - start = scale_n_add ((time_t)v, start, 60); + start = scale_n_add (v, start, 60); if (errno != 0) return BAD_TIME; @@ -144,7 +144,7 @@ parse_scaled_value (time_t base, cch_t ** ppz, cch_t * endp, int scale) return base; errno = 0; - val = (time_t)str_const_to_ul (pz, &pz, 10); + val = str_const_to_ul (pz, &pz, 10); if (errno != 0) return BAD_TIME; while (isspace ((unsigned char)*pz)) @@ -550,7 +550,7 @@ parse_non_iso8601 (cch_t * pz) break; } - res = scale_n_add (res, (time_t)val, (int)mult); + res = scale_n_add (res, val, mult); pz++; while (isspace ((unsigned char)*pz)) diff --git a/sntp/libopts/parse-duration.h b/sntp/libopts/parse-duration.h index 05570a09d..cbe31b87f 100644 --- a/sntp/libopts/parse-duration.h +++ b/sntp/libopts/parse-duration.h @@ -1,5 +1,5 @@ /* Parse a time duration and return a seconds count - Copyright (C) 2008-2012 Free Software Foundation, Inc. + Copyright (C) 2008-2013 Free Software Foundation, Inc. Written by Bruce Korb , 2008. This program is free software: you can redistribute it and/or modify diff --git a/sntp/libopts/pgusage.c b/sntp/libopts/pgusage.c index 5634799e5..9e923d94b 100644 --- a/sntp/libopts/pgusage.c +++ b/sntp/libopts/pgusage.c @@ -9,7 +9,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/proto.h b/sntp/libopts/proto.h index 38e551b01..20fec4bc1 100644 --- a/sntp/libopts/proto.h +++ b/sntp/libopts/proto.h @@ -1,97 +1,91 @@ /* -*- buffer-read-only: t -*- vi: set ro: * * Prototypes for autoopts - * Generated Thu Dec 27 12:59:13 PST 2012 + * Generated Fri Jan 4 16:15:56 PST 2013 */ #ifndef AUTOOPTS_PROTO_H_GUARD #define AUTOOPTS_PROTO_H_GUARD 1 -#ifndef LOCAL -# define LOCAL extern -# define REDEF_LOCAL 1 -#else -# undef REDEF_LOCAL -#endif /* * Extracted from autoopts.c */ -LOCAL void * +static void * ao_malloc(size_t sz); -LOCAL void * +static void * ao_realloc(void *p, size_t sz); -LOCAL char * +static char * ao_strdup(char const *str); -LOCAL tSuccess +static tSuccess handle_opt(tOptions * pOpts, tOptState * o_st); -LOCAL tSuccess +static tSuccess next_opt(tOptions * opts, tOptState * o_st); -LOCAL tSuccess +static tSuccess regular_opts(tOptions * opts); /* * Extracted from check.c */ -LOCAL bool +static bool is_consistent(tOptions * pOpts); /* * Extracted from configfile.c */ -LOCAL void +static void intern_file_load(tOptions * opts); -LOCAL char* +static char* parse_attrs(tOptions * opts, char * txt, tOptionLoadMode * pMode, tOptionValue * pType); /* * Extracted from env.c */ -LOCAL void +static void doPrognameEnv(tOptions * pOpts, teEnvPresetType type); -LOCAL void +static void env_presets(tOptions * pOpts, teEnvPresetType type); /* * Extracted from find.c */ -LOCAL tSuccess +static tSuccess opt_find_long(tOptions * opts, char const * opt_name, tOptState * state); -LOCAL tSuccess +static tSuccess opt_find_short(tOptions* pOpts, uint_t optValue, tOptState* pOptState); -LOCAL tSuccess +static tSuccess get_opt_arg(tOptions * opts, tOptState * o_st); -LOCAL tSuccess +static tSuccess find_opt(tOptions * opts, tOptState * o_st); /* * Extracted from init.c */ -LOCAL tSuccess +static tSuccess validate_struct(tOptions * opts, char const * pname); -LOCAL tSuccess +static tSuccess immediate_opts(tOptions * opts); -LOCAL bool +static bool ao_initialize(tOptions * opts, int a_ct, char ** a_v); /* * Extracted from load.c */ -LOCAL void +static void munge_str(char * txt, tOptionLoadMode mode); -LOCAL void +static void loadOptionLine( tOptions * opts, tOptState * opt_state, @@ -102,38 +96,34 @@ loadOptionLine( /* * Extracted from nested.c */ -LOCAL void +static void unload_arg_list(tArgList * arg_list); -LOCAL tOptionValue * +static tOptionValue * optionLoadNested(char const * text, char const * name, size_t nm_len); -LOCAL int +static int get_special_char(char const ** ppz, int * ct); -LOCAL void +static void emit_special_char(FILE * fp, int ch); /* * Extracted from sort.c */ -LOCAL void -optionSort(tOptions* pOpts); +static void +optionSort(tOptions * opts); /* * Extracted from stack.c */ -LOCAL void +static void addArgListEntry(void** ppAL, void* entry); /* * Extracted from usage.c */ -LOCAL void +static void set_usage_flags(tOptions * opts, char const * flg_txt); -#ifdef REDEF_LOCAL -# undef LOCAL -# define LOCAL -#endif #endif /* AUTOOPTS_PROTO_H_GUARD */ diff --git a/sntp/libopts/putshell.c b/sntp/libopts/putshell.c index 63f59218c..bafd4edd6 100644 --- a/sntp/libopts/putshell.c +++ b/sntp/libopts/putshell.c @@ -8,7 +8,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/reset.c b/sntp/libopts/reset.c index 19d042702..79967bfdd 100644 --- a/sntp/libopts/reset.c +++ b/sntp/libopts/reset.c @@ -4,7 +4,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/restore.c b/sntp/libopts/restore.c index 7b36cf029..2a3d9e181 100644 --- a/sntp/libopts/restore.c +++ b/sntp/libopts/restore.c @@ -8,7 +8,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/save.c b/sntp/libopts/save.c index 9e42019fa..471130b0f 100644 --- a/sntp/libopts/save.c +++ b/sntp/libopts/save.c @@ -8,7 +8,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/sort.c b/sntp/libopts/sort.c index f1c775c4f..e5fd66194 100644 --- a/sntp/libopts/sort.c +++ b/sntp/libopts/sort.c @@ -6,7 +6,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -27,26 +27,26 @@ /* = = = START-STATIC-FORWARD = = = */ static tSuccess -mustHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, - char** ppzOpts, int* pOptsIdx); +must_arg(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx); static tSuccess -mayHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, - char** ppzOpts, int* pOptsIdx); +maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx); static tSuccess -checkShortOpts(tOptions* pOpts, char* pzArg, tOptState* pOS, - char** ppzOpts, int* pOptsIdx); +short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx); /* = = = END-STATIC-FORWARD = = = */ /* - * "mustHandleArg" and "mayHandleArg" are really similar. The biggest + * "must_arg" and "maybe_arg" are really similar. The biggest * difference is that "may" will consume the next argument only if it * does not start with a hyphen and "must" will consume it, hyphen or not. */ static tSuccess -mustHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, - char** ppzOpts, int* pOptsIdx) +must_arg(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx) { /* * An option argument is required. Long options can either have @@ -59,7 +59,7 @@ mustHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, * See if an arg string follows the flag character. If not, * the next arg must be the option argument. */ - if (*pzArg != NUL) + if (*arg_txt != NUL) return SUCCESS; break; @@ -75,16 +75,16 @@ mustHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, default: return FAILURE; } - if (pOpts->curOptIdx >= pOpts->origArgCt) + if (opts->curOptIdx >= opts->origArgCt) return FAILURE; - ppzOpts[ (*pOptsIdx)++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + opt_txt[ (*opt_idx)++ ] = opts->origArgVect[ (opts->curOptIdx)++ ]; return SUCCESS; } static tSuccess -mayHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, - char** ppzOpts, int* pOptsIdx) +maybe_arg(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx) { /* * An option argument is optional. @@ -96,7 +96,7 @@ mayHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, * THEN see if there is another argument. If so and if it * does *NOT* start with a hyphen, then it is the option arg. */ - if (*pzArg != NUL) + if (*arg_txt != NUL) return SUCCESS; break; @@ -112,12 +112,12 @@ mayHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, default: return FAILURE; } - if (pOpts->curOptIdx >= pOpts->origArgCt) + if (opts->curOptIdx >= opts->origArgCt) return PROBLEM; - pzArg = pOpts->origArgVect[ pOpts->curOptIdx ]; - if (*pzArg != '-') - ppzOpts[ (*pOptsIdx)++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + arg_txt = opts->origArgVect[ opts->curOptIdx ]; + if (*arg_txt != '-') + opt_txt[ (*opt_idx)++ ] = opts->origArgVect[ (opts->curOptIdx)++ ]; return SUCCESS; } @@ -126,31 +126,31 @@ mayHandleArg(tOptions* pOpts, char* pzArg, tOptState* pOS, * does or may take an argument, the do the argument processing and leave. */ static tSuccess -checkShortOpts(tOptions* pOpts, char* pzArg, tOptState* pOS, - char** ppzOpts, int* pOptsIdx) +short_opt_ck(tOptions * opts, char * arg_txt, tOptState * pOS, + char ** opt_txt, uint32_t * opt_idx) { - while (*pzArg != NUL) { - if (FAILED(opt_find_short(pOpts, (uint8_t)*pzArg, pOS))) + while (*arg_txt != NUL) { + if (FAILED(opt_find_short(opts, (uint8_t)*arg_txt, pOS))) return FAILURE; /* * See if we can have an arg. */ if (OPTST_GET_ARGTYPE(pOS->pOD->fOptState) == OPARG_TYPE_NONE) { - pzArg++; + arg_txt++; } else if (pOS->pOD->fOptState & OPTST_ARG_OPTIONAL) { /* * Take an argument if it is not attached and it does not * start with a hyphen. */ - if (pzArg[1] != NUL) + if (arg_txt[1] != NUL) return SUCCESS; - pzArg = pOpts->origArgVect[ pOpts->curOptIdx ]; - if (*pzArg != '-') - ppzOpts[ (*pOptsIdx)++ ] = - pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + arg_txt = opts->origArgVect[ opts->curOptIdx ]; + if (*arg_txt != '-') + opt_txt[ (*opt_idx)++ ] = + opts->origArgVect[ (opts->curOptIdx)++ ]; return SUCCESS; } else { @@ -158,11 +158,11 @@ checkShortOpts(tOptions* pOpts, char* pzArg, tOptState* pOS, * IF we need another argument, be sure it is there and * take it. */ - if (pzArg[1] == NUL) { - if (pOpts->curOptIdx >= pOpts->origArgCt) + if (arg_txt[1] == NUL) { + if (opts->curOptIdx >= opts->origArgCt) return FAILURE; - ppzOpts[ (*pOptsIdx)++ ] = - pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + opt_txt[ (*opt_idx)++ ] = + opts->origArgVect[ (opts->curOptIdx)++ ]; } return SUCCESS; } @@ -175,12 +175,12 @@ checkShortOpts(tOptions* pOpts, char* pzArg, tOptState* pOS, * then this routine will to the trick. */ LOCAL void -optionSort(tOptions* pOpts) +optionSort(tOptions * opts) { - char** ppzOpts; - char** ppzOpds; - int optsIdx = 0; - int opdsIdx = 0; + char ** opt_txt; + char ** ppzOpds; + uint32_t optsIdx = 0; + uint32_t opdsIdx = 0; tOptState os = OPTSTATE_INITIALIZER(DEFINED); @@ -188,24 +188,24 @@ optionSort(tOptions* pOpts) * Disable for POSIX conformance, or if there are no operands. */ if ( (getenv("POSIXLY_CORRECT") != NULL) - || NAMED_OPTS(pOpts)) + || NAMED_OPTS(opts)) return; /* * Make sure we can allocate two full-sized arg vectors. */ - ppzOpts = malloc(pOpts->origArgCt * sizeof(char*)); - if (ppzOpts == NULL) + opt_txt = malloc(opts->origArgCt * sizeof(char*)); + if (opt_txt == NULL) goto exit_no_mem; - ppzOpds = malloc(pOpts->origArgCt * sizeof(char*)); + ppzOpds = malloc(opts->origArgCt * sizeof(char*)); if (ppzOpds == NULL) { - free(ppzOpts); + free(opt_txt); goto exit_no_mem; } - pOpts->curOptIdx = 1; - pOpts->pzCurOpt = NULL; + opts->curOptIdx = 1; + opts->pzCurOpt = NULL; /* * Now, process all the options from our current position onward. @@ -213,30 +213,30 @@ optionSort(tOptions* pOpts) * non-standard programs that require it.) */ for (;;) { - char* pzArg; + char * arg_txt; tSuccess res; /* * If we're out of arguments, we're done. Join the option and * operand lists into the original argument vector. */ - if (pOpts->curOptIdx >= pOpts->origArgCt) { + if (opts->curOptIdx >= opts->origArgCt) { errno = 0; goto joinLists; } - pzArg = pOpts->origArgVect[ pOpts->curOptIdx ]; - if (*pzArg != '-') { - ppzOpds[ opdsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + arg_txt = opts->origArgVect[ opts->curOptIdx ]; + if (*arg_txt != '-') { + ppzOpds[ opdsIdx++ ] = opts->origArgVect[ (opts->curOptIdx)++ ]; continue; } - switch (pzArg[1]) { + switch (arg_txt[1]) { case NUL: /* * A single hyphen is an operand. */ - ppzOpds[ opdsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + ppzOpds[ opdsIdx++ ] = opts->origArgVect[ (opts->curOptIdx)++ ]; continue; case '-': @@ -244,12 +244,12 @@ optionSort(tOptions* pOpts) * Two consecutive hypens. Put them on the options list and then * _always_ force the remainder of the arguments to be operands. */ - if (pzArg[2] == NUL) { - ppzOpts[ optsIdx++ ] = - pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + if (arg_txt[2] == NUL) { + opt_txt[ optsIdx++ ] = + opts->origArgVect[ (opts->curOptIdx)++ ]; goto restOperands; } - res = opt_find_long(pOpts, pzArg+2, &os); + res = opt_find_long(opts, arg_txt+2, &os); break; default: @@ -258,10 +258,10 @@ optionSort(tOptions* pOpts) * option processing. Otherwise the character must be a * short (i.e. single character) option. */ - if ((pOpts->fOptSet & OPTPROC_SHORTOPT) == 0) { - res = opt_find_long(pOpts, pzArg+1, &os); + if ((opts->fOptSet & OPTPROC_SHORTOPT) == 0) { + res = opt_find_long(opts, arg_txt+1, &os); } else { - res = opt_find_short(pOpts, (uint8_t)pzArg[1], &os); + res = opt_find_short(opts, (uint8_t)arg_txt[1], &os); } break; } @@ -275,7 +275,7 @@ optionSort(tOptions* pOpts) * Next, we have to see if we need to pull another argument to be * used as the option argument. */ - ppzOpts[ optsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + opt_txt[ optsIdx++ ] = opts->origArgVect[ (opts->curOptIdx)++ ]; if (OPTST_GET_ARGTYPE(os.pOD->fOptState) == OPARG_TYPE_NONE) { /* @@ -284,20 +284,20 @@ optionSort(tOptions* pOpts) * of the argument string. */ if ( (os.optType == TOPT_SHORT) - && FAILED(checkShortOpts(pOpts, pzArg+2, &os, ppzOpts, - &optsIdx)) ) { + && FAILED(short_opt_ck(opts, arg_txt+2, &os, opt_txt, + &optsIdx)) ) { errno = EINVAL; goto freeTemps; } } else if (os.pOD->fOptState & OPTST_ARG_OPTIONAL) { - switch (mayHandleArg(pOpts, pzArg+2, &os, ppzOpts, &optsIdx)) { + switch (maybe_arg(opts, arg_txt+2, &os, opt_txt, &optsIdx)) { case FAILURE: errno = EIO; goto freeTemps; case PROBLEM: errno = 0; goto joinLists; } } else { - switch (mustHandleArg(pOpts, pzArg+2, &os, ppzOpts, &optsIdx)) { + switch (must_arg(opts, arg_txt+2, &os, opt_txt, &optsIdx)) { case PROBLEM: case FAILURE: errno = EIO; goto freeTemps; } @@ -305,19 +305,19 @@ optionSort(tOptions* pOpts) } /* for (;;) */ restOperands: - while (pOpts->curOptIdx < pOpts->origArgCt) - ppzOpds[ opdsIdx++ ] = pOpts->origArgVect[ (pOpts->curOptIdx)++ ]; + while (opts->curOptIdx < opts->origArgCt) + ppzOpds[ opdsIdx++ ] = opts->origArgVect[ (opts->curOptIdx)++ ]; joinLists: if (optsIdx > 0) - memcpy(pOpts->origArgVect + 1, ppzOpts, + memcpy(opts->origArgVect + 1, opt_txt, (size_t)optsIdx * sizeof(char*)); if (opdsIdx > 0) - memcpy(pOpts->origArgVect + 1 + optsIdx, ppzOpds, + memcpy(opts->origArgVect + 1 + optsIdx, ppzOpds, (size_t)opdsIdx * sizeof(char*)); freeTemps: - free(ppzOpts); + free(opt_txt); free(ppzOpds); return; diff --git a/sntp/libopts/stack.c b/sntp/libopts/stack.c index 4887aea03..95c211e7c 100644 --- a/sntp/libopts/stack.c +++ b/sntp/libopts/stack.c @@ -7,7 +7,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/streqvcmp.c b/sntp/libopts/streqvcmp.c index c7b3ebde1..425331f1f 100644 --- a/sntp/libopts/streqvcmp.c +++ b/sntp/libopts/streqvcmp.c @@ -11,7 +11,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/text_mmap.c b/sntp/libopts/text_mmap.c index a72965d47..64b23855f 100644 --- a/sntp/libopts/text_mmap.c +++ b/sntp/libopts/text_mmap.c @@ -5,7 +5,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/time.c b/sntp/libopts/time.c index 2cd546800..a45f6158e 100644 --- a/sntp/libopts/time.c +++ b/sntp/libopts/time.c @@ -4,7 +4,7 @@ * * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/tokenize.c b/sntp/libopts/tokenize.c index 10073cf5f..8c68e84e3 100644 --- a/sntp/libopts/tokenize.c +++ b/sntp/libopts/tokenize.c @@ -2,7 +2,7 @@ * This file defines the string_tokenize interface * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/usage.c b/sntp/libopts/usage.c index 9cf272844..3f26c05da 100644 --- a/sntp/libopts/usage.c +++ b/sntp/libopts/usage.c @@ -14,7 +14,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control diff --git a/sntp/libopts/version.c b/sntp/libopts/version.c index 3a9c0488a..d0c4942bc 100644 --- a/sntp/libopts/version.c +++ b/sntp/libopts/version.c @@ -7,7 +7,7 @@ /* * This file is part of AutoOpts, a companion to AutoGen. * AutoOpts is free software. - * AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved + * AutoOpts is Copyright (C) 1992-2013 by Bruce Korb - all rights reserved * * AutoOpts is available under any one of two licenses. The license * in use must be one of these two and the choice is under the control @@ -38,10 +38,8 @@ char const* optionVersion(void) { - static char const zVersion[] = - STR(AO_CURRENT.AO_REVISION); - - return zVersion; + static char const ver[] = OPTIONS_DOTTED_VERSION; + return ver; } /**