[Commits] Makefile.am 1.1 1.2 ldifexport_extension.c 1.1 1.2

miras at claws-mail.org miras at claws-mail.org
Sat Dec 3 22:18:40 CET 2011


Update of /home/claws-mail/contacts/extensions/export
In directory claws-mail:/tmp/cvs-serv20360/extensions/export

Modified Files:
	Makefile.am ldifexport_extension.c 
Log Message:
2011-12-03 [mir]	0.6.0cvs36

	* plugins/example/AUTHORS
	* plugins/example/ChangeLog
	* plugins/example/Makefile.am
	* plugins/example/NEWS
	* plugins/example/README
	* plugins/example/TODO
	* plugins/example/configure.ac
	* plugins/example/example-plugin.c
	* plugins/example/src/Makefile.am
	* plugins/example/src/example-plugin.c
	* extensions/Makefile.am
	* extensions/example/AUTHORS
	* extensions/example/ChangeLog
	* extensions/example/Makefile.am
	* extensions/example/NEWS
	* extensions/example/README
	* extensions/example/TODO
	* extensions/example/configure.ac
	* extensions/example/config/Makefile.am
	* extensions/example/src/Makefile.am
	* extensions/example/src/example-extension.c
	* extensions/export/Makefile.am
	* extensions/export/ldifexport_extension.c
	* extensions/import/Makefile.am
	    Refactored extensions and plugins.

Index: Makefile.am
===================================================================
RCS file: /home/claws-mail/contacts/extensions/export/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile.am	30 Nov 2011 23:35:12 -0000	1.1
+++ Makefile.am	3 Dec 2011 21:18:38 -0000	1.2
@@ -11,6 +11,7 @@
 INCLUDES = \
 	   -I${top_srcdir} \
 	   -I${top_srcdir}/src \
+	   -I$(top_srcdir)/src/dbus \
 	   -I${top_builddir} \
 	   @GLIB_CFLAGS@ \
 	   @GTK_CFLAGS@

Index: ldifexport_extension.c
===================================================================
RCS file: /home/claws-mail/contacts/extensions/export/ldifexport_extension.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ldifexport_extension.c	30 Nov 2011 23:35:12 -0000	1.1
+++ ldifexport_extension.c	3 Dec 2011 21:18:38 -0000	1.2
@@ -0,0 +1,103 @@
+/*
+ * $Id$
+ */
+/* vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: */
+
+/*
+ * Claws-contacts is a proposed new design for the address book feature
+ * in Claws Mail. The goal for this new design was to create a
+ * solution more suitable for the term lightweight and to be more
+ * maintainable than the present implementation.
+ *
+ * More lightweight is achieved by design, in that sence that the whole
+ * structure is based on a plugable design.
+ *
+ * Claws Mail is Copyright (C) 1999-2011 by the Claws Mail Team and
+ * Claws-contacts is Copyright (C) 2011 by Michael Rasmussen.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
+ */
+#ifdef HAVE_CONFIG_H
+#       include <config.h>
+#endif
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib/gprintf.h>
+#include "extension.h"
+#include "utils.h"
+
+#define NAME "LDIF Export extension"
+
+static guint my_id;
+
+static void myhook(const MainWindow* mainwindow, gpointer object) {
+	AddressBook* abook = (AddressBook *) object;
+	
+	fprintf(stderr, "Address book [%s] loading\n", abook->abook_name);
+	fprintf(stderr, "Number of contacts: %d\n", g_list_length(abook->contacts));
+}
+
+/**
+ * The main application will call this function after loading the
+ * extension providing a uniq id for the extension which is to be
+ * used for further references
+ * @param id uniq id provided by main application
+ * @return 0 if success 1 otherwise
+ */
+gint extension_init(guint id) {
+	my_id = id;
+	gchar* error;
+	
+	register_hook_function(my_id, EXTENSION_BEFORE_OPEN_ABOOK_HOOK,
+						   myhook, &error);
+	return 0;
+}
+
+/**
+ * Called by main application when the extension should be unloaded
+ * @return TRUE if success FALSE otherwise
+ */
+gboolean extension_done(void) {
+	gchar* error;
+	
+	unregister_hook_function(my_id, EXTENSION_BEFORE_OPEN_ABOOK_HOOK, &error);
+	
+	return TRUE;
+}
+
+/**
+ * Called by main application to ensure extension license is compatible
+ * @return license
+ */
+const gchar* extension_license(void) {
+	return "GPL3+";
+}
+
+/**
+ * Called by main application to get name of extension
+ * @return name
+ */
+const gchar* extension_name(void) {
+	return NAME;
+}
+
+/**
+ * Called by main application to get extension's describtion
+ * @return description
+ */
+const gchar* extension_describtion(void) {
+	return _("Export an address book in LDIF format");
+}



More information about the Commits mailing list