WinMerge 2.13.14
Update to PCRE 8.10 (r7210)
+ Update SCEW to 1.1.2 (r7212)
WinMerge 2.13.13 - 2010-06-19 (r7205)
Improve editing of linefilter regular expressions (#3015416)
SCEW -- History of visible changes.
-Copyright (C) 2002-2009 Aleix Conchillo Flaqué
+Copyright (C) 2002-2010 Aleix Conchillo Flaqué
See the end for copying conditions.
------------------------------------------------------------------------
+* Version 1.1.2 (2010/06/04)
+
+** Fixes:
+
+ - Precondition violation when assigning preamble to tree after
+ trimming and becoming NULL (scew/xparser.c).
+ (reported by Rudolf Alexander Kerbitz)
+
+------------------------------------------------------------------------
+
* Version 1.1.1 (2009/12/11)
** Changes:
** Changes:
- - Ability to load and XML document from an stream has been
- added. The stream may not be completed, so it will just load
+ - Ability to load and XML document from an stream has been
+ added. The stream may not be completed, so it will just load
correct XML pieces. A callback, set by the user, will be called
each time an element is available.
- (thanks to Gord Shier)
+ (thanks to Gord Shier)
** Fixes:
- - Fixed indentation level when document contains multiple
- consecutive empty elements.
- (thanks to Tom Probasco)
+ - Fixed indentation level when document contains multiple
+ consecutive empty elements.
+ (thanks to Tom Probasco)
- - scew_element_add_attr_pair() did not add a new attribute
- correctly if the attribute already existed.
- (reported by Matthew Peltzer)
+ - scew_element_add_attr_pair() did not add a new attribute
+ correctly if the attribute already existed.
+ (reported by Matthew Peltzer)
- - Compiltaion fixes in MSVC. Compiler interpreted a function
- argument called list as the std::list.
- (reported by Renaud Dumont)
+ - Compiltaion fixes in MSVC. Compiler interpreted a function
+ argument called list as the std::list.
+ (reported by Renaud Dumont)
------------------------------------------------------------------------
** Changes:
- - A new "Unknown error code" message has been added.
- (thanks to Brodie Thiesfield)
+ - A new "Unknown error code" message has been added.
+ (thanks to Brodie Thiesfield)
- - Improved support for Windows and Unix compilation.
- (thanks to Brodie Thiesfield)
+ - Improved support for Windows and Unix compilation.
+ (thanks to Brodie Thiesfield)
- - Added improvements in str functions. mem.* has been removed.
- (thanks to Brodie Thiesfield)
+ - Added improvements in str functions. mem.* has been removed.
+ (thanks to Brodie Thiesfield)
- Write functions have been moved from tree to new writer.* files.
- - Added a preamble section to the XML declaration.
+ - Added a preamble section to the XML declaration.
** Fixes:
- - Allow building in a separate directory.
- (thanks to Kalle Valo)
+ - Allow building in a separate directory.
+ (thanks to Kalle Valo)
------------------------------------------------------------------------
- Added missing performace improvements by using the linked list in
element and attribute iterations.
- (thanks to Brodie Thiesfield)
+ (thanks to Brodie Thiesfield)
- - Added exponentially growing buffer to avoid many realloc calls
- which are slow and fragment memory in scew_element_list.
- (thanks to Brodie Thiesfield)
+ - Added exponentially growing buffer to avoid many realloc calls
+ which are slow and fragment memory in scew_element_list.
+ (thanks to Brodie Thiesfield)
- - Performance improvements in file loading by using a static
- buffer.
- (thanks to Brodie Thiesfield)
+ - Performance improvements in file loading by using a static
+ buffer.
+ (thanks to Brodie Thiesfield)
- - Added scew_parser_load_file_fp().
- (thanks to Brodie Thiesfield)
+ - Added scew_parser_load_file_fp().
+ (thanks to Brodie Thiesfield)
- - Some other minor changes.
- (thanks to Brodie Thiesfield)
+ - Some other minor changes.
+ (thanks to Brodie Thiesfield)
** Fixes:
- - scew_isxdigit() was calling isdigit() instead of isxdigit().
+ - scew_isxdigit() was calling isdigit() instead of isxdigit().
- - scew_isxxxx() fixed.
- (thanks to Brodie Thiesfield)
+ - scew_isxxxx() fixed.
+ (thanks to Brodie Thiesfield)
- - strdup() is a GNU extension, replaced it by own version.
+ - strdup() is a GNU extension, replaced it by own version.
- - Fixed scew_element_by_name.
- (reported by Eric Fronheiser)
+ - Fixed scew_element_by_name.
+ (reported by Eric Fronheiser)
- - Warning fixes (level 4) in Microsoft Visual C++ 7.
- (thanks to Brodie Thiesfield)
+ - Warning fixes (level 4) in Microsoft Visual C++ 7.
+ (thanks to Brodie Thiesfield)
- - Multi-thread support fixed in Microsoft Visual
+ - Multi-thread support fixed in Microsoft Visual
C++. __declspec(thread) did not work, use TLS functions instead.
- (thanks to Brodie Thiesfield)
+ (thanks to Brodie Thiesfield)
------------------------------------------------------------------------
- Added more string functions. New memory functions have also been
added.
- - Performance improved in element and attribute iteration.
- (thanks to Sanzo Miyazawa)
+ - Performance improved in element and attribute iteration.
+ (thanks to Sanzo Miyazawa)
- Support for XML declaration attributes has been added (version,
encoding, standalone). This attributes can be changed using SCEW
tree functions.
- - Improved white spaces treatment in XML element contents.
+ - Improved white spaces treatment in XML element contents.
- - Added error system. See documentation for more details.
+ - Added error system. See documentation for more details.
- - Added pkg-config file.
- (thanks to Neil Harvey)
+ - Added pkg-config file.
+ (thanks to Neil Harvey)
- - Added 'make doc'. If you have doxygen installed (which will be
+ - Added 'make doc'. If you have doxygen installed (which will be
automatically detected), it will create SCEW
documentation. Execute './configure --help' to see more
documentation options.
- - 'make install' does not install example binaries anymore.
+ - 'make install' does not install example binaries anymore.
** Fixes:
- - scew_tree_save_file() did not fclose output file.
- (reported by Paul Bohme)
+ - scew_tree_save_file() did not fclose output file.
+ (reported by Paul Bohme)
- scew_element_free() did not decrement parent number of children.
- (reported by anonymous)
+ (reported by anonymous)
------------------------------------------------------------------------
** Changes:
- - Added --enable-debug flag to the configure script.
+ - Added --enable-debug flag to the configure script.
** Fixes:
- - Added compatibilized headers with C++ (ifdef __cplusplus).
+ - Added compatibilized headers with C++ (ifdef __cplusplus).
- - Compilation warnings fixed.
+ - Compilation warnings fixed.
- - scew_element_del_attr() segmentation fault fixed.
- (reported by Jussi Mäki)
+ - scew_element_del_attr() segmentation fault fixed.
+ (reported by Jussi Mäki)
------------------------------------------------------------------------
** Changes:
- - Functions to create and save XML files have been added.
+ - Functions to create and save XML files have been added.
- A lot of cleanup and rewriting has been done. Internal structures
have changed.
- scew_get_element_by_name() and scew_get_attribute_by_name() did
not return NULL if an element/attribute was not found.
- (reported by Stuart R. Anderson)
+ (reported by Stuart R. Anderson)
------------------------------------------------------------------------
* Copying information:
-Copyright (C) 2002-2009 Aleix Conchillo Flaqué
+Copyright (C) 2002-2010 Aleix Conchillo Flaqué
Permission is granted to anyone to make or distribute verbatim
copies of this document as received, in any medium, provided that
improvements, or submitting actual code. Here is a list of these
people. Help me keep it complete and exempt of errors.
-* Jose A. Ortega suggested some important C implementation details. As
+* Jose A. Ortega suggested some important C implementation details. As
usual, he has helped me in many other ways. Thanks jao!
* Brodie Thiesfield has submitted lots of fixes and improvements. He
* Bug reporting and others (in alphabetical order):
Anonymous reporters, Stuart R. Anderson, Paul Bohme, Eric
- Fronheiser, Alex Katebi, Aaron S. Kurland, Christopher Layne, Jussi
- Mäki, Sanzo Miyazawa, George Neill, Gord Shier, Brodie Thiesfield,
- Andrew Thomas, Kalle Vallo, Michal Wozniak and Mark Zieg.
+ Fronheiser, Alex Katebi, Rudolf Alexander Kerbitz, Aaron S. Kurland,
+ Christopher Layne, Jussi Mäki, Sanzo Miyazawa, George Neill, Gord
+ Shier, Brodie Thiesfield, Andrew Thomas, Kalle Vallo, Michal Wozniak
+ and Mark Zieg.
# Author: Aleix Conchillo Flaque <aleix@member.fsf.org>
# Date: Mon Oct 07, 2002 01:56
#
-# Copyright (C) 2002-2009 Aleix Conchillo Flaque
+# Copyright (C) 2002-2010 Aleix Conchillo Flaque
#
#### boilerplate and flags
-define([scew_version], [1.1.1])
+define([scew_version], [1.1.2])
AC_INIT(scew/scew.h, scew_version)
AM_INIT_AUTOMAKE(scew, scew_version)
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
-PDF_HYPERLINKS = NO
+PDF_HYPERLINKS = YES
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
-USE_PDFLATEX = NO
+USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# Author: Aleix Conchillo Flaque <aleix@member.fsf.org>
# Start date: Sun Jul 06, 2003 04:41
#
-# Copyright (C) 2003-2008 Aleix Conchillo Flaque
+# Copyright (C) 2003-2010 Aleix Conchillo Flaque
#
# Locate doxygen and auxiliary programs.
[ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [enable_latex_docs=no])
if test "x$enable_doxygen" = xno; then
- enable_doc=no
+ enable_doc=no
else
- AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
- if test x$DOXYGEN = x; then
+ AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
+ if test x$DOXYGEN = x; then
AC_MSG_WARN(Could not find 'doxygen' (documentation disabled).)
- enable_doc=no
- else
- enable_doc=yes
+ enable_doc=no
+ else
+ enable_doc=yes
+ if test "x$enable_latex_docs" = xyes; then
+ AC_PATH_PROG(LATEX, latex, , $PATH)
+ if test x$LATEX = x; then
+ AC_MSG_WARN(Could not find 'latex'.)
+ enable_latex_docs=no
+ fi
+ fi
if test "x$enable_dot" = xyes; then
- AC_PATH_PROG(DOT, dot, , $PATH)
+ AC_PATH_PROG(DOT, dot, , $PATH)
if test x$DOT = x; then
AC_MSG_WARN(Could not find 'dot'.)
enable_dot=no
fi
- fi
- fi
+ fi
+ fi
fi
AC_SUBST(enable_dot)
/* Indentation size (in whitespaces). */
static unsigned int const INDENT_SIZE = 4;
- if (indent > 0)
+ if (indent > 0)
{
scew_printf (_XT("%*s"), indent * INDENT_SIZE, " ");
}
static void
print_attributes (scew_element *element)
{
- if (element != NULL)
+ if (element != NULL)
{
- /**
- * Iterates through the element's attribute list, printing the
- * pair name-value.
- */
+ /**
+ * Iterates through the element's attribute list, printing the
+ * pair name-value.
+ */
scew_list *list = scew_element_attributes (element);
while (list != NULL)
{
XML_Char const *contents = NULL;
scew_list *list = NULL;
- if (element == NULL)
+ if (element == NULL)
{
- return;
+ return;
}
/* Prints the starting element tag with its attributes. */
contents = scew_element_contents (element);
- if (contents == NULL)
+ if (contents == NULL)
{
scew_printf (_XT("\n"));
}
- /**
+ /**
* Call print_element function again for each child of the current
* element.
- */
+ */
list = scew_element_children (element);
while (list != NULL)
{
list = scew_list_next (list);
}
- /* Prints element's content. */
- if (contents != NULL)
+ /* Prints element's content. */
+ if (contents != NULL)
{
scew_printf (_XT("%s"), contents);
}
- else
+ else
{
print_indent (indent);
}
_setmode(_fileno(stdout), _O_U16TEXT);
#endif /* _MSC_VER && XML_UNICODE_WCHAR_T */
- if (argc < 2)
+ if (argc < 2)
{
scew_printf (_XT("Usage: scew_print file.xml\n"));
- return EXIT_FAILURE;
+ return EXIT_FAILURE;
}
/* Creates an SCEW parser. This is the first function to call. */
scew_error code = scew_error_code ();
scew_printf (_XT("Unable to parse file (error #%d: %s)\n"),
code, scew_error_string (code));
- if (code == scew_error_expat)
+ if (code == scew_error_expat)
{
enum XML_Error expat_code = scew_error_expat_code (parser);
scew_printf (_XT("Expat error #%d (line %d, column %d): %s\n"),
scew_error_expat_line (parser),
scew_error_expat_column (parser),
scew_error_expat_string (expat_code));
- }
+ }
/* Frees the SCEW parser and reader. */
scew_reader_free (reader);
scew_reader_free (reader);
scew_parser_free (parser);
- return 0;
+ return 0;
}
_setmode(_fileno(stdout), _O_U16TEXT);
#endif /* _MSC_VER && XML_UNICODE_WCHAR_T */
- if (argc < 2)
+ if (argc < 2)
{
scew_printf (_XT("Usage: scew_stream file.xml\n"));
- return EXIT_FAILURE;
+ return EXIT_FAILURE;
}
/* Create a writer for the standard output. */
scew_parser_set_tree_hook (parser, tree_hook_, NULL);
scew_parser_set_element_hook (parser, element_hook_, NULL);
if (!scew_parser_load_stream (parser, reader))
- {
+ {
scew_error code = scew_error_code ();
scew_printf (_XT("Unable to load file (error #%d: %s)\n"),
code, scew_error_string (code));
- if (code == scew_error_expat)
- {
+ if (code == scew_error_expat)
+ {
enum XML_Error expat_code = scew_error_expat_code (parser);
scew_printf (_XT("Expat error #%d (line %d, column %d): %s\n"),
- expat_code,
+ expat_code,
scew_error_expat_line (parser),
scew_error_expat_column (parser),
scew_error_expat_string (expat_code));
- }
+ }
/* Frees the SCEW parser, printer, reader and writer. */
scew_reader_free (reader);
scew_writer_free (stdout_writer_);
scew_printer_free (stdout_printer_);
- return EXIT_FAILURE;
- }
+ return EXIT_FAILURE;
+ }
/* Frees the SCEW parser, printer, reader and writer. */
scew_reader_free (reader);
scew_writer_free (stdout_writer_);
scew_printer_free (stdout_printer_);
- return 0;
+ return 0;
}
_setmode(_fileno(stdout), _O_U16TEXT);
#endif /* _MSC_VER && XML_UNICODE_WCHAR_T */
- if (argc < 2)
+ if (argc < 2)
{
scew_printf (_XT("Usage: scew_write new_file.xml\n"));
- return EXIT_FAILURE;
+ return EXIT_FAILURE;
}
- /**
- * Create an empty XML tree in memory, and add a root element
- * "scew_test".
- */
+ /**
+ * Create an empty XML tree in memory, and add a root element
+ * "scew_test".
+ */
tree = scew_tree_create ();
#ifdef XML_UNICODE_WCHAR_T
scew_tree_set_xml_encoding(tree, _XT("UTF-16"));
#endif /* XML_UNICODE_WCHAR_T */
root = scew_tree_set_root (tree, _XT("test"));
- /* Add an element and set element contents. */
+ /* Add an element and set element contents. */
element = scew_element_add (root, _XT("element"));
scew_element_set_contents (element, _XT("element contents"));
- /* Add an element with an attribute pair (name, value). */
+ /* Add an element with an attribute pair (name, value). */
element = scew_element_add (root, _XT("element"));
scew_element_add_attribute_pair (element, _XT("attribute"), _XT("value"));
element = scew_element_add (root, _XT("element"));
scew_element_add_attribute_pair (element, _XT("attribute1"), _XT("value1"));
- /**
- * Another way to add an attribute. You loose attribute ownership,
- * so there is no need to free it.
- */
+ /**
+ * Another way to add an attribute. You loose attribute ownership,
+ * so there is no need to free it.
+ */
attribute = scew_attribute_create (_XT("attribute2"), _XT("value2"));
scew_element_add_attribute (element, attribute);
_XT("attribute2"), _XT("value2"));
scew_element_add_attribute_pair (sub_sub_element,
_XT("attribute3"), _XT("value3"));
- /* Check attribute2 replacement. */
+ /* Check attribute2 replacement. */
scew_element_add_attribute_pair (sub_sub_element,
_XT("attribute2"), _XT("new_value2"));
scew_element_set_contents (sub_sub_element,
if (printer == NULL)
{
printf ("Unable to create printer\n");
- return EXIT_FAILURE;
+ return EXIT_FAILURE;
}
/* We should check for errors here. */
scew_printer_free (printer);
scew_tree_free (tree);
- return 0;
+ return 0;
}
&& (scew_attribute_set_value (new_attr, attribute->value) != NULL);
if (!copied)
- {
+ {
scew_attribute_free (new_attr);
new_attr = NULL;
- }
+ }
}
return new_attr;
{
assert (attribute != NULL);
- return attribute->name;
+ return attribute->name;
}
XML_Char const*
{
assert (attribute != NULL);
- return attribute->value;
+ return attribute->value;
}
XML_Char const*
element = calloc (1, sizeof (scew_element));
- if (element != NULL)
+ if (element != NULL)
{
scew_element_set_name (element, name);
}
- else
+ else
{
scew_error_set_last_error_ (scew_error_no_memory);
}
- return element;
+ return element;
}
void
new_name = scew_strdup (name);
if (new_name != NULL)
- {
+ {
free (element->name);
element->name = new_name;
}
- else
+ else
{
scew_error_set_last_error_ (scew_error_no_memory);
}
{
free (element->contents);
element->contents = NULL;
- }
+ }
}
\f
element->last_child = item;
element->n_children += 1;
}
- else
+ else
{
scew_error_set_last_error_ (scew_error_no_memory);
child = NULL;
{
static XML_Char const *message[] =
{
- _XT("No error"),
- _XT("Out of memory"),
- _XT("Input/Output error"),
+ _XT("No error"),
+ _XT("Out of memory"),
+ _XT("Input/Output error"),
_XT("Error while calling hook"),
_XT("Internal Expat parser error"),
_XT("Internal SCEW error")
{
return message[code];
}
- else
+ else
{
static XML_Char const *unk_message = _XT("Unknown error code");
void
scew_parser_free (scew_parser *parser)
{
- if (parser != NULL)
+ if (parser != NULL)
{
/* Free all intermediate parser data (if used before). */
scew_parser_reset (parser);
/* Free Expat parser. */
- if (parser->parser)
+ if (parser->parser)
{
XML_ParserFree (parser->parser);
}
scew_parser_reset (parser);
}
else
- {
+ {
scew_error_set_last_error_ (scew_error_no_memory);
scew_parser_free (parser);
parser = NULL;
- }
+ }
return parser;
}
scew_bool done = SCEW_FALSE;
scew_bool result = SCEW_TRUE;
- assert(parser != NULL);
+ assert(parser != NULL);
assert(reader != NULL);
while (!done && result)
result = SCEW_FALSE;
}
else
- {
+ {
result = parse_stream_buffer_ (parser, buffer, length);
done = ((0 == length) || scew_reader_end (reader));
}
unsigned int end = 0;
unsigned int length = 0;
- assert(parser != NULL);
- assert(buffer != NULL);
+ assert(parser != NULL);
+ assert(buffer != NULL);
- /**
+ /**
* Loop through the buffer and:
- * if we encounter a '>', send the chunk to Expat.
- * if we hit the end of the buffer, send whatever remains to Expat.
- */
- while ((start < size) && (end <= size))
+ * if we encounter a '>', send the chunk to Expat.
+ * if we hit the end of the buffer, send whatever remains to Expat.
+ */
+ while ((start < size) && (end <= size))
{
/* Skip initial whitespaces. */
while ((start < size) && scew_isspace (buffer[start]))
if ((end == size) || (buffer[end] == _XT('>')))
{
- length = end - start;
- if (end < size)
+ length = end - start;
+ if (end < size)
{
length += 1;
}
* We don't need to free last loaded XML, as it's the
* users responsibility.
*/
- parser->tree = NULL;
+ parser->tree = NULL;
/* Reset parser to continue using it. */
scew_parser_reset (parser);
}
- start = end + 1;
+ start = end + 1;
}
end += 1;
}
/* Strip leading whitespace. */
start = scew_strspn (src, _XT(" \n\r\t\v"));
- total = end - start;
+ total = end - start;
scew_memmove (src, &src[start], total);
- src[total] = _XT('\0');
+ src[total] = _XT('\0');
}
scew_bool
#include <wchar.h>
#include <wctype.h>
-#define _XT(str) L##str
+#define _XT(str) L##str
#define scew_printf wprintf
-#define scew_fprintf fwprintf
+#define scew_fprintf fwprintf
#define scew_vfprintf vfwprintf
#define scew_fputs fputws
#define scew_fgets fgetws
/**
* Creates a regular string or a wide character string.
*/
-#define _XT(str) str
+#define _XT(str) str
/**
* See standard @a printf documentation.
/**
* See standard @a fprintf documentation.
*/
-#define scew_fprintf fprintf
+#define scew_fprintf fprintf
/**
* See standard @a vfprintf documentation.
scew_error_set_last_error_ (scew_error_no_memory);
}
- return tree;
+ return tree;
}
scew_tree*
void
scew_tree_free (scew_tree *tree)
{
- if (tree != NULL)
+ if (tree != NULL)
{
free (tree->version);
free (tree->encoding);
XML_Char const*
scew_tree_xml_version (scew_tree const *tree)
{
- assert(tree != NULL);
+ assert(tree != NULL);
return tree->version;
}
XML_Char const*
scew_tree_xml_encoding (scew_tree const *tree)
{
- assert(tree != NULL);
+ assert(tree != NULL);
return tree->encoding;
}
void
scew_tree_set_xml_standalone (scew_tree *tree, scew_tree_standalone standalone)
{
- assert(tree != NULL);
+ assert(tree != NULL);
- tree->standalone = standalone;
+ tree->standalone = standalone;
}
\f
void
scew_error_set_last_error_ (scew_error code)
{
- last_error = code;
+ last_error = code;
}
scew_error
scew_error_last_error_ (void)
{
- return last_error;
+ return last_error;
}
#else /* SINGLE_THREADED */
error = (scew_error*) pthread_getspecific (key_error_);
if (NULL == error)
{
- return scew_error_none;
+ return scew_error_none;
}
return *error;
{
scew_element *element = parser_stack_pop_ (parser);
while (element != NULL)
- {
+ {
scew_element_free (element);
element = parser_stack_pop_ (parser);
- }
+ }
}
}
free (parser->preamble);
parser->preamble = NULL;
}
- scew_tree_set_xml_preamble (parser->tree, parser->preamble);
+ else
+ {
+ scew_tree_set_xml_preamble (parser->tree, parser->preamble);
+ }
}
scew_tree_set_root_element (parser->tree, current);
stack = calloc (1, sizeof (stack_element));
- if (stack != NULL)
+ if (stack != NULL)
{
stack->element = element;
if (parser->stack != NULL)
free (stack);
}
- return element;
+ return element;
}
Expat: 2.0.1
PCRE: 8.10
-SCEW: 1.1.1
+SCEW: 1.1.2