4 * Copyright 2019 Michael Rasmussen <mir@datanom.net>
6 * This program 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 2 of the License, or
9 * (at your option) any later version.
11 * This program 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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 #ifndef __VCARD_PARSER_H__
23 #define __VCARD_PARSER_H__
32 // vCard 2.1 properties and up
33 // https://github.com/emacsmirror/addressbook/blob/master/vcard-21.txt
39 LABEL
, // Removed in vCard 4.0
42 MAILER
, // Removed in vCard 4.0
57 AGENT
, // Removed in vCard 4.0
58 PROFILE
, // Removed in vCard 4.0
59 // vCard 3.0 properties
60 // https://tools.ietf.org/html/rfc2426
65 NAME
, // Removed in vCard 4.0
66 CLASS
, // Removed in vCard 4.0
74 // vCard 4.0 properties
75 // https://tools.ietf.org/html/rfc6350
98 VCARD_PARSER_VERSION_MISSING
,
99 VCARD_PARSER_VERSION_MISMATCH
,
100 VCARD_PARSER_ATTRIBUTE_VERSION_MISMATCH
,
101 VCARD_PARSER_BAD_FORMAT
,
103 } VCardParserResponse
;
110 VCardVersion
str_2_vcard_version(const gchar
* version
);
111 gchar
* vcard_version_2_str(VCardVersion version
);
112 Property
vcard_max_property(VCardVersion version
);
113 VCardParserResponse
vcard_parse_text(const gchar
* text
, VCardVersion
* version
, GHashTable
** vcard
);
114 void init_g_hash_table(GHashTable
** ht
, VCardVersion version
);
115 void destroy_hash_table(GHashTable
* ht
);