blob: 5c91a52cacb080ac999734ddda54f2dc2b22704a [file] [log] [blame]
Sylvain Munaut0f7e52d2010-10-29 11:38:54 +02001/* Formats handling */
2
3/*
4 * This file is part of gapk (GSM Audio Pocket Knife).
5 *
6 * gapk is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * gapk is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with gapk. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <stdio.h> /* for NULL */
21
22#include <gapk/formats.h>
23
24/* Extern format descriptors */
Sylvain Munaut5e380d02010-10-29 11:41:16 +020025extern const struct format_desc fmt_gsm;
26
Sylvain Munaut0f7e52d2010-10-29 11:38:54 +020027static const struct format_desc *supported_formats[_FMT_MAX] = {
28 [FMT_INVALID] = NULL,
Sylvain Munaut5e380d02010-10-29 11:41:16 +020029 [FMT_GSM] = &fmt_gsm,
Sylvain Munaut0f7e52d2010-10-29 11:38:54 +020030};
31
32
33const struct format_desc *
34fmt_get_from_type(enum format_type type)
35{
36 if (type <= FMT_INVALID || type >= _FMT_MAX)
37 return NULL;
38 return supported_formats[type];
39}