1 /* exif-ifd.c
2 *
3 * Copyright (c) 2002 Lutz Mueller <lutz@users.sourceforge.net>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA.
19 *
20 * SPDX-License-Identifier: LGPL-2.1-or-later
21 */
22
23 #include <config.h>
24
25 #include <libexif/exif-ifd.h>
26
27 #include <stdlib.h>
28
29 static const struct {
30 ExifIfd ifd;
31 const char *name;
32 } ExifIfdTable[] = {
33 {EXIF_IFD_0, "0"},
34 {EXIF_IFD_1, "1"},
35 {EXIF_IFD_EXIF, "EXIF"},
36 {EXIF_IFD_GPS, "GPS"},
37 {EXIF_IFD_INTEROPERABILITY, "Interoperability"},
38 {0, NULL}
39 };
40
41 const char *
exif_ifd_get_name(ExifIfd ifd)42 exif_ifd_get_name (ExifIfd ifd)
43 {
44 unsigned int i;
45
46 for (i = 0; ExifIfdTable[i].name; i++)
47 if (ExifIfdTable[i].ifd == ifd)
48 break;
49
50 return (ExifIfdTable[i].name);
51 }
52