cake
/
libg1m
Archived
1
0
Fork 0
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
libg1m/include/libg1m/formatutils.h

44 lines
1.9 KiB
C

/* *****************************************************************************
* libg1m/formatutils.h -- libg1m format decoder helpers.
* Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
*
* This file is part of libg1m.
* libg1m 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.0 of the License,
* or (at your option) any later version.
*
* libg1m 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libg1m; if not, see <http://www.gnu.org/licenses/>.
*
* Even though the structures and constants are shared in public headers, some
* things cannot be defined easily in structures and constants, such as
* strings <-> types correspondances. These utilities are there for this.
*
* If you want to implement the format lecture yourself, either link with
* libg1m and use these functions directly, or copy their sources in
* `src/utils/type.c` and/or `src/utils/mcstype.c`.
* ************************************************************************** */
#ifndef LIBG1M_FORMATUTILS_H
# define LIBG1M_FORMATUTILS_H
# include <libg1m/format.h>
/* get type */
int g1m_get_type_info(const char *path,
unsigned char *main_id, unsigned char *subtype,
const char **info, int *check_one, int *check_two,
unsigned int *platform, unsigned int *type);
/* get mcs type data */
int g1m_mcstype_getlib(const char *groupname, const char *filename,
unsigned int rawtype, unsigned int *type, int *id);
int g1m_mcstype_toraw(unsigned int type, int id,
char *name, char *dirname, char *groupname);
#endif /* LIBG1M_FORMATUTILS_H */