/*
    Copyright (C) 2008-2024, Millistream Market Data <support@millistream.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef TEMPLATES_H
# define TEMPLATES_H 1

struct msg_field {
	int pos;
	uint32_t tag;
};

struct msg_template {
	uint64_t mclass;
	int tags_num;
	uint32_t *tags;
	struct msg_field *fields;
};

struct templates {
	struct msg_template *templates;
	int num;
	int max_num_tags;
};

void templates_decode (uint8_t *data, const uint8_t * const end, struct templates ** const templates, struct templates ** const templates_old);
void templates_initialize (struct templates ** const templates);
void templates_free (struct templates *templates);

#endif

