Signed-off-by: Michael Rasmussen <mir@datanom.net>
Baytown, LA 30314=0D=0AUnited States of America
EMAIL:forrestgump@example.com
REV:20080424T195243Z
Baytown, LA 30314=0D=0AUnited States of America
EMAIL:forrestgump@example.com
REV:20080424T195243Z
+X-TEST:Test for private extension
LABEL;TYPE=HOME:42 Plantation St.\nBaytown\, LA 30314\nUnited States of America
EMAIL:forrestgump@example.com
REV:2008-04-24T19:52:43Z
LABEL;TYPE=HOME:42 Plantation St.\nBaytown\, LA 30314\nUnited States of America
EMAIL:forrestgump@example.com
REV:2008-04-24T19:52:43Z
+X-TEST:Test for private extension
ADR;TYPE=HOME;LABEL="42 Plantation St.\nBaytown\, LA 30314\nUnited States of America":;;42 Plantation St.;Baytown;LA;30314;United States of America
EMAIL:forrestgump@example.com
REV:20080424T195243Z
ADR;TYPE=HOME;LABEL="42 Plantation St.\nBaytown\, LA 30314\nUnited States of America":;;42 Plantation St.;Baytown;LA;30314;United States of America
EMAIL:forrestgump@example.com
REV:20080424T195243Z
+X-TEST:Test for private extension
Baytown, LA 30314=0D=0AUnited States of America
EMAIL:forrestgump@example.com
REV:20080424T195243Z
Baytown, LA 30314=0D=0AUnited States of America
EMAIL:forrestgump@example.com
REV:20080424T195243Z
+X-TEST:Test for private extension
EMAIL:forrestgump@example.com
REV:20080424T195243Z
SORT-STRING:alibaba
EMAIL:forrestgump@example.com
REV:20080424T195243Z
SORT-STRING:alibaba
+X-TEST:Test for private extension
ORG-DIRECTORY:test af ORG-DIRECTORY
SORT-STRING:alibaba
VERSION:4.0
ORG-DIRECTORY:test af ORG-DIRECTORY
SORT-STRING:alibaba
VERSION:4.0
+X-TEST:Test for private extension
}
static Property get_property(const gchar* property) {
}
static Property get_property(const gchar* property) {
-/* Property p = VCARD_PROPERTIES;
- gchar* lookup = NULL;
-
- if (g_strcmp0("ORG-DIRECTORY", property) == 0)
- lookup = g_strdup("ORG_DIRECTORY");
- else if (g_strcmp0("SORT-STRING", property) == 0)
- lookup = g_strdup("SORT_STRING");
- else
- lookup = g_strdup(property);
-
- for (int i = 0; i < VCARD_PROPERTIES; i++) {
- if (g_strcmp0(Properties[i], lookup) == 0) {
- p = i;
- break;
- }
- }
- g_free(lookup);*/
for (Property i = N; i < VCARD_PROPERTIES; i++) {
if (g_strcmp0(Properties[i], property) == 0) return i;
}
for (Property i = N; i < VCARD_PROPERTIES; i++) {
if (g_strcmp0(Properties[i], property) == 0) return i;
}
support = property <= IMPP ? TRUE : FALSE;
} else if (version == VCARD_VERSION_4_0) {
support = property <= VCARD_PROPERTIES ? TRUE : FALSE;
support = property <= IMPP ? TRUE : FALSE;
} else if (version == VCARD_VERSION_4_0) {
support = property <= VCARD_PROPERTIES ? TRUE : FALSE;
static VCardParserResponse vcard_parse(gchar** text, VCardVersion version, GHashTable** vcard) {
VCardParserResponse r = VCARD_PARSER_ERROR;
guint l = g_strv_length(text);
static VCardParserResponse vcard_parse(gchar** text, VCardVersion version, GHashTable** vcard) {
VCardParserResponse r = VCARD_PARSER_ERROR;
guint l = g_strv_length(text);
for (guint i = 0; i < l; i++) {
gchar** b = g_strsplit(text[i], ":", 2);
for (guint i = 0; i < l; i++) {
gchar** b = g_strsplit(text[i], ":", 2);
g_strfreev(b);
continue;
}
g_strfreev(b);
continue;
}
- Property property = get_property(c[0]);
- if (check_support(property, version)) {
+ if (g_str_has_prefix(c[0], "X-")) {
+ support = TRUE;
+ } else {
+ Property property = get_property(c[0]);
+ support = check_support(property, version);
+ }
+ if (support) {
GSList* value = g_hash_table_lookup(*vcard, c[0]);
VCardProperty* vp = g_new(VCardProperty, 1);
vp->name = g_strdup(b[0]);
GSList* value = g_hash_table_lookup(*vcard, c[0]);
VCardProperty* vp = g_new(VCardProperty, 1);
vp->name = g_strdup(b[0]);