libconfini
Yet another INI parser
|
Record of notable changes
Changes:
configure
script (made sure not to overwrite the user-given --docdir=[DIR]
argument; created a --disable-devel
option for generating binary-only installations – i.e. without installing headers, static libraries, documentation, examples, etc.) and in the GNU Make environment (Makefile.am
: removed † make binary-image
, † make source-image
and † make authors-suitcase
targets, renamed † make install-manifest
target to make manifest
, created make portable-builds
and make oblivion-clean
targets, improved install-data-hook
and all the helper targets; src/Makefile.am
: moved the CFLAGS
automatically guessed by AC_PROG_CC_C99
to AM_CFLAGS
)strip.exe
to the mgwmake.bat
scriptChanges:
autogen.sh
script has been renamed to bootstrap
make distcheck
fail; made sure that the configure
and bootstrap
scripts can be launched from any path; created † make source-image
, † make authors-suitcase
, make source-release
and make authors-copy
targets for better reproducing the content of the package as released by its authors; created † make binary-image
, make binary-release
and † make install-manifest
targets for aiding staged installations; created a make author-clean
target for cleaning the source directory with the same degree of fury of ./bootstrap --clean
; created a make help
target for printing the list of commonly used targets; replaced † autogen.sh --multiversion
with ./configure --with-other-versions
for creating a package able to coexist with other versions of itself)-Wl,--subsystem,windows
compiler option has been removed from mgwmake.bat
Changes:
strip_ini_cache()
)tests
has been createdexamples/utilities/load_ini_buffer.h
and examples/utilities/make_strarray.h
)configure
script has been improved with a built-in support for complete package renaming (using --program-prefix=PREFIX
, --program-suffix=SUFFX
and ‘--program-transform-name='s/[OLDTEXT]/[NEWTEXT]/[g]’) and several new options (
–enable-version-infoand
–disable-version-info, for enabling/disabling **libtool** versioning system;
–enable-extended-config, for safely exporting package renamings at
configuretime, or any changes in
configure.ac<tt>, directly tosrc/winres.rcand
package.json<tt>-- see INSTALLand
./configure –help` for more information)autostuff
subdirectoryChanges:
strip_ini_cache()
) – a small bug concerning CR
+ LF
line breaks has been fixedChanges:
strip_ini_cache()
has been created – see issue #9 – most of the code of load_ini_file()
has now been moved to strip_ini_cache()
load_ini_file()
and load_ini_path()
)examples/topics/strip_ini_cache.c
)Changes:
examples/miscellanea/colon_as_delimiter.c
)Changes:
further_cuts()
: fixed bug concerning blocks that had been marked as INI_IGNORE
wrongly re-marked as comments after 1.9.0 (due to this bug error CONFINI_EOOR
was thrown)load_ini_file()
: fixed bug related to IniFormat::disabled_after_space
stopping to work properly after 1.9.0Changes:
load_ini_file()
(ambiguous disabled entries that have been already tested with a negative result before invoking f_init()
will be internally marked as comments for not being tested twice – an example of such ambiguous disabled entries is #[foo #bar]
)--multiversion
option to the † autogen.sh
script for future major version changes (see INSTALL
)--with-pkgconfigdir=DIR
option to the configure
scriptdqultrim_s()
has been created_LIBCONFINI_IS_COM_MARKER_()
and _LIBCONFINI_SC_INT_MARKER_
have been created_LIBCONFINI_INLINE_MARKER_
has been renamed to _LIBCONFINI_IC_INT_MARKER_
load_ini_file()
, private functions uncomment()
and further_cuts()
)Changes:
load_ini_file()
, private functions get_type_as_active()
and further_cuts()
)Changes:
Changes:
autogen.sh
: replaced #!/bin/sh
with #!/bin/bash
– see issue #7Changes:
ini_string_match_ss()
, ini_string_match_si()
, ini_array_foreach()
, ini_array_split()
)Changes:
further_cuts()
)-O2
seems to be working better than -O3
on Unix systems: conditionally use -O2
or -O3
depending on the host-avoid-version
only when compiling under native Microsoft Windows environment--clean
option to the † autogen.sh
scriptChanges:
load_ini_file()
, ini_array_foreach()
, ini_array_split()
, private functions is_some_space()
, ltrim_s()
, ltrim_h()
, ltrim_hh()
, rtrim_s()
and rtrim_h()
)Changes:
typedef
s of callback functions (types IniStatsHandler
and IniDispHandler
, both required by load_ini_file()
and load_ini_path()
, type IniStrHandler
, required by ini_array_split()
, and type IniSubstrHandler
, required by ini_array_foreach()
)_LIBCONFINI_INIFORMAT_AS_()
has been renamed to INIFORMAT_TABLE_AS()
and marked as public – please note that the arguments that are passed to the user-given callback are now different0:0:0
); note that libtool versioning system does not affect the versioning of the project currently in use, but constitutes only a means for the linker to keep track of incompatibilities between different releases of the librarysrc/winres.rc
; conditionally added option -avoid-version
to LDFLAGS
in order to skip foreign libtool versioning system under Microsoft Windows; created batch script mgwmake.bat
for compiling libconfini under Microsoft Windows without Autotools)ini_fton()
and ini_ntof()
)examples/topics/ini_array_foreach.c
, examples/topics/ini_array_split.c
and examples/miscellanea/stats_only.c
)Changes:
load_ini_file()
, private function get_type_as_active()
)CLOSE_SECTION
character (]
) is never followed by anything else than empty spacesChanges:
load_ini_path()
– see issue #6 concerning file access under Microsoft Windows)Changes:
--disable-doc
and --disable-examples
options to the configure
script--noconfigure
and --help
options to the † autogen.sh
scriptChanges:
INI_UNIXLIKE_FORMAT
has been createdIniFormat::no_disabled_after_space
has been renamed to IniFormat::disabled_after_space
(the field has opposite meaning now, please invert your booleans accordingly)#include <stdio.h>
from confini.c
to confini.h
Changes:
CONFINI_EFEOOR
has been renamed to CONFINI_EOOR
Changes:
ltrim_hh()
, unescape_cr_lf()
, sanitize_section_path()
, collapse_everything()
, collapse_spaces()
and uncomment()
)Changes:
ini_array_match()
has been createdChanges:
ini_array_shift()
, ini_array_break()
, ini_array_release()
have been createdOFF
/ON
has been added to the list of supported INI booleans0
/1
has been removed from the list of supported INI booleansINIFORMAT_HAS_NO_ESC
has been createdini_get_lazy_bool()
has been removedIniDispatch::append_to
is now passed as const
ini_string_match_ss()
, ini_string_match_si()
, ini_string_match_ii()
, ini_string_parse()
, ini_array_get_length()
, ini_array_foreach()
, ini_array_split()
, private functions uncomment()
and further_cuts()
)get_metachar_pos()
and collapse_empty_quotes()
have been createdsanitize_key_name()
and † get_delimiter_pos()
have been renamed to collapse_everything()
and getn_metachar_pos()
(the latter now requires one more argument)Changes:
IniFormat::section_paths
option to the IniFormat
bitfieldenum
IniSectionPaths
ultrim_h()
has been renamed to qultrim_h()
and rewrittenini_array_foreach()
, ini_array_split()
, ini_string_parse()
, private functions † get_delimiter_pos()
and get_type_as_active()
)Changes:
IniFormat
bitfieldINI_KEY
, INI_SECTION
, INI_DISABLED_KEY
and INI_DISABLED_SECTION
(see enum
IniNodeType
)examples/ini_files
Changes:
IniFormat::preserve_empty_quotes
option to the IniFormat
bitfieldIniFormat::hash
, † IniFormat::semicolon
and † IniFormat::multiline_entries
have been renamed to IniFormat::hash_marker
, IniFormat::semicolon_marker
and IniFormat::multiline_nodes
ini_string_parse()
has been createdini_collapse_array()
has been renamed to ini_array_collapse()
ini_split_array()
has been renamed to ini_array_split()
ini_set_implicit_value()
has been renamed to ini_global_set_implicit_value()
confini_global_set_lowercase_mode()
has been renamed to ini_global_set_lowercase_mode()
INI_INSENSITIVE_LOWERCASE
has been renamed to INI_GLOBAL_LOWERCASE_MODE
INI_GLOBAL_LOWERCASE_MODE
has been set to FALSE
IniFormatId
has been renamed to IniFormatNum
ini_format_get_id()
has been renamed to ini_fton()
ini_format_set_to_id()
has been renamed to ini_ntof()
– now accepts only one argument and has a return valueINI_PARSE_COMMENT
, † INI_SHOW_COMMENT
, † INI_FORGET_COMMENT
and † INI_NORMAL_CHARACTER
have been renamed to INI_DISABLED_OR_COMMENT
, INI_ONLY_COMMENT
, INI_IGNORE
and INI_IS_NOT_A_MARKER
INI_EVERYTHING_MULTILINE
, † INI_ACTIVE_AND_DISABLED_MULTILINE
and † INI_ACTIVE_MULTILINE
have been renamed to INI_MULTILINE_EVERYWHERE
, INI_BUT_COMMENTS
, and INI_BUT_DISABLED_AND_COMMENTS
CONFINI_EIINTR
and † CONFINI_EFEINTR
have been renamed to CONFINI_IINTR
and CONFINI_FEINTR
enum
tags † ConfiniErrorNo
and † IniComments
have been renamed to ConfiniInterruptNo
and IniCommentMarker
sanitize_section_name()
has been renamed to sanitize_section_path()
sanitize_key_name()
ini_array_get_length()
, ini_string_match_si()
, ini_string_match_ii()
, private functions sanitize_section_path()
and collapse_spaces()
)Due to the many renamings this release is largely incompatible with previous versions. However it is possible to reach full backward compatibility with version 1.4.2 by using the following aliases:
#define hash hash_marker #define semicolon semicolon_marker #define multiline_entries multiline_nodes #define ini_collapse_array ini_array_collapse #define ini_split_array ini_array_split #define ini_set_implicit_value ini_global_set_implicit_value #define INI_INSENSITIVE_LOWERCASE INI_GLOBAL_LOWERCASE_MODE #define IniFormatId IniFormatNum #define ini_format_get_id ini_fton #define ini_format_set_to_id(DEST, SRC) (*(DEST) = ini_ntof(SRC)) #define INI_PARSE_COMMENT INI_DISABLED_OR_COMMENT #define INI_SHOW_COMMENT INI_ONLY_COMMENT #define INI_FORGET_COMMENT INI_IGNORE #define INI_NORMAL_CHARACTER INI_IS_NOT_A_MARKER #define INI_EVERYTHING_MULTILINE INI_MULTILINE_EVERYWHERE #define INI_ACTIVE_AND_DISABLED_MULTILINE INI_BUT_COMMENTS #define INI_ACTIVE_MULTILINE INI_BUT_COMMENTS #define CONFINI_EIINTR CONFINI_IINTR #define CONFINI_EFEINTR CONFINI_FEINTR
Changes:
sanitize_section_name()
Changes:
CONFINI_ERROR
INI_INSENSITIVE_LOWERCASE
confini_global_set_lowercase_mode()
, ini_string_match_ss()
, ini_string_match_si()
and ini_string_match_ii()
enum
† ConfiniErrorNo
, load_ini_file()
, ini_unquote()
)#include <stdint.h>
from confini.c
to confini.h
#include <stdio.h>
from confini.h
to confini.c
Changes:
load_ini_file()
now uses a FILE
handle instead of a path – in order to use a path (a string), the shortcut load_ini_path()
has been created#include <stdint.h>
to confini.c
#include <stdio.h>
from confini.c
to confini.h
nul
characters found in INI files will be skippedunsigned long int
replaced with size_t
in return values of ini_unquote()
, ini_array_get_length()
and † ini_collapse_array()
unsigned int
replaced with int
in return values of load_ini_file()
, ini_array_foreach()
and † ini_split_array()
${major}.${minor}.${revision}
instead of ${major}.${minor}-${release}
)Changes:
Changes:
further_cuts()
Changes:
Changes:
Changes:
ini_collapse_array()
has been createdindex
and format
parameters have been added to callback function in ini_array_foreach()
and † ini_split_array()
INI_ERASE_COMMENT
has been renamed to † INI_FORGET_COMMENT
Changes:
Changes:
IniFormat
bitfield has been changedIniFormat::implicit_is_special
has been renamed to IniFormat::implicit_is_not_empty
IniFormat::no_collapsed_values
has been renamed to IniFormat::do_not_collapse_values
IniDispatch::d_length
has been renamed to IniDispatch::d_len
IniDispatch::v_length
has been renamed to IniDispatch::v_len
IniDispatch::at_len
(length of IniDispatch::append_to
) has been createdChanges:
IniFormatMask
has been renamed to IniFormatId
ini_format_set_from_mask()
has been renamed to † ini_format_set_to_id()
ini_format_calculate_mask()
has been renamed to † ini_format_get_id()
IniFormat::no_spaces_in_names
: small bug fixedChanges:
IniDelimiters
has been createdINI_ANY_SPACE
(0
) as delimiter in ini_array_get_length()
, ini_array_foreach()
and † ini_split_array()
IniFormat::no_spaces_in_names
has been createdIniFormat::no_disabled_after_spaces
has been renamed to † IniFormat::no_disabled_after_space
IniFormat::preserve_spaces_in_values
has been renamed to † IniFormat::no_collapsed_values
Changes:
ini_array_getlength()
has been renamed to ini_array_get_length()
ini_getbool()
has been renamed to ini_get_bool()
ini_getlazybool()
has been renamed to ini_get_lazy_bool()
ini_getfloat()
has been renamed to ini_get_float()
ini_getllint()
has been renamed to ini_get_llint()
get_ini_format_mask()
has been renamed to † ini_format_calculate_mask()
read_ini_format_mask()
has been renamed to † ini_format_set_from_mask()
Changes:
Changes:
Changes:
libconfini 0.9-1 is ready to be published!