libtrading/libtrading — pull request #46 by StefanKarpinski (2014-04-23 18:07:38+00:00)
Title: fix_message: implement fix_message_add_field; fix_get_field_{count,at}

It looks like `fix_message_add_field` was added to `fix_message.h` in https://github.com/libtrading/libtrading/commit/2e8abc12f62318fe5bd696a5f6df44e70f2b4986 but never implemented it. This is a simple implementation. If there are already the maximum number of fields in a message, rather than corrupting the following memory, this just silently drops it – not great behavior, but it's better than memory corruption.

The `fix_get_field_count` function gives you the number of fields that a message has and `fix_get_field_at` gives the field in a message at a given index. Together, these allow you to iterate through a message object and get each field it contains.