コード例 #1
0
ファイル: fix_message.c プロジェクト: bjoto/libtrading
static int parse_msg_type(struct fix_message *self)
{
	int ret;

	ret = parse_field(self->head_buf, MsgType, &self->msg_type);

	if (ret)
		goto exit;

	self->type = fix_msg_type_parse(self->msg_type);

	// if third field is not MsgType -> garbled

	if (fix_message_type_is(self, FIX_MSG_TYPE_UNKNOWN))
		ret = FIX_MSG_STATE_GARBLED;

exit:
	return ret;
}
コード例 #2
0
static int parse_msg_type(struct fix_message *self, unsigned long flags)
{
    int ret;

    ret = match_field(self->head_buf, MsgType, &self->msg_type);

    if (ret)
        goto exit;

    if (!(flags & FIX_PARSE_FLAG_NO_TYPE)) {
        self->type = fix_msg_type_parse(self->msg_type, 0x01);

        /* If third field is not MsgType -> garbled */
        if (fix_message_type_is(self, FIX_MSG_TYPE_UNKNOWN))
            ret = FIX_MSG_STATE_GARBLED;
    } else
        self->type = FIX_MSG_TYPE_UNKNOWN;

exit:
    return ret;
}