From 6f6115d4d19e0ed85c6bff80b11ae59d62d962d4 Mon Sep 17 00:00:00 2001 From: madmurphy Date: Mon, 11 May 2020 10:40:41 +0100 Subject: [PATCH] Commit #143 --- ChangeLog | 7 ++++ MANUAL.md | 2 -- Makefile.am | 6 +--- README | 49 ++++++++++++++----------- autostuff/chunks/revision-warning.c | 5 ++- autostuff/m4/not-autotools.m4 | 4 +-- autostuff/shadows/package.json.in | 2 +- configure.ac | 25 ++++++------- dev/hackings/all/confini-metadata.c | 2 +- dev/hackings/all/confini-metadata.h | 2 +- dev/hackings/baremetal/README.md | 4 +-- dev/marked-sources/confini-marked.c | 21 ++++++----- dev/marked-sources/confini-marked.h | 11 +++--- docs/html/baremetal.html | 20 +++++------ docs/html/changelog.html | 5 +++ docs/html/confini_8c.html | 44 +++++++++++------------ docs/html/confini_8h.html | 44 +++++++++++------------ docs/html/confini_8h_source.html | 56 ++++++++++++++--------------- docs/html/libconfini.html | 32 ++++++++--------- docs/html/readme.html | 6 ++-- docs/man/man3/IniDispatch.3 | 2 +- docs/man/man3/IniFormat.3 | 2 +- docs/man/man3/IniStatistics.3 | 2 +- docs/man/man3/confini.h.3 | 8 ++--- docs/man/man3/libconfini.3 | 4 +-- docs/manual.html | 4 +-- examples/ini_files/delivery.conf | 2 -- package.json | 2 +- src/confini.c | 15 ++++---- src/confini.h | 2 +- src/winres.rc | 8 ++--- 31 files changed, 207 insertions(+), 191 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24d35b6..54e5d02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ Change Log {#changelog} ======================= +## 1.14.1 -- 2020-05-11 + +Changes: + +* Documentation + + ## 1.14.0 -- 2020-03-01 Changes: diff --git a/MANUAL.md b/MANUAL.md index 302f053..4589f73 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -35,12 +35,10 @@ location = Colosseum place = Rome [sender] - name = John Smith email = john.smith@example.com [receiver] - name = Mario Rossi # He's a big guy email = mario.rossi@example.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/Makefile.am b/Makefile.am index f1d1142..1354da6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,7 +56,7 @@ endif WANT_DOC if WANT_EXAMPLES examplesdir = $(docdir)/examples -dist_examples_DATA = \ +dist_examples_SCRIPTS = \ examples/run-example.sh examplesinifilesdir = $(examplesdir)/ini_files @@ -120,10 +120,6 @@ _examples_insthook_ += \ endif HAVE_TRANSFORMATIONS -# Make examples script executable -_examples_insthook_ += \ - chmod +x '$(DESTDIR)$(examplesdir)/run-example.sh'; - endif WANT_EXAMPLES diff --git a/README b/README index faf2b9b..2e8c273 100644 --- a/README +++ b/README @@ -164,34 +164,43 @@ by running the `bootstrap` script. By default, `bootstrap` will also run the `./bootstrap --help`. If you are using **Microsoft Windows**, a batch script for compiling -**libconfini** with [MinGW][7] without Bash is available (`mgwmake.bat`). If you -are interested in using Autotools for compiling **libconfini** under Microsoft -Windows, you can integrate MinGW with [MSYS][8], or you can directly use -[MSYS2][9]. Alternatively, [an unofficial port][10] of **libconfini** for -[Cygwin][11] is available. +**libconfini** with [MinGW][7] without Bash is available (`mgwmake.bat`). If +you are interested in using Autotools for compiling **libconfini** under +Microsoft Windows, you can integrate MinGW with [MSYS][8], or you can directly +use [MSYS2][9] and [its official port][10] of the library. Alternatively, [an +unofficial port][11] of **libconfini** for [Cygwin][12] is available. -For further information, see [INSTALL][12]. +For further information, see [INSTALL][13]. + + +Bindings +-------- + +[Danilo Spinella][14] maintains [a D binding package][15] of **libconfini**. Free software ------------- This library is free software. You can redistribute it and/or modify it under -the terms of the GPL license version 3 or any later version. See [COPYING][13] +the terms of the GPL license version 3 or any later version. See [COPYING][16] for details. -[1]: https://madmurphy.github.io/libconfini/html/baremetal.html -[2]: https://madmurphy.github.io/libconfini/html/libconfini.html -[3]: https://madmurphy.github.io/libconfini/manual.html -[4]: https://github.com/ -[5]: https://github.com/madmurphy/libconfini -[6]: https://repology.org/project/libconfini/versions -[7]: http://www.mingw.org/ -[8]: http://www.mingw.org/wiki/MSYS -[9]: https://www.msys2.org/ -[10]: https://github.com/fd00/yacp/tree/master/libconfini -[11]: https://www.cygwin.com/ -[12]: https://github.com/madmurphy/libconfini/blob/master/INSTALL -[13]: https://github.com/madmurphy/libconfini/blob/master/COPYING + [1]: https://madmurphy.github.io/libconfini/html/baremetal.html + [2]: https://madmurphy.github.io/libconfini/html/libconfini.html + [3]: https://madmurphy.github.io/libconfini/manual.html + [4]: https://github.com/ + [5]: https://github.com/madmurphy/libconfini + [6]: https://repology.org/project/libconfini/versions + [7]: http://www.mingw.org/ + [8]: http://www.mingw.org/wiki/MSYS + [9]: https://www.msys2.org/ + [10]: https://packages.msys2.org/base/mingw-w64-libconfini + [11]: https://github.com/fd00/yacp/tree/master/libconfini + [12]: https://www.cygwin.com/ + [13]: https://github.com/madmurphy/libconfini/blob/master/INSTALL + [14]: https://danyspin97.org/ + [15]: https://github.com/DanySpin97/libconfini-d + [16]: https://github.com/madmurphy/libconfini/blob/master/COPYING diff --git a/autostuff/chunks/revision-warning.c b/autostuff/chunks/revision-warning.c index 94f44d0..3549b4b 100644 --- a/autostuff/chunks/revision-warning.c +++ b/autostuff/chunks/revision-warning.c @@ -5,10 +5,9 @@ ever revised this content, although someone should have. If you are instead that human appointed to review this code before it is pasted to the public header, please remove this text. - If a "standard" header providing these objects is available for your - platform, please replace the entire section below with the following single - line: + platform, please replace the entire section below with the following + content: #include diff --git a/autostuff/m4/not-autotools.m4 b/autostuff/m4/not-autotools.m4 index 2843cb7..e7d710d 100644 --- a/autostuff/m4/not-autotools.m4 +++ b/autostuff/m4/not-autotools.m4 @@ -17,8 +17,8 @@ dnl ************************************************************************** dnl ************************************************************************** -dnl NOTE: This is only a selection of macros from the Not Autotools project -dnl without documentation. For the entire collection and the +dnl NOTE: This is only a selection of macros from the **Not Autotools** +dnl project without documentation. For the entire collection and the dnl documentation please refer to the project's website. dnl ************************************************************************** diff --git a/autostuff/shadows/package.json.in b/autostuff/shadows/package.json.in index 6da7973..8025ea0 100644 --- a/autostuff/shadows/package.json.in +++ b/autostuff/shadows/package.json.in @@ -4,7 +4,7 @@ "description": "@PROJECT_DESCRIPTION@", "homepage": "@PACKAGE_URL@", "author": "@PACKAGE_BUGREPORT@", - "license": "@LICENSE_ID@", + "license": "@LICENSE_SPDX@", "main": "@PACKAGE_CONFNAME@", "repo": "@PUBLISHER_ID@/@PACKAGE_TARNAME@", "repository": { diff --git a/configure.ac b/configure.ac index ad37dbc..1b15924 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_INIT([lib]n4_mem([GL_PROJECT_NAME], [confini]), m4_joinall([.], n4_mem([GL_PROJECT_MAJVER], [1]), n4_mem([GL_PROJECT_MINVER], [14]), - n4_mem([GL_PROJECT_REVVER], [0])), + n4_mem([GL_PROJECT_REVVER], [1])), [madmurphy333@gmail.com], [lib]GL_PROJECT_NAME, [https://madmurphy.github.io/libconfini]) @@ -38,7 +38,7 @@ NC_GLOBAL_LITERALS( [PROJECT_DESCRIPTION], [Yet another INI parser], [LICENSE_STRING], [GNU General Public License, version 3 or any later version], - [LICENSE_ID], [GPL-3.0-or-later], + [LICENSE_SPDX], [GPL-3.0-or-later], [PUBLISHER_NAME], [Stefano Gioffré], [PUBLISHER_ID], [madmurphy], [GIT_HTTP_SERVER], [https://github.com] @@ -141,7 +141,7 @@ AC_CONFIG_AUX_DIR([build-aux]) ### Add `--enable-extended-config[=MODE]` option NC_CONFIG_SHADOW_DIR([autostuff/shadows]) -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([gnu]) ### Add `--enable-author-mode` option AC_ARG_ENABLE([author-mode], @@ -225,7 +225,7 @@ AC_ARG_WITH([io_api], AS_VAR_SET([AC_CPPENV], ['$(OFFICIAL_CPPENV)']) AS_CASE(["${na_tmp_ioflavor}"], - [standard], [], + [standard], [:], [posix], [ AS_IF([test "x${ac_cv_have_posix_c}" = xno], [ NC_MSG_WARNBOX([The POSIX I/O API is not supported on this platform @@ -869,7 +869,7 @@ AS_MKDIR_P(['help']) ### Create a `help/make-targets.txt` file to be printed by `make help` { cat << 'END_HEREDOC' -GNU make utility to maintain AC_PACKAGE_NAME +GNU make utility to maintain AC_PACKAGE_NAME AC_PACKAGE_VERSION Commonly used targets: @@ -888,19 +888,19 @@ NA_HELP_STRINGS( `make check` tests the compiled objects directly from the source directory, `make installcheck` tests the compiled objects from the installation paths (you can pass a `DESTDIR` variable in case of staged - installations), `make finishcheck` tests the compiled objects from + installations), and `make finishcheck` tests the compiled objects from the installation paths without passing any information to the compiler about the latter, in order to check that and are automatically reachable (therefore no `DESTDIR` variable is supported here); note that `make installcheck` and `make finishcheck` can be - launched only after `make install(*)` has been launched], + launched only after having launched `make install(*)`], [[make mostlyclean], [make clean], [make distclean]], [clean the source directory according to different degrees of fury], [[make clobber]], [launch `make uninstall` followed by `make clean`], [[make alldone]], [launch `make install-strip` followed by `make installcheck` - in case - of staged installations it is possible to pass a `DEST` variable (see + of staged installations it is possible to pass a `DESTDIR` variable (see below)], [[make binary-release], [make manifest]], [create respectively a package and a manifest in the current location @@ -956,7 +956,7 @@ NA_HELP_STRINGS( script], [[make approve-revision], [make reject-revision]], [Approve/reject the current customization for a non-standard - environment (available only in specific cases))], + environment (available only in specific cases)], [[make expired]], [(Re)build all the targets listed in the `EXPIRE` user variable, as in `make EXPIRE=']AC_PACKAGE_TARNAME[-git.tar.gz @@ -977,9 +977,10 @@ NA_HELP_STRINGS( the `DESTDIR` variable allows to change the final installation path, independently of how the package has been configured; this variable can contain absolute paths only and defaults to an empty string when - omitted; the `DESTDIR` variable is meant only for staged installations - and must never contain a real installation path - if you need to - customize the target directories, launch `./configure --help`], + omitted; the `DESTDIR` variable is meant to be used only in case of + staged installations and should never contain a real installation path + - if you need to customize the target directories, launch `./configure + --help`], [[ZIPTYPE]], [Supported by `make authors-copy`, `make binary-release`, `make git-clone`, `make portable-builds` and `make source-release`, this diff --git a/dev/hackings/all/confini-metadata.c b/dev/hackings/all/confini-metadata.c index c38091b..71b4e8e 100644 --- a/dev/hackings/all/confini-metadata.c +++ b/dev/hackings/all/confini-metadata.c @@ -4,7 +4,7 @@ @brief libconfini functions @author Stefano Gioffré @copyright GNU General Public License, version 3 or any later version - @version 1.14.0 + @version 1.14.1 @date 2016-2020 @see https://madmurphy.github.io/libconfini diff --git a/dev/hackings/all/confini-metadata.h b/dev/hackings/all/confini-metadata.h index ad651b1..41b7ba9 100644 --- a/dev/hackings/all/confini-metadata.h +++ b/dev/hackings/all/confini-metadata.h @@ -4,7 +4,7 @@ @brief libconfini header @author Stefano Gioffré @copyright GNU General Public License, version 3 or any later version - @version 1.14.0 + @version 1.14.1 @date 2016-2020 @see https://madmurphy.github.io/libconfini diff --git a/dev/hackings/baremetal/README.md b/dev/hackings/baremetal/README.md index cc0636b..7e46b01 100644 --- a/dev/hackings/baremetal/README.md +++ b/dev/hackings/baremetal/README.md @@ -18,7 +18,7 @@ and possibly even without any header at all. Starting from version 1.13.0 a “bare metal” version of **libconfini** has been made available by simply passing a `--without-io-api` option to the `configure` -script. This modified version has the following characteristics: +script. This modified version comes with the following characteristics: * No heap usage (no memory is every allocated or freed) * No I/O functions (it is possible to parse only disposable `char` buffers via @@ -26,7 +26,7 @@ script. This modified version has the following characteristics: * Everything else is inherited verbatim from the official version -## The `--without-io-api` option +## The `dev/hackings/baremetal/` subdirectory When the `configure` script is launched with the `--without-io-api` option (or, equivalently, with `--with-io-api=baremetal`), it assumes that no standard diff --git a/dev/marked-sources/confini-marked.c b/dev/marked-sources/confini-marked.c index c3057ea..2cd04ab 100644 --- a/dev/marked-sources/confini-marked.c +++ b/dev/marked-sources/confini-marked.c @@ -3,14 +3,14 @@ /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ !START_OMISSION! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- -This is a marked **exact copy** of `src/confini.c`, where replaceable sections have -been enclosed within special tags that can be parsed and amended by GNU Make to -create custom forks of the library. +This is a marked **exact copy** of `src/confini.c`, in which replaceable sections +have been wrapped within special tags that can be parsed and amended by GNU Make +during the build process in order to create custom forks of the library. If you want to contribute to the development of this project, please **use this file**, as `src/confini.c` is automatically generated from here. -For more information about the tags used here, see the `NA_AMEND()` macro from +For more information about the tags used here, please see the `NA_AMEND()` macro in `m4/not-autotools.m4` at https://github.com/madmurphy/not-autotools The code below is distributed under the terms of the GPL license version 3 or any @@ -460,8 +460,9 @@ later version. /* - Maybe in the future there will be support for UTF-8 casefold (although probably - not -- see "Code considerations" in the Manual), but for now only ASCII... + Maybe in the future there will be support for UTF-8 case folding (although + probably not -- see "Code considerations" in the Manual), but for now only + ASCII... */ #define _LIBCONFINI_CHR_CASEFOLD_(CHR) (CHR > 0x40 && CHR < 0x5b ? CHR | 0x60 : CHR) @@ -4846,9 +4847,11 @@ void ini_global_set_lowercase_mode (const bool lowercase) { @brief Sets the value to be to be assigned to implicit keys @param implicit_value The string to be used as implicit value - (usually `"YES"`, or `"TRUE"`) - @param implicit_v_len The length of @p implicit_value (usually - `0`, independently of its real length) + (usually `"YES"`, `"TRUE"`, or `"ON"`, or + any other string; it can be `NULL`) + @param implicit_v_len The length of @p implicit_value (without + counting the NUL terminator; use `0` for + both an empty string and `NULL`) @return Nothing @warning This function changes the value of one or more global variables. In diff --git a/dev/marked-sources/confini-marked.h b/dev/marked-sources/confini-marked.h index 095f650..054f9d6 100644 --- a/dev/marked-sources/confini-marked.h +++ b/dev/marked-sources/confini-marked.h @@ -2,15 +2,16 @@ /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ !START_OMISSION! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@- -This is a marked **exact copy** of `src/confini.h`, where replaceable sections -have been enclosed within special tags that can be parsed and amended by GNU -Make to create custom forks of the library. +This is a marked **exact copy** of `src/confini.h`, in which replaceable +sections have been wrapped within special tags that can be parsed and amended +by GNU Make during the build process in order to create custom forks of the +library. If you want to contribute to the development of this project, please **use this file**, as `src/confini.h` is automatically generated from here. -For more information about the tags used here, see the `NA_AMEND()` macro from -`m4/not-autotools.m4` at https://github.com/madmurphy/not-autotools +For more information about the tags used here, please see the `NA_AMEND()` +macro in `m4/not-autotools.m4` at https://github.com/madmurphy/not-autotools The code below is distributed under the terms of the GPL license version 3 or any later version. diff --git a/docs/html/baremetal.html b/docs/html/baremetal.html index 2fb828f..e3721fc 100644 --- a/docs/html/baremetal.html +++ b/docs/html/baremetal.html @@ -69,17 +69,17 @@

What ./configure --without-io-api does

Almost everything in libconfini is implemented from scratch, with the only notable exception of the I/O functions load_ini_file() and load_ini_path(), which rely on standard libraries (either the C Standard or the POSIX Standard, depending on the build settings). On some platforms, however, only a rather exotic I/O API is available, while for some other platforms the C Standard Library is simply too heavy or just not implementable.

In the past the build environment of libconfini did not offer shortcuts for facing this kind of situations – although thanks to the modularity of the source code it was still relatively simple to get rid of every tie with the C Standard Library and compile libconfini as “bare metal”, with strip_ini_cache() as the only parsing function (since this relies only on a buffer for its input) – i.e. without load_ini_file() and load_ini_path(), and possibly even without any header at all.

-

Starting from version 1.13.0 a “bare metal” version of libconfini has been made available by simply passing a --without-io-api option to the configure script. This modified version has the following characteristics:

+

Starting from version 1.13.0 a “bare metal” version of libconfini has been made available by simply passing a --without-io-api option to the configure script. This modified version comes with the following characteristics:

  • No heap usage (no memory is every allocated or freed)
  • No I/O functions (it is possible to parse only disposable char buffers via strip_ini_cache())
  • Everything else is inherited verbatim from the official version
-

The --without-io-api option

+

The dev/hackings/baremetal/ subdirectory

When the configure script is launched with the --without-io-api option (or, equivalently, with --with-io-api=baremetal), it assumes that no standard library at all could be present in the system. Hence it runs a series of tests and creates an inventory of what is present and what is not, in order to amend the source code accordingly – to ignore all the tests and assume that literally nothing from the C Standard library is supported use --with-io-api=nolibc. The amendments are necessary (instead of just relying on the C preprocessor) because it is required to change the public header, and not just the compiled code.

Fortunately only a very small amount of code in libconfini, besides the I/O functions, depends on the C Standard library, so it is relatively easy to produce a “bare metal” fork with or without it.

The dev/hackings/baremetal subdirectory contains all the necessary amendments. These are automatically applied when launching make all or make baremetal-csources from the top level directory, after having launched ./configure --without-io-api (the original source code will be preserved).

-

The files pp-utils.c and number-parsers.c constitute a re-implementation of the functions ini_get_int(), ini_get_lint(), ini_get_llint(), ini_get_float() and ini_get_double(), which in the original code are implemented as pointers to standard functions (see below). These two files amend src/confini.c.

+

The files pp-utils.c and number-parsers.c constitute a re-implementation of the functions ini_get_int(), ini_get_lint(), ini_get_llint(), ini_get_float() and ini_get_double(), which in the original code are implemented as pointers to standard functions (see below). These two files amend src/confini.c.

The file number-parsers.h exports the function headers of what number-parsers.c implements, and amends src/confini.h (i.e. the public header).

The file confini-header.c contains only a nominal workaround-amendment to src/confini.c (for facilitating the build system) that does not change the final C code compiled.

To produce the source code of the “bare metal” version of libconfini a fifth amendment to the public header is also required, containing some common C standard definitions. This amendment is automatically generated for each platform during the build process and will be located under no-dist/hackings/baremetal/c-standard-library.h.

@@ -341,20 +341,20 @@

Parsing numbers without the C Standard Library

}
-
long int(*const ini_get_lint)(const char *ini_string)
Pointer to atol()
Definition: confini.c:4986
+
long int(*const ini_get_lint)(const char *ini_string)
Pointer to atol()
Definition: confini.c:4989
24-bit bitfield representing the format of an INI file (INI dialect)
Definition: confini.h:95
@ CONFINI_ENOENT
Definition: confini.h:380
@ CONFINI_EIO
Definition: confini.h:382
@ CONFINI_EBADF
Definition: confini.h:385
@ CONFINI_ENOMEM
Definition: confini.h:381
-
long long int(*const ini_get_llint)(const char *ini_string)
Pointer to atoll()
Definition: confini.c:4988
-
int load_ini_file(FILE *const ini_file, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parses an INI file and dispatches its content to a custom callback using a FILE structure as argument...
Definition: confini.c:2806
-
int strip_ini_cache(register char *const ini_source, const size_t ini_length, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parses and tokenizes a buffer containing an INI file, then dispatches its content to a custom callbac...
Definition: confini.c:2296
-
double(*const ini_get_double)(const char *ini_string)
Pointer to atof()
Definition: confini.c:4990
-
int(*const ini_get_int)(const char *ini_string)
Pointer to atoi()
Definition: confini.c:4984
+
long long int(*const ini_get_llint)(const char *ini_string)
Pointer to atoll()
Definition: confini.c:4991
+
int load_ini_file(FILE *const ini_file, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parses an INI file and dispatches its content to a custom callback using a FILE structure as argument...
Definition: confini.c:2807
+
int strip_ini_cache(register char *const ini_source, const size_t ini_length, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parses and tokenizes a buffer containing an INI file, then dispatches its content to a custom callbac...
Definition: confini.c:2297
+
double(*const ini_get_double)(const char *ini_string)
Pointer to atof()
Definition: confini.c:4993
+
int(*const ini_get_int)(const char *ini_string)
Pointer to atoi()
Definition: confini.c:4987
@ CONFINI_EFBIG
Definition: confini.h:387
int(* IniDispHandler)(IniDispatch *dispatch, void *user_data)
Callback function for handling an IniDispatch structure.
Definition: confini.h:142
-
int load_ini_path(const char *const path, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parses an INI file and dispatches its content to a custom callback using a path as argument.
Definition: confini.c:2890
+
int load_ini_path(const char *const path, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)
Parses an INI file and dispatches its content to a custom callback using a path as argument.
Definition: confini.c:2891
int(* IniStatsHandler)(IniStatistics *statistics, void *user_data)
Callback function for handling an IniStatistics structure.
Definition: confini.h:133