Bug 1008875: Move SAP parser to separate function

The SAP parser is now located in a separate function. All callers
have been adapted. The syntax of all users has been unified so that
'-1' means 'use last SAP'.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 1008875: Move NDEF parser to separate functions

This patch moves the parser for NDEF messages into two separate
functions. One function parses an individual NDEF records, the
other parses records into a complete NDEF message.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 1008875: Move RE-index parser into separate function

The parser for indices of remote endpoints is now located in a
separate function. All callers have been adapted. This patch
also fixes a bug where the RE parser was called for empty
input strings.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 1008875: Moved NCI-notification-type parser into separate function

The parser function for notification type is now located in a separate
function.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 1008875: Moved RF-index parser to separate function

The RF-index parser has been moved to a separate function. This
commit also fixes a bug, where the parser was called for empty
input strings.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Bug 1008875: Added separate lexer and value parsers

The parser code now contains a separate lexer function for fetching
the next token and several functions for parsing tokens into values
of primitive types. Callers have been adapted.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>