tidy-html5/src
Jim Derry 11178d775b Massive Revamp of the Messaging System
This is a rather large refactoring of Tidy's messaging system. This was done
mostly to allow non-C libraries that cannot adequately take advantage of
arg_lists a chance to query report filter information for information related
to arguments used in constructing an error message.

Three main goals were in mind for this project:

- Don't change the contents of Tidy's existing output sinks. This will ensure
  that changes do no affect console Tidy users, or LibTidy users who use the
  output sinks directly. This was accomplished 100% other than some improved
  cosmetics in the output. See tidy-html5-tests repository, the `refactor` and
  `more_messages_changes` branches for these minor diffs.
- Provide an API that is simple and also extensible without having to write new
  error filters all the time. This was accomplished by adding the new message
  callback `TidyMessageCallback` that provides callback functions an opaque
  object representing the message, and an API to query the message for wanted
  details. With this, we should never have to add a new callback routine again,
  as additional API can simply be written against the opaque object.
- The API should work the same as the rest of LibTidy's API in that it's
  consistent and only uses simple types with wide interoperability with other
  languages. Thanks to @gagern who suggested the model for the API in #409.
  Although the API uses the "Tidy" way off accessing data via an iterator
  rather than an index, this can be easily abstracted in the target language.

There are two *major* API breaking changes:

- Removed TidyReportFilter2
  - This was only used by one application in the entire world, and was a hacky
    kludge that served its purpose. TidyReportCallback (né TidyReportFilter3)
    is much better. If, for some reason, this affects you, I recommend using
    TidyReportCallback instead. It's a minor change for your application.
- Renamed TidyReportFilter3 to TidyReportCallback
  - This name is much more semantic, and much more sensible in light of
    improved callback system. As the name implies, it remains capable of
    *only* receiving callbacks for Tidy "reports."

Introducing TidyMessageCallback, and a new message interrogation API.

- As its name implies, it is able to capture (and optionally suppress) *all*
  of Tidy's output, including the dialogue messages that never make it to
  the existing report filters.
- Provides an opaque `TidyMessage` and an API that can be used to query against
  it to find the juicy goodness inside.
  - For example, `tidyGetMessageOutput( tmessage )` will return the complete,
    localized message.
  - Another example, `tidyGetMessageLine( tmessage )` will return the line the
    message applies to.
- You can also get information about the individual arguments that make up a
  message. By using the `tidyGetMessageArguments( tmessage )` itorator and
  `tidyGetNextMessageArgument` you will obtain an opaque `TidyMessageArgument`
  which has its own interrogation API. For example:
    - tidyGetArgType( tmessage, &iterator );
    - tidyGetArgFormat( tmessage, &iterator );
    - tidyGetArgValueString( tmessage, &iterator );
    - …and so on.

Other major changes include refactoring `messages.c` to use the new message
"object" directly when emitting messages to the console or output sinks. This
allowed replacement of a lot of specialized functions with generalized ones.

Some of this generalizing involved modifications to the `language_xx.h` header
files, and these are all positive improvements even without the above changes.
2017-03-13 13:28:57 -04:00
..
access.c Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
access.h Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
alloc.c Add some mem alloc and free debug to chase Issue #217 2015-06-03 20:24:41 +02:00
attrapi.c Combined leftover attribute API stuff into single, new file. 2017-02-18 16:57:11 -05:00
attrdict.c Add optional xmlns:xlink attributes as valid to support inline svg 2017-01-09 01:38:16 +02:00
attrdict.h Issue #199 - Add support for html5's template tag 2015-04-10 15:50:07 -07:00
attrs.c Add optional xmlns:xlink attributes as valid to support inline svg 2017-01-09 01:38:16 +02:00
attrs.h Phase 2 2016-02-13 11:31:16 +08:00
buffio.c Rename two headers. Issues #224 #223 #221 2015-06-30 20:06:02 +02:00
charsets.c Remove CVS info blocks 2012-08-08 17:27:29 +01:00
charsets.h Remove CVS info blocks 2012-08-08 17:27:29 +01:00
clean.c style: ansi conforming comments 2016-12-20 16:51:09 +11:00
clean.h Remove CVS info blocks 2012-08-08 17:27:29 +01:00
config.c Bump version to 5.5.5 for this fiasco, and fix poor planning and unfortunate 2017-03-10 09:13:21 -05:00
config.h - Removed deprecated options: 2017-02-18 18:30:41 -05:00
entities.c Issue #373 - Avoid a null added to output. 2016-02-15 13:02:10 +01:00
entities.h Remove CVS info blocks 2012-08-08 17:27:29 +01:00
fileio.c avoid DEBUG duplicate newline 2016-04-03 17:54:46 +02:00
fileio.h Rename two headers. Issues #224 #223 #221 2015-06-30 20:06:02 +02:00
forward.h Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
gdoc.c Remove CVS info blocks 2012-08-08 17:27:29 +01:00
gdoc.h Remove CVS info blocks 2012-08-08 17:27:29 +01:00
iconvtc.c Remove CVS info blocks 2012-08-08 17:27:29 +01:00
iconvtc.h Remove CVS info blocks 2012-08-08 17:27:29 +01:00
istack.c Issue #341 - No token can be inserted if istacksize == 0! 2016-02-08 15:12:23 +01:00
language.c Several foundational changes preparing for release of 5.4 and future 5.5: 2017-02-17 15:29:26 -05:00
language.h Several foundational changes preparing for release of 5.4 and future 5.5: 2017-02-17 15:29:26 -05:00
language_en.h Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
language_en_gb.h Bump version to 5.5.5 for this fiasco, and fix poor planning and unfortunate 2017-03-10 09:13:21 -05:00
language_es.h Bump version to 5.5.5 for this fiasco, and fix poor planning and unfortunate 2017-03-10 09:13:21 -05:00
language_es_mx.h Bump version to 5.5.5 for this fiasco, and fix poor planning and unfortunate 2017-03-10 09:13:21 -05:00
language_fr.h Bump version to 5.5.5 for this fiasco, and fix poor planning and unfortunate 2017-03-10 09:13:21 -05:00
language_zh_cn.h Bump version to 5.5.5 for this fiasco, and fix poor planning and unfortunate 2017-03-10 09:13:21 -05:00
lexer.c Issue #497 - lexer.c - Add comment for this PR @seaburg 2017-02-24 14:38:20 +01:00
lexer.h Add VERS_STRICT to identify future strict document types. 2016-02-12 20:46:49 +08:00
mappedio.c Issue #311 - small changes for MinGW32 build 2015-11-28 15:14:53 +01:00
mappedio.h Remove CVS info blocks 2012-08-08 17:27:29 +01:00
message.c Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
message.h Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
messageobj.c Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
messageobj.h Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
parser.c Issue #498 - parser.c - if a <table> in a <table> just close. 2017-02-24 16:20:10 +01:00
parser.h Restart with geoffmcl's fork 2014-11-22 15:42:28 +08:00
pprint.c Removed language as tidy config option; it is only CLI option. 2017-02-18 17:16:35 -05:00
pprint.h Make pretty printer keep track of line numbers as it prints. 2015-11-28 14:16:17 +08:00
sprtf.c Fix license for SPRTF modules. 2017-02-12 17:38:44 +01:00
sprtf.h Fix license for SPRTF modules. 2017-02-12 17:38:44 +01:00
streamio.c Consistent tabs 2016-01-30 15:51:54 +08:00
streamio.h Fixes Mac OS X encoding issues and harmonizes output across platforms. 2015-12-31 13:57:34 +08:00
tagask.c Removed deprecated NodeIsElementName from API. 2017-02-18 16:33:21 -05:00
tags.c style: ansi conforming comments 2016-12-20 16:51:09 +11:00
tags.h allow zero LI in UL when html5. fix for #396 2016-04-08 23:08:56 +02:00
tidy-int.h Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
tidylib.c Massive Revamp of the Messaging System 2017-03-13 13:28:57 -04:00
tmbstr.c Consistent tabs 2016-01-30 15:51:54 +08:00
tmbstr.h Rename two headers. Issues #224 #223 #221 2015-06-30 20:06:02 +02:00
utf8.c Remove CVS info blocks 2012-08-08 17:27:29 +01:00
utf8.h Rename two headers. Issues #224 #223 #221 2015-06-30 20:06:02 +02:00
version.h Rename two headers. Issues #224 #223 #221 2015-06-30 20:06:02 +02:00
win32tc.c Remove CVS info blocks 2012-08-08 17:27:29 +01:00
win32tc.h Remove CVS info blocks 2012-08-08 17:27:29 +01:00