Update of /cvsroot/multisync/multisync/plugins/sunbird_plugin/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11588/sunbird_plugin/src Added Files: Tag: branch_08X Makefile Makefile.am Makefile.in sunbird_plugin.c sunbird_plugin.h tools.c tools.h Log Message: initial revision --- NEW FILE: tools.h --- #include <stdlib.h> #include <glib.h> #include <multisync.h> /* Holds information about calendars */ typedef struct { GString* id; /* iCalendar id */ GString* sourcefile; /* Source calendar file (.ics) */ GString* last_modified; /* as iCalendar format date */ GString* data; /* The actual entry data in iCalendar format */ GString* remove_priority; int deleted; /* Notification that entry has been deleted */ } calendar_entry; /* Duplicate string in a GString. Returns NULL, if GString is also NULL, otherwise it returns a pointer to char* which must be freed after use. */ char* copy_from_g_string(GString* str); /* Only for debugging */ void dump_calendar_entries(GList* entries); /* Free memory for calendar entry */ void free_calendar_entry(calendar_entry* e); /* Make exact copy of calendar entry and its contents */ calendar_entry* clone_calendar_entry(calendar_entry* e); /* Free a list of events, including their contents */ void free_events_list(GList *lst); /* Free a list of strings (list of char* pointers, not GStrings) */ void free_string_list(GList *lst); /* Note that this function, despite its name, will at the moment not read every icalendar file, because it doesn't really parse the file, but assumes the structure Mozilla Calendar uses when it writes these files. */ int read_icalendar_file(char* filename, GList **entries_ptr); /* Write a file which remembers all the keys which have already been synced and their last modification date. This is essentially a "pseudo-vcalendar-file" and only used internally by the plugin. */ int write_key_file(char* filename, GList *entries); --- NEW FILE: sunbird_plugin.c --- /* MultiSync Plugin for Mozilla Sunbird Copyright (C) 2005 Markus Meyer <me...@me...> Derived from the API demo for MultiSync, which is Copyright (C) 2002-2003 Bo Lincoln <li...@ly...> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. */ #include "sunbird_plugin.h" ical_connection* sync_connect(sync_pair* handle, connection_type type, sync_object_type object_types) { ical_connection *conn; conn = g_malloc0(sizeof(ical_connection)); g_assert(conn); conn->sync_pair = handle; conn->commondata.object_types = object_types; conn->pending_changes = NULL; sync_set_requestdone(conn->sync_pair); return conn; } void sync_disconnect(ical_connection *conn) { sync_pair *sync_pair = conn->sync_pair; if (conn->pending_changes) { printf("Warning: Discarding pending changes\n"); free_events_list(conn->pending_changes); conn->pending_changes = NULL; } g_free(conn); sync_set_requestdone(sync_pair); } int get_calendar_changes(GList** changes_ptr, sync_object_type* retnewdbs_ptr, ical_connection* conn) { char keyfile[256]; GString* calendars_env = g_string_new(g_getenv("MULTISYNC_SUNBIRD_CALENDARS")); GList *entries = NULL, *cached_entries = NULL, *files = NULL, *cur, *cur2; /* Free previous pending changes, if any */ if (conn->pending_changes) { printf("Warning: Resetting pending changes\n"); free_events_list(conn->pending_changes); conn->pending_changes = NULL; } /* FIXME: We need an option dialog for that */ /* FIXME: We also should not use strtok (not multithread-safe) */ if (calendars_env) { char* pch; for (pch = (char*)strtok(calendars_env->str, ":"); pch; pch = (char*)strtok(NULL, ":")) files = g_list_append(files, (char*)strdup(pch)); g_string_free(calendars_env, TRUE); calendars_env = NULL; } if (!files) { printf("ERROR: List of calendars not set. Set MULTISYNC_SUNBIRD_CALENDARS\n"); printf(" to a list of ics files or URLs, separated with colons (':')"); return FALSE; } strcpy(keyfile, sync_get_datapath(conn->sync_pair)); strcat(keyfile, "/mozilla_keyfile.ics"); printf("Reading keyfile '%s'...\n", keyfile); if (!read_icalendar_file(keyfile, &cached_entries)) { printf("Keyfile not found, doing complete resync!\n"); *retnewdbs_ptr = SYNC_OBJECT_TYPE_CALENDAR; } printf("Reading calendar files...\n"); for (cur = g_list_first(files); cur; cur = cur->next) { char* filename = (char*)cur->data; printf("Reading calendar file '%s'...\n", filename); if (!read_icalendar_file(filename, &entries)) { printf("Error reading calendar file!\n"); sync_set_requestfailed(conn->sync_pair); goto err; } } printf("Syncing entries...\n"); /* For all entries check, if they are already cached, new or modified */ for (cur = g_list_first(entries); cur; cur = cur->next) { changed_object* obj = NULL; calendar_entry* cached = NULL; calendar_entry* e = (calendar_entry*)cur->data; /* Is this entry already cached? */ for (cur2 = g_list_first(cached_entries); cur2; cur2 = cur2->next) { calendar_entry* e2 = (calendar_entry*)cur2->data; if (strcmp(e2->id->str, e->id->str) == 0) { cached = e2; break; } } if (cached) { /* This element is already cached, check if it has been modified */ if (strcmp(cached->last_modified->str, e->last_modified->str) != 0) { /* This element has been modified, notify the sync engine */ printf("Entry %s has been modified\n", e->id->str); obj = (changed_object*)g_malloc0(sizeof(changed_object)); obj->change_type = SYNC_OBJ_MODIFIED; } } else { /* This element is not already cached, notify the sync engine */ printf("Entry %s is new\n", e->id->str); obj = (changed_object*)g_malloc0(sizeof(changed_object)); obj->change_type = SYNC_OBJ_ADDED; } if (obj) { /* Complete entry */ obj->comp = copy_from_g_string(e->data); obj->uid = copy_from_g_string(e->id); obj->removepriority = copy_from_g_string(e->remove_priority); obj->object_type = SYNC_OBJECT_TYPE_CALENDAR; /* Add it to list of changes */ *changes_ptr = g_list_append(*changes_ptr, obj); /* Add it to "pending-changes" entries */ conn->pending_changes = g_list_append(conn->pending_changes, clone_calendar_entry(e)); } } /* For all cached entries check if they have been deleted in the real calendar */ for (cur = g_list_first(cached_entries); cur; cur = cur->next) { int found = 0; calendar_entry* e = (calendar_entry*)cur->data; for (cur2 = g_list_first(entries); cur2; cur2 = cur2->next) { calendar_entry* e2 = (calendar_entry*)cur2->data; if (strcmp(e2->id->str, e->id->str) == 0) { found = 1; break; } } if (!found) { /* This entry has been deleted in the real calendar, since it is in the */ /* cached entries but not in the real calendar entries, notify sync engine */ changed_object* obj; printf("Entry %s was deleted\n", e->id->str); calendar_entry* deleted_entry = clone_calendar_entry(e); deleted_entry->deleted = 1; conn->pending_changes = g_list_append(conn->pending_changes, deleted_entry); obj = (changed_object*)g_malloc0(sizeof(changed_object)); obj->change_type = SYNC_OBJ_HARDDELETED; obj->uid = copy_from_g_string(e->id); obj->comp = NULL; obj->removepriority = NULL; obj->object_type = SYNC_OBJECT_TYPE_CALENDAR; *changes_ptr = g_list_append(*changes_ptr, obj); } } printf("Done!\n"); printf("Freeing lists...\n"); free_string_list(files); free_events_list(cached_entries); free_events_list(entries); printf("Done!\n"); return TRUE; err: printf("Freeing lists...\n"); free_string_list(files); free_events_list(cached_entries); free_events_list(entries); printf("Done!\n"); return FALSE; } void get_changes(ical_connection *conn, sync_object_type newdbs) { GList *changes = NULL; sync_object_type retnewdbs = 0; change_info *chinfo; if (conn->commondata.object_types & SYNC_OBJECT_TYPE_CALENDAR) { if (!get_calendar_changes(&changes, &retnewdbs, conn)) { sync_set_requestfailed(conn->sync_pair); return; } } chinfo = g_malloc0(sizeof(change_info)); chinfo->changes = changes; chinfo->newdbs = retnewdbs; sync_set_requestdata(chinfo, conn->sync_pair); } void syncobj_modify(ical_connection *conn, char* object, char *uid, sync_object_type objtype, char *returnuid, int *returnuidlen) { printf("ERROR: syncobj_modify called although syncobj_modify_list is implemented\n"); sync_set_requestfailed(conn->sync_pair); } void syncobj_delete(ical_connection *conn, char *uid, sync_object_type objtype, int softdelete) { printf("ERROR: syncobj_delete called although syncobj_modify_list is implemented\n"); sync_set_requestfailed(conn->sync_pair); } void syncobj_modify_list(ical_connection *conn, GList *changes) { GList *node; syncobj_modify_result *result; GList *results = NULL; GString *default_calendar = g_string_new(g_getenv("MULTISYNC_SUNBIRD_DEFAULT_CALENDAR")); if (!default_calendar || strlen(default_calendar->str) == 0) { printf("WARNING! Default calendar not set. Writing changes to the first calendar found\n"); printf(" To set the default calendar file, set MULTISYNC_SUNBIRD_DEFAULT_CALENDAR\n"); } for (node = g_list_first(changes); node; node = node->next) { changed_object *obj = (changed_object*)node->data; if (obj->object_type == SYNC_OBJECT_TYPE_CALENDAR) { printf("syncobj_modify_list got new calendar entry\n"); if (obj->change_type == SYNC_OBJ_ADDED) { printf("sync_object_modify_list adding entry\n"); } else if (obj->change_type == SYNC_OBJ_MODIFIED) { printf("sync_object_modify_list modifying entry\n"); } else if (obj->change_type == SYNC_OBJ_HARDDELETED) { printf("sync_object_modify_list (hard-)deleting entry\n"); } else if (obj->change_type == SYNC_OBJ_SOFTDELETED) { /* FIXME: We should not deleted the object here, but we could */ /* remember that it has been soft deleted so we don't */ /* propagate future changes to it. */ } } else { printf("Warning: syncobj_modify_list got other object than calendar entry\n"); } /* We create just a dummy result because we do not really return useful results */ result = (syncobj_modify_result*)g_malloc0(sizeof(syncobj_modify_result)); memset(result, 0, sizeof(syncobj_modify_result)); results = g_list_append(results, result); } g_string_free(default_calendar, TRUE); printf("syncobj_modify_list END\n"); sync_set_requestdata(results, conn->sync_pair); } void syncobj_get_recurring(ical_connection *conn, changed_object *obj) { /* FIXME ? */ sync_set_requestdata(NULL,conn->sync_pair); } void sync_done(ical_connection *conn, gboolean success) { if (conn->pending_changes) { char keyfile[256]; GList *cached_entries = NULL, *cur; printf("Sync done, remembering changes\n"); strcpy(keyfile, sync_get_datapath(conn->sync_pair)); strcat(keyfile, "/mozilla_keyfile.ics"); printf("Reading keyfile '%s'...\n", keyfile); if (!read_icalendar_file(keyfile, &cached_entries)) printf("Keyfile not found, creating new one\n"); printf("Merging changes with keyfile\n"); for (cur = g_list_first(conn->pending_changes); cur; cur = cur->next) { GList* cur2; calendar_entry *e = (calendar_entry*)cur->data; if (e->deleted) { /* Delete entry from cached entries list */ for (cur2 = g_list_first(cached_entries); cur2; cur2 = cur2->next) { calendar_entry *e2 = (calendar_entry*)cur2->data; if (strcmp(e2->id->str, e->id->str) == 0) { /* This is the entry, delete it */ printf("Removing entry %s\n", e2->id->str); cached_entries = g_list_remove(cached_entries, e2); free_calendar_entry(e2); break; } } } else { /* Modify/Add entry to cached list */ /* Check if entry is already in cached list. */ for (cur2 = g_list_first(cached_entries); cur2; cur2 = cur2->next) { calendar_entry *e2 = (calendar_entry*)cur2->data; if (strcmp(e2->id->str, e->id->str) == 0) { /* Entry already in cached entries list, delete it */ printf("Temporarily removing modifed entry %s\n", e2->id->str); cached_entries = g_list_remove(cached_entries, e2); free_calendar_entry(e2); break; } } /* Append entry */ printf("Appending entry %s\n", e->id->str); cached_entries = g_list_append(cached_entries, e); } } /* Notice that we do not delete the list entries because they are now in the cached_entries list */ g_list_free(conn->pending_changes); conn->pending_changes = NULL; printf("Writing keyfile '%s'...\n", keyfile); if (write_key_file(keyfile, cached_entries)) { printf("Keyfile written succesfully.\n"); } else { printf("ERROR: Error writing key file, but what should I do?\n"); } free_events_list(cached_entries); } else { printf("Sync done, no changes\n"); } sync_set_requestdone(conn->sync_pair); } gboolean always_connected() { return TRUE; } char* short_name() { return "sunbird-sync"; } char* long_name() { return "Mozilla Calendar"; } char* plugin_info(void) { return "Synchronisation with one or more Mozilla Calendar (Sunbird) calendars"; } void plugin_init(void) { } sync_object_type object_types() { /* We only handle calendar appointments at the moment */ return SYNC_OBJECT_TYPE_CALENDAR; } int plugin_API_version(void) { return 3; } --- NEW FILE: Makefile.am --- ## Process this file with automake to produce Makefile.in # not a nice way to do it libdir=$(prefix)/lib/multisync INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)/multisync"\" \ @PACKAGE_CFLAGS@ -I$(top_srcdir)/include \ -I../../../include lib_LTLIBRARIES = libsunbird_plugin.la libsunbird_plugin_la_SOURCES = \ tools.c tools.h \ sunbird_plugin.c sunbird_plugin.h #libbackup_plugin_la_LIBADD = @PACKAGE_LIBS@ --- NEW FILE: Makefile.in --- # Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ # not a nice way to do it libdir = $(prefix)/lib/multisync AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ CC = @CC@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MULTISYNC_VERSION = @MULTISYNC_VERSION@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)/multisync"\" \ @PACKAGE_CFLAGS@ -I$(top_srcdir)/include \ -I../../../include lib_LTLIBRARIES = libsunbird_plugin.la libsunbird_plugin_la_SOURCES = \ tools.c tools.h \ sunbird_plugin.c sunbird_plugin.h subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libsunbird_plugin_la_LDFLAGS = libsunbird_plugin_la_LIBADD = am_libsunbird_plugin_la_OBJECTS = tools.lo sunbird_plugin.lo libsunbird_plugin_la_OBJECTS = $(am_libsunbird_plugin_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/../../depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/sunbird_plugin.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/tools.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libsunbird_plugin_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libsunbird_plugin_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libsunbird_plugin.la: $(libsunbird_plugin_la_OBJECTS) $(libsunbird_plugin_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libsunbird_plugin_la_LDFLAGS) $(libsunbird_plugin_la_OBJECTS) $(libsunbird_plugin_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sunbird_plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tools.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` .c.lo: @AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES #libbackup_plugin_la_LIBADD = @PACKAGE_LIBS@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: --- NEW FILE: sunbird_plugin.h --- #include "tools.h" /* Main connection struct */ typedef struct { client_connection commondata; // Data the syncengine handles for us sync_pair *sync_pair; // The syncengine struct GList *pending_changes; // The recorded changes to the key file that are pending until sync_done } ical_connection; /* Standard MultiSync plugin API */ ical_connection* sync_connect(sync_pair* handle, connection_type type, sync_object_type object_types); void sync_disconnect(ical_connection *conn); void get_changes(ical_connection *conn, sync_object_type newdbs); void syncobj_modify(ical_connection *conn, char* object, char *uid, sync_object_type objtype, char *returnuid, int *returnuidlen); void syncobj_delete(ical_connection *conn, char *uid, sync_object_type objtype, int softdelete); void syncobj_modify_list(ical_connection *conn, GList *changes); void syncobj_get_recurring(ical_connection *conn, changed_object *obj); void sync_done(ical_connection *conn, gboolean success); gboolean always_connected(); char* short_name(); char* long_name(); char* plugin_info(void); void plugin_init(void); sync_object_type object_types(); int plugin_API_version(void); /* User functions */ int get_calendar_changes(GList** changes_ptr, sync_object_type* retnewdbs_ptr, ical_connection* conn); --- NEW FILE: tools.c --- /* MultiSync Plugin for Mozilla Sunbird Copyright (C) 2005 Markus Meyer <me...@me...> Derived from the API demo for MultiSync, which is Copyright (C) 2002-2003 Bo Lincoln <li...@ly...> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. */ #include "tools.h" void free_calendar_entry(calendar_entry* e) { g_string_free(e->id, TRUE); g_string_free(e->sourcefile, TRUE); g_string_free(e->last_modified, TRUE); if (e->data) g_string_free(e->data, TRUE); if (e->remove_priority) g_string_free(e->remove_priority, TRUE); g_free(e); } void free_events_list(GList *lst) { GList* cur; if (!lst) return; for (cur = g_list_first(lst); cur; cur = cur->next) free_calendar_entry((calendar_entry*)cur->data); g_list_free(lst); } int write_key_file(char* filename, GList *entries) { GList* cur; FILE* f; f = fopen(filename, "w"); if (!f) return 0; fprintf(f, "BEGIN:VCALENDAR\nVERSION:2.0\n"); for (cur = g_list_first(entries); cur; cur = cur->next) { calendar_entry* e = (calendar_entry*)cur->data; fprintf(f, "BEGIN:VEVENT\n"); fprintf(f, "UID\n"); fprintf(f, " :%s\n", e->id->str); fprintf(f, "LAST-MODIFIED\n"); fprintf(f, " :%s\n", e->last_modified->str); fprintf(f, "X-SOURCEFILE\n"); fprintf(f, " :%s\n", e->sourcefile->str); fprintf(f, "X-DELETED\n"); if (e->deleted) fprintf(f, " :1\n"); else fprintf(f, " :0\n"); fprintf(f, "END:VEVENT\n"); } fprintf(f, "END:VCALENDAR\n"); fclose(f); return 1; } void dump_calendar_entries(GList* entries) { GList* cur; printf("\n*** DEBUG DUMP OF CALENDAR ENTRIES ***\n"); if (entries) { for (cur = g_list_first(entries); cur; cur = cur->next) { calendar_entry* e = (calendar_entry*)cur->data; if (e) { if (e->id) printf("entry id = %s\n", e->id->str); else printf("ERROR: id is null pointer\n"); if (e->last_modified) printf("last modified: %s\n", e->last_modified->str); else printf("ERROR: last modified is null pointer\n"); if (e->sourcefile) printf("sourcefile: %s\n", e->sourcefile->str); else printf("ERROR: sourcefile is null pointer\n"); printf("deleted: %i\n", e->deleted); } else { printf("ERROR: element is null pointer\n"); } } } printf("*** END DEBUG DUMP ***\n\n"); } void free_string_list(GList *lst) { GList* cur; if (!lst) return; for (cur = g_list_first(lst); cur; cur = cur->next) { g_free(cur->data); } g_list_free(lst); } calendar_entry* clone_calendar_entry(calendar_entry* e) { calendar_entry* new_entry = (calendar_entry*)g_malloc0(sizeof(calendar_entry)); new_entry->id = g_string_new(e->id->str); new_entry->sourcefile = g_string_new(e->sourcefile->str); new_entry->last_modified = g_string_new(e->last_modified->str); new_entry->deleted = e->deleted; if (e->data) new_entry->data = g_string_new(e->data->str); else new_entry->data = NULL; if (e->remove_priority) new_entry->remove_priority = g_string_new(e->remove_priority->str); else new_entry->remove_priority = NULL; return new_entry; } int read_icalendar_file(char* filename, GList **entries_ptr) { int next_is_id = 0, next_is_last_modified = 0, next_is_remove_priority = 0; int next_is_deleted = 0, next_is_sourcefile = 0; int buf_size = 4096, len; char buf[buf_size]; FILE* f; calendar_entry *cur_entry = NULL; char *basename_ptr, *basename; f = fopen(filename, "r"); if (!f) return 0; basename_ptr = (char*)strdup(filename); basename = basename_ptr + strlen(basename_ptr) - 1; while (basename > basename_ptr && *(basename-1) != '/') basename--; while (!feof(f)) { if (!fgets(buf, buf_size, f)) break; len = strlen(buf); while (len > 0 && (buf[len-1] == '\n' || buf[len-1] == '\r')) { len--; buf[len] = 0; } if (next_is_id) { next_is_id = 0; cur_entry->id = g_string_new(buf+2); // skip " :" } if (next_is_last_modified) { next_is_last_modified = 0; cur_entry->last_modified = g_string_new(buf+2); // skip " :" } if (next_is_remove_priority) { next_is_remove_priority = 0; cur_entry->remove_priority = g_string_new(buf+2); // skip " :" } if (next_is_sourcefile) { /* Only present in key files, not in real calendars */ next_is_sourcefile = 0; cur_entry->sourcefile = g_string_new(buf+2); // skip " :" } if (next_is_deleted) { /* Only present in key files, not in real calendars */ next_is_deleted = 0; if (buf[2] == '0') cur_entry->deleted = 0; else cur_entry->deleted = 1; } if (strcmp(buf, "BEGIN:VEVENT") == 0) { cur_entry = (calendar_entry*)g_malloc0(sizeof(calendar_entry)); memset(cur_entry, 0, sizeof(calendar_entry)); cur_entry->sourcefile = g_string_new(basename); } if (strcmp(buf, "END:VEVENT") == 0) { /* Last-modified info can be missing, if the item */ /* was never modified. */ if (!cur_entry->last_modified) { cur_entry->last_modified = g_string_new("(new)"); } g_string_append(cur_entry->data, "\nEND:VEVENT\nEND:VCALENDAR\n"); *entries_ptr = g_list_append(*entries_ptr, cur_entry); cur_entry = NULL; } if (cur_entry) { if (strlen(buf) > 2 && buf[0] == ' ' && buf[1] == ':') { /* Merge this line with the previous one. This e.g. merges CLASS :PUBLIC into CLASS:PUBLIC */ g_string_append(cur_entry->data, buf+1); } else { if (cur_entry->data) g_string_append(cur_entry->data, "\n"); else cur_entry->data = g_string_new("BEGIN:VCALENDAR\nVERSION:2.0\n"); g_string_append(cur_entry->data, buf); } if (strcmp(buf, "UID") == 0) next_is_id = 1; if (strcmp(buf, "LAST-MODIFIED") == 0) next_is_last_modified = 1; if (strcmp(buf, "DTEND") == 0) next_is_remove_priority = 1; if (strcmp(buf, "X-SOURCEFILE") == 0) next_is_sourcefile = 1; if (strcmp(buf, "X-DELETED") == 0) next_is_deleted = 1; } } free(basename_ptr); fclose(f); return 1; } char* copy_from_g_string(GString* str) { char* p; if (!str) return NULL; p = (char*)g_malloc0(str->len + 1); if (p) memcpy(p, str->str, str->len + 1); return p; } --- NEW FILE: Makefile --- # Makefile.in generated by automake 1.6.3 from Makefile.am. # src/Makefile. Generated from Makefile.in by configure. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = /bin/sh srcdir = . top_srcdir = .. prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var infodir = ${prefix}/info mandir = ${prefix}/man includedir = ${prefix}/include oldincludedir = /usr/include pkgdatadir = $(datadir)/sunbird_plugin pkglibdir = $(libdir)/sunbird_plugin pkgincludedir = $(includedir)/sunbird_plugin top_builddir = .. ACLOCAL = ${SHELL} /home/markus/multisync/missing --run aclocal-1.6 AUTOCONF = ${SHELL} /home/markus/multisync/missing --run autoconf AUTOMAKE = ${SHELL} /home/markus/multisync/missing --run automake-1.6 AUTOHEADER = ${SHELL} /home/markus/multisync/missing --run autoheader am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = ${INSTALL} INSTALL_HEADER = $(INSTALL_DATA) transform = s,x,x, NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = host_triplet = i686-pc-linux-gnu EXEEXT = OBJEXT = o PATH_SEPARATOR = : # not a nice way to do it libdir = $(prefix)/lib/multisync AMTAR = ${SHELL} /home/markus/multisync/missing --run tar AS = @AS@ AWK = gawk CC = gcc DEPDIR = .deps DLLTOOL = @DLLTOOL@ ECHO = echo INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s MULTISYNC_VERSION = 0.82 OBJDUMP = @OBJDUMP@ PACKAGE = sunbird_plugin PACKAGE_CFLAGS = -DORBIT2=1 -pthread -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/X11R6/include -I/usr/include/libxml2 PACKAGE_LIBS = -pthread -Wl,--export-dynamic -L/usr/X11R6/lib -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lxml2 -lpthread -lz -lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lpangoft2-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lXrandr -lXi -lXinerama -lXext -latk-1.0 -lgdk_pixbuf-2.0 -lXcursor -lpangoxft-1.0 -lXft -lfreetype -lXrender -lfontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lbonobo-2 -lgconf-2 -lgnomevfs-2 -lbonobo-activation -lORBit-2 -lgobject-2.0 -lgthread-2.0 -lm -lgmodule-2.0 -ldl -lglib-2.0 PKG_CONFIG = /usr/bin/pkg-config RANLIB = ranlib STRIP = strip VERSION = 0.82 am__include = include am__quote = install_sh = /home/markus/multisync/install-sh INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)/multisync"\" \ -DORBIT2=1 -pthread -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/X11R6/include -I/usr/include/libxml2 -I$(top_srcdir)/include \ -I../../../include lib_LTLIBRARIES = libsunbird_plugin.la libsunbird_plugin_la_SOURCES = \ tools.c tools.h \ sunbird_plugin.c sunbird_plugin.h subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libsunbird_plugin_la_LDFLAGS = libsunbird_plugin_la_LIBADD = am_libsunbird_plugin_la_OBJECTS = tools.lo sunbird_plugin.lo libsunbird_plugin_la_OBJECTS = $(am_libsunbird_plugin_la_OBJECTS) DEFS = -DHAVE_CONFIG_H DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) CPPFLAGS = LDFLAGS = LIBS = depcomp = $(SHELL) $(top_srcdir)/../../depcomp am__depfiles_maybe = depfiles DEP_FILES = ./$(DEPDIR)/sunbird_plugin.Plo \ ./$(DEPDIR)/tools.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = -g -O2 DIST_SOURCES = $(libsunbird_plugin_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libsunbird_plugin_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libsunbird_plugin.la: $(libsunbird_plugin_la_OBJECTS) $(libsunbird_plugin_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libsunbird_plugin_la_LDFLAGS) $(libsunbird_plugin_la_OBJECTS) $(libsunbird_plugin_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c include ./$(DEPDIR)/sunbird_plugin.Plo include ./$(DEPDIR)/tools.Plo distclean-depend: -rm -rf ./$(DEPDIR) .c.o: source='$<' object='$@' libtool=no \ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ $(CCDEPMODE) $(depcomp) \ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: source='$<' object='$@' libtool=no \ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ $(CCDEPMODE) $(depcomp) \ $(COMPILE) -c `cygpath -w $<` .c.lo: source='$<' object='$@' libtool=yes \ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' \ $(CCDEPMODE) $(depcomp) \ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< CCDEPMODE = depmode=gcc3 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-depend distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am uninstall-libLTLIBRARIES #libbackup_plugin_la_LIBADD = -pthread -Wl,--export-dynamic -L/usr/X11R6/lib -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lxml2 -lpthread -lz -lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lpangoft2-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lXrandr -lXi -lXinerama -lXext -latk-1.0 -lgdk_pixbuf-2.0 -lXcursor -lpangoxft-1.0 -lXft -lfreetype -lXrender -lfontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lbonobo-2 -lgconf-2 -lgnomevfs-2 -lbonobo-activation -lORBit-2 -lgobject-2.0 -lgthread-2.0 -lm -lgmodule-2.0 -ldl -lglib-2.0 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: |