aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/Makefile.am17
-rw-r--r--addressbook/backend/ebook/e-card.c18
-rw-r--r--addressbook/backend/ebook/e-card.h2
3 files changed, 35 insertions, 2 deletions
diff --git a/addressbook/backend/ebook/Makefile.am b/addressbook/backend/ebook/Makefile.am
index dd213e1ab7..78a947e729 100644
--- a/addressbook/backend/ebook/Makefile.am
+++ b/addressbook/backend/ebook/Makefile.am
@@ -1,4 +1,4 @@
-noinst_PROGRAMS = test-card test-client test-client-list
+noinst_PROGRAMS = test-card test-client test-client-list load-pine-addressbook
CORBA_SOURCE = \
addressbook.h \
@@ -20,6 +20,7 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/addressbook/backend \
-I$(top_builddir)/addressbook/backend \
+ -I$(top_builddir)/addressbook/ename \
$(BONOBO_GNOME_CFLAGS)
lib_LTLIBRARIES = libebook.la
@@ -55,7 +56,8 @@ test_client_SOURCES = \
test_client_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
- $(top_builddir)/libversit/libversit.la
+ $(top_builddir)/libversit/libversit.la \
+ $(top_builddir)/addressbook/ename/libename.la
test_client_list_SOURCES = \
test-client-list.c
@@ -63,6 +65,7 @@ test_client_list_SOURCES = \
test_client_list_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
+ $(top_builddir)/addressbook/ename/libename.la \
$(top_builddir)/libversit/libversit.la
test_card_SOURCES = \
@@ -71,6 +74,16 @@ test_card_SOURCES = \
test_card_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
+ $(top_builddir)/addressbook/ename/libename.la \
+ $(top_builddir)/libversit/libversit.la
+
+load_pine_addressbook_SOURCES = \
+ load-pine-addressbook.c
+
+load_pine_addressbook_LDADD = \
+ libebook.la \
+ $(BONOBO_GNOME_LIBS) \
+ $(top_builddir)/addressbook/ename/libename.la \
$(top_builddir)/libversit/libversit.la
BUILT_SOURCES = $(CORBA_SOURCE)
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index eea5c16dc1..2f0f05b97f 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -17,6 +17,7 @@
#include <libversit/vcc.h>
#include "e-card.h"
#include "e-card-pairs.h"
+#include "e-name-western.h"
#define is_a_prop_of(obj,prop) (isAPropertyOf ((obj),(prop)))
#define str_val(obj) (the_str = (vObjectValueType (obj))? fakeCString (vObjectUStringZValue (obj)) : calloc (1, 1))
@@ -994,6 +995,23 @@ e_card_name_to_string(const ECardName *name)
return g_strjoinv(" ", strings);
}
+ECardName *
+e_card_name_from_string(const char *full_name)
+{
+ ECardName *name = g_new(ECardName, 1);
+ ENameWestern *western = e_name_western_parse (full_name);
+
+ name->prefix = g_strdup (western->prefix);
+ name->given = g_strdup (western->first );
+ name->additional = g_strdup (western->middle);
+ name->family = g_strdup (western->last );
+ name->suffix = g_strdup (western->suffix);
+
+ e_name_western_free(western);
+
+ return name;
+}
+
/*
* ECard lifecycle management and vCard loading/saving.
*/
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index c42db15461..98fa4a9060 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -111,6 +111,7 @@ ECardDeliveryAddress *e_card_delivery_address_new (void);
void e_card_delivery_address_free (ECardDeliveryAddress *addr);
ECardDeliveryAddress *e_card_delivery_address_copy (const ECardDeliveryAddress *addr);
char *e_card_delivery_address_to_string (const ECardDeliveryAddress *addr);
+char *e_card_delivery_address_from_string (const ECardDeliveryAddress *addr);
ECardAddrLabel *e_card_address_label_new (void);
void e_card_address_label_free (ECardAddrLabel *addr);
@@ -120,6 +121,7 @@ ECardName *e_card_name_new (void);
void e_card_name_free(ECardName *name);
ECardName *e_card_name_copy (const ECardName *name);
char *e_card_name_to_string(const ECardName *name);
+ECardName *e_card_name_from_string(const char *full_name);
/* Standard Gtk function */
GtkType e_card_get_type (void);