FIX: new fields are added

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FAST: name and id attributes introduced

It's quite usual that FAST fields have name and id
attributes (e.g. if FIX messages are transferred via FAST).
Libtrading should support these attributes.

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FAST: message copying functionality is added

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: new message and field types are added

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Remove buffer_first_char() from API

Use the more generic buffer_peek_8() function and remove
buffer_first_char() which does the same thing from the API.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
FAST: Use buffer_get_8() where possible

Clean up FAST message parsing code by replacing sequences of

    c = buffer_peek_8(buffer);
    buffer_advance(buffer, 1);

with

    buffer_get_8(buffer);

which is the appropriate API for consuming bytes from a buffer.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: accept arbitrary delimiter while message type is being parsed

Make fix_msg_type_parse() usable for parsing FIX/FAST streams, for
example, by adding a "delim" parameter that specifies the message field
delimiter.

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
[ penberg@kernel.org: changelog ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX/FAST: resolve session receive latency issue

As Pekka Enberg fairly noted, "we now seem to always wait for
the *next* message to arrive until we actually attempt to decode
the current message".

To prevent such a situation we make session receiving engine
parse/decode the incoming message just after another portion
of data is received.

Note, that we also trying to parse/decode the message just
before any attempt to receive the data to cover the cases
when there are enough data in the buffer. This is done
intentionally to prevent the library going to socket every
time session receiving engine is invoked.

Reported-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Use endianess-annotated types everywhere in the code

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FAST: message name support introduced

We assume that name of message is presented in a template file.
If it is not, the field becomes empty.

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Update project description

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Kill redundant return statements

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Update TODO

Signed-off-by: Pekka Enberg <penberg@kernel.org>
itch41: Add zlib support

This adds zlib support to tools/test-itch41.c. We can now directly
inspect data files provided on NASDAQ FTP without needing to uncompress
them first.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: Fix API return values for error handling

This makes the FIX API functions return zero on success and a negative
integer value on error. Also propagate error returned by
fix_session_send() to the callers where appropriate.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: Flip fix_session_admin return value

Make fix_session_admin() return type a 'bool' and flip the return value.
This avoids users confusing the return value to other API functions that
return zero on success and negative on error.

Reviewed-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: Flip fix_session_keepalive return value

Same rationale as in commit 7de6c4d ("FIX: Flip fix_session_admin return
value") but for fix_session_keepalive().

Reviewed-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Fix dependency to zlib

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Fix xread() return value checking

The clang compiler noticed the following problem:

  tools/test-itch41.c:71:23: error: comparison of unsigned expression < 0 is
      always false [-Werror,-Wtautological-compare]
        if (stream->avail_in < 0)
            ~~~~~~~~~~~~~~~~ ^ ~

Fix it up.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Make 'nr' signed

Fix problem explained in commit 253cd4c ("Fix xread() return value
checking") for real.

Signed-off-by: Pekka Enberg <penberg@kernel.org>