]> git.datanom.net - vcard-parser.git/blob - src/parser/vcard-parser.h
All features added
[vcard-parser.git] / src / parser / vcard-parser.h
1 /*
2 * vcard-parser.h
3 *
4 * Copyright 2019 Michael Rasmussen <mir@datanom.net>
5 *
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.
10 *
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.
15 *
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,
19 * MA 02110-1301, USA.
20 */
21
22 #ifndef __VCARD_PARSER_H__
23 #define __VCARD_PARSER_H__
24
25 #include <glib.h>
26
27 G_BEGIN_DECLS
28
29 #include <globals.h>
30 #include <vcard.h>
31
32 typedef enum {
33 // vCard 2.1 properties and up
34 // https://github.com/emacsmirror/addressbook/blob/master/vcard-21.txt
35 N = 0,
36 FN,
37 PHOTO,
38 BDAY,
39 ADR,
40 LABEL, // Removed in vCard 4.0
41 TEL,
42 EMAIL,
43 MAILER, // Removed in vCard 4.0
44 GEO,
45 TITLE,
46 ROLE,
47 LOGO,
48 ORG,
49 NOTE,
50 REV,
51 SOUND,
52 URL,
53 UID,
54 VERSION,
55 KEY,
56 TZ,
57 SOURCE,
58 AGENT, // Removed in vCard 4.0
59 PROFILE, // Removed in vCard 4.0
60 // vCard 3.0 properties
61 // https://tools.ietf.org/html/rfc2426
62 CATEGORIES,
63 SORT_STRING,
64 PRODID,
65 NICKNAME,
66 NAME, // Removed in vCard 4.0
67 CLASS, // Removed in vCard 4.0
68 // rfc2739 properties
69 FBURL,
70 CAPURI,
71 CALURI,
72 CALADRURI,
73 // rfc4770 properties
74 IMPP,
75 // vCard 4.0 properties
76 // https://tools.ietf.org/html/rfc6350
77 XML,
78 ANNIVERSARY,
79 CLIENTPIDMAP,
80 LANG,
81 GENDER,
82 KIND,
83 MEMBER,
84 RELATED,
85 // rfc6474 properties
86 BIRTHPLACE,
87 DEATHPLACE,
88 DEATHDATE,
89 // rfc6715 properties
90 EXPERTISE,
91 HOBBY,
92 INTEREST,
93 ORG_DIRECTORY,
94 VCARD_PROPERTIES,
95 } Property;
96
97 typedef enum {
98 VCARD_PARSER_OK,
99 VCARD_PARSER_VERSION_MISSING,
100 VCARD_PARSER_VERSION_MISMATCH,
101 VCARD_PARSER_ATTRIBUTE_VERSION_MISMATCH,
102 VCARD_PARSER_BAD_FORMAT,
103 VCARD_PARSER_ERROR,
104 } VCardParserResponse;
105
106 VCardVersion str_2_vcard_version(const gchar* version);
107 gchar* vcard_version_2_str(VCardVersion version);
108 Property vcard_max_property(VCardVersion version);
109 VCardParserResponse vcard_parse_text(const gchar* text, VCardVersion* version, GHashTable** vcard);
110 GHashTable* init_g_hash_table(VCardVersion version);
111 void destroy_hash_table(GHashTable* ht);
112
113 G_END_DECLS
114
115 #endif
This page took 0.47767 seconds and 6 git commands to generate.