EXIF library (libexif) Internals 0.6.26
mnote-apple-tag.c
Go to the documentation of this file.
1/* mnote-apple-tag.c:
2 *
3 * Copyright (c) 2018 zhanwang-sky <zhanwang_sky@163.com>
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 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.0-or-later
21 */
22
23#include <config.h>
24#include "mnote-apple-tag.h"
25
26#include <libexif/i18n.h>
27#include <libexif/exif-utils.h>
28
29#include <stdlib.h>
30
31static const struct {
33 const char *name;
34 const char *title;
35 const char *description;
36} table[] = {
37#ifndef NO_VERBOSE_TAG_STRINGS
38 {MNOTE_APPLE_TAG_HDR, "HDR", N_("HDR Mode"), ""},
39 {MNOTE_APPLE_TAG_RUNTIME, "RUNTIME", N_("Runtime"), ""},
40 {MNOTE_APPLE_TAG_ACCELERATION_VECTOR, "ACCELERATION_VECTOR", N_("Acceleration Vector"), ""},
41 {MNOTE_APPLE_TAG_HDR, "HDR", N_("HDR"), ""},
42 {MNOTE_APPLE_TAG_BURST_UUID, "BURST_UUID", N_("Burst UUID"), ""},
43 {MNOTE_APPLE_TAG_MEDIA_GROUP_UUID, "MEDIA_GROUP_UUID", N_("Media Group UUID"), ""},
44 {MNOTE_APPLE_TAG_IMAGE_UNIQUE_ID, "IMAGE_UNIQUE_ID", N_("Image Unique ID"), ""},
45#endif
46 {0, NULL, NULL, NULL}
47};
48
49const char *
51 unsigned int i;
52
53 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++) {
54 if (table[i].tag == t) {
55 return table[i].name;
56 }
57 }
58
59 return NULL;
60}
61
62const char *
64 unsigned int i;
65
66 (void) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
67 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++) {
68 if (table[i].tag == t) {
69 if (!table[i].title)
70 NULL;
71 return _(table[i].title);
72 }
73 }
74
75 return NULL;
76}
77
78const char *
80 unsigned int i;
81
82 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++) {
83 if (table[i].tag == t) {
84 if (!table[i].description || !*table[i].description) {
85 return "";
86 }
87 (void) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
88 return _(table[i].description);
89 }
90 }
91
92 return NULL;
93}
EXIF data manipulation functions and types.
#define _(String)
Definition i18n.h:50
#define N_(String)
Definition i18n.h:51
#define bindtextdomain(Domain, Directory)
Definition i18n.h:48
const char * mnote_apple_tag_get_name(MnoteAppleTag t)
const char * mnote_apple_tag_get_description(MnoteAppleTag t)
MnoteAppleTag tag
const char * description
const char * title
const char * name
static const struct @0 table[]
const char * mnote_apple_tag_get_title(MnoteAppleTag t)
@ MNOTE_APPLE_TAG_RUNTIME
@ MNOTE_APPLE_TAG_ACCELERATION_VECTOR
@ MNOTE_APPLE_TAG_MEDIA_GROUP_UUID
@ MNOTE_APPLE_TAG_IMAGE_UNIQUE_ID
@ MNOTE_APPLE_TAG_HDR
@ MNOTE_APPLE_TAG_BURST_UUID
enum _MnoteAppleTag MnoteAppleTag

libexif Generated by doxygen