** Remove trailing whitespace from source code.
authorMatthew Barnes <mbarnes@redhat.com>
Wed, 14 Nov 2007 22:04:19 +0000 (22:04 +0000)
committerMatthew Barnes <mbarnes@src.gnome.org>
Wed, 14 Nov 2007 22:04:19 +0000 (22:04 +0000)
2007-11-14  Matthew Barnes  <mbarnes@redhat.com>

** Remove trailing whitespace from source code.

svn path=/trunk/; revision=8210

564 files changed:
ChangeLog
addressbook/backends/file/e-book-backend-file.c
addressbook/backends/groupwise/e-book-backend-groupwise.c
addressbook/backends/groupwise/e-book-backend-groupwise.h
addressbook/backends/ldap/e-book-backend-ldap.c
addressbook/backends/ldap/openldap-extract.h
addressbook/backends/vcf/e-book-backend-vcf.c
addressbook/libebook/e-address-western.c
addressbook/libebook/e-address-western.h
addressbook/libebook/e-book-listener.c
addressbook/libebook/e-book-query.c
addressbook/libebook/e-book-query.h
addressbook/libebook/e-book-view-listener.c
addressbook/libebook/e-book-view-listener.h
addressbook/libebook/e-book-view.c
addressbook/libebook/e-book.c
addressbook/libebook/e-contact.c
addressbook/libebook/e-contact.h
addressbook/libebook/e-destination.c
addressbook/libebook/e-destination.h
addressbook/libebook/e-name-western.c
addressbook/libebook/e-vcard.c
addressbook/libedata-book/e-book-backend-cache.c
addressbook/libedata-book/e-book-backend-cache.h
addressbook/libedata-book/e-book-backend-db-cache.c
addressbook/libedata-book/e-book-backend-db-cache.h
addressbook/libedata-book/e-book-backend-sexp.c
addressbook/libedata-book/e-book-backend-sexp.h
addressbook/libedata-book/e-book-backend-summary.c
addressbook/libedata-book/e-book-backend-summary.h
addressbook/libedata-book/e-book-backend-sync.c
addressbook/libedata-book/e-book-backend.c
addressbook/libedata-book/e-book-backend.h
addressbook/libedata-book/e-data-book-factory.c
addressbook/libedata-book/e-data-book-view.c
addressbook/libedata-book/e-data-book.c
addressbook/tests/ebook/test-date.c
addressbook/tests/ebook/test-ebook-view.c
addressbook/tests/ebook/test-ebook.c
addressbook/tests/ebook/test-nonexistent-id.c
addressbook/tests/ebook/test-photo.c
addressbook/tests/ebook/test-query.c
addressbook/tests/ebook/test-stress-bookviews.c
addressbook/tests/ebook/test-string.c
addressbook/tests/ebook/test-untyped-phones.c
calendar/backends/caldav/create-account.c
calendar/backends/caldav/e-cal-backend-caldav-factory.c
calendar/backends/caldav/e-cal-backend-caldav-factory.h
calendar/backends/caldav/e-cal-backend-caldav.c
calendar/backends/caldav/e-cal-backend-caldav.h
calendar/backends/contacts/e-cal-backend-contacts.c
calendar/backends/file/e-cal-backend-file-events.c
calendar/backends/file/e-cal-backend-file-journal.c
calendar/backends/file/e-cal-backend-file-todos.c
calendar/backends/file/e-cal-backend-file.c
calendar/backends/google/e-cal-backend-google-factory.c
calendar/backends/google/e-cal-backend-google-factory.h
calendar/backends/google/e-cal-backend-google-utils.c
calendar/backends/google/e-cal-backend-google-utils.h
calendar/backends/google/e-cal-backend-google.c
calendar/backends/google/e-cal-backend-google.h
calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
calendar/backends/groupwise/e-cal-backend-groupwise-utils.h
calendar/backends/groupwise/e-cal-backend-groupwise.c
calendar/backends/groupwise/e-cal-backend-groupwise.h
calendar/backends/http/e-cal-backend-http.c
calendar/backends/weather/e-cal-backend-weather.c
calendar/libecal/e-cal-component.c
calendar/libecal/e-cal-component.h
calendar/libecal/e-cal-listener.c
calendar/libecal/e-cal-listener.h
calendar/libecal/e-cal-recur.c
calendar/libecal/e-cal-time-util.c
calendar/libecal/e-cal-time-util.h
calendar/libecal/e-cal-types.h
calendar/libecal/e-cal-util.c
calendar/libecal/e-cal-view-listener.c
calendar/libecal/e-cal-view.c
calendar/libecal/e-cal.c
calendar/libecal/e-cal.h
calendar/libedata-cal/e-cal-backend-cache.c
calendar/libedata-cal/e-cal-backend-sexp.c
calendar/libedata-cal/e-cal-backend-sexp.h
calendar/libedata-cal/e-cal-backend-sync.c
calendar/libedata-cal/e-cal-backend-sync.h
calendar/libedata-cal/e-cal-backend-util.c
calendar/libedata-cal/e-cal-backend-util.h
calendar/libedata-cal/e-cal-backend.c
calendar/libedata-cal/e-cal-backend.h
calendar/libedata-cal/e-data-cal-factory.c
calendar/libedata-cal/e-data-cal-factory.h
calendar/libedata-cal/e-data-cal-view.c
calendar/libedata-cal/e-data-cal.c
calendar/libedata-cal/e-data-cal.h
calendar/tests/ecal/test-ecal.c
calendar/tests/ecal/test-search.c
camel/broken-date-parser.c
camel/camel-address.c
camel/camel-block-file.c
camel/camel-certdb.c
camel/camel-certdb.h
camel/camel-charset-map-private.h
camel/camel-charset-map.c
camel/camel-cipher-context.c
camel/camel-cipher-context.h
camel/camel-data-cache.c
camel/camel-data-cache.h
camel/camel-data-wrapper.c
camel/camel-data-wrapper.h
camel/camel-debug.c
camel/camel-debug.h
camel/camel-digest-folder.c
camel/camel-digest-folder.h
camel/camel-digest-store.c
camel/camel-digest-store.h
camel/camel-digest-summary.c
camel/camel-digest-summary.h
camel/camel-disco-diary.c
camel/camel-disco-diary.h
camel/camel-disco-folder.c
camel/camel-disco-folder.h
camel/camel-disco-store.c
camel/camel-disco-store.h
camel/camel-exception.c
camel/camel-exception.h
camel/camel-file-utils.c
camel/camel-file-utils.h
camel/camel-filter-driver.c
camel/camel-filter-driver.h
camel/camel-filter-search.c
camel/camel-folder-search.c
camel/camel-folder-search.h
camel/camel-folder-summary.c
camel/camel-folder-summary.h
camel/camel-folder-thread.c
camel/camel-folder-thread.h
camel/camel-folder.c
camel/camel-folder.h
camel/camel-gpg-context.c
camel/camel-gpg-context.h
camel/camel-html-parser.c
camel/camel-http-stream.c
camel/camel-http-stream.h
camel/camel-i18n.h
camel/camel-index.c
camel/camel-internet-address.c
camel/camel-list-utils.c
camel/camel-list-utils.h
camel/camel-lock-client.c
camel/camel-lock-client.h
camel/camel-lock-helper.c
camel/camel-lock-helper.h
camel/camel-lock.c
camel/camel-lock.h
camel/camel-mime-filter-basic.c
camel/camel-mime-filter-basic.h
camel/camel-mime-filter-bestenc.c
camel/camel-mime-filter-bestenc.h
camel/camel-mime-filter-canon.c
camel/camel-mime-filter-charset.c
camel/camel-mime-filter-crlf.c
camel/camel-mime-filter-enriched.c
camel/camel-mime-filter-enriched.h
camel/camel-mime-filter-from.c
camel/camel-mime-filter-from.h
camel/camel-mime-filter-gzip.c
camel/camel-mime-filter-gzip.h
camel/camel-mime-filter-html.c
camel/camel-mime-filter-index.c
camel/camel-mime-filter-linewrap.c
camel/camel-mime-filter-linewrap.h
camel/camel-mime-filter-pgp.c
camel/camel-mime-filter-save.c
camel/camel-mime-filter-save.h
camel/camel-mime-filter-tohtml.c
camel/camel-mime-filter-tohtml.h
camel/camel-mime-filter-windows.c
camel/camel-mime-filter-windows.h
camel/camel-mime-filter-yenc.c
camel/camel-mime-filter-yenc.h
camel/camel-mime-filter.c
camel/camel-mime-message.c
camel/camel-mime-message.h
camel/camel-mime-parser.c
camel/camel-mime-parser.h
camel/camel-mime-part-utils.c
camel/camel-mime-part-utils.h
camel/camel-mime-part.c
camel/camel-mime-part.h
camel/camel-mime-utils.c
camel/camel-movemail.c
camel/camel-movemail.h
camel/camel-multipart-encrypted.c
camel/camel-multipart-encrypted.h
camel/camel-multipart-signed.c
camel/camel-multipart-signed.h
camel/camel-multipart.c
camel/camel-net-utils.c
camel/camel-net-utils.h
camel/camel-news-address.c
camel/camel-nntp-address.c
camel/camel-object.c
camel/camel-offline-folder.c
camel/camel-offline-folder.h
camel/camel-offline-journal.c
camel/camel-offline-journal.h
camel/camel-offline-store.c
camel/camel-offline-store.h
camel/camel-operation.c
camel/camel-partition-table.c
camel/camel-private.h
camel/camel-process.c
camel/camel-provider.c
camel/camel-provider.h
camel/camel-sasl-anonymous.c
camel/camel-sasl-anonymous.h
camel/camel-sasl-cram-md5.c
camel/camel-sasl-cram-md5.h
camel/camel-sasl-digest-md5.c
camel/camel-sasl-digest-md5.h
camel/camel-sasl-gssapi.c
camel/camel-sasl-gssapi.h
camel/camel-sasl-kerberos4.c
camel/camel-sasl-kerberos4.h
camel/camel-sasl-login.c
camel/camel-sasl-login.h
camel/camel-sasl-ntlm.c
camel/camel-sasl-ntlm.h
camel/camel-sasl-plain.c
camel/camel-sasl-plain.h
camel/camel-sasl-popb4smtp.c
camel/camel-sasl-popb4smtp.h
camel/camel-sasl.c
camel/camel-sasl.h
camel/camel-search-private.c
camel/camel-service.c
camel/camel-service.h
camel/camel-session.c
camel/camel-session.h
camel/camel-smime-context.c
camel/camel-store-summary.c
camel/camel-store.c
camel/camel-store.h
camel/camel-stream-buffer.c
camel/camel-stream-filter.c
camel/camel-stream-fs.c
camel/camel-stream-mem.c
camel/camel-stream-null.h
camel/camel-stream-process.c
camel/camel-stream-process.h
camel/camel-stream-vfs.c
camel/camel-stream.c
camel/camel-string-utils.c
camel/camel-tcp-stream-openssl.c
camel/camel-tcp-stream-raw.c
camel/camel-tcp-stream-raw.h
camel/camel-tcp-stream-ssl.c
camel/camel-tcp-stream-ssl.h
camel/camel-tcp-stream.c
camel/camel-tcp-stream.h
camel/camel-text-index.c
camel/camel-transport.c
camel/camel-transport.h
camel/camel-types.h
camel/camel-uid-cache.c
camel/camel-uid-cache.h
camel/camel-url-scanner.c
camel/camel-url.c
camel/camel-url.h
camel/camel-utf8.c
camel/camel-vee-folder.c
camel/camel-vee-store.c
camel/camel-vtrash-folder.c
camel/camel-vtrash-folder.h
camel/camel.c
camel/camel.h
camel/providers/groupwise/camel-groupwise-folder.c
camel/providers/groupwise/camel-groupwise-folder.h
camel/providers/groupwise/camel-groupwise-journal.c
camel/providers/groupwise/camel-groupwise-journal.h
camel/providers/groupwise/camel-groupwise-private.h
camel/providers/groupwise/camel-groupwise-provider.c
camel/providers/groupwise/camel-groupwise-store-summary.c
camel/providers/groupwise/camel-groupwise-store.c
camel/providers/groupwise/camel-groupwise-store.h
camel/providers/groupwise/camel-groupwise-summary.c
camel/providers/groupwise/camel-groupwise-summary.h
camel/providers/groupwise/camel-groupwise-transport.c
camel/providers/groupwise/camel-groupwise-transport.h
camel/providers/groupwise/camel-groupwise-utils.c
camel/providers/groupwise/camel-groupwise-utils.h
camel/providers/hula/camel-hula-provider.c
camel/providers/imap/camel-imap-command.c
camel/providers/imap/camel-imap-command.h
camel/providers/imap/camel-imap-folder.c
camel/providers/imap/camel-imap-folder.h
camel/providers/imap/camel-imap-message-cache.c
camel/providers/imap/camel-imap-message-cache.h
camel/providers/imap/camel-imap-provider.c
camel/providers/imap/camel-imap-search.c
camel/providers/imap/camel-imap-store-summary.c
camel/providers/imap/camel-imap-store.c
camel/providers/imap/camel-imap-store.h
camel/providers/imap/camel-imap-summary.c
camel/providers/imap/camel-imap-summary.h
camel/providers/imap/camel-imap-types.h
camel/providers/imap/camel-imap-utils.c
camel/providers/imap/camel-imap-wrapper.c
camel/providers/imap4/camel-imap4-command.c
camel/providers/imap4/camel-imap4-command.h
camel/providers/imap4/camel-imap4-engine.c
camel/providers/imap4/camel-imap4-engine.h
camel/providers/imap4/camel-imap4-folder.c
camel/providers/imap4/camel-imap4-folder.h
camel/providers/imap4/camel-imap4-journal.c
camel/providers/imap4/camel-imap4-journal.h
camel/providers/imap4/camel-imap4-provider.c
camel/providers/imap4/camel-imap4-search.c
camel/providers/imap4/camel-imap4-search.h
camel/providers/imap4/camel-imap4-specials.c
camel/providers/imap4/camel-imap4-specials.h
camel/providers/imap4/camel-imap4-store-summary.c
camel/providers/imap4/camel-imap4-store-summary.h
camel/providers/imap4/camel-imap4-store.c
camel/providers/imap4/camel-imap4-store.h
camel/providers/imap4/camel-imap4-stream.c
camel/providers/imap4/camel-imap4-stream.h
camel/providers/imap4/camel-imap4-summary.c
camel/providers/imap4/camel-imap4-summary.h
camel/providers/imap4/camel-imap4-utils.c
camel/providers/imapp/camel-imapp-driver.c
camel/providers/imapp/camel-imapp-engine.c
camel/providers/imapp/camel-imapp-engine.h
camel/providers/imapp/camel-imapp-fetch-stream.c
camel/providers/imapp/camel-imapp-folder.c
camel/providers/imapp/camel-imapp-folder.h
camel/providers/imapp/camel-imapp-provider.c
camel/providers/imapp/camel-imapp-store-summary.c
camel/providers/imapp/camel-imapp-store.c
camel/providers/imapp/camel-imapp-store.h
camel/providers/imapp/camel-imapp-stream.c
camel/providers/imapp/camel-imapp-summary.c
camel/providers/imapp/camel-imapp-utils.c
camel/providers/imapp/camel-imapp-utils.h
camel/providers/local/camel-local-folder.c
camel/providers/local/camel-local-folder.h
camel/providers/local/camel-local-provider.c
camel/providers/local/camel-local-store.c
camel/providers/local/camel-local-store.h
camel/providers/local/camel-local-summary.c
camel/providers/local/camel-local-summary.h
camel/providers/local/camel-maildir-folder.c
camel/providers/local/camel-maildir-folder.h
camel/providers/local/camel-maildir-store.c
camel/providers/local/camel-maildir-store.h
camel/providers/local/camel-maildir-summary.c
camel/providers/local/camel-mbox-folder.c
camel/providers/local/camel-mbox-folder.h
camel/providers/local/camel-mbox-store.c
camel/providers/local/camel-mbox-store.h
camel/providers/local/camel-mbox-summary.c
camel/providers/local/camel-mh-folder.c
camel/providers/local/camel-mh-folder.h
camel/providers/local/camel-mh-store.c
camel/providers/local/camel-mh-store.h
camel/providers/local/camel-mh-summary.c
camel/providers/local/camel-spool-folder.c
camel/providers/local/camel-spool-folder.h
camel/providers/local/camel-spool-store.c
camel/providers/local/camel-spool-store.h
camel/providers/local/camel-spool-summary.c
camel/providers/local/camel-spool-summary.h
camel/providers/nntp/camel-nntp-auth.c
camel/providers/nntp/camel-nntp-auth.h
camel/providers/nntp/camel-nntp-folder.c
camel/providers/nntp/camel-nntp-folder.h
camel/providers/nntp/camel-nntp-grouplist.c
camel/providers/nntp/camel-nntp-grouplist.h
camel/providers/nntp/camel-nntp-newsrc.c
camel/providers/nntp/camel-nntp-private.h
camel/providers/nntp/camel-nntp-provider.c
camel/providers/nntp/camel-nntp-resp-codes.h
camel/providers/nntp/camel-nntp-store-summary.c
camel/providers/nntp/camel-nntp-store.c
camel/providers/nntp/camel-nntp-store.h
camel/providers/nntp/camel-nntp-summary.c
camel/providers/nntp/camel-nntp-types.h
camel/providers/nntp/camel-nntp-utils.c
camel/providers/nntp/camel-nntp-utils.h
camel/providers/pop3/camel-pop3-engine.c
camel/providers/pop3/camel-pop3-engine.h
camel/providers/pop3/camel-pop3-folder.c
camel/providers/pop3/camel-pop3-folder.h
camel/providers/pop3/camel-pop3-provider.c
camel/providers/pop3/camel-pop3-store.c
camel/providers/pop3/camel-pop3-store.h
camel/providers/pop3/camel-pop3-stream.c
camel/providers/sendmail/camel-sendmail-provider.c
camel/providers/sendmail/camel-sendmail-transport.c
camel/providers/sendmail/camel-sendmail-transport.h
camel/providers/smtp/camel-smtp-provider.c
camel/providers/smtp/camel-smtp-transport.c
camel/providers/smtp/camel-smtp-transport.h
camel/tests/folder/test10.c
camel/tests/folder/test11.c
camel/tests/folder/test3.c
camel/tests/folder/test8.c
camel/tests/folder/test9.c
camel/tests/lib/addresses.c
camel/tests/lib/camel-test.c
camel/tests/lib/messages.c
camel/tests/lib/session.c
camel/tests/lib/session.h
camel/tests/message/test1.c
camel/tests/message/test2.c
camel/tests/message/test3.c
camel/tests/message/test4.c
camel/tests/mime-filter/test-charset.c
camel/tests/mime-filter/test-crlf.c
camel/tests/mime-filter/test-tohtml.c
camel/tests/mime-filter/test1.c
camel/tests/misc/rfc2047.c
camel/tests/misc/url-scan.c
camel/tests/smime/pgp-mime.c
camel/tests/smime/pgp.c
camel/tests/smime/pkcs7.c
camel/tests/stream/test1.c
camel/tests/stream/test3.c
docs/reference/addressbook/libebook/tmpl/e-contact.sgml
docs/reference/libedataserverui/tmpl/e-cell-renderer-color.sgml
iconv-detect.c
libdb/db/db.c
libdb/db/db_cam.c
libdb/dbinc/mutex.h
libdb/hmac/sha1.c
libdb/mutex/mut_win32.c
libdb/perl/BerkeleyDB/ppport.h
libdb/perl/DB_File/ppport.h
libdb/perl/DB_File/version.c
libdb/rep/rep_method.c
libdb/rpc_server/c/gen_db_server.c
libdb/txn/txn.c
libedataserver/e-account-list.c
libedataserver/e-account-list.h
libedataserver/e-account.c
libedataserver/e-account.h
libedataserver/e-categories.c
libedataserver/e-categories.h
libedataserver/e-data-server-module.c
libedataserver/e-data-server-util.c
libedataserver/e-dbhash.c
libedataserver/e-file-cache.c
libedataserver/e-flag.c
libedataserver/e-flag.h
libedataserver/e-iconv.c
libedataserver/e-iconv.h
libedataserver/e-iterator.c
libedataserver/e-iterator.h
libedataserver/e-list-iterator.c
libedataserver/e-list.c
libedataserver/e-list.h
libedataserver/e-memory.c
libedataserver/e-memory.h
libedataserver/e-msgport.c
libedataserver/e-sexp.c
libedataserver/e-sexp.h
libedataserver/e-source-group.c
libedataserver/e-source-list.c
libedataserver/e-source.c
libedataserver/e-time-utils.c
libedataserver/e-time-utils.h
libedataserver/e-trie.c
libedataserver/e-uid.c
libedataserver/e-url.c
libedataserver/e-url.h
libedataserver/e-xml-hash-utils.c
libedataserver/e-xml-hash-utils.h
libedataserver/e-xml-utils.c
libedataserver/e-xml-utils.h
libedataserver/libedataserver-private.h
libedataserver/md5-utils.c
libedataserver/test-source-list.c
libedataserverui/e-book-auth-util.c
libedataserverui/e-categories-dialog.c
libedataserverui/e-categories-dialog.h
libedataserverui/e-cell-renderer-color.c
libedataserverui/e-contact-store.c
libedataserverui/e-destination-store.c
libedataserverui/e-destination-store.h
libedataserverui/e-name-selector-dialog.c
libedataserverui/e-name-selector-entry.c
libedataserverui/e-name-selector-list.c
libedataserverui/e-name-selector-list.h
libedataserverui/e-name-selector-model.c
libedataserverui/e-passwords.c
libedataserverui/e-passwords.h
libedataserverui/e-source-option-menu.c
libedataserverui/e-source-selector.c
libedataserverui/e-tree-model-generator.c
libedataserverui/test-source-combo-box.c
servers/exchange/lib/cptest.c
servers/exchange/lib/e2k-action.c
servers/exchange/lib/e2k-autoconfig.c
servers/exchange/lib/e2k-context.c
servers/exchange/lib/e2k-context.h
servers/exchange/lib/e2k-freebusy.c
servers/exchange/lib/e2k-global-catalog.c
servers/exchange/lib/e2k-global-catalog.h
servers/exchange/lib/e2k-path.h
servers/exchange/lib/e2k-properties.c
servers/exchange/lib/e2k-restriction.c
servers/exchange/lib/e2k-restriction.h
servers/exchange/lib/e2k-rule-xml.c
servers/exchange/lib/e2k-rule.h
servers/exchange/lib/e2k-security-descriptor.c
servers/exchange/lib/e2k-uri.c
servers/exchange/lib/ebrowse.c
servers/exchange/lib/gctest.c
servers/exchange/lib/urltest.c
servers/exchange/storage/e-folder-exchange.c
servers/exchange/storage/e-folder-tree.c
servers/exchange/storage/e-folder-tree.h
servers/exchange/storage/e-folder.c
servers/exchange/storage/e-storage.c
servers/exchange/storage/exchange-account.c
servers/exchange/storage/exchange-account.h
servers/exchange/storage/exchange-esource.c
servers/exchange/storage/exchange-folder-size.c
servers/exchange/storage/exchange-hierarchy-favorites.c
servers/exchange/storage/exchange-hierarchy-foreign.c
servers/exchange/storage/exchange-hierarchy-gal.c
servers/exchange/storage/exchange-hierarchy-somedav.c
servers/exchange/storage/exchange-hierarchy-webdav.c
servers/exchange/storage/exchange-hierarchy.c
servers/exchange/storage/exchange-oof.c
servers/exchange/xntlm/xntlm-des.c
servers/google/libgdata-google/gdata-google-service.c
servers/google/libgdata-google/gdata-google-service.h
servers/google/libgdata/gdata-entry.c
servers/google/libgdata/gdata-entry.h
servers/google/libgdata/gdata-feed.c
servers/google/libgdata/gdata-feed.h
servers/google/libgdata/gdata-service-iface.c
servers/google/libgdata/gdata-service-iface.h
servers/groupwise/e-gw-connection.c
servers/groupwise/e-gw-connection.h
servers/groupwise/e-gw-container.c
servers/groupwise/e-gw-container.h
servers/groupwise/e-gw-filter.c
servers/groupwise/e-gw-filter.h
servers/groupwise/e-gw-item.c
servers/groupwise/e-gw-item.h
servers/groupwise/e-gw-message.c
servers/groupwise/e-gw-message.h
servers/groupwise/e-gw-proxy.c
servers/groupwise/e-gw-proxy.h
servers/groupwise/e-gw-recur-utils.c
servers/groupwise/e-gw-recur-utils.h
servers/groupwise/e-gw-sendoptions.c
servers/groupwise/e-gw-sendoptions.h
src/offline-listener.c
src/offline-listener.h
src/server-logging.c
src/server.c

index d3ad86d..a08a68e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-14  Matthew Barnes  <mbarnes@redhat.com>
+
+       ** Remove trailing whitespace from source code.
+
 2007-11-13  Ondrej Jirman  <megous@megous.com>
 
        ** Fix for bug #494299
index 59da41d..8ecfe90 100644 (file)
@@ -23,7 +23,7 @@
  *          Hans Petter Jansson <hpj@novell.com>
  */
 
-#include <config.h> 
+#include <config.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -166,7 +166,7 @@ e_book_backend_file_create_unique_id (void)
        return g_strdup_printf (PAS_ID_PREFIX "%08lX%08X", time(NULL), c++);
 }
 
-static void 
+static void
 set_revision (EContact *contact)
 {
        char time_string[25] = {0};
@@ -178,7 +178,7 @@ set_revision (EContact *contact)
        if (tm)
                strftime (time_string, 100, "%Y-%m-%dT%H:%M:%SZ", tm);
        e_contact_set (contact, E_CONTACT_REV, time_string);
-       
+
 }
 
 static EBookBackendSyncStatus
@@ -192,7 +192,7 @@ do_create(EBookBackendFile  *bf,
        char           *id;
        char           *vcard;
        const char *rev;
-       
+
        g_assert (bf);
        g_assert (vcard_req);
        g_assert (contact);
@@ -402,11 +402,11 @@ e_book_backend_file_get_contact_list (EBookBackendSync *backend,
        const char *search = query;
        GList *contact_list = NULL;
        EBookBackendSyncStatus status;
-       
+
        d(printf ("e_book_backend_file_get_contact_list (%s)\n", search));
        status = GNOME_Evolution_Addressbook_Success;
        if (e_book_backend_summary_is_summary_query (bf->priv->summary, search)) {
-       
+
                /* do a summary query */
                GPtrArray *ids = e_book_backend_summary_search (bf->priv->summary, search);
                int i;
@@ -466,7 +466,7 @@ e_book_backend_file_get_contact_list (EBookBackendSync *backend,
 
                }
                g_object_unref (card_sexp);
-               
+
                if (db_error == DB_NOTFOUND) {
                        status = GNOME_Evolution_Addressbook_Success;
                } else {
@@ -546,7 +546,7 @@ book_view_thread (gpointer data)
        /* ref the book view because it'll be removed and unrefed
           when/if it's stopped */
        bonobo_object_ref (book_view);
-       
+
        db = bf->priv->file_db;
        query = e_data_book_view_get_card_query (book_view);
 
@@ -692,13 +692,13 @@ e_book_backend_file_changes_foreach_key (const char *key, gpointer user_data)
        DB      *db = ctx->db;
        DBT     id_dbt, vcard_dbt;
        int     db_error = 0;
-       
+
        string_to_dbt (key, &id_dbt);
        memset (&vcard_dbt, 0, sizeof (vcard_dbt));
        vcard_dbt.flags = DB_DBT_MALLOC;
 
        db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
-       
+
        if (db_error != 0) {
                EContact *contact;
                char *id = id_dbt.data;
@@ -706,7 +706,7 @@ e_book_backend_file_changes_foreach_key (const char *key, gpointer user_data)
 
                contact = e_contact_new ();
                e_contact_set (contact, E_CONTACT_UID, id);
-               
+
                vcard_string = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
 
                ctx->del_ids = g_list_append (ctx->del_ids,
@@ -715,7 +715,7 @@ e_book_backend_file_changes_foreach_key (const char *key, gpointer user_data)
                                                vcard_string);
 
                g_object_unref (contact);
-               
+
                g_free (vcard_dbt.data);
        }
 }
@@ -766,10 +766,10 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
                                EContact *contact;
                                char *id = id_dbt.data;
                                char *vcard_string;
-                               
+
                                /* Remove fields the user can't change
                                 * and can change without the rest of the
-                                * card changing 
+                                * card changing
                                 */
                                contact = create_contact (id_dbt.data, vcard_dbt.data);
 
@@ -778,7 +778,7 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 #endif
                                vcard_string = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
                                g_object_unref (contact);
-                               
+
                                /* check what type of change has occurred, if any */
                                switch (e_dbhash_compare (ehash, id, vcard_string)) {
                                case E_DBHASH_STATUS_SAME:
@@ -820,7 +820,7 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 
                        g_free (i->data);
                        g_free (v->data);
-               }       
+               }
                for (i = ctx.mod_ids, v = ctx.mod_cards; i != NULL; i = i->next, v = v->next){
                        char *id = i->data;
                        char *vcard = v->data;
@@ -830,14 +830,14 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
                                                  e_book_backend_change_modify_new (vcard));
 
                        g_free (i->data);
-                       g_free (v->data);               
+                       g_free (v->data);
                }
-               for (i = ctx.del_ids, v = ctx.del_cards; i != NULL; i = i->next, v = v->next){  
+               for (i = ctx.del_ids, v = ctx.del_cards; i != NULL; i = i->next, v = v->next){
                        char *id = i->data;
                        char *vcard = v->data;
-                       
+
                        e_dbhash_remove (ehash, id);
-                       
+
                        changes = g_list_prepend (changes,
                                                  e_book_backend_change_delete_new (vcard));
                        g_free (i->data);
@@ -881,7 +881,7 @@ e_book_backend_file_get_required_fields (EBookBackendSync *backend,
                                          GList **fields_out)
 {
        GList *fields = NULL;
-       
+
        fields = g_list_append (fields , g_strdup(e_contact_field_name (E_CONTACT_FILE_AS)));
        *fields_out = fields;
        return GNOME_Evolution_Addressbook_Success;
@@ -924,7 +924,7 @@ e_book_backend_file_upgrade_db (EBookBackendFile *bf, char *old_version)
        DB  *db = bf->priv->file_db;
        int db_error;
        DBT version_name_dbt, version_dbt;
-       
+
        if (strcmp (old_version, "0.0")
            && strcmp (old_version, "0.1")) {
                g_warning ("unsupported version '%s' found in PAS backend file\n",
@@ -1094,7 +1094,7 @@ e_book_backend_file_load_source (EBookBackend           *backend,
                env->set_errcall (env, file_errcall);
 
                /* Set the allocation routines to the non-aborting GLib functions */
-               env->set_alloc (env, (void *(*)(size_t))g_try_malloc, 
+               env->set_alloc (env, (void *(*)(size_t))g_try_malloc,
                                (void *(*)(void *, size_t))g_try_realloc,
                                g_free);
 
@@ -1195,7 +1195,7 @@ e_book_backend_file_load_source (EBookBackend           *backend,
 #ifdef CREATE_DEFAULT_VCARD
                                EContact *contact = NULL;
                                EBookBackendSyncStatus status;
-                               
+
                                status = do_create (bf, XIMIAN_VCARD, &contact);
                                if (status != GNOME_Evolution_Addressbook_Success)
                                        g_warning ("Cannot create default contact: %d", status);
@@ -1209,7 +1209,7 @@ e_book_backend_file_load_source (EBookBackend           *backend,
        }
 
        bf->priv->file_db = db;
-       
+
        if (db_error != 0) {
                bf->priv->file_db = NULL;
                g_free (dirname);
@@ -1331,7 +1331,7 @@ e_book_backend_file_cancel_operation (EBookBackend *backend, EDataBook *book)
 {
        return GNOME_Evolution_Addressbook_CouldNotCancel;
 }
-static void 
+static void
 e_book_backend_file_set_mode (EBookBackend *backend,  GNOME_Evolution_Addressbook_BookMode mode)
 {
        if (e_book_backend_is_loaded (backend)) {
@@ -1340,14 +1340,14 @@ e_book_backend_file_set_mode (EBookBackend *backend,  GNOME_Evolution_Addressboo
        }
 }
 
-static void 
+static void
 e_book_backend_file_sync (EBookBackend *backend)
 {
        EBookBackendFile *bf = E_BOOK_BACKEND_FILE (backend);
        int db_error;
-       
+
        g_return_if_fail (bf != NULL);
-       
+
        if (bf->priv->file_db) {
                db_error = bf->priv->file_db->sync (bf->priv->file_db, 0);
                if (db_error != 0)
@@ -1397,7 +1397,7 @@ e_book_backend_file_dispose (GObject *object)
                bf->priv->file_db->close (bf->priv->file_db, 0);
                bf->priv->file_db = NULL;
        }
-       
+
        G_LOCK (global_env);
        global_env.ref_count--;
        if (global_env.ref_count == 0) {
@@ -1405,13 +1405,13 @@ e_book_backend_file_dispose (GObject *object)
                global_env.env = NULL;
        }
        G_UNLOCK (global_env);
-       
+
        if (bf->priv->summary) {
                g_object_unref (bf->priv->summary);
                bf->priv->summary = NULL;
        }
 
-       G_OBJECT_CLASS (e_book_backend_file_parent_class)->dispose (object);    
+       G_OBJECT_CLASS (e_book_backend_file_parent_class)->dispose (object);
 }
 
 static void
@@ -1424,7 +1424,7 @@ e_book_backend_file_finalize (GObject *object)
        g_free (bf->priv->filename);
        g_free (bf->priv->dirname);
        g_free (bf->priv->summary_filename);
-       
+
        g_free (bf->priv);
 
        G_OBJECT_CLASS (e_book_backend_file_parent_class)->finalize (object);
@@ -1502,7 +1502,7 @@ e_book_backend_file_class_init (EBookBackendFileClass *klass)
        sync_class->authenticate_user_sync     = e_book_backend_file_authenticate_user;
        sync_class->get_supported_fields_sync  = e_book_backend_file_get_supported_fields;
        sync_class->get_required_fields_sync   = e_book_backend_file_get_required_fields;
-       
+
 
        object_class->dispose = e_book_backend_file_dispose;
        object_class->finalize = e_book_backend_file_finalize;
index 55ad3c8..9b9dcd2 100644 (file)
@@ -41,7 +41,7 @@
 #include "libedataserver/e-data-server-util.h"
 #include "libedataserver/e-db3-utils.h"
 #include "libedataserver/e-flag.h"
-#include "libedataserver/e-url.h" 
+#include "libedataserver/e-url.h"
 #include "libebook/e-contact.h"
 #include "libedata-book/e-book-backend-sexp.h"
 #include "libedata-book/e-data-book.h"
@@ -55,9 +55,9 @@
 #include "e-gw-filter.h"
 
 G_DEFINE_TYPE (EBookBackendGroupwise, e_book_backend_groupwise, E_TYPE_BOOK_BACKEND);
-                                                                                                                             
+
 struct _EBookBackendGroupwisePrivate {
-       EGwConnection *cnc; 
+       EGwConnection *cnc;
        char *uri;
        char *container_id;
        char *book_name;
@@ -118,9 +118,9 @@ static const struct field_element_mapping {
        void (*populate_contact_func)(EContact *contact,    gpointer data);
        void (*set_value_in_gw_item) (EGwItem *item, gpointer data);
        void (*set_changes) (EGwItem *new_item, EGwItem *old_item);
-} mappings [] = { 
-  
+
+} mappings [] = {
+
        { E_CONTACT_UID, ELEMENT_TYPE_SIMPLE, "id"},
        { E_CONTACT_FILE_AS, ELEMENT_TYPE_SIMPLE, "name" },
        { E_CONTACT_FULL_NAME, ELEMENT_TYPE_COMPLEX, "full_name", populate_full_name, set_full_name_in_gw_item, set_full_name_changes},
@@ -143,22 +143,22 @@ static const struct field_element_mapping {
        { E_CONTACT_EMAIL_1, ELEMENT_TYPE_COMPLEX, "email", populate_emails, set_emails_in_gw_item, set_emails_changes },
        { E_CONTACT_REV, ELEMENT_TYPE_SIMPLE, "modified_time"},
        { E_CONTACT_BOOK_URI, ELEMENT_TYPE_SIMPLE, "book_uri"}
-}; 
+};
 
 static void
 free_attr_list (GList *attr_list)
 {
         GList *l;
-                                                                                                                             
+
         for (l = attr_list; l; l = g_list_next (l)) {
                 EVCardAttribute *attr = l->data;
                 e_vcard_attribute_free (attr);
         }
-                                                                                                                             
+
         g_list_free (attr_list);
 }
 
-static void 
+static void
 populate_ims (EContact *contact, gpointer data)
 {
        GList *im_list;
@@ -171,7 +171,7 @@ populate_ims (EContact *contact, gpointer data)
        GList *groupwise_list = NULL;
        IMAddress *address;
        EGwItem *item;
-  
+
        item = E_GW_ITEM (data);
        im_list = e_gw_item_get_im_list (item);
 
@@ -184,7 +184,7 @@ populate_ims (EContact *contact, gpointer data)
                if (address->service == NULL) {
                        continue;
                }
-               
+
                if (g_str_equal (address->service, "icq")) {
                        im_field_id = E_CONTACT_IM_ICQ;
                        im_attr_list = &icq_list;
@@ -209,7 +209,7 @@ populate_ims (EContact *contact, gpointer data)
                        im_field_id = E_CONTACT_IM_JABBER;
                        im_attr_list = &jabber_list;
                }
-                       
+
                else if (g_str_equal (address->service, "nov")) {
                        im_field_id = E_CONTACT_IM_GROUPWISE;
                        im_attr_list = &groupwise_list;
@@ -222,7 +222,7 @@ populate_ims (EContact *contact, gpointer data)
                e_vcard_attribute_add_value (attr, address->address);
                *im_attr_list = g_list_append (*im_attr_list, attr);
        }
-       
+
        e_contact_set_attributes (contact, E_CONTACT_IM_AIM, aim_list);
        e_contact_set_attributes (contact, E_CONTACT_IM_JABBER, jabber_list);
        e_contact_set_attributes (contact, E_CONTACT_IM_ICQ, icq_list);
@@ -230,7 +230,7 @@ populate_ims (EContact *contact, gpointer data)
        e_contact_set_attributes (contact, E_CONTACT_IM_GADUGADU, gadugadu_list);
        e_contact_set_attributes (contact, E_CONTACT_IM_MSN, msn_list);
        e_contact_set_attributes (contact, E_CONTACT_IM_GROUPWISE, groupwise_list);
-       
+
        free_attr_list (aim_list);
        free_attr_list (jabber_list);
        free_attr_list (icq_list);
@@ -253,17 +253,17 @@ append_ims_to_list (GList **im_list, EContact *contact,  char *service_name, ECo
                *im_list = g_list_append (*im_list, address);
        }
        g_list_free (list);
-       
+
 }
 
-static void 
+static void
 set_ims_in_gw_item (EGwItem *item, gpointer data)
 {
        EContact *contact;
        GList *im_list = NULL;
-  
+
        contact = E_CONTACT (data);
-  
+
        append_ims_to_list (&im_list, contact, "aim", E_CONTACT_IM_AIM);
        append_ims_to_list (&im_list, contact, "yahoo", E_CONTACT_IM_YAHOO);
        append_ims_to_list (&im_list, contact, "gadu-gadu", E_CONTACT_IM_GADUGADU);
@@ -290,10 +290,10 @@ set_im_changes (EGwItem *new_item, EGwItem *old_item)
        new_ims = e_gw_item_get_im_list (new_item);
 
        if (old_ims && new_ims) {
-       
+
                old_ims_copy = g_list_copy (old_ims);
                for ( ; new_ims != NULL; new_ims = g_list_next (new_ims)) {
-                       
+
                        im1 = new_ims->data;
                        temp = old_ims;
                        ims_matched = FALSE;
@@ -304,12 +304,12 @@ set_im_changes (EGwItem *new_item, EGwItem *old_item)
                                        old_ims_copy = g_list_remove (old_ims_copy, im2);
                                        break;
                                }
-                               
+
                        }
                        if (! ims_matched)
                                added_ims = g_list_append (added_ims, im1);
                }
-                            
+
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_ADD, "ims", added_ims);
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_DELETE, "ims", old_ims_copy);
 
@@ -318,10 +318,10 @@ set_im_changes (EGwItem *new_item, EGwItem *old_item)
        } else if (new_ims && !old_ims) {
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_ADD, "ims", g_list_copy (new_ims));
        }
-       
+
 }
 
-static void 
+static void
 copy_postal_address_to_contact_address ( EContactAddress *contact_addr, PostalAddress *address)
 {
        contact_addr->address_format = NULL;
@@ -334,7 +334,7 @@ copy_postal_address_to_contact_address ( EContactAddress *contact_addr, PostalAd
        contact_addr->country = g_strdup (address->country);
 }
 
-static void 
+static void
 copy_contact_address_to_postal_address (PostalAddress *address, EContactAddress *contact_addr)
 {
        /* ugh, contact addr has null terminated strings instead of NULLs*/
@@ -346,15 +346,15 @@ copy_contact_address_to_postal_address (PostalAddress *address, EContactAddress
        address->country = (contact_addr->country && *(contact_addr->country)) ? g_strdup (contact_addr->country) : NULL;
 }
 
-static void 
+static void
 populate_address (EContact *contact, gpointer data)
 {
        PostalAddress *address;
        EGwItem *item;
        EContactAddress *contact_addr;
-       
+
        item = E_GW_ITEM (data);
-       
+
        address = e_gw_item_get_address (item, "Home");
        contact_addr = NULL;
 
@@ -364,7 +364,7 @@ populate_address (EContact *contact, gpointer data)
                e_contact_set (contact, E_CONTACT_ADDRESS_HOME, contact_addr);
                e_contact_address_free (contact_addr);
        }
-  
+
        address = e_gw_item_get_address (item, "Office");
        if (address) {
                contact_addr = g_new0(EContactAddress, 1);
@@ -374,7 +374,7 @@ populate_address (EContact *contact, gpointer data)
        }
 }
 
-static void 
+static void
 set_address_in_gw_item (EGwItem *item, gpointer data)
 {
        EContact *contact;
@@ -382,7 +382,7 @@ set_address_in_gw_item (EGwItem *item, gpointer data)
        PostalAddress *address;
 
        contact = E_CONTACT (data);
-       
+
        contact_address = e_contact_get (contact, E_CONTACT_ADDRESS_HOME);
        if (contact_address) {
                address = g_new0(PostalAddress, 1);
@@ -390,7 +390,7 @@ set_address_in_gw_item (EGwItem *item, gpointer data)
                e_gw_item_set_address (item, "Home", address);
                e_contact_address_free (contact_address);
        }
-               
+
        contact_address = e_contact_get (contact, E_CONTACT_ADDRESS_WORK);
        if (contact_address) {
                address = g_new0(PostalAddress, 1);
@@ -416,7 +416,7 @@ copy_postal_address (PostalAddress *address)
        return address_copy;
 }
 
-static void 
+static void
 set_postal_address_change (EGwItem *new_item, EGwItem *old_item,  char *address_type)
 {
        PostalAddress *old_postal_address;
@@ -425,7 +425,7 @@ set_postal_address_change (EGwItem *new_item, EGwItem *old_item,  char *address_
        char *s1, *s2;
        update_postal_address = g_new0(PostalAddress, 1);
        delete_postal_address = g_new0 (PostalAddress, 1);
-       
+
        new_postal_address = e_gw_item_get_address (new_item,  address_type);
        old_postal_address = e_gw_item_get_address (old_item, address_type);
        if (new_postal_address && old_postal_address) {
@@ -435,7 +435,7 @@ set_postal_address_change (EGwItem *new_item, EGwItem *old_item,  char *address_
                        delete_postal_address->street_address = g_strdup(s2);
                else if (s1)
                        update_postal_address->street_address = g_strdup(s1);
-               
+
                s1 =  new_postal_address->location;
                s2 = old_postal_address->location;
                if (!s1 && s2)
@@ -472,7 +472,7 @@ set_postal_address_change (EGwItem *new_item, EGwItem *old_item,  char *address_
 
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_UPDATE, address_type, update_postal_address);
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_DELETE, address_type, delete_postal_address);
-               
+
        } else if (!new_postal_address && old_postal_address) {
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_DELETE, address_type, copy_postal_address(old_postal_address));
        } else if (new_postal_address && !old_postal_address) {
@@ -480,20 +480,20 @@ set_postal_address_change (EGwItem *new_item, EGwItem *old_item,  char *address_
        }
 }
 
-static void 
+static void
 set_address_changes (EGwItem *new_item , EGwItem *old_item)
 {
        set_postal_address_change (new_item, old_item, "Home");
        set_postal_address_change (new_item, old_item, "Office");
 }
 
-static void 
+static void
 populate_birth_date (EContact *contact, gpointer data)
 {
        EGwItem *item;
        char *value ;
        EContactDate *date;
-  
+
        item = E_GW_ITEM (data);
        value = e_gw_item_get_field_value (item, "birthday");
        if (value) {
@@ -503,7 +503,7 @@ populate_birth_date (EContact *contact, gpointer data)
        }
 }
 
-static void 
+static void
 set_birth_date_in_gw_item (EGwItem *item, gpointer data)
 {
        EContact *contact;
@@ -520,7 +520,7 @@ set_birth_date_in_gw_item (EGwItem *item, gpointer data)
 
 }
 
-static void 
+static void
 set_birth_date_changes (EGwItem *new_item, EGwItem *old_item)
 {
        char *new_birthday;
@@ -528,7 +528,7 @@ set_birth_date_changes (EGwItem *new_item, EGwItem *old_item)
 
        new_birthday = e_gw_item_get_field_value (new_item, "birthday");
        old_birthday = e_gw_item_get_field_value (old_item, "birthday");
-       
+
        if (new_birthday && old_birthday) {
                if (!g_str_equal (new_birthday, old_birthday))
                        e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_UPDATE, "birthday", new_birthday);
@@ -548,7 +548,7 @@ static const int email_fields[3] = {
 
 };
 
-static void 
+static void
 populate_emails (EContact *contact, gpointer data)
 {
        GList *email_list;
@@ -559,13 +559,13 @@ populate_emails (EContact *contact, gpointer data)
        email_list = e_gw_item_get_email_list(item);
 
        for (i =0 ; i < 3 && email_list; i++, email_list = g_list_next (email_list)) {
-               if (email_list->data) 
+               if (email_list->data)
                        e_contact_set (contact, email_fields[i], email_list->data);
        }
-} 
+}
 
 
-static void 
+static void
 set_emails_in_gw_item (EGwItem *item, gpointer data)
 {
        GList *email_list;
@@ -581,19 +581,19 @@ set_emails_in_gw_item (EGwItem *item, gpointer data)
                        email_list = g_list_append (email_list, g_strdup (email));
        }
        e_gw_item_set_email_list (item, email_list);
-}  
+}
 
-static void 
+static void
 compare_string_lists ( GList *old_list, GList *new_list, GList **additions, GList **deletions)
 {
        GList *temp, *old_list_copy;
        gboolean strings_matched;
        char *string1, *string2;
-        
+
        if (old_list && new_list) {
                old_list_copy = g_list_copy (old_list);
                for ( ; new_list != NULL; new_list = g_list_next (new_list)) {
-                       
+
                        string1 = new_list->data;
                        temp = old_list;
                        strings_matched = FALSE;
@@ -610,13 +610,13 @@ compare_string_lists ( GList *old_list, GList *new_list, GList **additions, GLis
                }
                *deletions = old_list_copy;
        }
-       else if (!new_list && old_list) 
+       else if (!new_list && old_list)
                *deletions = g_list_copy (old_list);
        else if (new_list && !old_list)
                *additions = g_list_copy (new_list);
 }
-static void 
+
+static void
 set_emails_changes (EGwItem *new_item, EGwItem *old_item)
 {
        GList *old_email_list;
@@ -631,8 +631,8 @@ set_emails_changes (EGwItem *new_item, EGwItem *old_item)
        if (deleted_emails)
                e_gw_item_set_change (new_item,  E_GW_ITEM_CHANGE_TYPE_DELETE, "email", deleted_emails);
 }
-static void 
+
+static void
 populate_full_name (EContact *contact, gpointer data)
 {
        EGwItem *item;
@@ -653,7 +653,7 @@ populate_full_name (EContact *contact, gpointer data)
        }
 }
 
-static void 
+static void
 set_full_name_in_gw_item (EGwItem *item, gpointer data)
 {
        EContact *contact;
@@ -662,7 +662,7 @@ set_full_name_in_gw_item (EGwItem *item, gpointer data)
        FullName *full_name;
 
        contact = E_CONTACT (data);
-  
+
        name = e_contact_get (contact, E_CONTACT_FULL_NAME);
 
        if(name) {
@@ -692,7 +692,7 @@ copy_full_name (FullName *full_name)
        return full_name_copy;
 }
 
-static void 
+static void
 set_full_name_changes (EGwItem *new_item, EGwItem *old_item)
 {
        FullName *old_full_name;
@@ -701,10 +701,10 @@ set_full_name_changes (EGwItem *new_item, EGwItem *old_item)
        char *s1, *s2;
        update_full_name = g_new0(FullName, 1);
        delete_full_name = g_new0 (FullName, 1);
-       
+
        old_full_name = e_gw_item_get_full_name (old_item);
        new_full_name = e_gw_item_get_full_name (new_item);
-       
+
        if (old_full_name && new_full_name) {
                s1 = new_full_name->name_prefix;
                s2 = old_full_name->name_prefix;
@@ -724,7 +724,7 @@ set_full_name_changes (EGwItem *new_item, EGwItem *old_item)
                        delete_full_name->middle_name = g_strdup(s2);
                else if (s1)
                        update_full_name->middle_name = g_strdup(s1);
-               
+
                s1 = new_full_name->last_name;
                s2 = old_full_name->last_name;
                if(!s1 && s2)
@@ -739,7 +739,7 @@ set_full_name_changes (EGwItem *new_item, EGwItem *old_item)
                        update_full_name->name_suffix = g_strdup(s1);
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_UPDATE,"full_name",  update_full_name);
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_DELETE,"full_name",  delete_full_name);
-       
+
        } else if (!new_full_name && old_full_name) {
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_DELETE, "full_name", copy_full_name(old_full_name));
        } else if (new_full_name && !old_full_name) {
@@ -747,7 +747,7 @@ set_full_name_changes (EGwItem *new_item, EGwItem *old_item)
        }
 }
 
-static void 
+static void
 populate_contact_members (EContact *contact, gpointer data)
 {
        EGwItem *item;
@@ -818,7 +818,7 @@ set_members_in_gw_item (EGwItem  *item, EContact *contact, EBookBackendGroupwise
                                                /* The item corresponding to this id is not found. This happens in case of
                                                 * importing, in imported file the stored id is corresponding to the address
                                                 * book from which the contact list was exported.
-                                                */ 
+                                                */
                                                id = NULL;
                                        }
                                        else
@@ -862,22 +862,22 @@ set_members_in_gw_item (EGwItem  *item, EContact *contact, EBookBackendGroupwise
                }
                g_object_unref (temp_item);
        }
-       
 
-       /* In groupwise there is no way to put arbitrary members into a group. There's no 
-        * mechanism for a group to contain members that are not already present in a system 
+
+       /* In groupwise there is no way to put arbitrary members into a group. There's no
+        * mechanism for a group to contain members that are not already present in a system
         * or personal addressbook as a contact, and so they cant be saved and will be lost.
-        * In order to save them we first need to create groupwise based contacts for these 
+        * In order to save them we first need to create groupwise based contacts for these
         * arbitrary contacts and then add them as members to the group.
         */
-       
+
        temp = emails_without_ids ;
        for (; temp != NULL; temp = g_list_next (temp)) {
                EContact *new_contact = e_contact_new ();
                EGwItem *new_item = e_gw_item_new_empty ();
                FullName *full_name;
 
-               e_contact_set (new_contact,E_CONTACT_FULL_NAME, e_contact_name_from_string (strdup (temp->data))); 
+               e_contact_set (new_contact,E_CONTACT_FULL_NAME, e_contact_name_from_string (strdup (temp->data)));
                e_contact_set (new_contact, E_CONTACT_EMAIL_1, strdup (temp->data));
                e_contact_set (new_contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (FALSE));
                e_gw_item_set_item_type (new_item, E_GW_ITEM_TYPE_CONTACT);
@@ -889,7 +889,7 @@ set_members_in_gw_item (EGwItem  *item, EContact *contact, EBookBackendGroupwise
                full_name->last_name = NULL;
                full_name->name_suffix = NULL;
                e_gw_item_set_full_name (new_item, full_name);
-               
+
                for (i=0; i < G_N_ELEMENTS (mappings); i++) {
                        element_type = mappings[i].element_type;
                        if (element_type == ELEMENT_TYPE_SIMPLE) {
@@ -914,13 +914,13 @@ set_members_in_gw_item (EGwItem  *item, EContact *contact, EBookBackendGroupwise
                                        mappings[i].set_value_in_gw_item (new_item, new_contact);
                                }
                        }
-               
+
                }
                id = NULL;
                status = e_gw_connection_create_item (egwb->priv->cnc, new_item, &id);
                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                        status = e_gw_connection_create_item (egwb->priv->cnc, new_item, &id);
-               
+
                if (status == E_GW_CONNECTION_STATUS_OK && id) {
                        e_contact_set (new_contact, E_CONTACT_UID, id);
                        e_book_backend_db_cache_add_contact (egwb->priv->file_db, new_contact);
@@ -942,7 +942,7 @@ set_members_in_gw_item (EGwItem  *item, EContact *contact, EBookBackendGroupwise
                e_gw_item_set_member_list (item, group_members);
 }
 
-static void 
+static void
 set_member_changes (EGwItem *new_item, EGwItem *old_item, EBookBackendGroupwise *egwb)
 {
        GList *old_members, *new_members ;
@@ -962,9 +962,9 @@ set_member_changes (EGwItem *new_item, EGwItem *old_item, EBookBackendGroupwise
                member = (EGroupMember *)new_members->data;
                new_ids = g_list_append (new_ids, member->id);
        }
-       
+
        compare_string_lists (old_ids, new_ids, &additions, &deletions);
-       if (additions) 
+       if (additions)
                e_gw_connection_add_members (egwb->priv->cnc, e_gw_item_get_id (old_item), additions);
        if (deletions)
                e_gw_connection_remove_members (egwb->priv->cnc, e_gw_item_get_id (old_item), deletions);
@@ -975,7 +975,7 @@ set_member_changes (EGwItem *new_item, EGwItem *old_item, EBookBackendGroupwise
        g_list_free (deletions);
 }
 
-static void 
+static void
 set_organization_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise *egwb)
 {
        char *organization_name;
@@ -984,7 +984,7 @@ set_organization_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroup
        int status;
        char *id;
        GList *items;
-       
+
        organization_name = e_contact_get (contact, E_CONTACT_ORG);
        if (organization_name == NULL || strlen (organization_name) == 0)
                return;
@@ -1029,7 +1029,7 @@ set_organization_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroup
                if (status != E_GW_CONNECTION_STATUS_OK)
                        return;
        }
-       if (id == NULL) 
+       if (id == NULL)
                return;
        e_gw_item_set_field_value (item, "organization_id", id);
        e_gw_item_set_field_value (item , "organization", organization_name);
@@ -1061,7 +1061,7 @@ set_organization_changes_in_gw_item (EGwItem *new_item, EGwItem *old_item)
        }
 }
 
-static void 
+static void
 set_categories_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise *egwb)
 {
        GHashTable *categories_by_name;
@@ -1077,7 +1077,7 @@ set_categories_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwi
                if (!category_names->data || strlen(category_names->data) == 0 )
                        continue;
                id = g_hash_table_lookup (categories_by_name, category_names->data);
-               if (id) 
+               if (id)
                        category_ids = g_list_append (category_ids, g_strdup (id));
                else {
                        EGwItem *category_item;
@@ -1089,7 +1089,7 @@ set_categories_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwi
                        if (status == E_GW_CONNECTION_STATUS_OK && id != NULL) {
                                char **components = g_strsplit (id, "@", -1);
                                char *temp_id = components[0];
-                                                       
+
                                g_hash_table_insert (categories_by_name, g_strdup (category_names->data), g_strdup(temp_id));
                                g_hash_table_insert (egwb->priv->categories_by_id, g_strdup(temp_id), g_strdup (category_names->data));
                                category_ids = g_list_append (category_ids, g_strdup(temp_id));
@@ -1099,10 +1099,10 @@ set_categories_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwi
                        g_object_unref (category_item);
                }
        }
-       e_gw_item_set_categories (item, category_ids);  
+       e_gw_item_set_categories (item, category_ids);
 }
 
-static void 
+static void
 set_categories_changes (EGwItem *new_item, EGwItem *old_item)
 {
        GList *old_category_list;
@@ -1133,7 +1133,7 @@ set_categories_changes (EGwItem *new_item, EGwItem *old_item)
                        if (!categories_matched)
                                added_categories = g_list_append (added_categories, category1);
                }
-               
+
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_ADD, "categories", added_categories);
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_DELETE, "categories", old_categories_copy);
        } else if (!new_category_list && old_category_list) {
@@ -1143,14 +1143,14 @@ set_categories_changes (EGwItem *new_item, EGwItem *old_item)
        }
 }
 
-static void 
+static void
 fill_contact_from_gw_item (EContact *contact, EGwItem *item, GHashTable *categories_by_ids)
 {
        char* value;
        int element_type;
        int i;
        gboolean is_contact_list;
-       
+
        is_contact_list = e_gw_item_get_item_type (item) == E_GW_ITEM_TYPE_GROUP ? TRUE: FALSE;
        e_contact_set (contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (is_contact_list));
        if (is_contact_list)
@@ -1182,7 +1182,7 @@ fill_contact_from_gw_item (EContact *contact, EGwItem *item, GHashTable *categor
                                        g_list_free (category_names);
                                }
                        }
-                       else      
+                       else
                                mappings[i].populate_contact_func(contact, item);
                }
        }
@@ -1213,9 +1213,9 @@ e_book_backend_groupwise_create_contact (EBookBackend *backend,
        case GNOME_Evolution_Addressbook_MODE_LOCAL :
                e_data_book_respond_create(book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
                return;
-          
-       case  GNOME_Evolution_Addressbook_MODE_REMOTE : 
-               
+
+       case  GNOME_Evolution_Addressbook_MODE_REMOTE :
+
                if (egwb->priv->cnc == NULL) {
                        e_data_book_respond_create(book, opid, GNOME_Evolution_Addressbook_AuthenticationRequired, NULL);
                        return;
@@ -1228,7 +1228,7 @@ e_book_backend_groupwise_create_contact (EBookBackend *backend,
                item = e_gw_item_new_empty ();
                e_gw_item_set_item_type (item, e_contact_get (contact, E_CONTACT_IS_LIST) ? E_GW_ITEM_TYPE_GROUP :E_GW_ITEM_TYPE_CONTACT);
                e_gw_item_set_container_id (item, g_strdup(egwb->priv->container_id));
-               
+
                for (i = 0; i < G_N_ELEMENTS (mappings); i++) {
                        element_type = mappings[i].element_type;
                        if (element_type == ELEMENT_TYPE_SIMPLE)  {
@@ -1253,9 +1253,9 @@ e_book_backend_groupwise_create_contact (EBookBackend *backend,
                        }
                }
                id = NULL;
-               status = e_gw_connection_create_item (egwb->priv->cnc, item, &id);  
-               if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION) 
-                       status = e_gw_connection_create_item (egwb->priv->cnc, item, &id);  
+               status = e_gw_connection_create_item (egwb->priv->cnc, item, &id);
+               if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+                       status = e_gw_connection_create_item (egwb->priv->cnc, item, &id);
 
                /* Make sure server has returned  an id for the created contact */
                if (status == E_GW_CONNECTION_STATUS_OK && id) {
@@ -1265,7 +1265,7 @@ e_book_backend_groupwise_create_contact (EBookBackend *backend,
                        egwb->priv->file_db->sync(egwb->priv->file_db, 0);
                        e_book_backend_summary_add_contact (egwb->priv->summary, contact);
                        e_data_book_respond_create(book, opid, GNOME_Evolution_Addressbook_Success, contact);
-                       
+
                }
                else {
                        e_data_book_respond_create(book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
@@ -1291,24 +1291,24 @@ e_book_backend_groupwise_remove_contacts (EBookBackend *backend,
                printf ("\ne_book_backend_groupwise_remove_contacts...\n");
 
        ebgw = E_BOOK_BACKEND_GROUPWISE (backend);
-       
+
        switch (ebgw->priv->mode) {
 
        case GNOME_Evolution_Addressbook_MODE_LOCAL :
                e_data_book_respond_remove_contacts (book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
                return;
 
-       case GNOME_Evolution_Addressbook_MODE_REMOTE : 
+       case GNOME_Evolution_Addressbook_MODE_REMOTE :
                if (ebgw->priv->cnc == NULL) {
                        e_data_book_respond_remove_contacts (book, opid, GNOME_Evolution_Addressbook_AuthenticationRequired, NULL);
                        return;
                }
-               
+
                if (!ebgw->priv->is_writable) {
                        e_data_book_respond_remove_contacts (book, opid, GNOME_Evolution_Addressbook_PermissionDenied, NULL);
                        return;
                }
-               
+
                for ( ; id_list != NULL; id_list = g_list_next (id_list)) {
                        id = (char*) id_list->data;
                        e_gw_connection_remove_item (ebgw->priv->cnc, ebgw->priv->container_id, id);
@@ -1325,7 +1325,7 @@ e_book_backend_groupwise_remove_contacts (EBookBackend *backend,
        }
 }
 
-static void 
+static void
 set_changes_in_gw_item (EGwItem *new_item, EGwItem *old_item)
 {
        char* new_value;
@@ -1335,7 +1335,7 @@ set_changes_in_gw_item (EGwItem *new_item, EGwItem *old_item)
 
        g_return_if_fail (E_IS_GW_ITEM(new_item));
        g_return_if_fail (E_IS_GW_ITEM(old_item));
-       
+
        for ( i = 0; i < G_N_ELEMENTS (mappings); i++) {
                element_type = mappings[i].element_type;
                if (element_type == ELEMENT_TYPE_SIMPLE) {
@@ -1343,7 +1343,7 @@ set_changes_in_gw_item (EGwItem *new_item, EGwItem *old_item)
                                set_organization_changes_in_gw_item (new_item, old_item);
                                continue;
                        }
-               
+
                        new_value = e_gw_item_get_field_value (new_item, mappings[i].element_name);
                        old_value = e_gw_item_get_field_value (old_item, mappings[i].element_name);
                        if (new_value && old_value) {
@@ -1354,7 +1354,7 @@ set_changes_in_gw_item (EGwItem *new_item, EGwItem *old_item)
                        } else if (new_value && !old_value) {
                                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_ADD, mappings[i].element_name, new_value);
                        }
-                                                               
+
                } else if (element_type == ELEMENT_TYPE_COMPLEX) {
                        if (mappings[i].field_id != E_CONTACT_EMAIL)
                                mappings[i].set_changes(new_item, old_item);
@@ -1367,7 +1367,7 @@ e_book_backend_groupwise_modify_contact (EBookBackend *backend,
                                         EDataBook    *book,
                                         guint32       opid,
                                         const char   *vcard)
-{      
+{
        EContact *contact;
        EBookBackendGroupwise *egwb;
        char *id;
@@ -1380,7 +1380,7 @@ e_book_backend_groupwise_modify_contact (EBookBackend *backend,
        int i;
 
        if (enable_debug)
-               printf ("\ne_book_backend_groupwise_modify_contact...\n");      
+               printf ("\ne_book_backend_groupwise_modify_contact...\n");
        egwb = E_BOOK_BACKEND_GROUPWISE (backend);
 
        switch (egwb->priv->mode) {
@@ -1389,7 +1389,7 @@ e_book_backend_groupwise_modify_contact (EBookBackend *backend,
                e_data_book_respond_modify(book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
                return;
        case GNOME_Evolution_Addressbook_MODE_REMOTE :
-                       
+
                if (egwb->priv->cnc == NULL) {
                        e_data_book_respond_modify (book, opid, GNOME_Evolution_Addressbook_AuthenticationRequired, NULL);
                        return;
@@ -1408,7 +1408,7 @@ e_book_backend_groupwise_modify_contact (EBookBackend *backend,
                                if (value &&  *value)
                                        e_gw_item_set_field_value (new_item, mappings[i].element_name, value);
                        } else if (element_type == ELEMENT_TYPE_COMPLEX) {
-                               if (mappings[i].field_id == E_CONTACT_CATEGORIES) 
+                               if (mappings[i].field_id == E_CONTACT_CATEGORIES)
                                        set_categories_in_gw_item (new_item, contact, egwb);
                                else if (mappings[i].field_id == E_CONTACT_EMAIL) {
                                        if (e_contact_get (contact, E_CONTACT_IS_LIST))
@@ -1418,33 +1418,33 @@ e_book_backend_groupwise_modify_contact (EBookBackend *backend,
                                        mappings[i].set_value_in_gw_item (new_item, contact);
                        }
                }
-       
+
                id = e_contact_get (contact, E_CONTACT_UID);
                old_item = NULL;
                status = e_gw_connection_get_item (egwb->priv->cnc, egwb->priv->container_id, id, NULL,  &old_item);
-               
+
                if (old_item == NULL) {
                        e_data_book_respond_modify (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, NULL);
                        return;
                }
-               
+
                if (status != E_GW_CONNECTION_STATUS_OK) {
                        e_data_book_respond_modify (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
                        return;
                }
-               
+
                if (e_contact_get (contact, E_CONTACT_IS_LIST))
                        set_member_changes (new_item, old_item, egwb);
                new_org = e_gw_item_get_field_value (new_item, "organization");
                old_org = e_gw_item_get_field_value (old_item, "organization");
                if (new_org && *new_org) {
-                       
+
                        if ((old_org == NULL) || (old_org && strcmp (new_org, old_org)) != 0)
                                set_organization_in_gw_item (new_item, contact, egwb);
                }
-               
+
                set_changes_in_gw_item (new_item, old_item);
-               
+
                e_gw_item_set_item_type (new_item, e_gw_item_get_item_type (old_item));
                status = e_gw_connection_modify_item (egwb->priv->cnc, id, new_item);
                if (status == E_GW_CONNECTION_STATUS_OK) {
@@ -1455,7 +1455,7 @@ e_book_backend_groupwise_modify_contact (EBookBackend *backend,
                        egwb->priv->file_db->sync(egwb->priv->file_db, 0);
                        e_book_backend_summary_add_contact (egwb->priv->summary, contact);
                }
-               else 
+               else
                        e_data_book_respond_modify (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
                g_object_unref (new_item);
                g_object_ref (old_item);
@@ -1465,7 +1465,7 @@ e_book_backend_groupwise_modify_contact (EBookBackend *backend,
                break;
        }
 }
-       
+
 static void
 e_book_backend_groupwise_get_contact (EBookBackend *backend,
                                      EDataBook    *book,
@@ -1479,7 +1479,7 @@ e_book_backend_groupwise_get_contact (EBookBackend *backend,
        char *vcard;
 
        if (enable_debug)
-               printf ("\ne_book_backend_groupwise_get_contact...\n"); 
+               printf ("\ne_book_backend_groupwise_get_contact...\n");
 
        gwb =  E_BOOK_BACKEND_GROUPWISE (backend);
 
@@ -1498,7 +1498,7 @@ e_book_backend_groupwise_get_contact (EBookBackend *backend,
                }
                return;
 
-       case GNOME_Evolution_Addressbook_MODE_REMOTE :  
+       case GNOME_Evolution_Addressbook_MODE_REMOTE :
                if (gwb->priv->cnc == NULL) {
                        e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
                        return;
@@ -1518,7 +1518,7 @@ e_book_backend_groupwise_get_contact (EBookBackend *backend,
                                return;
                        }
                }
-               e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, "");  
+               e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_ContactNotFound, "");
                return;
        default :
                break;
@@ -1529,7 +1529,7 @@ typedef struct {
        EGwFilter *filter;
        gboolean is_filter_valid;
        gboolean is_personal_book;
-       int auto_completion; 
+       int auto_completion;
        char *search_string;
 } EBookBackendGroupwiseSExpData;
 
@@ -1614,24 +1614,24 @@ func_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, void *dat
                        gw_field_name = "emailList/email";
                else if (g_str_equal (propname, "file_as") || g_str_equal (propname, "nickname"))
                         gw_field_name = "name";
-               
+
                if (gw_field_name) {
                        if (g_str_equal (gw_field_name, "fullName")) {
-                               e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_CONTAINS, "fullName/firstName", str);  
+                               e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_CONTAINS, "fullName/firstName", str);
                                e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_CONTAINS, "fullName/lastName", str);
                                if (sexp_data->is_personal_book) {
                                        e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_CONTAINS, "fullName/displayName", str);
                                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 3);
                                }
-                               else { 
+                               else {
                                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 2);
                                }
                        }
-                       else { 
+                       else {
                                e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_CONTAINS, gw_field_name, str);
                        }
                }
-               else { 
+               else {
                     sexp_data->is_filter_valid = FALSE;
                }
        }
@@ -1658,7 +1658,7 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                char *propname = argv[0]->value.string;
                char *str = argv[1]->value.string;
                char *gw_field_name;
-       
+
                gw_field_name = NULL;
                if (g_str_equal (propname, "full_name"))
                        gw_field_name = "fullName";
@@ -1666,16 +1666,16 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                        gw_field_name = "emailList/email";
                else if (g_str_equal (propname, "file_as") || g_str_equal (propname, "nickname"))
                        gw_field_name = "name";
-               
+
                if (gw_field_name) {
                        if (g_str_equal (gw_field_name, "fullName")) {
-                               e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EQUAL, "fullName/firstName", str);     
+                               e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EQUAL, "fullName/firstName", str);
                                e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EQUAL, "fullName/lastName", str);
                                if (sexp_data->is_personal_book) {
                                        e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EQUAL, "fullName/displayName", str);
                                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 3);
                                }
-                               else { 
+                               else {
                                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 2);
                                }
                        }
@@ -1735,24 +1735,24 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
                        gw_field_name = "emailList/email";
                        sexp_data->auto_completion |= BEGINS_WITH_EMAIL;
                }
-               else if (g_str_equal (propname, "file_as")) { 
+               else if (g_str_equal (propname, "file_as")) {
                         gw_field_name = "name";
                         sexp_data->auto_completion |= BEGINS_WITH_FILE_AS;
-               } else if (g_str_equal (propname, "nickname")) { 
+               } else if (g_str_equal (propname, "nickname")) {
                         gw_field_name = "name";
                         sexp_data->auto_completion |= BEGINS_WITH_NICK_NAME;
                }
 
                if (gw_field_name) {
-                       
+
                        if (g_str_equal (gw_field_name, "fullName")) {
-                               e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS, "fullName/firstName", str);    
+                               e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS, "fullName/firstName", str);
                                e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS, "fullName/lastName", str);
                                if (sexp_data->is_personal_book) {
                                        e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS, "fullName/displayName", str);
                                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 3);
                                }
-                               else { 
+                               else {
                                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 2);
                                }
                        }
@@ -1779,10 +1779,10 @@ func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
 
        sexp_data = (EBookBackendGroupwiseSExpData *) data;
        sexp_data->is_filter_valid = FALSE;
-       
+
        r = e_sexp_result_new(f, ESEXP_RES_BOOL);
-       
-       r->value.bool = FALSE; 
+
+       r->value.bool = FALSE;
 
        return r;
 }
@@ -1802,7 +1802,7 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                char *propname = argv[0]->value.string;
                char *str = argv[1]->value.string;
                char *gw_field_name;
-       
+
                gw_field_name = NULL;
                if (g_str_equal (propname, "full_name"))
                        gw_field_name = "fullName";
@@ -1812,15 +1812,15 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                         gw_field_name = "name";
 
                if (gw_field_name) {
-                       
+
                        if (g_str_equal (gw_field_name, "fullName")) {
-                               e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EXISTS, "fullName/firstName", str);    
+                               e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EXISTS, "fullName/firstName", str);
                                e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EXISTS, "fullName/lastName", str);
                                if (sexp_data->is_personal_book) {
                                        e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EXISTS, "fullName/displayName", str);
                                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 3);
                                }
-                               else { 
+                               else {
                                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 2);
                                }
                        }
@@ -1828,7 +1828,7 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                                e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EXISTS, gw_field_name, str);
                        }
                }
-               else { 
+               else {
                        sexp_data->is_filter_valid = FALSE;
                }
        }
@@ -1867,7 +1867,7 @@ e_book_backend_groupwise_build_gw_filter (EBookBackendGroupwise *ebgw, const cha
 
        sexp = e_sexp_new();
        filter = e_gw_filter_new ();
-       
+
        sexp_data = g_new0 (EBookBackendGroupwiseSExpData, 1);
        sexp_data->filter = filter;
        sexp_data->is_filter_valid = TRUE;
@@ -1890,7 +1890,7 @@ e_book_backend_groupwise_build_gw_filter (EBookBackendGroupwise *ebgw, const cha
        r = e_sexp_eval(sexp);
        e_sexp_result_free(sexp, r);
        e_sexp_unref (sexp);
-       
+
        if (sexp_data->is_filter_valid) {
                if (sexp_data->auto_completion == AUTO_COMPLETION_QUERY)
                        *(gboolean *)is_auto_completion = TRUE;
@@ -1931,24 +1931,24 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
                printf ("\ne_book_backend_groupwise_get_contact_list...\n");
 
        switch (egwb->priv->mode) {
-               
+
        case GNOME_Evolution_Addressbook_MODE_LOCAL :
 
                if (!egwb->priv->file_db) {
                        e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
                        return;
                }
-               
-               if (egwb->priv->is_summary_ready && 
+
+               if (egwb->priv->is_summary_ready &&
                    e_book_backend_summary_is_summary_query (egwb->priv->summary, query)) {
                        int i;
                        ids = e_book_backend_summary_search (egwb->priv->summary, query);
                        for (i = 0; i < ids->len; i ++) {
                                char *uid = g_ptr_array_index (ids, i);
 
-                               EContact *contact = 
+                               EContact *contact =
                                        e_book_backend_db_cache_get_contact (egwb->priv->file_db, uid);
-                               contacts = g_list_append (contacts, contact);   
+                               contacts = g_list_append (contacts, contact);
                        }
                        g_ptr_array_free (ids, TRUE);
                }
@@ -1956,9 +1956,9 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
                        contacts = e_book_backend_db_cache_get_contacts (egwb->priv->file_db, query);
 
                temp = contacts;
-               for (; contacts != NULL; contacts = g_list_next(contacts)) { 
-                       vcard_list = g_list_append (vcard_list, 
-                                                   e_vcard_to_string (E_VCARD (contacts->data), 
+               for (; contacts != NULL; contacts = g_list_next(contacts)) {
+                       vcard_list = g_list_append (vcard_list,
+                                                   e_vcard_to_string (E_VCARD (contacts->data),
                                                    EVC_FORMAT_VCARD_30));
                        g_object_unref (contacts->data);
                }
@@ -1967,7 +1967,7 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
                if (temp)
                        g_list_free (temp);
                return;
-               
+
        case GNOME_Evolution_Addressbook_MODE_REMOTE:
 
                if (egwb->priv->cnc == NULL) {
@@ -1981,10 +1981,10 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
                        e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_InvalidQuery,
                                                      vcard_list);
                }
-               
+
                status = E_GW_CONNECTION_STATUS_OK;
                if (egwb->priv->is_cache_ready ) {
-                       if (egwb->priv->is_summary_ready && 
+                       if (egwb->priv->is_summary_ready &&
                            e_book_backend_summary_is_summary_query (egwb->priv->summary, query)) {
                                ids = e_book_backend_summary_search (egwb->priv->summary, query);
 
@@ -2007,37 +2007,37 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
                        }
 
                        if (ids->len > 0) {
-                               status = e_gw_connection_get_items_from_ids (egwb->priv->cnc, 
-                                                                       egwb->priv->container_id, 
-                                                                       "name email default members", 
+                               status = e_gw_connection_get_items_from_ids (egwb->priv->cnc,
+                                                                       egwb->priv->container_id,
+                                                                       "name email default members",
                                                                        ids, &gw_items);
                                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
-                               status = e_gw_connection_get_items_from_ids (egwb->priv->cnc, 
-                                                                       egwb->priv->container_id, 
-                                                                       "name email default members", 
+                               status = e_gw_connection_get_items_from_ids (egwb->priv->cnc,
+                                                                       egwb->priv->container_id,
+                                                                       "name email default members",
                                                                        ids, &gw_items);
                        g_ptr_array_free (ids, TRUE);
                        }
                        match_needed = FALSE;
-               } else { 
+               } else {
                        if (strcmp (query, "(contains \"x-evolution-any-field\" \"\")") != 0)
-                               filter = e_book_backend_groupwise_build_gw_filter (egwb, 
-                                                                                  query, 
-                                                                                  &is_auto_completion, 
+                               filter = e_book_backend_groupwise_build_gw_filter (egwb,
+                                                                                  query,
+                                                                                  &is_auto_completion,
                                                                                   NULL);
                        if (filter)
                                match_needed = FALSE;
-                       status = e_gw_connection_get_items (egwb->priv->cnc, 
-                                                           egwb->priv->container_id, 
-                                                           "name email default members", 
+                       status = e_gw_connection_get_items (egwb->priv->cnc,
+                                                           egwb->priv->container_id,
+                                                           "name email default members",
                                                            filter, &gw_items);
                        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
-                               status = e_gw_connection_get_items (egwb->priv->cnc, 
-                                                                   egwb->priv->container_id, 
-                                                                   "name email default members", 
+                               status = e_gw_connection_get_items (egwb->priv->cnc,
+                                                                   egwb->priv->container_id,
+                                                                   "name email default members",
                                                                    filter, &gw_items);
                }
-               
+
                if (status != E_GW_CONNECTION_STATUS_OK) {
                        e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_OtherError,
                                                              NULL);
@@ -2048,12 +2048,12 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
                        fill_contact_from_gw_item (contact, E_GW_ITEM (gw_items->data), egwb->priv->categories_by_id);
                        e_contact_set (contact, E_CONTACT_BOOK_URI, egwb->priv->original_uri);
                        if (match_needed &&  e_book_backend_sexp_match_contact (card_sexp, contact))
-                               vcard_list = g_list_append (vcard_list, 
-                                                           e_vcard_to_string (E_VCARD (contact), 
+                               vcard_list = g_list_append (vcard_list,
+                                                           e_vcard_to_string (E_VCARD (contact),
                                                            EVC_FORMAT_VCARD_30));
-                       else 
-                               vcard_list = g_list_append (vcard_list, 
-                                                           e_vcard_to_string (E_VCARD (contact), 
+                       else
+                               vcard_list = g_list_append (vcard_list,
+                                                           e_vcard_to_string (E_VCARD (contact),
                                                            EVC_FORMAT_VCARD_30));
                        g_object_unref (contact);
                        g_object_unref (gw_items->data);
@@ -2067,10 +2067,10 @@ e_book_backend_groupwise_get_contact_list (EBookBackend *backend,
                return;
        default :
                break;
-               
+
        }
 }
-       
+
 typedef struct {
        EBookBackendGroupwise *bg;
        GThread *thread;
@@ -2106,10 +2106,10 @@ get_closure (EDataBookView *book_view)
 }
 
 static void
-get_contacts_from_cache (EBookBackendGroupwise *ebgw, 
+get_contacts_from_cache (EBookBackendGroupwise *ebgw,
                         const char *query,
                         GPtrArray *ids,
-                        EDataBookView *book_view, 
+                        EDataBookView *book_view,
                         GroupwiseBackendSearchClosure *closure)
 {
        int i;
@@ -2118,7 +2118,7 @@ get_contacts_from_cache (EBookBackendGroupwise *ebgw,
                printf ("\nread contacts from cache for the ids found in summary\n");
        for (i = 0; i < ids->len; i ++) {
                char *uid;
-               EContact *contact; 
+               EContact *contact;
 
                 if (!e_flag_is_set (closure->running))
                         break;
@@ -2131,10 +2131,10 @@ get_contacts_from_cache (EBookBackendGroupwise *ebgw,
                }
        }
        if (e_flag_is_set (closure->running))
-               e_data_book_view_notify_complete (book_view, 
+               e_data_book_view_notify_complete (book_view,
                                                  GNOME_Evolution_Addressbook_Success);
 }
+
 static gpointer
 book_view_thread (gpointer data)
 {
@@ -2160,7 +2160,7 @@ book_view_thread (gpointer data)
                printf ("start book view for %s \n", gwb->priv->book_name);
                bonobo_object_ref (book_view);
        e_flag_set (closure->running);
-       
+
        query = e_data_book_view_get_card_query (book_view);
        if (enable_debug)
                printf ("get view for query %s \n", query);
@@ -2172,7 +2172,7 @@ book_view_thread (gpointer data)
                        return NULL;
                }
 
-               if (gwb->priv->is_summary_ready && 
+               if (gwb->priv->is_summary_ready &&
                    e_book_backend_summary_is_summary_query (gwb->priv->summary, query)) {
                        if (enable_debug)
                                printf ("reading the uids from summary \n");
@@ -2205,14 +2205,14 @@ book_view_thread (gpointer data)
                        g_list_free (temp_list);
                bonobo_object_unref (book_view);
                return NULL;
-               
+
        case GNOME_Evolution_Addressbook_MODE_REMOTE :
-               
+
                if (gwb->priv->cnc == NULL) {
-                       e_data_book_view_notify_complete (book_view, 
+                       e_data_book_view_notify_complete (book_view,
                                                          GNOME_Evolution_Addressbook_AuthenticationRequired);
                        bonobo_object_unref (book_view);
-                       return NULL; 
+                       return NULL;
                }
 
                if (enable_debug)
@@ -2220,15 +2220,15 @@ book_view_thread (gpointer data)
 
                filter = e_book_backend_groupwise_build_gw_filter (gwb, query, &is_auto_completion, &search_string);
                view = "name email default members";
-               if (is_auto_completion) 
+               if (is_auto_completion)
                        view = "name email";
 
                if (search_string) {
                        /* groupwise server supports only name, rebuild the filter */
                        filter = e_gw_filter_new ();
-                       e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS, 
+                       e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS,
                                                          "fullName/lastName", search_string);
-                       e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS, 
+                       e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_BEGINS,
                                                          "fullName/firstName", search_string);
                        e_gw_filter_group_conditions (filter, E_GW_FILTER_OP_OR, 2);
                        g_free (search_string);
@@ -2237,13 +2237,13 @@ book_view_thread (gpointer data)
                if (!gwb->priv->is_writable && !filter) {
                        e_data_book_view_notify_complete (book_view, GNOME_Evolution_Addressbook_Success);
                        bonobo_object_unref (book_view);
-                       return NULL; 
+                       return NULL;
                }
-               else 
+               else
                        status =  E_GW_CONNECTION_STATUS_OK;
 
                /* Check if the data is found on summary */
-               if (gwb->priv->is_summary_ready && 
+               if (gwb->priv->is_summary_ready &&
                    e_book_backend_summary_is_summary_query (gwb->priv->summary, query)) {
                        if (enable_debug)
                                printf("reading the uids from summary file\n");
@@ -2251,7 +2251,7 @@ book_view_thread (gpointer data)
                }
 
                /*
-                * Search for contact in cache, if not found, read from server 
+                * Search for contact in cache, if not found, read from server
                 */
 
                if (ids && ids->len > 0) {
@@ -2260,12 +2260,12 @@ book_view_thread (gpointer data)
                        /* read from summary */
                        if (gwb->priv->is_cache_ready && !gwb->priv->is_writable) {
                                /* read from cache, only for system address book, as we refresh
-                                * only system address book, periodically. 
-                                */     
+                                * only system address book, periodically.
+                                */
                                if (enable_debug)
                                        printf ("reading contacts from cache for the uids in summary \n");
                                if (!is_auto_completion)
-                                       e_data_book_view_notify_status_message (book_view, 
+                                       e_data_book_view_notify_status_message (book_view,
                                                                                _("Searching..."));
                                get_contacts_from_cache (gwb, query, ids, book_view, closure);
                                g_ptr_array_free (ids, TRUE);
@@ -2285,14 +2285,14 @@ book_view_thread (gpointer data)
                                if (enable_debug)
                                        printf ("reading contacts from server for the uids in summary \n");
                                if (!is_auto_completion)
-                                       e_data_book_view_notify_status_message (book_view, 
+                                       e_data_book_view_notify_status_message (book_view,
                                                                                _("Searching..."));
-                               status = e_gw_connection_get_items_from_ids (gwb->priv->cnc, 
-                                                                            gwb->priv->container_id, 
+                               status = e_gw_connection_get_items_from_ids (gwb->priv->cnc,
+                                                                            gwb->priv->container_id,
                                                                             view, ids, &gw_items);
                                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
-                                       status = e_gw_connection_get_items_from_ids (gwb->priv->cnc, 
-                                                                                    gwb->priv->container_id, 
+                                       status = e_gw_connection_get_items_from_ids (gwb->priv->cnc,
+                                                                                    gwb->priv->container_id,
                                                                                     view, ids, &gw_items);
                                if (enable_debug && status == E_GW_CONNECTION_STATUS_OK)
                                        printf ("read contacts from server \n");
@@ -2304,17 +2304,17 @@ book_view_thread (gpointer data)
                        if (enable_debug)
                                printf ("summary not found, reading the contacts from server\n");
                        if (!is_auto_completion) {
-                               if (filter) 
+                               if (filter)
                                        e_data_book_view_notify_status_message (book_view, _("Searching..."));
-                               else 
+                               else
                                        e_data_book_view_notify_status_message (book_view, _("Loading..."));
                        }
-                       status = e_gw_connection_get_items (gwb->priv->cnc, 
-                                                           gwb->priv->container_id, 
+                       status = e_gw_connection_get_items (gwb->priv->cnc,
+                                                           gwb->priv->container_id,
                                                            view, filter, &gw_items);
                        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
-                               status = e_gw_connection_get_items (gwb->priv->cnc, 
-                                                                   gwb->priv->container_id, 
+                               status = e_gw_connection_get_items (gwb->priv->cnc,
+                                                                   gwb->priv->container_id,
                                                                    view, filter, &gw_items);
                }
 
@@ -2325,7 +2325,7 @@ book_view_thread (gpointer data)
                }
 
                temp_list = gw_items;
-               for (; gw_items != NULL; gw_items = g_list_next(gw_items)) { 
+               for (; gw_items != NULL; gw_items = g_list_next(gw_items)) {
 
                        if (!e_flag_is_set (closure->running)) {
                                for (;gw_items != NULL; gw_items = g_list_next (gw_items))
@@ -2335,13 +2335,13 @@ book_view_thread (gpointer data)
 
                        count ++;
                        contact = e_contact_new ();
-                       fill_contact_from_gw_item (contact, 
-                                                  E_GW_ITEM (gw_items->data), 
+                       fill_contact_from_gw_item (contact,
+                                                  E_GW_ITEM (gw_items->data),
                                                   gwb->priv->categories_by_id);
                        e_contact_set (contact, E_CONTACT_BOOK_URI, gwb->priv->original_uri);
-                       if (e_contact_get_const (contact, E_CONTACT_UID)) 
+                       if (e_contact_get_const (contact, E_CONTACT_UID))
                                e_data_book_view_notify_update (book_view, contact);
-                       else 
+                       else
                                g_critical ("Id missing for item %s\n", (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
                        g_object_unref(contact);
                        g_object_unref (gw_items->data);
@@ -2379,16 +2379,16 @@ e_book_backend_groupwise_start_book_view (EBookBackend  *backend,
                printf ("\ne_book_backend_groupwise_start_book_view...\n");
        closure->thread = g_thread_create (book_view_thread, book_view, FALSE, NULL);
        e_flag_wait (closure->running);
-       
+
        /* at this point we know the book view thread is actually running */
 }
-  
+
 static void
 e_book_backend_groupwise_stop_book_view (EBookBackend  *backend,
                                         EDataBookView *book_view)
 {
        GroupwiseBackendSearchClosure *closure = get_closure (book_view);
-       
+
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_stop_book_view...\n");
        e_flag_clear (closure->running);
@@ -2404,7 +2404,7 @@ e_book_backend_groupwise_get_changes (EBookBackend *backend,
                printf ("\ne_book_backend_groupwise_get_changes...\n");
 
        /* FIXME : provide implmentation */
-       
+
 }
 
 static void
@@ -2441,11 +2441,11 @@ find_book_view (EBookBackendGroupwise *ebgw)
 
        g_object_unref (iter);
        g_object_unref (views);
-       
+
        return rv;
 }
 
-static void 
+static void
 get_sequence_from_cache (DB *db,
                gdouble *cache_first_sequence,
                gdouble *cache_last_sequence,
@@ -2466,7 +2466,7 @@ get_sequence_from_cache (DB *db,
                *cache_first_sequence = strtod (g_strdup (vcard_dbt.data), NULL);
                g_free (vcard_dbt.data);
        }
-       
+
        string_to_dbt ("lastSequence", &uid_dbt);
        memset (&vcard_dbt, 0, sizeof(vcard_dbt));
        vcard_dbt.flags = DB_DBT_MALLOC;
@@ -2497,10 +2497,10 @@ get_sequence_from_cache (DB *db,
                printf("Read sequences from cache\n");
                printf("firstSequence:%lf, lastSequence:%lf, lastPoRebuildTime:%lf\n", *cache_first_sequence, *cache_last_sequence, *cache_last_po_rebuild_time);
        }
-               
+
 }
 static void
-add_sequence_to_cache (DB *db, 
+add_sequence_to_cache (DB *db,
                       gdouble first_sequence,
                       gdouble last_sequence,
                       gdouble last_po_rebuild_time)
@@ -2537,7 +2537,7 @@ add_sequence_to_cache (DB *db,
                if (db_error != 0) {
                        g_warning ("db->put failed with %d", db_error);
                }
-               
+
                string_to_dbt ("lastTimePORebuild",&uid_dbt );
                tmp = g_strdup_printf("%lf", last_po_rebuild_time);
                string_to_dbt (tmp, &vcard_dbt);
@@ -2562,13 +2562,13 @@ build_cache (EBookBackendGroupwise *ebgw)
        EDataBookView *book_view;
        EBookBackendGroupwisePrivate *priv = ebgw->priv;
        char *status_msg;
-       
+
        status = e_gw_connection_get_items (ebgw->priv->cnc, ebgw->priv->container_id, "name email default members", NULL, &gw_items);
-       if (status != E_GW_CONNECTION_STATUS_OK) 
+       if (status != E_GW_CONNECTION_STATUS_OK)
                return FALSE;
-       
 
-       for (; gw_items != NULL; gw_items = g_list_next(gw_items)) { 
+
+       for (; gw_items != NULL; gw_items = g_list_next(gw_items)) {
                contact_num++;
                contact = e_contact_new ();
                fill_contact_from_gw_item (contact, E_GW_ITEM (gw_items->data), ebgw->priv->categories_by_id);
@@ -2581,19 +2581,19 @@ build_cache (EBookBackendGroupwise *ebgw)
                }
                g_object_unref(contact);
                g_object_unref (gw_items->data);
-                       
+
        }
-               
+
        e_book_backend_cache_set_populated (priv->cache);
        priv->is_cache_ready=TRUE;
-       
+
        g_list_free (gw_items);
-       
+
        return NULL;
 }*/
 
 
-/*FIXME using cursors for address book seems to be crashing server 
+/*FIXME using cursors for address book seems to be crashing server
 till it gets fixed we will use get items. cursor implementation is below */
 
 static gpointer
@@ -2621,7 +2621,7 @@ build_cache (EBookBackendGroupwise *ebgw)
                printf("Building the cache for %s \n", ebgw->priv->book_name);
        }
 
-       status = e_gw_connection_create_cursor (priv->cnc, priv->container_id, 
+       status = e_gw_connection_create_cursor (priv->cnc, priv->container_id,
                                                "name email default members", NULL, &cursor);
        if (status != E_GW_CONNECTION_STATUS_OK) {
                if (enable_debug)
@@ -2639,10 +2639,10 @@ build_cache (EBookBackendGroupwise *ebgw)
 
        while (!done) {
 
-               if (enable_debug) 
+               if (enable_debug)
                        g_get_current_time(&tstart);
-               status = e_gw_connection_read_cursor (priv->cnc, priv->container_id, 
-                                                     cursor, TRUE, CURSOR_ITEM_LIMIT, 
+               status = e_gw_connection_read_cursor (priv->cnc, priv->container_id,
+                                                     cursor, TRUE, CURSOR_ITEM_LIMIT,
                                                      position, &gw_items);
                if (enable_debug) {
                        g_get_current_time(&tend);
@@ -2651,11 +2651,11 @@ build_cache (EBookBackendGroupwise *ebgw)
                        printf("e_gw_connection_read_cursor took %ld.%03ld seconds for %d contacts\n", diff / 1000, diff % 1000, CURSOR_ITEM_LIMIT);
                }
 
-               for (l = gw_items; l != NULL; l = g_list_next (l)) { 
+               for (l = gw_items; l != NULL; l = g_list_next (l)) {
                        contact_num++;
 
                        contact = e_contact_new ();
-                       fill_contact_from_gw_item (contact, E_GW_ITEM (l->data), 
+                       fill_contact_from_gw_item (contact, E_GW_ITEM (l->data),
                                                   ebgw->priv->categories_by_id);
                        e_contact_set (contact, E_CONTACT_BOOK_URI, priv->original_uri);
                        e_book_backend_db_cache_add_contact (ebgw->priv->file_db, contact);
@@ -2675,7 +2675,7 @@ build_cache (EBookBackendGroupwise *ebgw)
 
                        g_object_unref(contact);
                        g_object_unref (l->data);
-                       
+
                }
                if (!gw_items) {
                        e_book_backend_db_cache_set_populated (ebgw->priv->file_db);
@@ -2683,7 +2683,7 @@ build_cache (EBookBackendGroupwise *ebgw)
                        priv->is_cache_ready=TRUE;
                        priv->is_summary_ready = TRUE;
                }
-               
+
                g_list_free (gw_items);
                gw_items = NULL;
                position = E_GW_CURSOR_POSITION_CURRENT;
@@ -2703,7 +2703,7 @@ build_cache (EBookBackendGroupwise *ebgw)
                g_get_current_time(&end);
                diff = end.tv_sec * 1000 + end.tv_usec/1000;
                diff -= start.tv_sec * 1000 + start.tv_usec/1000;
-               printf("completed building cache for %s in %ld.%03ld seconds for %d contacts\n", 
+               printf("completed building cache for %s in %ld.%03ld seconds for %d contacts\n",
                        priv->book_name, diff / 1000, diff % 1000, contact_num);
        }
        return NULL;
@@ -2719,7 +2719,7 @@ build_summary (EBookBackendGroupwise *ebgw)
 
        if (enable_debug) {
                g_get_current_time(&start);
-               printf ("summary file not found or not up-to-date, building summary for %s\n", 
+               printf ("summary file not found or not up-to-date, building summary for %s\n",
                        ebgw->priv->book_name);
        }
 
@@ -2738,12 +2738,12 @@ build_summary (EBookBackendGroupwise *ebgw)
        if (temp_list)
                g_list_free (temp_list);
        ebgw->priv->is_summary_ready = TRUE;
-       
+
        if (enable_debug) {
                g_get_current_time(&end);
                diff = end.tv_sec * 1000 + end.tv_usec/1000;
                diff -= start.tv_sec * 1000 + start.tv_usec/1000;
-               printf("building summary for %s took %ld.%03ld seconds \n", 
+               printf("building summary for %s took %ld.%03ld seconds \n",
                        ebgw->priv->book_name, diff / 1000, diff % 1000);
        }
 }
@@ -2767,7 +2767,7 @@ update_cache (EBookBackendGroupwise *ebgw)
 
        if (!ebgw)
                return FALSE;
-       
+
        g_mutex_lock (ebgw->priv->update_cache_mutex);
 
        if (enable_debug) {
@@ -2790,16 +2790,16 @@ update_cache (EBookBackendGroupwise *ebgw)
        tm = gmtime (&mod_time);
        strftime (cache_time_string, 100, "%Y-%m-%dT%H:%M:%SZ", tm);
 
-       if (e_book_backend_summary_load (ebgw->priv->summary) == FALSE || 
+       if (e_book_backend_summary_load (ebgw->priv->summary) == FALSE ||
            e_book_backend_summary_is_up_to_date (ebgw->priv->summary, mod_time) == FALSE) {
                /* build summary */
                 build_summary (ebgw);
        }
-       
+
        filter = e_gw_filter_new ();
-       e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_GREATERTHAN, 
+       e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_GREATERTHAN,
                                          "modified", cache_time_string);
-       status = e_gw_connection_get_items (ebgw->priv->cnc, ebgw->priv->container_id, 
+       status = e_gw_connection_get_items (ebgw->priv->cnc, ebgw->priv->container_id,
                                            "name email default members", filter, &gw_items);
        if (status != E_GW_CONNECTION_STATUS_OK) {
                if (book_view)
@@ -2809,14 +2809,14 @@ update_cache (EBookBackendGroupwise *ebgw)
                g_mutex_unlock (ebgw->priv->update_cache_mutex);
                return FALSE;
        }
-       
-       for (; gw_items != NULL; gw_items = g_list_next(gw_items)) { 
+
+       for (; gw_items != NULL; gw_items = g_list_next(gw_items)) {
                const char *id;
 
                contact = e_contact_new ();
-               fill_contact_from_gw_item (contact, E_GW_ITEM (gw_items->data), 
+               fill_contact_from_gw_item (contact, E_GW_ITEM (gw_items->data),
                                           ebgw->priv->categories_by_id);
-               
+
                e_contact_set (contact, E_CONTACT_BOOK_URI, ebgw->priv->original_uri);
                id =  e_contact_get_const (contact, E_CONTACT_UID);
 
@@ -2836,14 +2836,14 @@ update_cache (EBookBackendGroupwise *ebgw)
                        e_book_backend_db_cache_add_contact (ebgw->priv->file_db, contact);
                        e_book_backend_summary_add_contact (ebgw->priv->summary, contact);
                }
-               
+
                g_object_unref(contact);
                g_object_unref (gw_items->data);
        }
-       
+
        ebgw->priv->is_cache_ready = TRUE;
        ebgw->priv->is_summary_ready = TRUE;
-       
+
        ebgw->priv->file_db->sync(ebgw->priv->file_db, 0);
 
        if (book_view) {
@@ -2858,7 +2858,7 @@ update_cache (EBookBackendGroupwise *ebgw)
                g_get_current_time(&end);
                diff = end.tv_sec * 1000 + end.tv_usec/1000;
                diff -= start.tv_sec * 1000 + start.tv_usec/1000;
-               printf("updating the cache for %s complated in %ld.%03ld seconds for %d contacts\n", 
+               printf("updating the cache for %s complated in %ld.%03ld seconds for %d contacts\n",
                        ebgw->priv->book_name, diff / 1000, diff % 1000, contact_num);
        }
        g_mutex_unlock (ebgw->priv->update_cache_mutex);
@@ -2893,15 +2893,15 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
        priv = ebgw->priv;
 
        g_mutex_lock (priv->update_mutex);
-       
+
        if (enable_debug)
                printf("\nupdating GroupWise system address book cache \n");
-               
-       /* builds or updates the cache for system address book */       
+
+       /* builds or updates the cache for system address book */
        status = e_gw_connection_get_items_delta_info (priv->cnc,
-                                                      ebgw->priv->container_id, 
+                                                      ebgw->priv->container_id,
                                                       &server_first_sequence,
-                                                      &server_last_sequence, 
+                                                      &server_last_sequence,
                                                       &server_last_po_rebuild_time);
        if (status != E_GW_CONNECTION_STATUS_OK) {
                if (enable_debug)
@@ -2916,7 +2916,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
                if (enable_debug)
                        printf ("sequence is reset, rebuilding cache...\n");
                build_cache (ebgw);
-               add_sequence_to_cache (priv->file_db, server_first_sequence, 
+               add_sequence_to_cache (priv->file_db, server_first_sequence,
                                       server_last_sequence, server_last_po_rebuild_time);
                ebgw->priv->file_db->sync (ebgw->priv->file_db, 0);
                g_mutex_unlock (priv->update_mutex);
@@ -2927,13 +2927,13 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
        get_sequence_from_cache(priv->file_db, &cache_first_sequence, &cache_last_sequence, &cache_last_po_rebuild_time);
 
        /* check whether the all the sequences are available and also whether the PO is rebuilt */
-       if (server_first_sequence > cache_last_sequence || cache_last_sequence == -1 || 
+       if (server_first_sequence > cache_last_sequence || cache_last_sequence == -1 ||
            server_last_po_rebuild_time != cache_last_po_rebuild_time) {
                /* build the cache again and update the cache with the sequence information */
                if (enable_debug)
                        printf ("either the sequences missing or PO is rebuilt...rebuilding the cache\n");
                build_cache (ebgw);
-               add_sequence_to_cache (priv->file_db, server_first_sequence, 
+               add_sequence_to_cache (priv->file_db, server_first_sequence,
                                       server_last_sequence, server_last_po_rebuild_time);
                ebgw->priv->file_db->sync (ebgw->priv->file_db, 0);
                g_mutex_unlock (priv->update_mutex);
@@ -2960,7 +2960,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
        g_stat (cache_file_name, &buf);
        g_free (cache_file_name);
        mod_time = buf.st_mtime;
-       if (e_book_backend_summary_load (ebgw->priv->summary) == FALSE || 
+       if (e_book_backend_summary_load (ebgw->priv->summary) == FALSE ||
            e_book_backend_summary_is_up_to_date (ebgw->priv->summary, mod_time) == FALSE) {
                /* build summary */
                 build_summary (ebgw);
@@ -2972,16 +2972,16 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
                                printf("cache_last_sequence:%lf, server_last_sequence:%lf\n", cache_last_sequence, server_last_sequence);
                                printf("Calling get_items_delta\n");
                        }
-                       e_gw_connection_get_items_delta (priv->cnc, 
-                                                        ebgw->priv->container_id, 
-                                                        "name email sync", count, 
-                                                        sequence, 
+                       e_gw_connection_get_items_delta (priv->cnc,
+                                                        ebgw->priv->container_id,
+                                                        "name email sync", count,
+                                                        sequence,
                                                         &add_list, &delete_list);
 
                        if (add_list == NULL && delete_list == NULL) {
                                if (enable_debug)
                                        printf("sequence differs but no changes found !!!\n");
-                               add_sequence_to_cache (priv->file_db, server_first_sequence, 
+                               add_sequence_to_cache (priv->file_db, server_first_sequence,
                                       server_last_sequence, server_last_po_rebuild_time);
                                g_mutex_unlock (priv->update_mutex);
                                g_free (sequence);
@@ -2994,18 +2994,18 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
                                printf("delete_list size:%d\n", g_list_length(delete_list));
                        }
 
-                       for (; delete_list != NULL; delete_list = g_list_next(delete_list)) { 
+                       for (; delete_list != NULL; delete_list = g_list_next(delete_list)) {
                                const char *id;
 
                                /* deleted from the server */
                                contact = e_contact_new ();
-                               fill_contact_from_gw_item (contact, 
-                                                          E_GW_ITEM (delete_list->data), 
+                               fill_contact_from_gw_item (contact,
+                                                          E_GW_ITEM (delete_list->data),
                                                           ebgw->priv->categories_by_id);
                                if (enable_debug)
                                        printf("contact email:%s, contact name:%s\n", (char *) e_contact_get(contact, E_CONTACT_EMAIL_1), (char *) e_contact_get(contact, E_CONTACT_GIVEN_NAME));
-                               e_contact_set (contact, 
-                                              E_CONTACT_BOOK_URI, 
+                               e_contact_set (contact,
+                                              E_CONTACT_BOOK_URI,
                                               priv->original_uri);
                                id =  e_contact_get_const (contact, E_CONTACT_UID);
 
@@ -3025,13 +3025,13 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
                                g_object_unref (delete_list->data);
                        }
 
-                       for (; add_list != NULL; add_list = g_list_next(add_list)) { 
+                       for (; add_list != NULL; add_list = g_list_next(add_list)) {
                                const char *id;
 
                                /* newly added to server */
                                contact = e_contact_new ();
-                               fill_contact_from_gw_item (contact, 
-                                                          E_GW_ITEM (add_list->data), 
+                               fill_contact_from_gw_item (contact,
+                                                          E_GW_ITEM (add_list->data),
                                                           ebgw->priv->categories_by_id);
 
                                /* When a distribution list is modified the server sends me a delete and add response.
@@ -3040,7 +3040,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
                                if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
                                        if(enable_debug)
                                                printf ("Contact List modified fetching the members of the contact list\n");
-                                                       
+
                                        status = e_gw_connection_get_item (ebgw->priv->cnc, ebgw->priv->container_id, e_contact_get (contact, E_CONTACT_UID), "name email default members", &item);
                                        g_object_unref (contact);
                                        contact = e_contact_new ();
@@ -3050,8 +3050,8 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 
                                if (enable_debug)
                                        printf("contact email:%s, contact name:%s\n", (char *)e_contact_get(contact, E_CONTACT_EMAIL_1),(char *) e_contact_get(contact, E_CONTACT_GIVEN_NAME));
-                               e_contact_set (contact, 
-                                              E_CONTACT_BOOK_URI, 
+                               e_contact_set (contact,
+                                              E_CONTACT_BOOK_URI,
                                               priv->original_uri);
                                id =  e_contact_get_const (contact, E_CONTACT_UID);
 
@@ -3082,13 +3082,13 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
 
                /* cache is updated, now adding the sequence information to the cache */
 
-               add_sequence_to_cache (priv->file_db, server_first_sequence, 
+               add_sequence_to_cache (priv->file_db, server_first_sequence,
                                       server_last_sequence, server_last_po_rebuild_time);
 
                g_list_free (add_list);
                g_list_free (delete_list);
        }
-       
+
        g_free (sequence);
        g_free (count);
        ebgw->priv->is_cache_ready = TRUE;
@@ -3108,7 +3108,7 @@ update_address_book_deltas (EBookBackendGroupwise *ebgw)
                g_get_current_time(&end);
                diff = end.tv_sec * 1000 + end.tv_usec/1000;
                diff -= start.tv_sec * 1000 + start.tv_usec/1000;
-               printf("updating GroupWise system address book cache took %ld.%03ld seconds for %d changes\n", 
+               printf("updating GroupWise system address book cache took %ld.%03ld seconds for %d changes\n",
                        diff / 1000, diff % 1000, contact_num);
        }
        g_mutex_unlock(priv->update_mutex);
@@ -3165,28 +3165,28 @@ e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
                        printf("book_name:%s\n", priv->book_name);
        }
 
-       
+
        switch (ebgw->priv->mode) {
        case GNOME_Evolution_Addressbook_MODE_LOCAL:
                /* load summary file for offline use */
                g_mkdir_with_parents (g_path_get_dirname (priv->summary_file_name), 0700);
-               priv->summary = e_book_backend_summary_new (priv->summary_file_name, 
+               priv->summary = e_book_backend_summary_new (priv->summary_file_name,
                                                    SUMMARY_FLUSH_TIMEOUT);
                e_book_backend_summary_load (priv->summary);
 
                e_book_backend_notify_writable (backend, FALSE);
-               e_book_backend_notify_connection_status (backend, FALSE); 
-               e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success); 
+               e_book_backend_notify_connection_status (backend, FALSE);
+               e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success);
                return;
-               
+
        case GNOME_Evolution_Addressbook_MODE_REMOTE:
-               
+
                if (priv->cnc) { /*we have already authenticated to server */
                        printf("already authenticated\n");
-                       e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success); 
+                       e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success);
                        return;
                }
-               
+
                priv->cnc = e_gw_connection_new (priv->uri, user, passwd);
                if (!E_IS_GW_CONNECTION(priv->cnc) && priv->use_ssl && g_str_equal (priv->use_ssl, "when-possible")) {
                        http_uri = g_strconcat ("http://", priv->uri + 8, NULL);
@@ -3197,12 +3197,12 @@ e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
                        e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_AuthenticationFailed);
                        return;
                }
-               
+
                id = NULL;
                is_writable = FALSE;
-               status = e_gw_connection_get_address_book_id (priv->cnc,  priv->book_name, &id, &is_writable); 
+               status = e_gw_connection_get_address_book_id (priv->cnc,  priv->book_name, &id, &is_writable);
                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
-                       status = e_gw_connection_get_address_book_id (priv->cnc,  priv->book_name, &id, &is_writable); 
+                       status = e_gw_connection_get_address_book_id (priv->cnc,  priv->book_name, &id, &is_writable);
                if (status == E_GW_CONNECTION_STATUS_OK) {
                        if ( (id == NULL) && !priv->only_if_exists ) {
                                status = e_gw_connection_create_book (priv->cnc, priv->book_name,  &id);
@@ -3218,13 +3218,13 @@ e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
                        g_free(id);
                        e_book_backend_set_is_writable (backend, is_writable);
                        e_book_backend_notify_writable (backend, is_writable);
-                       e_book_backend_notify_connection_status (backend, TRUE); 
+                       e_book_backend_notify_connection_status (backend, TRUE);
                        priv->is_writable = is_writable;
                        e_gw_connection_get_categories (priv->cnc, &priv->categories_by_id, &priv->categories_by_name);
-                       if (!e_gw_connection_get_version(priv->cnc))  
+                       if (!e_gw_connection_get_version(priv->cnc))
                                e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_InvalidServerVersion);
                        else
-                               e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success); 
+                               e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_Success);
                } else {
                        e_book_backend_set_is_loaded (backend, FALSE);
                        e_data_book_respond_authenticate_user (book, opid, GNOME_Evolution_Addressbook_NoSuchBook);
@@ -3234,7 +3234,7 @@ e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
                tmpfile = g_path_get_dirname (priv->summary_file_name);
                g_mkdir_with_parents (tmpfile, 0700);
                g_free (tmpfile);
-               priv->summary = e_book_backend_summary_new (priv->summary_file_name, 
+               priv->summary = e_book_backend_summary_new (priv->summary_file_name,
                                                            SUMMARY_FLUSH_TIMEOUT);
 
                if (!ebgw->priv->file_db) {
@@ -3260,12 +3260,12 @@ e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
 
                                t = g_thread_create ((GThreadFunc) update_address_book_deltas, ebgw, TRUE, NULL);
 
-                               /* spawn a thread to update the system address book cache 
+                               /* spawn a thread to update the system address book cache
                                 * at given intervals
                                 */
                                cache_refresh_interval_set = g_getenv ("BOOK_CACHE_REFRESH_INTERVAL");
                                if (cache_refresh_interval_set) {
-                                       cache_refresh_interval = g_ascii_strtod (cache_refresh_interval_set, 
+                                       cache_refresh_interval = g_ascii_strtod (cache_refresh_interval_set,
                                                                                NULL); /* use this */
                                        cache_refresh_interval *= (60*1000);
                                }
@@ -3274,9 +3274,9 @@ e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
                                g_thread_join (t);
                                if (enable_debug)
                                        printf ("creating cache refresh thread for GW system book \n");
-                               priv->cache_timeout = g_timeout_add (cache_refresh_interval, 
+                               priv->cache_timeout = g_timeout_add (cache_refresh_interval,
                                                                     (GSourceFunc) update_address_book_cache,
-                                                                    (gpointer)ebgw); 
+                                                                    (gpointer)ebgw);
                        }
                }
                else if (priv->is_writable) {  /* for personal books we always cache */
@@ -3287,7 +3287,7 @@ e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
                        }
                        g_thread_create ((GThreadFunc) build_cache, ebgw, FALSE, NULL);
                }
-               else if(priv->marked_for_offline) { 
+               else if(priv->marked_for_offline) {
                        GThread *t;
                        if (enable_debug)
                                printf("else if marked_for_offline\n");
@@ -3300,9 +3300,9 @@ e_book_backend_groupwise_authenticate_user (EBookBackend *backend,
                        /* set the cache refresh time */
                        if (enable_debug)
                                printf ("creating cache refresh thread for GW system book \n");
-                       priv->cache_timeout = g_timeout_add (cache_refresh_interval, 
+                       priv->cache_timeout = g_timeout_add (cache_refresh_interval,
                                                             (GSourceFunc) update_address_book_cache,
-                                                            (gpointer)ebgw); 
+                                                            (gpointer)ebgw);
                }
                return;
        default :
@@ -3319,13 +3319,13 @@ e_book_backend_groupwise_get_required_fields (EBookBackend *backend,
 
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_get_required_fields...\n");
-  
+
        fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FILE_AS));
        e_data_book_respond_get_supported_fields (book, opid,
                                                  GNOME_Evolution_Addressbook_Success,
                                                  fields);
        g_list_free (fields);
+
 }
 
 static void
@@ -3338,7 +3338,7 @@ e_book_backend_groupwise_get_supported_fields (EBookBackend *backend,
 
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_get_supported_fields...\n");
-  
+
        for (i = 0; i < G_N_ELEMENTS (mappings) ; i ++)
                fields = g_list_append (fields, g_strdup (e_contact_field_name (mappings[i].field_id)));
        fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_EMAIL_2)));
@@ -3404,11 +3404,11 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
        offline = e_source_get_property (source, "offline_sync");
        if (offline  && g_str_equal (offline, "1"))
                priv->marked_for_offline = TRUE;
-       
+
        if (priv->mode ==  GNOME_Evolution_Addressbook_MODE_LOCAL &&  !priv->marked_for_offline ) {
                return GNOME_Evolution_Addressbook_OfflineUnavailable;
        }
-       
+
        uri =  e_source_get_uri (source);
        priv->original_uri = g_strdup (uri);
        if(uri == NULL)
@@ -3416,7 +3416,7 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
 
        tokens = g_strsplit (uri, ";", 2);
        g_free (uri);
-       if (tokens[0]) 
+       if (tokens[0])
                uri = g_strdup(tokens[0]);
        book_name = g_strdup (tokens[1]);
        if(book_name == NULL)
@@ -3427,24 +3427,24 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
        if (port == NULL)
                port = "7191";
        use_ssl = e_source_get_property (source, "use_ssl");
-       if (use_ssl && !g_str_equal (use_ssl, "never")) 
+       if (use_ssl && !g_str_equal (use_ssl, "never"))
                priv->uri = g_strconcat ("https://", parsed_uri->host,":", port, "/soap", NULL );
-       else 
+       else
                priv->uri = g_strconcat ("http://", parsed_uri->host,":", port, "/soap", NULL );
        priv->use_ssl = g_strdup (use_ssl);
        priv->only_if_exists = only_if_exists;
-       
+
        priv->book_name = book_name;
        e_book_backend_set_is_loaded (E_BOOK_BACKEND (backend), TRUE);
-       e_book_backend_set_is_writable (E_BOOK_BACKEND(backend), FALSE);  
+       e_book_backend_set_is_writable (E_BOOK_BACKEND(backend), FALSE);
        if (priv->mode == GNOME_Evolution_Addressbook_MODE_LOCAL) {
                e_book_backend_notify_writable (backend, FALSE);
-               e_book_backend_notify_connection_status (backend, FALSE); 
+               e_book_backend_notify_connection_status (backend, FALSE);
        }
        else {
                e_book_backend_notify_connection_status (backend, TRUE);
        }
-       
+
        for (i = 0; i < strlen (uri); i++) {
                switch (uri[i]) {
                case ':' :
@@ -3453,7 +3453,7 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
                }
        }
 
-       if (priv->mode == GNOME_Evolution_Addressbook_MODE_LOCAL) 
+       if (priv->mode == GNOME_Evolution_Addressbook_MODE_LOCAL)
                if (!e_book_backend_db_cache_exists (priv->original_uri)) {
                        g_free (uri);
                        e_uri_free (parsed_uri);
@@ -3475,12 +3475,12 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
                g_free (filename);
                return GNOME_Evolution_Addressbook_OtherError;
        }
-       
+
        g_static_mutex_lock(&global_env_lock);
        if (global_env.ref_count > 0) {
                env = global_env.env;
                global_env.ref_count++;
-       } 
+       }
        else {
                db_error = db_env_create (&env, 0);
                if (db_error != 0) {
@@ -3529,7 +3529,7 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
                        g_free(dirname);
                        return GNOME_Evolution_Addressbook_OtherError;
                }
-               
+
                db_error = db->open (db, NULL, filename, NULL, DB_HASH, DB_THREAD, 0666);
        }
 
@@ -3538,7 +3538,7 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
        if (db_error != 0) {
                int rv;
 
-               /* the databade didn't exist, so we create the 
+               /* the databade didn't exist, so we create the
                   directory then the .db */
                rv = g_mkdir_with_parents (dirname, 0777);
                if (rv == -1 && errno != EEXIST) {
@@ -3566,7 +3566,7 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
                g_free(dirname);
                return GNOME_Evolution_Addressbook_OtherError;
        }
-       
+
        e_book_backend_db_cache_set_filename (ebgw->priv->file_db, filename);
        g_free(filename);
        g_free(dirname);
@@ -3574,7 +3574,7 @@ e_book_backend_groupwise_load_source (EBookBackend           *backend,
        e_uri_free (parsed_uri);
 
        /*if (enable_debug) {
-               printf ("summary file name = %s\ncache file name = %s \n", 
+               printf ("summary file name = %s\ncache file name = %s \n",
                         priv->summary_file_name, e_file_cache_get_filename (E_FILE_CACHE(priv->cache)));
        }*/
 
@@ -3588,7 +3588,7 @@ e_book_backend_groupwise_remove (EBookBackend *backend,
 {
        EBookBackendGroupwise *ebgw;
        int status;
-  
+
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_remove...\n");
        ebgw = E_BOOK_BACKEND_GROUPWISE (backend);
@@ -3601,7 +3601,7 @@ e_book_backend_groupwise_remove (EBookBackend *backend,
                return;
        }
        status = e_gw_connection_remove_item (ebgw->priv->cnc, NULL, ebgw->priv->container_id);
-       if (status == E_GW_CONNECTION_STATUS_OK) 
+       if (status == E_GW_CONNECTION_STATUS_OK)
                e_data_book_respond_remove (book,  opid, GNOME_Evolution_Addressbook_Success);
        else
                e_data_book_respond_remove (book,  opid, GNOME_Evolution_Addressbook_OtherError);
@@ -3615,22 +3615,22 @@ e_book_backend_groupwise_get_static_capabilities (EBookBackend *backend)
 
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_get_static_capabilities...\n");
-       
+
        ebgw = E_BOOK_BACKEND_GROUPWISE (backend);
 
        /* do-initialy-query is enabled for system address book also, so that we get the
-        * book_view, which is needed for displaying cache update progress. 
-        * and null query is handled for system address book. 
+        * book_view, which is needed for displaying cache update progress.
+        * and null query is handled for system address book.
         */
        return g_strdup ("net,bulk-removes,do-initial-query,contact-lists");
 }
 
-static void 
+static void
 e_book_backend_groupwise_get_supported_auth_methods (EBookBackend *backend, EDataBook *book, guint32 opid)
 {
        GList *auth_methods = NULL;
        char *auth_method;
-       
+
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_get_supported_auth_methods...\n");
        auth_method =  g_strdup_printf ("plain/password");
@@ -3638,16 +3638,16 @@ e_book_backend_groupwise_get_supported_auth_methods (EBookBackend *backend, EDat
        e_data_book_respond_get_supported_auth_methods (book,
                                                        opid,
                                                        GNOME_Evolution_Addressbook_Success,
-                                                       auth_methods);  
+                                                       auth_methods);
        g_free (auth_method);
        g_list_free (auth_methods);
 }
 
-static void 
+static void
 e_book_backend_groupwise_set_mode (EBookBackend *backend, int mode)
 {
        EBookBackendGroupwise *bg;
-       
+
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_set_mode...\n");
        bg = E_BOOK_BACKEND_GROUPWISE (backend);
@@ -3664,7 +3664,7 @@ e_book_backend_groupwise_set_mode (EBookBackend *backend, int mode)
                else if (mode == GNOME_Evolution_Addressbook_MODE_REMOTE) {
                        if (bg->priv->is_writable)
                                e_book_backend_notify_writable (backend, TRUE);
-                       else 
+                       else
                                e_book_backend_notify_writable (backend, FALSE);
                        e_book_backend_notify_connection_status (backend, TRUE);
                        e_book_backend_notify_auth_required (backend);
@@ -3682,9 +3682,9 @@ e_book_backend_groupwise_new (void)
 
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_new...\n");
-                                                                                                                             
+
        backend = g_object_new (E_TYPE_BOOK_BACKEND_GROUPWISE, NULL);
-                                                                                                       
+
        return E_BOOK_BACKEND (backend);
 }
 
@@ -3695,9 +3695,9 @@ e_book_backend_groupwise_dispose (GObject *object)
 
        if (enable_debug)
                printf ("\ne_book_backend_groupwise_dispose...\n");
-                                                                                                                             
+
        bgw = E_BOOK_BACKEND_GROUPWISE (object);
-                                                                                                                             
+
        if (bgw->priv) {
                if (bgw->priv->file_db)
                        bgw->priv->file_db->close (bgw->priv->file_db, 0);
@@ -3751,18 +3751,18 @@ e_book_backend_groupwise_dispose (GObject *object)
                        g_mutex_free (bgw->priv->update_mutex);
                if (bgw->priv->update_cache_mutex)
                        g_mutex_free (bgw->priv->update_cache_mutex);
-               
+
                g_free (bgw->priv);
                bgw->priv = NULL;
        }
-                                                                                                                             
+
        G_OBJECT_CLASS (e_book_backend_groupwise_parent_class)->dispose (object);
 }
-                                                                                                                            
+
 static void
 e_book_backend_groupwise_class_init (EBookBackendGroupwiseClass *klass)
 {
-  
+
 
        GObjectClass  *object_class = G_OBJECT_CLASS (klass);
        EBookBackendClass *parent_class;
@@ -3795,7 +3795,7 @@ static void
 e_book_backend_groupwise_init (EBookBackendGroupwise *backend)
 {
        EBookBackendGroupwisePrivate *priv;
-                                                                                                                             
+
        priv= g_new0 (EBookBackendGroupwisePrivate, 1);
        priv->is_writable = TRUE;
        priv->is_cache_ready = FALSE;
@@ -3809,7 +3809,7 @@ e_book_backend_groupwise_init (EBookBackendGroupwise *backend)
        priv->update_cache_mutex = g_mutex_new();
                backend->priv = priv;
 
-       if (g_getenv ("GROUPWISE_DEBUG")) { 
+       if (g_getenv ("GROUPWISE_DEBUG")) {
                if (atoi (g_getenv ("GROUPWISE_DEBUG")) == 2)
                        enable_debug = TRUE;
                else
index ccea6de..bcfacdd 100644 (file)
  *
  * Authors: Sivaiah Nallagatla <snallagatla@novell.com>
  */
-                                                                                                                          
+
 #ifndef __E_BOOK_BACKEND_GROUPWISE_H__
 #define __E_BOOK_BACKEND_GROUPWISE_H__
-                                                                                                                             
+
 #include <libedata-book/e-book-backend-sync.h>
 #include "db.h"
-                                                                                                                             
+
 #define E_TYPE_BOOK_BACKEND_GROUPWISE        (e_book_backend_groupwise_get_type ())
 #define E_BOOK_BACKEND_GROUPWISE(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_BACKEND_GROUPWISE, EBookBackendGroupwise))
 #define E_BOOK_BACKEND_GROUPWISE_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_BACKEND_GROUPWISE, EBookBackendGroupwiseClass))
 #define E_IS_BOOK_BACKEND_GROUPWISE(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_BACKEND_GROUPWISE))
 #define E_IS_BOOK_BACKEND_GROUPWISE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_BACKEND_GROUPWISE))
-#define E_BOOK_BACKEND_GROUPWISE_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_BACKEND_GROUPWISE, EBookBackenGroupwiseClass))                                                                                                                             
+#define E_BOOK_BACKEND_GROUPWISE_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_BACKEND_GROUPWISE, EBookBackenGroupwiseClass))
 typedef struct _EBookBackendGroupwisePrivate EBookBackendGroupwisePrivate;
-                                                                                                                             
+
 typedef struct {
        EBookBackend         parent_object;
        EBookBackendGroupwisePrivate *priv;
 } EBookBackendGroupwise;
-                                                                                                                             
+
 typedef struct {
        EBookBackendClass parent_class;
 } EBookBackendGroupwiseClass;
 
 EBookBackend *e_book_backend_groupwise_new      (void);
 GType       e_book_backend_groupwise_get_type (void);
-                                                                                                                             
+
 #endif /* ! __E_BOOK_BACKEND_GROUPWISE_H__ */
-                                                                                                                             
+
 
 
index ac14154..a350908 100644 (file)
@@ -25,7 +25,7 @@
 #define DEBUG
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>  
+#include <config.h>
 #endif
 
 #include <stdlib.h>
@@ -98,7 +98,7 @@ typedef enum {
 } EBookBackendLDAPUseTLS;
 
 /* interval for our poll_ldap timeout */
-#define LDAP_POLL_INTERVAL 20 
+#define LDAP_POLL_INTERVAL 20
 
 /* timeout for ldap_result */
 #define LDAP_RESULT_TIMEOUT_MILLIS 10
@@ -158,7 +158,7 @@ struct _EBookBackendLDAPPrivate {
        gboolean calEntrySupported;
        gboolean evolutionPersonChecked;
        gboolean marked_for_offline;
-       
+
        int mode;
        /* our operations */
        GStaticRecMutex op_hash_mutex;
@@ -306,11 +306,11 @@ static struct prop_info {
        COMPLEX_PROP  (E_CONTACT_PHONE_HOME,         "homePhone", homephone_populate, homephone_ber, homephone_compare),
        STRING_PROP   (E_CONTACT_PHONE_MOBILE,       "mobile"),
        E_STRING_PROP (E_CONTACT_PHONE_CAR,          "carPhone"),
-       STRING_PROP   (E_CONTACT_PHONE_BUSINESS_FAX, "facsimileTelephoneNumber"), 
-       E_STRING_PROP (E_CONTACT_PHONE_HOME_FAX,     "homeFacsimileTelephoneNumber"), 
-       E_STRING_PROP (E_CONTACT_PHONE_OTHER,        "otherPhone"), 
-       E_STRING_PROP (E_CONTACT_PHONE_OTHER_FAX,    "otherFacsimileTelephoneNumber"), 
-       STRING_PROP   (E_CONTACT_PHONE_ISDN,         "internationaliSDNNumber"), 
+       STRING_PROP   (E_CONTACT_PHONE_BUSINESS_FAX, "facsimileTelephoneNumber"),
+       E_STRING_PROP (E_CONTACT_PHONE_HOME_FAX,     "homeFacsimileTelephoneNumber"),
+       E_STRING_PROP (E_CONTACT_PHONE_OTHER,        "otherPhone"),
+       E_STRING_PROP (E_CONTACT_PHONE_OTHER_FAX,    "otherFacsimileTelephoneNumber"),
+       STRING_PROP   (E_CONTACT_PHONE_ISDN,         "internationaliSDNNumber"),
        STRING_PROP   (E_CONTACT_PHONE_PAGER,        "pager"),
        E_STRING_PROP (E_CONTACT_PHONE_RADIO,        "radio"),
        E_STRING_PROP (E_CONTACT_PHONE_TELEX,        "telex"),
@@ -324,9 +324,9 @@ static struct prop_info {
        STRING_PROP   (E_CONTACT_ORG_UNIT,  "ou"),
        STRING_PROP   (E_CONTACT_OFFICE,    "roomNumber"),
        STRING_PROP   (E_CONTACT_TITLE,     "title"),
-       E_STRING_PROP (E_CONTACT_ROLE,      "businessRole"), 
-       E_STRING_PROP (E_CONTACT_MANAGER,   "managerName"), 
-       E_STRING_PROP (E_CONTACT_ASSISTANT, "assistantName"), 
+       E_STRING_PROP (E_CONTACT_ROLE,      "businessRole"),
+       E_STRING_PROP (E_CONTACT_MANAGER,   "managerName"),
+       E_STRING_PROP (E_CONTACT_ASSISTANT, "assistantName"),
 
        /* addresses */
        COMPLEX_PROP  (E_CONTACT_ADDRESS_LABEL_WORK, "postalAddress", work_address_populate, work_address_ber, work_address_compare),
@@ -360,11 +360,11 @@ static struct prop_info {
        STRING_PROP    (E_CONTACT_HOMEPAGE_URL,  "labeledURI"),
        /* map nickname to displayName */
        STRING_PROP    (E_CONTACT_NICKNAME,    "displayName"),
-       E_STRING_PROP  (E_CONTACT_SPOUSE,      "spouseName"), 
-       E_STRING_PROP  (E_CONTACT_NOTE,        "note"), 
-       E_COMPLEX_PROP (E_CONTACT_ANNIVERSARY, "anniversary", anniversary_populate, anniversary_ber, anniversary_compare), 
-       E_COMPLEX_PROP (E_CONTACT_BIRTH_DATE,  "birthDate", birthday_populate, birthday_ber, birthday_compare), 
-       E_STRING_PROP  (E_CONTACT_MAILER,      "mailer"), 
+       E_STRING_PROP  (E_CONTACT_SPOUSE,      "spouseName"),
+       E_STRING_PROP  (E_CONTACT_NOTE,        "note"),
+       E_COMPLEX_PROP (E_CONTACT_ANNIVERSARY, "anniversary", anniversary_populate, anniversary_ber, anniversary_compare),
+       E_COMPLEX_PROP (E_CONTACT_BIRTH_DATE,  "birthDate", birthday_populate, birthday_ber, birthday_compare),
+       E_STRING_PROP  (E_CONTACT_MAILER,      "mailer"),
 
        E_STRING_PROP  (E_CONTACT_FILE_AS,     "fileAs"),
 
@@ -435,7 +435,7 @@ view_destroy(gpointer data, GObject *where_object_was)
                        CORBA_exception_init(&ev);
 
                        GNOME_Evolution_Addressbook_Book_unref(corba_book, &ev);
-       
+
                        if (ev._major != CORBA_NO_EXCEPTION) {
                                g_warning("view_destroy: Exception unreffing "
                                          "corba book.\n");
@@ -507,7 +507,7 @@ add_to_supported_fields (EBookBackendLDAP *bl, char **attrs, GHashTable *attr_ha
                        else if (!strcmp (query_prop, e_contact_field_name (E_CONTACT_CATEGORY_LIST) )) {
                                bl->priv->supported_fields = g_list_append (bl->priv->supported_fields, g_strdup (e_contact_field_name (E_CONTACT_CATEGORIES)));
                        }
-                       
+
                }
        }
 }
@@ -798,16 +798,16 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
        if (blpriv->ldap) {
                ldap_unbind (blpriv->ldap);
        }
-       
+
 #ifdef SUNLDAP
        if (bl->priv->use_tls != E_BOOK_BACKEND_LDAP_TLS_NO) {
-               char *evolution_dir_path = 
+               char *evolution_dir_path =
                        g_build_path ("/", g_get_home_dir (), ".evolution", NULL);
                ldap_flag = ldapssl_client_init (evolution_dir_path, NULL);
                g_free (evolution_dir_path);
        }
 #endif
-                       
+
        blpriv->ldap = ldap_init (blpriv->ldap_host, blpriv->ldap_port);
 
 #if defined (DEBUG) && defined (LDAP_OPT_DEBUG_LEVEL)
@@ -844,7 +844,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
                                        ldap_error = ldapssl_install_routines (blpriv->ldap);
                                } else
                                        ldap_error = LDAP_NOT_SUPPORTED;
-                       
+
                                if (LDAP_SUCCESS == ldap_error) {
                                        ldap_error = ldap_set_option (blpriv->ldap, LDAP_OPT_SSL, LDAP_OPT_ON );
                                        ldap_set_option(blpriv->ldap, LDAP_OPT_RECONNECT, LDAP_OPT_ON );
@@ -867,7 +867,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
                                        ldap_error = ldapssl_install_routines (blpriv->ldap);
                                } else
                                        ldap_error = LDAP_NOT_SUPPORTED;
-                               
+
                                if (LDAP_SUCCESS == ldap_error) {
                                        ldap_error = ldap_set_option (blpriv->ldap, LDAP_OPT_SSL, LDAP_OPT_ON );
                                        ldap_set_option(blpriv->ldap, LDAP_OPT_RECONNECT, LDAP_OPT_ON );
@@ -902,7 +902,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
                        /* server doesn't support v3 binds, so let's
                           drop it down to v2 and try again. */
                        bl->priv->ldap_v3 = FALSE;
-                       
+
                        protocol_version = LDAP_VERSION2;
                        ldap_set_option (blpriv->ldap, LDAP_OPT_PROTOCOL_VERSION, &protocol_version);
 
@@ -933,7 +933,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl)
                   LDAP_NO_SUCH_OBJECT, and GWIA's LDAP server (which
                   is v2 based and doesn't have a root dse) seems to
                   fail with LDAP_PARTIAL_RESULTS. */
-               if (ldap_error == LDAP_SUCCESS 
+               if (ldap_error == LDAP_SUCCESS
                    || ldap_error == LDAP_PARTIAL_RESULTS
                    || LDAP_NAME_ERROR (ldap_error)) {
                        blpriv->connected = TRUE;
@@ -1036,7 +1036,7 @@ e_book_backend_ldap_reconnect (EBookBackendLDAP *bl, EDataBookView *book_view, i
 static void
 ldap_op_add (LDAPOp *op, EBookBackend *backend,
             EDataBook *book, EDataBookView *view,
-            int opid, 
+            int opid,
             int msgid,
             LDAPOpHandler handler, LDAPOpDtor dtor)
 {
@@ -1082,7 +1082,7 @@ ldap_op_finished (LDAPOp *op)
        if (bl->priv->ldap)
                ldap_abandon (bl->priv->ldap, op->id);
        g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
-       
+
        if (op->dtor)
                op->dtor (op);
 
@@ -1128,7 +1128,7 @@ ldap_error_to_response (int ldap_error)
        else if (ldap_error == LDAP_ALREADY_EXISTS)
                return GNOME_Evolution_Addressbook_ContactIdAlreadyExists;
        else if(ldap_error == LDAP_TYPE_OR_VALUE_EXISTS )
-               return GNOME_Evolution_Addressbook_ContactIdAlreadyExists;      
+               return GNOME_Evolution_Addressbook_ContactIdAlreadyExists;
        else
                return GNOME_Evolution_Addressbook_OtherError;
 }
@@ -1317,7 +1317,7 @@ build_mods_from_contacts (EBookBackendLDAP *bl, EContact *current, EContact *new
                                else
                                        mod->mod_op = LDAP_MOD_REPLACE;
                        }
-                       
+
                        mod->mod_type = g_strdup (prop_info[i].ldap_attr);
 
                        if (prop_info[i].prop_type & PROP_TYPE_STRING) {
@@ -1496,13 +1496,13 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
        LDAPMod **ldap_mods;
        LDAP *ldap;
 
-       
+
        switch (bl->priv->mode) {
 
        case GNOME_Evolution_Addressbook_MODE_LOCAL :
                e_data_book_respond_create(book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
                return;
-       case GNOME_Evolution_Addressbook_MODE_REMOTE : 
+       case GNOME_Evolution_Addressbook_MODE_REMOTE :
 
                g_static_rec_mutex_lock (&eds_ldap_handler_lock);
                if (!bl->priv->ldap) {
@@ -1515,15 +1515,15 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
                book_view = find_book_view (bl);
 
                printf ("Create Contact: vcard = %s\n", vcard);
-               
+
                create_op->new_contact = e_contact_new_from_vcard (vcard);
-       
+
                create_op->dn = create_dn_from_contact (create_op->new_contact, bl->priv->ldap_rootdn);
                e_contact_set (create_op->new_contact, E_CONTACT_UID, create_op->dn);
-               
+
                /* build our mods */
                mod_array = build_mods_from_contacts (bl, NULL, create_op->new_contact, NULL);
-               
+
 #if 0
                if (!mod_array) {
                        /* there's an illegal field in there.  report
@@ -1531,31 +1531,31 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
                        e_data_book_respond_create (book,
                                                    GNOME_Evolution_Addressbook_BookListener_UnsupportedField,
                                                    NULL);
-                       
+
                        g_free (create_op->dn);
                        g_object_unref (create_op->new_contact);
                        g_free (create_op);
                        return;
                }
 #endif
-               
+
                /* remove the NULL at the end */
                g_ptr_array_remove (mod_array, NULL);
-               
+
                /* add our objectclass(es) */
                if (e_contact_get (create_op->new_contact, E_CONTACT_IS_LIST))
                        add_objectclass_mod (bl, mod_array, NULL, TRUE);
                else
                        add_objectclass_mod (bl, mod_array, NULL, FALSE);
-               
+
                /* then put the NULL back */
                g_ptr_array_add (mod_array, NULL);
-               
+
 #ifdef LDAP_DEBUG_ADD
                {
                        int i;
                        printf ("Sending the following to the server as ADD\n");
-                       
+
                        for (i = 0; g_ptr_array_index(mod_array, i); i ++) {
                                LDAPMod *mod = g_ptr_array_index(mod_array, i);
                                if (mod->mod_op & LDAP_MOD_DELETE)
@@ -1568,9 +1568,9 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
                                        printf ("ber ");
                                else
                                        printf ("    ");
-                       
+
                                printf (" %s:\n", mod->mod_type);
-                       
+
                                if (mod->mod_op & LDAP_MOD_BVALUES) {
                                        int j;
                                        for (j = 0; mod->mod_bvalues[j] && mod->mod_bvalues[j]->bv_val; j++)
@@ -1578,30 +1578,30 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
                                }
                                else {
                                        int j;
-                               
+
                                        for (j = 0; mod->mod_values[j]; j++)
                                                printf ("\t\t'%s'\n", mod->mod_values[j]);
                                }
                        }
                }
 #endif
-       
+
                ldap_mods = (LDAPMod**)mod_array->pdata;
 
                ldap = bl->priv->ldap;
-               
+
                do {
                        book_view_notify_status (book_view, _("Adding contact to LDAP server..."));
-                       g_static_rec_mutex_lock (&eds_ldap_handler_lock);       
+                       g_static_rec_mutex_lock (&eds_ldap_handler_lock);
                        err = ldap_add_ext (ldap, create_op->dn, ldap_mods,
                                            NULL, NULL, &create_contact_msgid);
                        g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
-               
+
                } while (e_book_backend_ldap_reconnect (bl, book_view, err));
-       
+
                /* and clean up */
                free_mods (mod_array);
-       
+
                if (LDAP_SUCCESS != err) {
                        response = ldap_error_to_response (err);
                        e_data_book_respond_create (create_op->op.book,
@@ -1619,7 +1619,7 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
                }
        }
 }
-       
+
 
 typedef struct {
        LDAPOp op;
@@ -1702,7 +1702,7 @@ e_book_backend_ldap_remove_contacts (EBookBackend *backend,
                e_data_book_respond_remove_contacts (book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, NULL);
                g_free (remove_op);
                return;
-       case GNOME_Evolution_Addressbook_MODE_REMOTE : 
+       case GNOME_Evolution_Addressbook_MODE_REMOTE :
                if (!bl->priv->ldap) {
                        e_data_book_respond_remove_contacts (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
                        g_free (remove_op);
@@ -1717,17 +1717,17 @@ e_book_backend_ldap_remove_contacts (EBookBackend *backend,
                ** the id we're deleting is the first and only id in the list.
                */
                remove_op->id = g_strdup (ids->data);
-               
+
                do {
                        book_view_notify_status (book_view, _("Removing contact from LDAP server..."));
-               
-                       g_static_rec_mutex_lock (&eds_ldap_handler_lock);       
+
+                       g_static_rec_mutex_lock (&eds_ldap_handler_lock);
                        ldap_error = ldap_delete_ext (bl->priv->ldap,
                                                      remove_op->id,
                                                      NULL, NULL, &remove_msgid);
                        g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
                } while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
-               
+
                if (ldap_error != LDAP_SUCCESS) {
                        e_data_book_respond_remove_contacts (remove_op->op.book,
                                                             opid,
@@ -1744,9 +1744,9 @@ e_book_backend_ldap_remove_contacts (EBookBackend *backend,
                }
                break;
        }
-       
+
 }
-       
+
 /*
 ** MODIFY
 **
@@ -1910,7 +1910,7 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
                        {
                                int i;
                                printf ("Sending the following to the server as MOD\n");
-                       
+
                                for (i = 0; g_ptr_array_index(mod_array, i); i ++) {
                                        LDAPMod *mod = g_ptr_array_index(mod_array, i);
                                        if (mod->mod_op & LDAP_MOD_DELETE)
@@ -1923,9 +1923,9 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
                                                printf ("ber ");
                                        else
                                                printf ("    ");
-                       
+
                                        printf (" %s:\n", mod->mod_type);
-                       
+
                                        if (mod->mod_op & LDAP_MOD_BVALUES) {
                                                int j;
                                                for (j = 0; mod->mod_bvalues[j] && mod->mod_bvalues[j]->bv_val; j++)
@@ -1961,7 +1961,7 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
                                return;
                        }
                }
-               
+
                /* and clean up */
                free_mods (mod_array);
        }
@@ -2133,7 +2133,7 @@ get_contact_handler (LDAPOp *op, LDAPMessage *res)
                }
                ldap_memfree (ldap_error_msg);
 
-               e_data_book_respond_get_contact (op->book, 
+               e_data_book_respond_get_contact (op->book,
                                                 op->opid,
                                                 ldap_error_to_response (ldap_error),
                                                 "");
@@ -2199,7 +2199,7 @@ e_book_backend_ldap_get_contact (EBookBackend *backend,
                e_data_book_respond_get_contact(book, opid, GNOME_Evolution_Addressbook_RepositoryOffline, "");
                return;
 
-       case GNOME_Evolution_Addressbook_MODE_REMOTE : 
+       case GNOME_Evolution_Addressbook_MODE_REMOTE :
 
                if (enable_debug) {
                        printf("e_book_backend_ldap_get_contact ... \n");
@@ -2217,7 +2217,7 @@ e_book_backend_ldap_get_contact (EBookBackend *backend,
                get_contact_op = g_new0 (LDAPGetContactOp, 1);
                book_view = find_book_view (bl);
 
-               do {    
+               do {
                        g_static_rec_mutex_lock (&eds_ldap_handler_lock);
                        ldap_error = ldap_search_ext (ldap, id,
                                                      LDAP_SCOPE_BASE,
@@ -2295,7 +2295,7 @@ contact_list_handler (LDAPOp *op, LDAPMessage *res)
                        vcard = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
 
                        printf ("vcard = %s\n", vcard);
+
                        contact_list_op->contacts = g_list_append (contact_list_op->contacts,
                                                                   vcard);
 
@@ -2392,7 +2392,7 @@ e_book_backend_ldap_get_contact_list (EBookBackend *backend,
        }
 
        switch (bl->priv->mode) {
-               
+
        case GNOME_Evolution_Addressbook_MODE_LOCAL :
                if (bl->priv->marked_for_offline && bl->priv->cache) {
                        GList *contacts;
@@ -2412,11 +2412,11 @@ e_book_backend_ldap_get_contact_list (EBookBackend *backend,
                        e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_Success, vcard_strings);
                        return;
                }
-               
+
                e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_RepositoryOffline,
                                                      NULL);
                return;
-               
+
        case GNOME_Evolution_Addressbook_MODE_REMOTE:
                ldap = bl->priv->ldap;
 
@@ -2434,7 +2434,7 @@ e_book_backend_ldap_get_contact_list (EBookBackend *backend,
 
                printf ("getting contact list with filter: %s\n", ldap_query);
 
-               do {    
+               do {
                        g_static_rec_mutex_lock (&eds_ldap_handler_lock);
                        ldap_error = ldap_search_ext (ldap,
                                                      bl->priv->ldap_rootdn,
@@ -2595,11 +2595,11 @@ member_ber (EContact *contact)
        for (l = members; l != NULL; l = g_list_next (l)) {
                EVCardAttribute *attr = l->data;
                dn = NULL;
-       
+
                for (p = e_vcard_attribute_get_params (attr); p; p = p->next) {
                        EVCardAttributeParam *param = p->data;
                        const char *param_name = e_vcard_attribute_param_get_name (param);
-                       
+
                        if (!g_ascii_strcasecmp (param_name, EVC_X_DEST_CONTACT_UID)) {
                                GList *v = e_vcard_attribute_param_get_values (param);
                                dn = v ? v->data : NULL;
@@ -2649,11 +2649,11 @@ member_compare (EContact *contact_new, EContact *contact_current)
        for (l1 = members_new; l1 != NULL; l1 = g_list_next (l1)) {
                EVCardAttribute *attr_new = l1->data;
                char *dn_new = NULL;
-       
+
                for (p_new = e_vcard_attribute_get_params (attr_new); p_new; p_new = p_new->next) {
                        EVCardAttributeParam *param = p_new->data;
                        const char *param_name1 = e_vcard_attribute_param_get_name (param);
-                       
+
                        if (!g_ascii_strcasecmp (param_name1, EVC_X_DEST_CONTACT_UID)) {
                                gboolean found = FALSE;
                                GList *v = e_vcard_attribute_param_get_values (param);
@@ -2670,7 +2670,7 @@ member_compare (EContact *contact_new, EContact *contact_current)
                                                        if (!g_ascii_strcasecmp (param_name2, EVC_X_DEST_CONTACT_UID)) {
                                                                GList *v2 = e_vcard_attribute_param_get_values (param2);
                                                                dn_cur = v2 ? v2->data : NULL;
-                                                       
+
                                                                if (dn_cur) {
                                                                        if (!g_ascii_strcasecmp (dn_new, dn_cur)) {
                                                                                found = TRUE;
@@ -2687,7 +2687,7 @@ member_compare (EContact *contact_new, EContact *contact_current)
                                }
                        }
                }
-               next_member: 
+               next_member:
                continue;
        }
        return TRUE;
@@ -3266,7 +3266,7 @@ photo_compare(EContact * ecard1, EContact * ecard2)
                } else {
                        equal = FALSE;
                }
-                       
+
        }
        else {
                equal = (!!photo1 == !!photo2);
@@ -3344,7 +3344,7 @@ func_and(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                strings = g_new0(char*, argc+3);
                strings[0] = g_strdup ("(&");
                strings[argc+3 - 2] = g_strdup (")");
-               
+
                for (i = 0; i < argc; i ++) {
                        GList *list_head = ldap_data->list;
                        if (!list_head)
@@ -3560,7 +3560,7 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
                                        ldap_data->list = g_list_prepend(ldap_data->list,
                                                                 g_strdup_printf("(|(fileAs=%s*)(&(!(fileAs=*))(sn=%s*)))",
                                                                                 str, str));
-                               else 
+                               else
                                        ldap_data->list = g_list_prepend(ldap_data->list,
                                                                         g_strdup_printf("(sn=%s*)", str));
                        }
@@ -3766,7 +3766,7 @@ typedef struct {
 
 static EContact *
 build_contact_from_entry (EBookBackendLDAP *bl,
-                         LDAPMessage *e, 
+                         LDAPMessage *e,
                          GList **existing_objectclasses)
 {
        EContact *contact = e_contact_new ();
@@ -3795,7 +3795,7 @@ build_contact_from_entry (EBookBackendLDAP *bl,
                                        e_contact_set (contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (TRUE));
                                        e_contact_set (contact, E_CONTACT_LIST_SHOW_ADDRESSES, GINT_TO_POINTER (TRUE));
                                }
-                               if (existing_objectclasses) 
+                               if (existing_objectclasses)
                                        *existing_objectclasses = g_list_append (*existing_objectclasses, g_strdup (values[i]));
                        }
                        ldap_value_free (values);
@@ -3850,8 +3850,8 @@ build_contact_from_entry (EBookBackendLDAP *bl,
                                                        grpattrs[2] = NULL;
                                                        /* search for member attributes */
                                                        /* get the e-mail id for each member and add them to the list */
-               
-                                                       book_view = find_book_view (bl);        
+
+                                                       book_view = find_book_view (bl);
                                                        if (book_view)
                                                                view_limit = e_data_book_view_get_max_results (book_view);
                                                        if (view_limit == -1 || view_limit > bl->priv->ldap_limit)
@@ -3869,7 +3869,7 @@ build_contact_from_entry (EBookBackendLDAP *bl,
                                                                                                        values[j],
                                                                                                        LDAP_SCOPE_BASE,
                                                                                                        NULL,
-                                                                                                       grpattrs, 0, 
+                                                                                                       grpattrs, 0,
                                                                                                        NULL,
                                                                                                        NULL,
                                                                                                        NULL,
@@ -3881,35 +3881,35 @@ build_contact_from_entry (EBookBackendLDAP *bl,
 
                                                                                if (email_values) {
                                                                                        printf ("email = %s \n", email_values[0]);
-                                                                                       *(member_info + j) = 
-                                                                                               g_strdup_printf ("%s;%s;", 
+                                                                                       *(member_info + j) =
+                                                                                               g_strdup_printf ("%s;%s;",
                                                                                                                 email_values[0], values[j]);
                                                                                        ldap_value_free (email_values);
                                                                                }
                                                                                if (cn_values) {
                                                                                        printf ("cn = %s \n", cn_values[0]);
-                                                                                       *(member_info + j) = 
-                                                                                               g_strconcat (*(member_info + j), 
+                                                                                       *(member_info + j) =
+                                                                                               g_strconcat (*(member_info + j),
                                                                                                             cn_values [0], NULL);
                                                                                        ldap_value_free (cn_values);
                                                                                }
                                                                        }
                                                                }
                                                                while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
-                       
+
                                                                if (ldap_error != LDAP_SUCCESS) {
-                                                                       book_view_notify_status (book_view, 
+                                                                       book_view_notify_status (book_view,
                                                                                                 ldap_err2string(ldap_error));
                                                                        continue;
                                                                }
                                                        }
-                                                       /* call populate function */    
-                                                       info->populate_contact_func (contact, member_info); 
-                                               
+                                                       /* call populate function */
+                                                       info->populate_contact_func (contact, member_info);
+
                                                        for (j = 0; j < count; j++) {
                                                                g_free (*(member_info + j));
                                                        }
-                                                       g_free (member_info);   
+                                                       g_free (member_info);
                                                }
 
                                                ldap_value_free (values);
@@ -4129,7 +4129,7 @@ e_book_backend_ldap_search (EBookBackendLDAP *bl,
 
                e_data_book_view_notify_complete (view, GNOME_Evolution_Addressbook_Success);
                return;
-               
+
        case GNOME_Evolution_Addressbook_MODE_REMOTE :
                ldap_query = e_book_backend_ldap_build_query (bl, e_data_book_view_get_card_query (view));
 
@@ -4181,7 +4181,7 @@ e_book_backend_ldap_search (EBookBackendLDAP *bl,
                                op->aborted = FALSE;
                                bonobo_object_ref (view);
 
-                               ldap_op_add ((LDAPOp*)op, E_BOOK_BACKEND(bl), book, view, 
+                               ldap_op_add ((LDAPOp*)op, E_BOOK_BACKEND(bl), book, view,
                                             0, search_msgid,
                                             ldap_search_handler, ldap_search_dtor);
 
@@ -4299,7 +4299,7 @@ generate_cache_handler (LDAPOp *op, LDAPMessage *res)
                GList *l;
                int contact_num = 0;
                char *status_msg;
-               
+
                e_file_cache_clean (E_FILE_CACHE (bl->priv->cache));
 
                e_file_cache_freeze_changes (E_FILE_CACHE (bl->priv->cache));
@@ -4311,7 +4311,7 @@ generate_cache_handler (LDAPOp *op, LDAPMessage *res)
                                status_msg = g_strdup_printf (_("Downloading contacts (%d)... "),
                                                                 contact_num);
                                e_data_book_view_notify_status_message (book_view, status_msg);
-                               g_free (status_msg); 
+                               g_free (status_msg);
                        }
                        e_book_backend_cache_add_contact (bl->priv->cache, contact);
                }
@@ -4355,7 +4355,7 @@ generate_cache (EBookBackendLDAP *book_backend_ldap)
        gint ldap_error;
        GTimeVal start, end;
        unsigned long diff;
-       
+
        if (enable_debug) {
                printf ("generating offline cache ... \n");
                g_get_current_time (&start);
@@ -4370,7 +4370,7 @@ generate_cache (EBookBackendLDAP *book_backend_ldap)
                return;
        }
 
-       ldap_query = e_book_backend_ldap_build_query (book_backend_ldap, 
+       ldap_query = e_book_backend_ldap_build_query (book_backend_ldap,
                                                      "(beginswith \"file_as\" \"\")");
 
        do {
@@ -4434,7 +4434,7 @@ e_book_backend_ldap_authenticate_user (EBookBackend *backend,
                                                               opid, status);
                        return ;
                }
-                                                      
+
        }
 
        if (!g_ascii_strncasecmp (auth_method, LDAP_SIMPLE_PREFIX, strlen (LDAP_SIMPLE_PREFIX))) {
@@ -4494,7 +4494,7 @@ e_book_backend_ldap_authenticate_user (EBookBackend *backend,
                                                passwd);
                g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
                /* Some ldap servers are returning (ex active directory ones) LDAP_SERVER_DOWN
-                * when we try to do an ldap operation  after being  idle 
+                * when we try to do an ldap operation  after being  idle
                 * for some time. This error is handled by poll_ldap in case of search operations
                 * We need to handle it explicitly for this bind call. We call reconnect so that
                 * we get a fresh ldap handle Fixes #67541 */
@@ -4507,7 +4507,7 @@ e_book_backend_ldap_authenticate_user (EBookBackend *backend,
                        }
 
                }
-                               
+
                e_data_book_respond_authenticate_user (book,
                                                       opid,
                                                       ldap_error_to_response (ldap_error));
@@ -4577,15 +4577,15 @@ e_book_backend_ldap_get_required_fields (EBookBackend *backend,
 
 {
        GList *fields = NULL;
-       
-       
+
+
        /*FIMEME we should look at mandatory attributs in the schema
          and return all those fields here */
        fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FILE_AS));
        fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FULL_NAME));
        fields = g_list_append (fields, (char *)e_contact_field_name (E_CONTACT_FAMILY_NAME));
-       
-       
+
+
        e_data_book_respond_get_required_fields (book,
                                                  opid,
                                                  GNOME_Evolution_Addressbook_Success,
@@ -4742,7 +4742,7 @@ e_book_backend_ldap_load_source (EBookBackend             *backend,
 
                return GNOME_Evolution_Addressbook_Success;
        }
-       else 
+       else
                e_book_backend_notify_connection_status (backend, TRUE);
 
        /* Online */
@@ -4815,7 +4815,7 @@ start_views (EBookBackend *backend)
 }
 #endif
 
-static void 
+static void
 e_book_backend_ldap_set_mode (EBookBackend *backend, int mode)
 {
        EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
@@ -4854,7 +4854,7 @@ e_book_backend_ldap_set_mode (EBookBackend *backend, int mode)
        }
        else if (mode == GNOME_Evolution_Addressbook_MODE_REMOTE) {
                /* Go online */
-       
+
                e_book_backend_set_is_writable (backend, TRUE);
                e_book_backend_notify_writable (backend, TRUE);
                e_book_backend_notify_connection_status (backend, TRUE);
@@ -4934,7 +4934,7 @@ e_book_backend_ldap_dispose (GObject *object)
                g_static_rec_mutex_unlock (&bl->priv->op_hash_mutex);
                g_static_rec_mutex_free (&bl->priv->op_hash_mutex);
 
-               g_static_rec_mutex_lock (&eds_ldap_handler_lock);       
+               g_static_rec_mutex_lock (&eds_ldap_handler_lock);
                if (bl->priv->ldap)
                        ldap_unbind (bl->priv->ldap);
                g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
@@ -5005,7 +5005,7 @@ e_book_backend_ldap_class_init (EBookBackendLDAPClass *klass)
        parent_class->get_supported_auth_methods = e_book_backend_ldap_get_supported_auth_methods;
        parent_class->cancel_operation        = e_book_backend_ldap_cancel_operation;
        parent_class->set_mode                = e_book_backend_ldap_set_mode;
-       
+
        object_class->dispose = e_book_backend_ldap_dispose;
 }
 
index eea0aa0..49b2d1a 100644 (file)
@@ -232,7 +232,7 @@ get_token( const char ** sp, char ** token_val )
 /*             kind = TK_UNEXPCHAR; */
 /*             break; */
        }
-       
+
        return kind;
 }
 
@@ -762,7 +762,7 @@ static char *ldap_utf8_strchr( const char *str, const char *chr )
        for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) {
                if( ldap_x_utf8_to_ucs4( str ) == ldap_x_utf8_to_ucs4( chr ) ) {
                        return (char *) str;
-               } 
+               }
        }
 
        return NULL;
@@ -777,7 +777,7 @@ static size_t ldap_utf8_strcspn( const char *str, const char *set )
                for( cset = set; *cset != '\0'; LDAP_UTF8_INCR(cset) ) {
                        if( ldap_x_utf8_to_ucs4( cstr ) == ldap_x_utf8_to_ucs4( cset ) ) {
                                return cstr - str;
-                       } 
+                       }
                }
        }
 
@@ -797,7 +797,7 @@ static size_t ldap_utf8_strspn( const char *str, const char *set )
 
                        if( ldap_x_utf8_to_ucs4( cstr ) == ldap_x_utf8_to_ucs4( cset ) ) {
                                break;
-                       } 
+                       }
                }
        }
 
@@ -967,7 +967,7 @@ ldap_free_urldesc( LDAPURLDesc *ludp )
        if ( ludp == NULL ) {
                return;
        }
-       
+
        if ( ludp->lud_scheme != NULL ) {
                LDAP_FREE( ludp->lud_scheme );
        }
@@ -1218,7 +1218,7 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
         * anything real.
         */
        if( (p == NULL) && (q != NULL) && ((q = strchr( q, '?')) != NULL)) {
-               q++;            
+               q++;
                /* ? immediately followed by question */
                if( *q == '?') {
                        q++;
index 7792506..d27035f 100644 (file)
@@ -44,7 +44,7 @@
 #include "libedataserver/e-flag.h"
 
 #include "libebook/e-contact.h"
+
 #include "libedata-book/e-data-book.h"
 #include "libedata-book/e-data-book-view.h"
 #include "libedata-book/e-book-backend-sexp.h"
@@ -576,7 +576,7 @@ e_book_backend_vcf_get_supported_fields (EBookBackendSync *backend,
        /* XXX we need a way to say "we support everything", since the
           vcf backend does */
        for (i = 0; i < E_CONTACT_FIELD_LAST; i ++)
-               fields = g_list_append (fields, (char*)e_contact_field_name (i));               
+               fields = g_list_append (fields, (char*)e_contact_field_name (i));
 
        *fields_out = fields;
        return GNOME_Evolution_Addressbook_Success;
@@ -674,7 +674,7 @@ e_book_backend_vcf_cancel_operation (EBookBackend *backend, EDataBook *book)
        return GNOME_Evolution_Addressbook_CouldNotCancel;
 }
 
-static void 
+static void
 e_book_backend_vcf_set_mode (EBookBackend *backend, int mode)
 {
        if (e_book_backend_is_loaded (backend)) {
@@ -747,7 +747,7 @@ e_book_backend_vcf_dispose (GObject *object)
                bvcf->priv = NULL;
        }
 
-       G_OBJECT_CLASS (e_book_backend_vcf_parent_class)->dispose (object);     
+       G_OBJECT_CLASS (e_book_backend_vcf_parent_class)->dispose (object);
 }
 
 static void
index be37020..6190354 100644 (file)
@@ -6,7 +6,7 @@
    Jesse Pavel (jpavel@ximian.com)
 
  Copyright 2000, Ximian, Inc.
-   -------------------------------------------------- 
+   --------------------------------------------------
 */
 
 #include <ctype.h>
@@ -63,7 +63,7 @@ e_address_western_shift_line (gchar *lines[], gint line_num, gint num_lines)
 }
 
 
-static void 
+static void
 e_address_western_remove_blank_lines (gchar *lines[], gint *linecntr)
 {
        gint cntr;
@@ -74,7 +74,7 @@ e_address_western_remove_blank_lines (gchar *lines[], gint *linecntr)
                           one spot to fill its old spot. */
                        e_address_western_shift_line (lines, cntr, *linecntr);
 
-                       /* Since we must check the newly shifted line, let's 
+                       /* Since we must check the newly shifted line, let's
                          not advance the counter on this next pass. */
                        cntr--;
 
@@ -83,7 +83,7 @@ e_address_western_remove_blank_lines (gchar *lines[], gint *linecntr)
                }
        }
 }
+
 
 static gboolean
 e_address_western_is_po_box (gchar *line)
@@ -92,12 +92,12 @@ e_address_western_is_po_box (gchar *line)
 
        /* In which phase of processing are we? */
        enum State { FIRSTCHAR, SECONDCHAR, WHITESPACE } state;
-       
-       
+
+
        /* If the first two letters of the line are `p' and `o', and these
         are in turn followed by whitespace before another letter, then I
         will deem the line a representation of a PO Box address. */
-       
+
        gint cntr;
 
        state = FIRSTCHAR;
@@ -145,19 +145,19 @@ e_address_western_is_postal (gchar *line)
 {
        gboolean retval;
        int cntr;
-       
+
        if (strchr (line, ',') == NULL)
                retval = FALSE;  /* No comma. */
        else {
                int index;
-               
+
                /* Ensure that the first character after the comma is
                 a letter. */
                index = strcspn (line, ",");
                index++;
                while (isspace(line[index]))
                        index++;
-               
+
                if (!isalpha (line[index]))
                        return FALSE;   /* FIXME: ugly control flow. */
 
@@ -166,8 +166,8 @@ e_address_western_is_postal (gchar *line)
                /* Go to the character immediately following the last
                  whitespace character. */
                while (cntr >= 0 && isspace(line[cntr]))
-                       cntr--; 
-               
+                       cntr--;
+
                while (cntr >= 0 && !isspace(line[cntr]))
                        cntr--;
 
@@ -179,7 +179,7 @@ e_address_western_is_postal (gchar *line)
                        else
                                retval = FALSE;
                }
-       }       
+       }
 
        return retval;
 }
@@ -189,16 +189,16 @@ e_address_western_extract_po_box (gchar *line)
 {
        /* Return everything from the beginning of the line to
           the end of the first word that contains a number. */
-       
+
        int index;
 
        index = 0;
        while (!isdigit(line[index]))
                index++;
-       
+
        while (isgraph(line[index]))
                index++;
-       
+
        return g_strndup (line, index);
 }
 
@@ -229,7 +229,7 @@ e_address_western_extract_region (gchar *line)
        start++;
        while (isspace(line[start]))
                start++;
-       
+
        end = strlen(line) - 1;
        while (isspace (line[end]))
                end--;
@@ -260,13 +260,13 @@ e_address_western_extract_postal_code (gchar *line)
        end = strlen (line) - 1;
        while (isspace(line[end]))
                end--;
-       
+
        start = end;
        end++;
 
        while (!isspace(line[start]))
                start--;
-       start++;        
+       start++;
 
        /* Between start and end lie the string. */
        return g_strndup ( (line+start), end-start);
@@ -320,7 +320,7 @@ e_address_western_parse (const gchar *in_address)
 
        if (in_address == NULL)
                return NULL;
-       
+
        eaw = (EAddressWestern *)g_malloc (sizeof(EAddressWestern));
        eaw->po_box = NULL;
        eaw->extended = NULL;
@@ -329,7 +329,7 @@ e_address_western_parse (const gchar *in_address)
        eaw->region = NULL;
        eaw->postal_code = NULL;
        eaw->country = NULL;
-       
+
        address = g_strndup (in_address, 2047);
 
        /* The first thing I'll do is divide the multiline input string
@@ -341,7 +341,7 @@ e_address_western_parse (const gchar *in_address)
        while (address[lineindex] != '\0') {
                if (address[lineindex] == '\n')
                        linecntr++;
-                       
+
                lineindex++;
        }
 
@@ -416,13 +416,13 @@ e_address_western_parse (const gchar *in_address)
                                }
                        }
                }
-       }                       
-       
+       }
+
        g_free (lines);
-       g_free (address);       
-       
+       g_free (address);
+
        return eaw;
-}      
+}
 
 /**
  * e_address_western_free:
@@ -430,12 +430,12 @@ e_address_western_parse (const gchar *in_address)
  *
  * Frees @eaw and its contents.
  **/
-void 
+void
 e_address_western_free (EAddressWestern *eaw)
 {
        if (eaw == NULL)
                return;
-       
+
        if (eaw->po_box != NULL)
                g_free(eaw->po_box);
        if (eaw->extended != NULL)
@@ -450,7 +450,7 @@ e_address_western_free (EAddressWestern *eaw)
                g_free(eaw->postal_code);
        if (eaw->country != NULL)
                g_free(eaw->country);
-       
+
        g_free (eaw);
 }
 
index c19becc..ae91a78 100644 (file)
@@ -4,7 +4,7 @@
 G_BEGIN_DECLS
 
 typedef struct {
-       
+
        /* Public */
        char *po_box;
        char *extended;  /* I'm not sure what this is. */
index 88a1d4c..4b7c935 100644 (file)
@@ -403,12 +403,12 @@ e_book_listener_new (void)
        static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
        static PortableServer_POA poa = NULL;
        EBookListener *listener;
-       
+
        g_static_mutex_lock (&mutex);
        if (poa == NULL)
                poa = bonobo_poa_get_threaded (ORBIT_THREAD_HINT_ON_CONTEXT, _ebook_context, NULL);
        g_static_mutex_unlock (&mutex);
-       
+
        listener = g_object_new (E_TYPE_BOOK_LISTENER, "poa", poa, NULL);
 
        return listener;
index 5f0ee80..e4f08b6 100644 (file)
@@ -331,7 +331,7 @@ func_and(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                int i;
 
                qs = g_new0(EBookQuery*, argc);
-               
+
                for (i = 0; i < argc; i ++) {
                        GList *list_head = *list;
                        if (!list_head)
@@ -340,7 +340,7 @@ func_and(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                        *list = g_list_delete_link(*list, list_head);
                }
 
-               *list = g_list_prepend(*list, 
+               *list = g_list_prepend(*list,
                                       e_book_query_and (argc, qs, TRUE));
 
                g_free (qs);
@@ -363,7 +363,7 @@ func_or(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                int i;
 
                qs = g_new0(EBookQuery*, argc);
-               
+
                for (i = 0; i < argc; i ++) {
                        GList *list_head = *list;
                        if (!list_head)
@@ -372,7 +372,7 @@ func_or(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                        *list = g_list_delete_link(*list, list_head);
                }
 
-               *list = g_list_prepend(*list, 
+               *list = g_list_prepend(*list,
                                       e_book_query_or (argc, qs, TRUE));
 
                g_free (qs);
@@ -673,7 +673,7 @@ e_book_query_to_string    (EBookQuery *q)
                e_sexp_encode_string (str, q->query.any_field_contains.value);
                break;
        }
-        
+
 
        g_string_append (str, ")");
 
index 2984b07..8458b5e 100644 (file)
@@ -17,7 +17,7 @@ typedef enum {
   E_BOOK_QUERY_ENDS_WITH,
 
   /*
-    Consider these "coming soon". 
+    Consider these "coming soon".
 
     E_BOOK_QUERY_LT,
     E_BOOK_QUERY_LE,
index 96d21ab..2b2503e 100644 (file)
@@ -76,7 +76,7 @@ main_thread_get_response (gpointer data)
        g_mutex_unlock (listener->priv->idle_mutex);
 
        bonobo_object_unref (listener);
-       
+
        return FALSE;
 }
 
@@ -160,12 +160,12 @@ e_book_view_listener_queue_sequence_event (EBookViewListener          *listener,
 
        resp->op        = op;
        resp->status    = E_BOOK_VIEW_STATUS_OK;
-       
+
        for ( i = 0; i < vcards->_length; i++ ) {
                resp->contacts = g_list_prepend (resp->contacts, e_contact_new_from_vcard (vcards->_buffer[i]));
        }
        resp->contacts = g_list_reverse (resp->contacts);
-       
+
        e_book_view_listener_queue_response (listener, resp);
 }
 
index b94822f..ba67280 100644 (file)
@@ -80,7 +80,7 @@ struct _EBookViewListenerResponse {
 
        /* For StatusMessageEvent */
        char                   *message;
-       
+
 };
 
 EBookViewListener         *e_book_view_listener_new            (void);
index 229ba6f..51c4ba0 100644 (file)
@@ -21,7 +21,7 @@ struct _EBookViewPrivate {
        GNOME_Evolution_Addressbook_BookView     corba_book_view;
 
        EBook                 *book;
-       
+
        EBookViewListener     *listener;
 
        int                    response_id;
index c6f829b..26c7def 100644 (file)
@@ -249,7 +249,7 @@ do_add_contact (gboolean          sync,
                        g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_SOURCE_NOT_LOADED,
                                     /* translators: the placeholders will be filled by
                                      * function names, e.g.
-                                     * "e_book_add_contact" on book before 
+                                     * "e_book_add_contact" on book before
                                      * "e_book_open */
                                     _("\"%s\" on book before \"%s\""),
                                     "e_book_add_contact", "e_book_open");
@@ -361,7 +361,7 @@ e_book_add_contact (EBook           *book,
  * @cb: function to call when the operation finishes
  * @closure: data to pass to callback function
  *
- * Adds @contact to @book without blocking. 
+ * Adds @contact to @book without blocking.
  *
  * Return value: %TRUE if the operation was started, %FALSE otherwise.
  **/
@@ -568,7 +568,7 @@ e_book_commit_contact (EBook           *book,
        return do_commit_contact (TRUE,
                                  book, contact, error,
                                  NULL, NULL);
-                                 
+
 }
 
 /**
@@ -934,7 +934,7 @@ e_book_response_get_required_fields (EBook       *book,
        }
        else {
                GList *l;
-               EList *efields = e_list_new ((EListCopyFunc) g_strdup, 
+               EList *efields = e_list_new ((EListCopyFunc) g_strdup,
                                             (EListFreeFunc) g_free,
                                             NULL);
 
@@ -982,7 +982,7 @@ e_book_response_get_supported_fields (EBook       *book,
        }
        else {
                GList *l;
-               EList *efields = e_list_new ((EListCopyFunc) g_strdup, 
+               EList *efields = e_list_new ((EListCopyFunc) g_strdup,
                                             (EListFreeFunc) g_free,
                                             NULL);
 
@@ -1171,7 +1171,7 @@ e_book_response_get_supported_auth_methods (EBook                 *book,
        }
        else {
                GList *l;
-               EList *emethods = e_list_new ((EListCopyFunc) g_strdup, 
+               EList *emethods = e_list_new ((EListCopyFunc) g_strdup,
                                              (EListFreeFunc) g_free,
                                              NULL);
 
@@ -1218,7 +1218,7 @@ do_authenticate_user (gboolean        sync,
                        g_warning (_("\"%s\" on book before \"%s\""),
                                   "e_book_authenticate_user", "e_book_open");
                }
-                       
+
                return FALSE;
        }
 
@@ -1365,7 +1365,7 @@ do_get_contact (gboolean sync,
        EBookOp *our_op;
        EBookStatus status;
        CORBA_Environment ev;
-                              
+
        g_mutex_lock (book->priv->mutex);
 
        if (book->priv->load_state != E_BOOK_SOURCE_LOADED) {
@@ -1643,7 +1643,7 @@ do_remove_contacts (gboolean sync,
                }
                return FALSE;
        }
-       
+
        CORBA_exception_free (&ev);
 
        if (sync) {
@@ -1896,7 +1896,7 @@ do_get_book_view (gboolean sync,
 
                return FALSE;
        }
-       
+
        CORBA_exception_free (&ev);
 
        if (sync) {
@@ -2026,7 +2026,7 @@ e_book_response_get_book_view (EBook       *book,
        op->status = status;
        op->view = e_book_view_new (corba_book_view, op->listener);
        e_book_view_set_book (op->view, book);
-       
+
        bonobo_object_unref(BONOBO_OBJECT(op->listener));
 
        if (op->synchronous) {
@@ -2123,7 +2123,7 @@ do_get_contacts (gboolean sync,
 
                return FALSE;
        }
-       
+
        CORBA_exception_free (&ev);
 
        if (sync) {
@@ -2144,7 +2144,7 @@ do_get_contacts (gboolean sync,
                return TRUE;
        }
 }
-                
+
 /**
  * e_book_get_contacts:
  * @book: an #EBook
@@ -2334,7 +2334,7 @@ do_get_changes (gboolean sync,
 
                return FALSE;
        }
-       
+
        CORBA_exception_free (&ev);
 
        if (sync) {
@@ -3028,7 +3028,7 @@ e_book_idle_writable (gpointer data)
        return FALSE;
 }
 
-static gboolean 
+static gboolean
 e_book_idle_connection (gpointer data)
 {
        EBook *book = data;
@@ -3049,7 +3049,7 @@ e_book_idle_connection (gpointer data)
        return FALSE;
 }
 
-static gboolean 
+static gboolean
 e_book_idle_auth_required (gpointer data)
 {
        EBook *book = data;
@@ -3114,9 +3114,9 @@ e_book_handle_response (EBookListener *listener, EBookListenerResponse *resp, EB
        case GetSupportedAuthMethodsResponse:
                e_book_response_get_supported_auth_methods (book, resp->opid, resp->status, resp->list);
                break;
-       case WritableStatusEvent: 
+       case WritableStatusEvent:
                book->priv->writable = resp->writable;
-       
+
                g_mutex_lock (book->priv->mutex);
                if (book->priv->writable_idle_id == 0) {
                        g_object_ref (book);
@@ -3142,7 +3142,7 @@ e_book_handle_response (EBookListener *listener, EBookListenerResponse *resp, EB
                }
                g_mutex_unlock (book->priv->mutex);
                break;
-               
+
        default:
                g_error ("EBook: Unknown response code %d!\n",
                         resp->op);
@@ -3209,7 +3209,7 @@ static void
 backend_died_cb (EComponentListener *cl, gpointer user_data)
 {
        EBook *book = user_data;
-                                                                                                                              
+
        book->priv->load_state = E_BOOK_SOURCE_NOT_LOADED;
         g_signal_emit (book, e_book_signals [BACKEND_DIED], 0);
 }
@@ -3226,7 +3226,7 @@ activate_factories_for_uri (EBook *book, const char *uri)
        query = "repo_ids.has ('IDL:GNOME/Evolution/DataServer/BookFactory:" API_VERSION "')";
 
        CORBA_exception_init (&ev);
-       
+
        info_list = bonobo_activation_query (query, NULL, &ev);
 
        if (ev._major != CORBA_NO_EXCEPTION) {
@@ -3326,7 +3326,7 @@ fetch_corba_book (EBook       *book,
        for (l = factories; l; l = l->next) {
                GNOME_Evolution_Addressbook_BookFactory factory = l->data;
                CORBA_Environment ev;
-               
+
                CORBA_exception_init (&ev);
 
                corba_book = GNOME_Evolution_Addressbook_BookFactory_getBook (factory, source_xml,
@@ -3362,7 +3362,7 @@ fetch_corba_book (EBook       *book,
                g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_PROTOCOL_NOT_SUPPORTED,
                             _("%s: no factories available for URI `%s'"), "e_book_new", uri);
        }
-               
+
        return rv;
 }
 
@@ -3497,9 +3497,9 @@ e_book_is_opened (EBook *book)
 /**
  * e_book_is_writable:
  * @book: an #EBook
- * 
+ *
  * Check if this book is writable.
- * 
+ *
  * Return value: %TRUE if this book is writable, otherwise %FALSE.
  */
 gboolean
@@ -3518,7 +3518,7 @@ e_book_is_writable (EBook *book)
  *
  * Return value: %TRUE if this book is connected, otherwise %FALSE.
  **/
-gboolean 
+gboolean
 e_book_is_online (EBook *book)
 {
        g_return_val_if_fail (book && E_IS_BOOK (book), FALSE);
@@ -3653,10 +3653,10 @@ e_book_is_self (EContact *contact)
  * e_book_set_default_addressbook:
  * @book: An #EBook pointer
  * @error: A #GError pointer
- * 
+ *
  * sets the #ESource of the #EBook as the "default" addressbook.  This is the source
  * that will be loaded in the e_book_get_default_addressbook call.
- * 
+ *
  * Return value: %TRUE if the setting was stored in libebook's ESourceList, otherwise %FALSE.
  */
 gboolean
@@ -3677,10 +3677,10 @@ e_book_set_default_addressbook (EBook *book, GError **error)
  * e_book_set_default_source:
  * @source: An #ESource pointer
  * @error: A #GError pointer
- * 
+ *
  * sets @source as the "default" addressbook.  This is the source that
  * will be loaded in the e_book_get_default_addressbook call.
- * 
+ *
  * Return value: %TRUE if the setting was stored in libebook's ESourceList, otherwise %FALSE.
  */
 gboolean
@@ -3747,7 +3747,7 @@ gboolean
 e_book_get_addressbooks (ESourceList **addressbook_sources, GError **error)
 {
        GConfClient *gconf;
-       
+
        e_return_error_if_fail (addressbook_sources, E_BOOK_ERROR_INVALID_ARG, FALSE);
 
        gconf = gconf_client_get_default();
@@ -3907,7 +3907,7 @@ e_book_new_system_addressbook    (GError **error)
                uri = g_filename_to_uri (filename, NULL, NULL);
 
                g_free (filename);
-       
+
                book = e_book_new_from_uri (uri, error);
 
                g_free (uri);
@@ -4025,7 +4025,7 @@ e_book_dispose (GObject *object)
                        bonobo_object_unref (book->priv->listener);
                        book->priv->listener = NULL;
                }
-               
+
                g_free (book->priv->cap);
 
                g_free (book->priv->uri);
@@ -4071,7 +4071,7 @@ e_book_class_init (EBookClass *klass)
                              g_cclosure_marshal_VOID__BOOLEAN,
                              G_TYPE_NONE, 1,
                              G_TYPE_BOOLEAN);
-       
+
        e_book_signals [CONNECTION_STATUS] =
                g_signal_new ("connection_status",
                              G_OBJECT_CLASS_TYPE (object_class),
index 07b6a6d..c5d6eb5 100644 (file)
@@ -66,7 +66,7 @@ typedef struct {
        const char *vcard_field_name;
        const char *field_name;      /* non translated */
        const char *pretty_name;     /* translated */
-       
+
        gboolean read_only;
 
        int list_elem;
@@ -159,7 +159,7 @@ static const EContactFieldInfo field_info[] = {
        ATTR_TYPE_STR_FIELD  (E_CONTACT_PHONE_TELEX,        EVC_TEL, "telex",             N_("Telex"),            FALSE, EVC_X_TELEX,     0),
        /* To translators: TTY is Teletypewriter */
        ATTR_TYPE_STR_FIELD  (E_CONTACT_PHONE_TTYTDD,       EVC_TEL, "tty",               N_("TTY"),              FALSE, EVC_X_TTYTDD,    0),
-       
+
        /* Organizational fields */
        LIST_ELEM_STR_FIELD (E_CONTACT_ORG,      EVC_ORG, "org",      N_("Organization"),        FALSE, 0),
        LIST_ELEM_STR_FIELD (E_CONTACT_ORG_UNIT, EVC_ORG, "org_unit", N_("Organizational Unit"), FALSE, 1),
@@ -325,7 +325,7 @@ e_contact_class_init (EContactClass *klass)
 
                /* Verify the table is correctly ordered */
                g_assert (i == field_info[i].field_id);
-               
+
                if (field_info[i].t & E_CONTACT_FIELD_TYPE_STRING)
                        pspec = g_param_spec_string (field_info[i].field_name,
                                                     _(field_info[i].pretty_name),
@@ -430,7 +430,7 @@ geo_getter (EContact *contact, EVCardAttribute *attr)
 static void
 geo_setter (EContact *contact, EVCardAttribute *attr, void *data)
 {
-       EContactGeo *geo = data;        
+       EContactGeo *geo = data;
        char buf[G_ASCII_DTOSTR_BUF_SIZE];
 
        e_vcard_attribute_add_value
@@ -447,19 +447,19 @@ photo_getter (EContact *contact, EVCardAttribute *attr)
 
        if (!attr)
                return NULL;
-       
+
        values = e_vcard_attribute_get_param (attr, EVC_ENCODING);
        if (values && (g_ascii_strcasecmp (values->data, "b") == 0 ||
                       /* second for photo vCard 2.1 support */
                       g_ascii_strcasecmp (values->data, "base64") == 0)) {
-               values = e_vcard_attribute_get_values_decoded (attr);   
+               values = e_vcard_attribute_get_values_decoded (attr);
                if (values && values->data) {
                        GString *s = values->data;
                        EContactPhoto *photo;
-                       
+
                        if (!s->len)
                                return NULL;
-                       
+
                        photo = g_new0 (EContactPhoto, 1);
                        photo->type = E_CONTACT_PHOTO_TYPE_INLINED;
                        photo->data.inlined.length = s->len;
@@ -493,7 +493,7 @@ photo_setter (EContact *contact, EVCardAttribute *attr, void *data)
        switch (photo->type) {
        case E_CONTACT_PHOTO_TYPE_INLINED:
                g_return_if_fail (photo->data.inlined.length > 0);
-               
+
                e_vcard_attribute_add_param_with_value (attr,
                                                        e_vcard_attribute_param_new (EVC_ENCODING),
                                                        "b");
@@ -505,7 +505,7 @@ photo_setter (EContact *contact, EVCardAttribute *attr, void *data)
                e_vcard_attribute_add_param_with_value (attr,
                                                        e_vcard_attribute_param_new (EVC_TYPE),
                                                        image_type);
-               
+
                e_vcard_attribute_add_value_decoded (attr, (char*)photo->data.inlined.data, photo->data.inlined.length);
                break;
        case E_CONTACT_PHOTO_TYPE_URI:
@@ -714,7 +714,7 @@ cert_getter (EContact *contact, EVCardAttribute *attr)
           up via NSS, but that would require the additional NSS dep
           here, and we'd have more than one process opening the
           certdb, which is bad.  *sigh* */
-       
+
        return NULL;
 }
 
@@ -801,8 +801,8 @@ e_contact_set_property (GObject *object,
                                else {
                                        /* we didn't find it - add a new attribute */
                                        attr = e_vcard_attribute_new (NULL, info->vcard_field_name);
-                                       if (!strcmp(info->vcard_field_name, "EMAIL") && 
-                                           !info->attr_type1 && 
+                                       if (!strcmp(info->vcard_field_name, "EMAIL") &&
+                                           !info->attr_type1 &&
                                            !info->attr_type2) {
                                                /* Add default type */
                                                e_vcard_attribute_add_param_with_value ( attr,
@@ -936,7 +936,7 @@ e_contact_set_property (GObject *object,
                                attr = e_vcard_attribute_new (NULL, info->vcard_field_name);
                                e_vcard_add_attribute (E_VCARD (contact), attr);
                        }
-                       
+
                        values = e_vcard_attribute_get_values (attr);
                        p = g_list_nth (values, info->list_elem);
 
@@ -1166,13 +1166,13 @@ e_contact_get_property (GObject *object,
 {
        const EContactFieldInfo *info = NULL;
        gpointer data;
-       
+
        if (prop_id < 1 || prop_id >= E_CONTACT_FIELD_LAST) {
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                g_value_reset (value);
                return;
        }
-       
+
        info = &field_info[prop_id];
        data = e_contact_get (E_CONTACT (object), prop_id);
 
@@ -1213,7 +1213,7 @@ e_contact_new (void)
 /**
  * e_contact_new_from_vcard:
  * @vcard: a string representing a vcard
- * 
+ *
  * Creates a new #EContact based on a vcard.
  *
  * Return value: A new #EContact.
@@ -1348,7 +1348,7 @@ e_contact_vcard_attribute  (EContactField field_id)
 /**
  * e_contact_field_id:
  * @field_name: a string representing a contact field
- * 
+ *
  * Gets the #EContactField corresponding to the @field_name.
  *
  * Return value: An #EContactField corresponding to @field_name, or %0 if it doesn't exist.
@@ -1379,7 +1379,7 @@ gpointer
 e_contact_get (EContact *contact, EContactField field_id)
 {
        const EContactFieldInfo *info = NULL;
+
        g_return_val_if_fail (contact && E_IS_CONTACT (contact), NULL);
        g_return_val_if_fail (field_id >= 1 && field_id <= E_CONTACT_FIELD_LAST, NULL);
 
@@ -1412,10 +1412,10 @@ e_contact_get (EContact *contact, EContactField field_id)
 
                        if (attr) {
                                GList *v;
-                               
+
                                v = e_vcard_attribute_get_values (attr);
                                v = g_list_nth (v, info->list_elem);
-                               
+
                                return v ? g_strdup (v->data) : NULL;
                        }
                }
@@ -1727,15 +1727,15 @@ e_contact_name_from_string (const char *name_str)
        g_return_val_if_fail (name_str != NULL, NULL);
 
        western = e_name_western_parse (name_str ? name_str : "");
-       
+
        name->prefixes   = g_strdup (western->prefix);
        name->given      = g_strdup (western->first );
        name->additional = g_strdup (western->middle);
        name->family     = g_strdup (western->last  );
        name->suffixes   = g_strdup (western->suffix);
-       
+
        e_name_western_free(western);
-       
+
        return name;
 }
 
@@ -1755,13 +1755,13 @@ e_contact_name_copy (EContactName *n)
        g_return_val_if_fail (n != NULL, NULL);
 
        name = e_contact_name_new();
-       
+
        name->prefixes   = g_strdup (n->prefixes);
        name->given      = g_strdup (n->given);
        name->additional = g_strdup (n->additional);
        name->family     = g_strdup (n->family);
        name->suffixes   = g_strdup (n->suffixes);
-       
+
        return name;
 }
 
@@ -1821,7 +1821,7 @@ e_contact_date_from_string (const char *str)
                length = t - str;
        else
                length = strlen(str);
-       
+
        if (length == 10 ) {
                date->year = str[0] * 1000 + str[1] * 100 + str[2] * 10 + str[3] - '0' * 1111;
                date->month = str[5] * 10 + str[6] - '0' * 11;
@@ -1831,7 +1831,7 @@ e_contact_date_from_string (const char *str)
                date->month = str[4] * 10 + str[5] - '0' * 11;
                date->day = str[6] * 10 + str[7] - '0' * 11;
        }
-       
+
        return date;
 }
 
@@ -1847,7 +1847,7 @@ e_contact_date_from_string (const char *str)
 char *
 e_contact_date_to_string (EContactDate *dt)
 {
-       if (dt) 
+       if (dt)
                return g_strdup_printf ("%04d-%02d-%02d",
                                        CLAMP(dt->year, 1000, 9999),
                                        CLAMP(dt->month, 1, 12),
@@ -1921,7 +1921,7 @@ e_contact_date_get_type (void)
 
 /**
  * e_contact_date_new:
- * 
+ *
  * Creates a new #EContactDate struct.
  *
  * Return value: A new #EContactDate struct.
@@ -1943,7 +1943,7 @@ e_contact_photo_free (EContactPhoto *photo)
 {
        if (!photo)
                return;
-       
+
        switch (photo->type) {
        case E_CONTACT_PHOTO_TYPE_INLINED:
                g_free (photo->data.inlined.mime_type);
index 7f1dec7..02ee929 100644 (file)
@@ -170,7 +170,7 @@ typedef enum {
        E_CONTACT_IM_YAHOO,      /* Multi-valued */
        E_CONTACT_IM_MSN,        /* Multi-valued */
        E_CONTACT_IM_ICQ,        /* Multi-valued */
-       
+
        E_CONTACT_WANTS_HTML,    /* boolean field */
 
        /* fields used for describing contact lists.  a contact list
@@ -194,8 +194,8 @@ typedef enum {
        E_CONTACT_IM_GADUGADU_WORK_3,  /* Synthetic string field */
 
        E_CONTACT_IM_GADUGADU,   /* Multi-valued */
-       
-       E_CONTACT_GEO,  /* structured field (EContactGeo) */    
+
+       E_CONTACT_GEO,  /* structured field (EContactGeo) */
 
        E_CONTACT_TEL, /* list of strings */
 
index b4c2dba..1b810e7 100644 (file)
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
- * 
+ *
  * 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 Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
@@ -120,7 +120,7 @@ e_destination_dispose (GObject *obj)
 
        if (dest->priv) {
                e_destination_clear (dest);
-         
+
                g_free (dest->priv);
                dest->priv = NULL;
        }
@@ -249,16 +249,16 @@ e_destination_clear (EDestination *dest)
 
        g_free (dest->priv->raw);
        dest->priv->raw = NULL;
-       
+
        g_free (dest->priv->name);
        dest->priv->name = NULL;
-       
+
        g_free (dest->priv->email);
        dest->priv->email = NULL;
-       
+
        g_free (dest->priv->addr);
        dest->priv->addr = NULL;
-       
+
        g_free (dest->priv->textrep);
        dest->priv->textrep = NULL;
 
@@ -267,7 +267,7 @@ e_destination_clear (EDestination *dest)
                dest->priv->contact = NULL;
        }
        dest->priv->email_num = -1;
-       
+
        g_list_foreach (dest->priv->list_dests, (GFunc) g_object_unref, NULL);
        g_list_free (dest->priv->list_dests);
        dest->priv->list_dests = NULL;
@@ -303,9 +303,9 @@ e_destination_empty (const EDestination *dest)
        struct _EDestinationPrivate *p;
 
        g_return_val_if_fail (E_IS_DESTINATION (dest), TRUE);
-       
+
        p = dest->priv;
-       
+
        return !(p->contact != NULL
                 || (p->source_uid && *p->source_uid)
                 || (p->contact_uid && *p->contact_uid)
@@ -330,34 +330,34 @@ e_destination_equal (const EDestination *a, const EDestination *b)
 {
        const struct _EDestinationPrivate *pa, *pb;
        const char *na, *nb;
-       
+
        g_return_val_if_fail (E_IS_DESTINATION (a), FALSE);
        g_return_val_if_fail (E_IS_DESTINATION (b), FALSE);
 
        if (a == b)
                return TRUE;
-       
+
        pa = a->priv;
        pb = b->priv;
-       
+
        /* Check equality of contacts. */
        if (pa->contact || pb->contact) {
                if (! (pa->contact && pb->contact))
                        return FALSE;
-               
+
                if (pa->contact == pb->contact || !strcmp (e_contact_get_const (pa->contact, E_CONTACT_UID),
                                                           e_contact_get_const (pb->contact, E_CONTACT_UID)))
                        return TRUE;
-               
+
                return FALSE;
        }
-       
+
        /* Just in case name returns NULL */
        na = e_destination_get_name (a);
        nb = e_destination_get_name (b);
        if ((na || nb) && !(na && nb && ! utf8_casefold_collate (na, nb)))
                return FALSE;
-       
+
        if (!g_ascii_strcasecmp (e_destination_get_email (a), e_destination_get_email (b)))
                return TRUE;
        else
@@ -469,10 +469,10 @@ e_destination_set_contact (EDestination *dest, EContact *contact, gint email_num
                dest->priv->contact_uid = e_contact_get (dest->priv->contact, E_CONTACT_UID);
 
                dest->priv->email_num = email_num;
-       
-               g_signal_emit (dest, signals [CHANGED], 0);             
+
+               g_signal_emit (dest, signals [CHANGED], 0);
        }
-       
+
 }
 
 /**
@@ -515,15 +515,15 @@ e_destination_set_contact_uid (EDestination *dest, const char *uid, gint email_n
 {
        g_return_if_fail (dest && E_IS_DESTINATION (dest));
        g_return_if_fail (uid != NULL);
-       
+
        if (dest->priv->contact_uid == NULL
            || strcmp (dest->priv->contact_uid, uid)
            || dest->priv->email_num != email_num) {
-               
+
                g_free (dest->priv->contact_uid);
                dest->priv->contact_uid = g_strdup (uid);
                dest->priv->email_num = email_num;
-               
+
                /* If we already have a contact, remove it unless it's uid matches the one
                   we just set. */
                if (dest->priv->contact && strcmp (uid,
@@ -541,7 +541,7 @@ e_destination_set_source_uid (EDestination *dest, const char *uid)
 {
        g_return_if_fail (dest && E_IS_DESTINATION (dest));
        g_return_if_fail (uid != NULL);
-       
+
        if (dest->priv->source_uid == NULL
            || strcmp (dest->priv->source_uid, uid)) {
 
@@ -565,7 +565,7 @@ e_destination_set_name (EDestination *dest, const char *name)
        gboolean changed = FALSE;
 
        g_return_if_fail (E_IS_DESTINATION (dest));
-       
+
        if (name == NULL) {
                if (dest->priv->name != NULL) {
                        g_free (dest->priv->name);
@@ -577,7 +577,7 @@ e_destination_set_name (EDestination *dest, const char *name)
                dest->priv->name = g_strdup (name);
                changed = TRUE;
        }
-       
+
        if (changed) {
                g_free (dest->priv->addr);
                dest->priv->addr = NULL;
@@ -601,7 +601,7 @@ e_destination_set_email (EDestination *dest, const char *email)
        gboolean changed = FALSE;
 
        g_return_if_fail (E_IS_DESTINATION (dest));
-       
+
        if (email == NULL) {
                if (dest->priv->email != NULL) {
                        g_free (dest->priv->addr);
@@ -613,7 +613,7 @@ e_destination_set_email (EDestination *dest, const char *email)
                dest->priv->email = g_strdup (email);
                changed = TRUE;
        }
-       
+
        if (changed) {
                g_free (dest->priv->addr);
                dest->priv->addr = NULL;
@@ -645,7 +645,7 @@ gboolean
 e_destination_is_auto_recipient (const EDestination *dest)
 {
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
-       
+
        return dest->priv->auto_recipient;
 }
 
@@ -653,7 +653,7 @@ e_destination_is_auto_recipient (const EDestination *dest)
  * e_destination_set_auto_recipient:
  * @dest: an #EDestination
  * @value: the auto recipient flag
- * 
+ *
  * Sets the flag indicating if @dest is an automatic recipient, meaning
  * it was not explicitly specified by the user. This can be used
  * to hide it from some UI elements.
@@ -662,7 +662,7 @@ void
 e_destination_set_auto_recipient (EDestination *dest, gboolean value)
 {
        g_return_if_fail (dest && E_IS_DESTINATION (dest));
-       
+
        dest->priv->auto_recipient = value;
 
        g_signal_emit (dest, signals [CHANGED], 0);
@@ -680,7 +680,7 @@ EContact *
 e_destination_get_contact (const EDestination *dest)
 {
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        return dest->priv->contact;
 }
 
@@ -696,7 +696,7 @@ const char *
 e_destination_get_contact_uid (const EDestination *dest)
 {
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        return dest->priv->contact_uid;
 }
 
@@ -730,17 +730,17 @@ gint
 e_destination_get_email_num (const EDestination *dest)
 {
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), -1);
-       
+
        if (dest->priv->contact == NULL && (dest->priv->source_uid == NULL || dest->priv->contact_uid == NULL))
                return -1;
-       
+
        return dest->priv->email_num;
 }
 
 /**
  * e_destination_get_name:
  * @dest: an #EDestination
- * 
+ *
  * Gets the full name of @dest's addressee, or if the addressee is
  * a contact list, the name the list was filed under.
  *
@@ -752,18 +752,18 @@ e_destination_get_name (const EDestination *dest)
        struct _EDestinationPrivate *priv;
 
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
-       
+
        if (priv->name == NULL) {
                if (priv->contact != NULL) {
                        priv->name = e_contact_get (priv->contact, E_CONTACT_FULL_NAME);
-                       
+
                        if (priv->name == NULL || *priv->name == '\0') {
                                g_free (priv->name);
                                priv->name = e_contact_get (priv->contact, E_CONTACT_FILE_AS);
                        }
-                       
+
                        if (priv->name == NULL || *priv->name == '\0') {
                                g_free (priv->name);
                                if (e_contact_get (priv->contact, E_CONTACT_IS_LIST))
@@ -777,15 +777,15 @@ e_destination_get_name (const EDestination *dest)
 
                        if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
                                const char *camel_name = NULL;
-                               
+
                                camel_internet_address_get (addr, 0, &camel_name, NULL);
                                priv->name = g_strdup (camel_name);
                        }
-                       
+
                        camel_object_unref (CAMEL_OBJECT (addr));
                }
        }
-       
+
        return priv->name;
 }
 
@@ -828,11 +828,11 @@ const char *
 e_destination_get_email (const EDestination *dest)
 {
        struct _EDestinationPrivate *priv;
-       
+
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
-       
+
        if (priv->email == NULL) {
                if (priv->contact != NULL) {
                        /* Pull the address out of the card. */
@@ -842,30 +842,30 @@ e_destination_get_email (const EDestination *dest)
 
                                if (e)
                                        priv->email = g_strdup (e);
-                       } 
+                       }
                        if (email) {
                                g_list_foreach (email, (GFunc)g_free, NULL);
                                g_list_free (email);
                        }
-                       
+
                } else if (priv->raw != NULL) {
                        CamelInternetAddress *addr = camel_internet_address_new ();
-                       
+
                        if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
                                const char *camel_email = NULL;
                                camel_internet_address_get (addr, 0, NULL, &camel_email);
                                priv->email = g_strdup (camel_email);
                        }
-                       
+
                        camel_object_unref (CAMEL_OBJECT (addr));
-               } 
-               
+               }
+
                /* Force e-mail to be non-null... */
                if (priv->email == NULL) {
                        priv->email = g_strdup ("");
                }
        }
-       
+
        return priv->email;
 }
 
@@ -884,18 +884,18 @@ e_destination_get_address (const EDestination *dest)
        struct _EDestinationPrivate *priv;
 
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
-       
+
        if (priv->addr == NULL) {
                CamelInternetAddress *addr = camel_internet_address_new ();
-               
+
                if (e_destination_is_evolution_list (dest)) {
                        GList *iter = dest->priv->list_dests;
-                       
+
                        while (iter) {
                                EDestination *list_dest = E_DESTINATION (iter->data);
-                               
+
                                if (!e_destination_empty (list_dest) && !list_dest->priv->ignored) {
                                        const char *name, *email;
                                        name = e_destination_get_name (list_dest);
@@ -911,7 +911,7 @@ e_destination_get_address (const EDestination *dest)
                                }
                                iter = g_list_next (iter);
                        }
-                       
+
                        priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
                } else if (priv->raw) {
 
@@ -930,13 +930,13 @@ e_destination_get_address (const EDestination *dest)
                        else /* this case loses i suppose, but there's
                                nothing we can do here */
                                camel_address_decode (CAMEL_ADDRESS (addr), name);
-                       
+
                        priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
                }
-               
+
                camel_object_unref (CAMEL_OBJECT (addr));
        }
-       
+
        return priv->addr;
 }
 
@@ -953,9 +953,9 @@ e_destination_set_raw (EDestination *dest, const char *raw)
 {
        g_return_if_fail (E_IS_DESTINATION (dest));
        g_return_if_fail (raw != NULL);
-       
+
        if (dest->priv->raw == NULL || strcmp (dest->priv->raw, raw)) {
-                       
+
                e_destination_clear (dest);
                dest->priv->raw = g_strdup (raw);
 
@@ -977,34 +977,34 @@ const char *
 e_destination_get_textrep (const EDestination *dest, gboolean include_email)
 {
        const char *name, *email;
-       
+
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        if (dest->priv->raw)
                return dest->priv->raw;
-       
+
        name  = e_destination_get_name (dest);
        email = e_destination_get_email (dest);
-       
+
        if (e_destination_from_contact (dest) && name != NULL && (!include_email || !email || !*email))
                return name;
-       
+
        /* Make sure that our address gets quoted properly */
        if (name && email && dest->priv->textrep == NULL) {
                CamelInternetAddress *addr = camel_internet_address_new ();
-               
+
                camel_internet_address_add (addr, name, email);
                g_free (dest->priv->textrep);
                dest->priv->textrep = camel_address_format (CAMEL_ADDRESS (addr));
                camel_object_unref (CAMEL_OBJECT (addr));
        }
-       
+
        if (dest->priv->textrep != NULL)
                return dest->priv->textrep;
 
        if (email)
                return email;
-       
+
        return "";
 }
 
@@ -1037,10 +1037,10 @@ gboolean
 e_destination_list_show_addresses (const EDestination *dest)
 {
        g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE);
-       
+
        if (dest->priv->contact != NULL)
                return GPOINTER_TO_UINT (e_contact_get (dest->priv->contact, E_CONTACT_LIST_SHOW_ADDRESSES));
-       
+
        return dest->priv->show_addresses;
 }
 
@@ -1057,7 +1057,7 @@ const GList *
 e_destination_list_get_dests (const EDestination *dest)
 {
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        if (!e_destination_is_evolution_list (dest))
                return NULL;
 
@@ -1076,10 +1076,10 @@ gboolean
 e_destination_get_html_mail_pref (const EDestination *dest)
 {
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
-       
+
        if (dest->priv->html_mail_override || dest->priv->contact == NULL)
                return dest->priv->wants_html_mail;
-       
+
        return e_contact_get (dest->priv->contact, E_CONTACT_WANTS_HTML) ? TRUE : FALSE;
 }
 
@@ -1094,7 +1094,7 @@ void
 e_destination_set_html_mail_pref (EDestination *dest, gboolean flag)
 {
        g_return_if_fail (dest && E_IS_DESTINATION (dest));
-       
+
        dest->priv->html_mail_override = TRUE;
        if (dest->priv->wants_html_mail != flag) {
                dest->priv->wants_html_mail = flag;
@@ -1124,11 +1124,11 @@ e_destination_get_textrepv (EDestination **destv)
        char *str;
 
        g_return_val_if_fail (destv, NULL);
-       
+
        /* Q: Please tell me this is only for assertion
            reasons. If this is considered to be ok behavior then you
-           shouldn't use g_return's. Just a reminder ;-) 
-          
+           shouldn't use g_return's. Just a reminder ;-)
+
           A: Yes, this is just an assertion.  (Though it does find the
           length of the vector in the process...)
        */
@@ -1136,7 +1136,7 @@ e_destination_get_textrepv (EDestination **destv)
                g_return_val_if_fail (E_IS_DESTINATION (destv[len]), NULL);
                len++;
        }
-       
+
        strv = g_new0 (char *, len + 1);
        for (i = 0, j = 0; destv[i]; i++) {
                if (!e_destination_empty (destv[i])) {
@@ -1144,11 +1144,11 @@ e_destination_get_textrepv (EDestination **destv)
                        strv[j++] = addr ? (char *) addr : "";
                }
        }
-       
+
        str = g_strjoinv (", ", strv);
-       
+
        g_free (strv);
-       
+
        return str;
 }
 
@@ -1165,22 +1165,22 @@ e_destination_xml_encode (const EDestination *dest)
 {
        xmlNodePtr dest_node;
        const char *str;
-       
+
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        dest_node = xmlNewNode (NULL, (xmlChar*)"destination");
-       
+
        str = e_destination_get_name (dest);
        if (str)
                xmlNewTextChild (dest_node, NULL, (xmlChar*)"name", (xmlChar*)str);
-       
+
        if (!e_destination_is_evolution_list (dest)) {
                str = e_destination_get_email (dest);
                if (str)
                        xmlNewTextChild (dest_node, NULL, (xmlChar*)"email", (xmlChar*)str);
        } else {
                GList *iter = dest->priv->list_dests;
-               
+
                while (iter) {
                        EDestination *list_dest = E_DESTINATION (iter->data);
                        xmlNodePtr list_node = xmlNewNode (NULL, (xmlChar*)"list_entry");
@@ -1191,45 +1191,45 @@ e_destination_xml_encode (const EDestination *dest)
                                xmlNewTextChild (list_node, NULL, (xmlChar*)"name", escaped);
                                xmlFree (escaped);
                        }
-                       
+
                        str = e_destination_get_email (list_dest);
                        if (str) {
                                xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar*)str);
                                xmlNewTextChild (list_node, NULL, (xmlChar*)"email", escaped);
                                xmlFree (escaped);
                        }
-                       
+
                        xmlAddChild (dest_node, list_node);
-                       
+
                        iter = g_list_next (iter);
                }
-               
+
                xmlNewProp (dest_node, (xmlChar*)"is_list", (xmlChar*)"yes");
-               xmlNewProp (dest_node, (xmlChar*)"show_addresses", 
+               xmlNewProp (dest_node, (xmlChar*)"show_addresses",
                            e_destination_list_show_addresses (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
        }
-       
+
        str = e_destination_get_source_uid (dest);
        if (str) {
                xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar*)str);
                xmlNewTextChild (dest_node, NULL, (xmlChar*)"source_uid", escaped);
                xmlFree (escaped);
        }
-       
+
        str = e_destination_get_contact_uid (dest);
        if (str) {
                char buf[16];
-               
+
                xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, (xmlChar*)"card_uid", (xmlChar*)str);
                g_snprintf (buf, 16, "%d", e_destination_get_email_num (dest));
                xmlNewProp (uri_node, (xmlChar*)"email_num", (xmlChar*)buf);
        }
-       
+
        xmlNewProp (dest_node, (xmlChar*)"html_mail", e_destination_get_html_mail_pref (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
-       
+
        xmlNewProp (dest_node, (xmlChar*)"auto_recipient",
                    e_destination_is_auto_recipient (dest) ? (xmlChar*)"yes" : (xmlChar*)"no");
-       
+
        return dest_node;
 }
 
@@ -1255,34 +1255,34 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
        g_return_val_if_fail (node != NULL, FALSE);
-       
+
        if (strcmp ((char*)node->name, "destination"))
                return FALSE;
-       
+
        tmp = (char*)xmlGetProp (node, (xmlChar*)"html_mail");
        if (tmp) {
                html_mail = !strcmp (tmp, "yes");
                xmlFree (tmp);
        }
-       
+
        tmp = (char*)xmlGetProp (node, (xmlChar*)"is_list");
        if (tmp) {
                is_list = !strcmp (tmp, "yes");
                xmlFree (tmp);
        }
-       
+
        tmp = (char*)xmlGetProp (node, (xmlChar*)"show_addresses");
        if (tmp) {
                show_addr = !strcmp (tmp, "yes");
                xmlFree (tmp);
        }
-       
+
        tmp = (char*)xmlGetProp (node, (xmlChar*)"auto_recipient");
        if (tmp) {
                auto_recip = !strcmp (tmp, "yes");
                xmlFree (tmp);
        }
-       
+
        node = node->xmlChildrenNode;
        while (node) {
                if (!strcmp ((char*)node->name, "name")) {
@@ -1298,7 +1298,7 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
                } else if (is_list && !strcmp ((char*)node->name, "list_entry")) {
                        xmlNodePtr subnode = node->xmlChildrenNode;
                        char *list_name = NULL, *list_email = NULL;
-                       
+
                        while (subnode) {
                                if (!strcmp ((char*)subnode->name, "name")) {
                                        tmp = (char*)xmlNodeGetContent (subnode);
@@ -1311,21 +1311,21 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
                                        list_email = g_strdup (tmp);
                                        xmlFree (tmp);
                                }
-                               
+
                                subnode = subnode->next;
                        }
-                       
+
                        if (list_name || list_email) {
                                EDestination *list_dest = e_destination_new ();
-                               
+
                                if (list_name)
                                        e_destination_set_name (list_dest, list_name);
                                if (list_email)
                                        e_destination_set_email (list_dest, list_email);
-                               
+
                                g_free (list_name);
                                g_free (list_email);
-                               
+
                                list_dests = g_list_append (list_dests, list_dest);
                        }
                } else if (!strcmp ((char*)node->name, "source_uid")) {
@@ -1338,17 +1338,17 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
                        g_free (card_uid);
                        card_uid = g_strdup (tmp);
                        xmlFree (tmp);
-                       
+
                        tmp = (char*)xmlGetProp (node, (xmlChar*)"email_num");
                        email_num = atoi (tmp);
                        xmlFree (tmp);
                }
-               
+
                node = node->next;
        }
-       
+
        e_destination_clear (dest);
-       
+
        if (name) {
                e_destination_set_name (dest, name);
                g_free (name);
@@ -1367,14 +1367,14 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
        }
        if (list_dests)
                dest->priv->list_dests = list_dests;
-       
+
        dest->priv->html_mail_override = TRUE;
        dest->priv->wants_html_mail = html_mail;
-       
+
        dest->priv->show_addresses = show_addr;
-       
+
        dest->priv->auto_recipient = auto_recip;
-       
+
        return TRUE;
 }
 
@@ -1384,21 +1384,21 @@ null_terminate_and_remove_extra_whitespace (xmlChar *xml_in, gint size)
        gboolean skip_white = FALSE;
        char *xml, *r, *w;
 
-       if (xml_in == NULL || size <= 0) 
+       if (xml_in == NULL || size <= 0)
                return NULL;
-       
+
        xml = g_strndup ((char*)xml_in, size);
        r = w = xml;
-       
+
        while (*r) {
                if (*r == '\n' || *r == '\r') {
                        skip_white = TRUE;
                } else {
                        gunichar c = g_utf8_get_char (r);
                        gboolean is_space = g_unichar_isspace (c);
-                       
+
                        *w = *r;
-                       
+
                        if (!(skip_white && is_space))
                                w++;
                        if (!is_space)
@@ -1406,9 +1406,9 @@ null_terminate_and_remove_extra_whitespace (xmlChar *xml_in, gint size)
                }
                r = g_utf8_next_char (r);
        }
-       
+
        *w = '\0';
-       
+
        return xml;
 }
 
@@ -1430,20 +1430,20 @@ e_destination_export (const EDestination *dest)
        char *str;
 
        g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-       
+
        dest_node = e_destination_xml_encode (dest);
        if (dest_node == NULL)
                return NULL;
-       
+
        dest_doc = xmlNewDoc ((xmlChar*)XML_DEFAULT_VERSION);
        xmlDocSetRootElement (dest_doc, dest_node);
-       
+
        xmlDocDumpMemory (dest_doc, &buffer, &size);
        xmlFreeDoc (dest_doc);
-       
+
        str = null_terminate_and_remove_extra_whitespace (buffer, size);
        xmlFree (buffer);
-       
+
        return str;
 }
 
@@ -1463,7 +1463,7 @@ e_destination_import (const char *str)
 
        if (!(str && *str))
                return NULL;
-       
+
        dest_doc = xmlParseMemory ((char *) str, strlen (str));
        if (dest_doc && dest_doc->xmlRootNode) {
                dest = e_destination_new ();
@@ -1473,7 +1473,7 @@ e_destination_import (const char *str)
                }
        }
        xmlFreeDoc (dest_doc);
-       
+
        return dest;
 }
 
@@ -1496,11 +1496,11 @@ e_destination_exportv (EDestination **destv)
 
        if (destv == NULL || *destv == NULL)
                return NULL;
-       
+
        destv_doc  = xmlNewDoc ((xmlChar*)XML_DEFAULT_VERSION);
        destv_node = xmlNewNode (NULL, (xmlChar*)"destinations");
        xmlDocSetRootElement (destv_doc, destv_node);
-       
+
        for (i = 0; destv[i]; i++) {
                if (! e_destination_empty (destv[i])) {
                        xmlNodePtr dest_node = e_destination_xml_encode (destv[i]);
@@ -1508,13 +1508,13 @@ e_destination_exportv (EDestination **destv)
                                xmlAddChild (destv_node, dest_node);
                }
        }
-       
+
        xmlDocDumpMemory (destv_doc, &buffer, &size);
        xmlFreeDoc (destv_doc);
-       
+
        str = null_terminate_and_remove_extra_whitespace (buffer, size);
        xmlFree (buffer);
-       
+
        return str;
 }
 
@@ -1534,45 +1534,45 @@ e_destination_importv (const char *str)
        xmlDocPtr destv_doc;
        xmlNodePtr node;
        EDestination **destv = NULL;
-       
+
        if (!(str && *str))
                return NULL;
-       
+
        destv_doc = xmlParseMemory ((char *)str, strlen (str));
        if (destv_doc == NULL)
                return NULL;
-       
+
        node = destv_doc->xmlRootNode;
-       
+
        if (strcmp ((char*)node->name, "destinations"))
                goto finished;
-       
+
        node = node->xmlChildrenNode;
-       
+
        dest_array = g_ptr_array_new ();
-       
+
        while (node) {
                EDestination *dest;
-               
+
                dest = e_destination_new ();
                if (e_destination_xml_decode (dest, node) && !e_destination_empty (dest)) {
                        g_ptr_array_add (dest_array, dest);
                } else {
                        g_object_unref (dest);
                }
-               
+
                node = node->next;
        }
-       
+
        /* we need destv to be NULL terminated */
        g_ptr_array_add (dest_array, NULL);
-       
+
        destv = (EDestination **) dest_array->pdata;
        g_ptr_array_free (dest_array, FALSE);
-       
+
  finished:
        xmlFreeDoc (destv_doc);
-       
+
        return destv;
 }
 
@@ -1586,7 +1586,7 @@ void
 e_destination_freev (EDestination **destv)
 {
        int i;
-       
+
        if (destv) {
                for (i = 0; destv[i] != NULL; ++i) {
                        g_object_unref (destv[i]);
index 710cf27..7b7391f 100644 (file)
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
- * 
+ *
  * 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 Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
index 8f1f66c..d865e2e 100644 (file)
@@ -14,7 +14,7 @@
 #include <ctype.h>
 #include <string.h>
 #include <glib.h>
+
 #include "e-name-western.h"
 #include "e-name-western-tables.h"
 
@@ -107,7 +107,7 @@ e_name_western_get_words_at_idx (char *str, int idx, int num_words)
 
 /*
  * What the fuck is wrong with glib's MAX macro.
- */ 
+ */
 static int
 e_name_western_max (const int a, const int b)
 {
@@ -173,7 +173,7 @@ e_name_western_get_one_prefix_at_str (char *str)
         */
        word = e_name_western_get_words_at_idx (str, 0, 1);
 
-       if (g_utf8_strlen (word, -1) > 2 && 
+       if (g_utf8_strlen (word, -1) > 2 &&
            g_unichar_isalpha (g_utf8_get_char (word)) &&
            g_unichar_isalpha (g_utf8_get_char (g_utf8_next_char (word))) &&
            word [strlen (word) - 1] == '.')
@@ -318,14 +318,14 @@ e_name_western_extract_middle (ENameWestern *name, ENameWesternIdxs *idxs)
        middle = g_utf8_next_char (middle);
        if (*middle == '\0')
                return;
-       
+
        /*
         * Search for the first space (or the terminating \0)
         */
        while (g_unichar_isspace (g_utf8_get_char (middle)) &&
               *middle != '\0')
                middle = g_utf8_next_char (middle);
-               
+
        if (*middle == '\0')
                return;
 
@@ -338,7 +338,7 @@ e_name_western_extract_middle (ENameWestern *name, ENameWesternIdxs *idxs)
 
                middle = name->full + idxs->nick_idx + strlen (name->nick);
                middle = g_utf8_next_char (middle);
-               
+
                while (g_unichar_isspace (g_utf8_get_char (middle)) &&
                       *middle != '\0')
                        middle = g_utf8_next_char (middle);
@@ -372,7 +372,7 @@ e_name_western_extract_middle (ENameWestern *name, ENameWesternIdxs *idxs)
                g_free (word);
                return;
        }
-       
+
        idxs->middle_idx = middle - name->full;
        name->middle = word;
 }
@@ -556,7 +556,7 @@ e_name_western_get_suffix_at_str_end (char *str)
                        break;
                }
                nextp = g_utf8_prev_char (nextp);
-               
+
                e_name_western_cleanup_string (& word);
 
                if (e_name_western_word_is_suffix (word)) {
@@ -642,7 +642,7 @@ e_name_western_reorder_asshole (ENameWestern *name, ENameWesternIdxs *idxs)
         * to
         *    <Prefix> <First name> <Middle[+nick] name> <Last name> <Suffix>
         */
-       
+
        /*
         * Grab the prefix from the beginning.
         */
@@ -660,11 +660,11 @@ e_name_western_reorder_asshole (ENameWestern *name, ENameWesternIdxs *idxs)
 
        while (g_unichar_isspace (g_utf8_get_char (p)) && *p != '\0')
                p = g_utf8_next_char (p);
-       
-       /* 
+
+       /*
           Consider this case, "Br.Gate,Br. Gate,W". I know this is a damn
           random name, but, I got this from the bug report of 317411.
-          
+
           comma = ",Br.Gate,W"
           prefix = "Br.Gate,Br."
           p = " Gate,W"
@@ -677,7 +677,7 @@ e_name_western_reorder_asshole (ENameWestern *name, ENameWesternIdxs *idxs)
                g_free (prefix);
                return;
        }
-       
+
        last = g_malloc0 (comma - p + 1);
        strncpy (last, p, comma - p);
 
@@ -1007,7 +1007,7 @@ e_name_western_free (ENameWestern *w)
        g_free (w->nick);
        g_free (w->last);
        g_free (w->suffix);
-       
+
        g_free (w->full);
 
        g_free (w);
index 6956412..453f7b1 100644 (file)
@@ -34,7 +34,7 @@
 
 #define CRLF "\r\n"
 
-/** Encoding used in v-card 
+/** Encoding used in v-card
  *  Note: v-card spec defines additional 7BIT 8BIT and X- encoding
  */
 typedef enum {
@@ -127,14 +127,14 @@ e_vcard_get_type (void)
 
 
 /*  Skip newline characters and return the next character.
- *  This function takes care of folding lines, skipping 
+ *  This function takes care of folding lines, skipping
  *  newline characters if found, taking care of equal characters
  *  and other strange things.
  */
 static char*
 skip_newline (char *str, gboolean quoted_printable)
 {
-       char *p; 
+       char *p;
        char *next;
        char *next2;
        p = str;
@@ -231,7 +231,7 @@ read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable
        /* read in the value */
        str = g_string_new ("");
        for( lp =  skip_newline( *p, quoted_printable );
-            *lp != '\n' && *lp != '\r' && *lp != '\0'; 
+            *lp != '\n' && *lp != '\r' && *lp != '\0';
             lp = skip_newline( lp, quoted_printable ) ) {
 
                if (*lp == '=' && quoted_printable) {
@@ -246,15 +246,15 @@ read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable
 
                                c = (((a>='a'?a-'a'+10:a-'0')&0x0f) << 4)
                                        | ((b>='a'?b-'a'+10:b-'0')&0x0f);
-                               
+
                                g_string_append_c (str, c); /* add decoded byte (this is not a unicode yet) */
                        }
-                       else 
+                       else
                                {
                                        g_string_append_c (str, a);
                                        g_string_append_c (str, b);
                                }
-                       
+
                        lp++;
 
                } else if (*lp == '\\') {
@@ -318,7 +318,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
 
        str = g_string_new ("");
        for( lp =  skip_newline( *p, *quoted_printable );
-            *lp != '\n' && *lp != '\r' && *lp != '\0'; 
+            *lp != '\n' && *lp != '\r' && *lp != '\0';
             lp = skip_newline( lp, *quoted_printable ) ) {
 
                if (*lp == '"') {
@@ -349,7 +349,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
                                } else if (*lp == ':') {
                                        /* do nothing */
 
-                               } else {                                
+                               } else {
                                        skip_to_next_line( &lp );
                                        break;
                                }
@@ -421,7 +421,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
                                else {
                                        /* we've got an attribute with a truly empty
                                           attribute parameter.  So it's of the form:
-                                          
+
                                           ATTR;[PARAM=value;]*;[PARAM=value;]*:
 
                                           (note the extra ';')
@@ -446,7 +446,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
                        g_warning ("invalid character found in parameter spec");
                        g_string_assign (str, "");
                        /*                      skip_until (&lp, ":;"); */
-                       
+
                        skip_to_next_line( &lp );
                }
        }
@@ -472,7 +472,7 @@ read_attribute (char **p)
        /* first read in the group/name */
        str = g_string_new ("");
        for( lp =  skip_newline( *p, is_qp );
-            *lp != '\n' && *lp != '\r' && *lp != '\0'; 
+            *lp != '\n' && *lp != '\r' && *lp != '\0';
             lp = skip_newline( lp, is_qp ) ) {
 
                if (*lp == ':' || *lp == ';') {
@@ -562,34 +562,34 @@ make_valid_utf8 (const gchar *name)
        GString *string;
        const gchar *remainder, *invalid;
        gint remaining_bytes, valid_bytes;
-  
+
        string = NULL;
        remainder = name;
        remaining_bytes = strlen (name);
-  
+
        while (remaining_bytes != 0) {
-               if (g_utf8_validate (remainder, remaining_bytes, &invalid)) 
+               if (g_utf8_validate (remainder, remaining_bytes, &invalid))
                        break;
              valid_bytes = invalid - remainder;
-    
-               if (string == NULL) 
+
+               if (string == NULL)
                        string = g_string_sized_new (remaining_bytes);
 
                g_string_append_len (string, remainder, valid_bytes);
                /* append U+FFFD REPLACEMENT CHARACTER */
                g_string_append (string, "\357\277\275");
-      
+
                remaining_bytes -= valid_bytes + 1;
                remainder = invalid + 1;
        }
-  
+
        if (string == NULL)
                return g_strdup (name);
-  
+
        g_string_append (string, remainder);
 
         g_assert (g_utf8_validate (string->str, -1, NULL));
-  
+
         return g_string_free (string, FALSE);
 }
 
@@ -603,7 +603,7 @@ parse (EVCard *evc, const char *str)
        char *buf ;
        char *p;
        EVCardAttribute *attr;
-       
+
        buf = make_valid_utf8 (str);
 
        //buf = fold_lines (buf);
@@ -747,7 +747,7 @@ e_vcard_construct (EVCard *evc, const char *str)
 
 /**
  * e_vcard_new:
- * 
+ *
  * Creates a new, blank #EVCard.
  *
  * Return value: A new, blank #EVCard.
@@ -1060,7 +1060,7 @@ e_vcard_attribute_copy (EVCardAttribute *attr)
  * @attr_group: group name of attributes to be removed
  * @attr_name: name of the arributes to be removed
  *
- * Removes all the attributes with group name and attribute name equal to 
+ * Removes all the attributes with group name and attribute name equal to
  * passed in values. If @attr_group is %NULL or an empty string,
  * it removes all the attributes with passed in name irrespective of
  * their group names.
@@ -1298,7 +1298,7 @@ e_vcard_attribute_remove_value (EVCardAttribute *attr, const char *s)
        if (l == NULL) {
                return;
        }
-       
+
        attr->values = g_list_delete_link (attr->values, l);
 }
 
@@ -1319,7 +1319,7 @@ e_vcard_attribute_remove_param (EVCardAttribute *attr, const char *param_name)
 
        g_return_if_fail (attr != NULL);
        g_return_if_fail (param_name != NULL);
-       
+
        for (l = attr->params; l; l = l->next) {
                param = l->data;
                if (g_ascii_strcasecmp (e_vcard_attribute_param_get_name (param),
@@ -1437,7 +1437,7 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
        contains = FALSE;
        params = attr->params;
        par_name = param->name;
+
        for (p = params; p; p = p->next) {
                EVCardAttributeParam *param2 = p->data;
                if (g_ascii_strcasecmp (param2->name, par_name) == 0) {
@@ -1472,7 +1472,7 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
                        break;
                }
        }
-       
+
        if (!contains) {
                attr->params = g_list_prepend (attr->params, param);
        }
@@ -1645,7 +1645,7 @@ e_vcard_attribute_remove_param_value (EVCardAttribute *attr, const char *param_n
                        if (l == NULL) {
                                return;
                        }
-                       
+
                        param->values = g_list_delete_link (param->values, l);
                        if (param->values == NULL) {
                                e_vcard_attribute_param_free (param);
@@ -1697,7 +1697,7 @@ e_vcard_get_attribute (EVCard     *evc,
         attrs = e_vcard_get_attributes (evc);
         for (l = attrs; l; l = l->next) {
                 EVCardAttribute *attr;
-               
+
                 attr = (EVCardAttribute *) l->data;
                 if (strcmp (attr->name, name) == 0)
                         return attr;
@@ -1743,7 +1743,7 @@ e_vcard_attribute_get_name (EVCardAttribute *attr)
  *
  * Gets the list of values from @attr. The list and its
  * contents are owned by @attr, and must not be freed.
- * 
+ *
  * Return value: A list of string values.
  **/
 GList*
@@ -1910,7 +1910,7 @@ e_vcard_attribute_has_type (EVCardAttribute *attr, const char *typestr)
 /**
  * e_vcard_attribute_get_params:
  * @attr: an #EVCardAttribute
- * 
+ *
  * Gets the list of parameters from @attr. The list and its
  * contents are owned by @attr, and must not be freed.
  *
@@ -1928,7 +1928,7 @@ e_vcard_attribute_get_params (EVCardAttribute *attr)
  * e_vcard_attribute_get_param:
  * @attr: an #EVCardAttribute
  * @name: a parameter name
- * 
+ *
  * Gets the list of values for the paramater @name from @attr. The list and its
  * contents are owned by @attr, and must not be freed.
  *
@@ -1938,10 +1938,10 @@ GList *
 e_vcard_attribute_get_param (EVCardAttribute *attr, const char *name)
 {
        GList *params, *p;
-       
+
        g_return_val_if_fail (attr != NULL, NULL);
        g_return_val_if_fail (name != NULL, NULL);
-       
+
        params = e_vcard_attribute_get_params (attr);
 
        for (p = params; p; p = p->next) {
@@ -1973,7 +1973,7 @@ e_vcard_attribute_param_get_name (EVCardAttributeParam *param)
 /**
  * e_vcard_attribute_param_get_values:
  * @param: an #EVCardAttributeParam
- * 
+ *
  * Gets the list of values from @param. The list and its
  * contents are owned by @param, and must not be freed.
  *
index e1b4934..39c441b 100644 (file)
@@ -126,7 +126,7 @@ e_book_backend_cache_finalize (GObject *object)
                        g_free (priv->uri);
                        priv->uri = NULL;
                }
-       
+
 
                g_free (priv);
                cache->priv = NULL;
@@ -148,7 +148,7 @@ e_book_backend_cache_constructor (GType type,
        obj = parent_class->constructor (type,
                                         n_construct_properties,
                                         construct_properties);
-  
+
        /* extract uid */
        if (!g_ascii_strcasecmp ( g_param_spec_get_name (construct_properties->pspec), "uri")) {
                uri = g_value_get_string (construct_properties->value);
@@ -227,7 +227,7 @@ EBookBackendCache *
 e_book_backend_cache_new (const char *uri)
 {
        EBookBackendCache *cache;
-        
+
                cache = g_object_new (E_TYPE_BOOK_BACKEND_CACHE, "uri", uri, NULL);
 
         return cache;
@@ -256,7 +256,7 @@ e_book_backend_cache_get_contact (EBookBackendCache *cache, const char *uid)
        vcard_str = e_file_cache_get_object (E_FILE_CACHE (cache), uid);
        if (vcard_str) {
                contact = e_contact_new_from_vcard (vcard_str);
-               
+
        }
 
 
@@ -311,7 +311,7 @@ e_book_backend_cache_add_contact (EBookBackendCache *cache,
 gboolean
 e_book_backend_cache_remove_contact (EBookBackendCache *cache,
                                    const char *uid)
-                                     
+
 {
        gboolean retval;
        EBookBackendCachePrivate *priv;
@@ -341,7 +341,7 @@ e_book_backend_cache_remove_contact (EBookBackendCache *cache,
  *
  * Return value: %TRUE if the cache contains the contact, %FALSE otherwise.
  **/
-gboolean 
+gboolean
 e_book_backend_cache_check_contact (EBookBackendCache *cache, const char *uid)
 {
 
@@ -354,7 +354,7 @@ e_book_backend_cache_check_contact (EBookBackendCache *cache, const char *uid)
        priv = cache->priv;
 
        retval = FALSE;
-       if (e_file_cache_get_object (E_FILE_CACHE (cache), uid)) 
+       if (e_file_cache_get_object (E_FILE_CACHE (cache), uid))
                retval = TRUE;
        return retval;
 }
@@ -386,7 +386,7 @@ e_book_backend_cache_get_contacts (EBookBackendCache *cache, const char *query)
                if (!sexp)
                        return NULL;
        }
-       
+
 
         lcache = l = e_file_cache_get_objects (E_FILE_CACHE (cache));
 
@@ -400,7 +400,7 @@ e_book_backend_cache_get_contacts (EBookBackendCache *cache, const char *query)
                        else
                                g_object_unref (contact);
                 }
-                
+
         }
        if (lcache)
                g_slist_free (lcache);
@@ -426,17 +426,17 @@ e_book_backend_cache_search (EBookBackendCache *cache, const char *query)
 {
        GList *matching_contacts, *temp;
        GPtrArray *ptr_array;
-       
+
        matching_contacts = e_book_backend_cache_get_contacts (cache, query);
        ptr_array = g_ptr_array_new ();
-       
+
        temp = matching_contacts;
        for (; matching_contacts != NULL; matching_contacts = g_list_next (matching_contacts)) {
                g_ptr_array_add (ptr_array, e_contact_get (matching_contacts->data, E_CONTACT_UID));
                g_object_unref (matching_contacts->data);
        }
        g_list_free (temp);
-       
+
        return ptr_array;
 }
 
@@ -448,18 +448,18 @@ e_book_backend_cache_search (EBookBackendCache *cache, const char *query)
  *
  * Return value: %TRUE if cache exists, %FALSE if not.
  **/
-gboolean 
+gboolean
 e_book_backend_cache_exists (const char *uri)
 {
        char *file_name;
        gboolean exists = FALSE;
        file_name = get_filename_from_uri (uri);
-       
+
        if (file_name && g_file_test (file_name, G_FILE_TEST_EXISTS)) {
                exists = TRUE;
                g_free (file_name);
        }
-       
+
        return exists;
 }
 
@@ -467,7 +467,7 @@ e_book_backend_cache_exists (const char *uri)
  * e_book_backend_cache_set_populated:
  * @cache: an #EBookBackendCache
  *
- * Flags @cache as being populated - that is, it is up-to-date on the 
+ * Flags @cache as being populated - that is, it is up-to-date on the
  * contents of the book it's caching.
  **/
 void
@@ -475,7 +475,7 @@ e_book_backend_cache_set_populated (EBookBackendCache *cache)
 {
        g_return_if_fail (E_IS_BOOK_BACKEND_CACHE (cache));
        e_file_cache_add_object (E_FILE_CACHE (cache), "populated", "TRUE");
-       
+
 }
 
 /**
@@ -492,7 +492,7 @@ e_book_backend_cache_is_populated (EBookBackendCache *cache)
        g_return_val_if_fail (E_IS_BOOK_BACKEND_CACHE (cache), FALSE);
        if (e_file_cache_get_object (E_FILE_CACHE (cache), "populated"))
                return TRUE;
-       return FALSE;   
+       return FALSE;
 }
 
 void
index ce4d55a..fcdce62 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  *  A class to cache address book conents on local file system
- * 
+ *
  * Copyright (C) 2004 Novell, Inc.
  *
  * Authors: Sivaiah Nallagatla <snallagatla@ximian.com>
index ffe6a1a..b020959 100644 (file)
@@ -28,7 +28,7 @@
 #include "e-book-backend.h"
 #include "e-book-backend-sexp.h"
 
-void 
+void
 string_to_dbt(const char *str, DBT *dbt)
 {
        memset(dbt, 0, sizeof(dbt));
@@ -71,7 +71,7 @@ get_filename_from_uri (const char *uri)
  * Set the filename for db cacahe file.
  **/
 
-void 
+void
 e_book_backend_db_cache_set_filename(DB *db, const char *filename)
 {
        DBT uid_dbt, vcard_dbt;
@@ -84,7 +84,7 @@ e_book_backend_db_cache_set_filename(DB *db, const char *filename)
        if (db_error != 0) {
                g_warning ("db->put failed with %d", db_error);
        }
-       
+
 }
 
 /**
@@ -104,7 +104,7 @@ e_book_backend_db_cache_get_filename(DB *db)
        string_to_dbt ("filename", &uid_dbt);
        memset (&vcard_dbt, 0 , sizeof(vcard_dbt));
        vcard_dbt.flags = DB_DBT_MALLOC;
-       
+
        db_error = db->get (db, NULL, &uid_dbt, &vcard_dbt, 0);
        if (db_error != 0) {
                g_warning ("db-<get failed with %d", db_error);
@@ -140,13 +140,13 @@ e_book_backend_db_cache_get_contact (DB *db, const char *uid)
        string_to_dbt (uid, &uid_dbt);
        memset (&vcard_dbt, 0 , sizeof(vcard_dbt));
        vcard_dbt.flags = DB_DBT_MALLOC;
-       
+
        db_error = db->get (db, NULL, &uid_dbt, &vcard_dbt,0);
-       if (db_error != 0) { 
+       if (db_error != 0) {
                g_warning ("db->get failed with %d", db_error);
                return NULL;
        }
-       
+
        contact = e_contact_new_from_vcard ((const char *)vcard_dbt.data);
        g_free (vcard_dbt.data);
        return contact;
@@ -176,10 +176,10 @@ e_book_backend_db_cache_add_contact (DB *db,
                printf("name:%s, email:%s\n",
                       (char*)e_contact_get (contact, E_CONTACT_GIVEN_NAME),
                       (char*)e_contact_get (contact, E_CONTACT_EMAIL_1));
-               return FALSE; 
+               return FALSE;
        }
        string_to_dbt (uid, &uid_dbt);
-       
+
        vcard_str = e_vcard_to_string (E_VCARD(contact), EVC_FORMAT_VCARD_30);
        string_to_dbt (vcard_str, &vcard_dbt);
 
@@ -188,11 +188,11 @@ e_book_backend_db_cache_add_contact (DB *db,
 
        g_free (vcard_str);
 
-       if (db_error != 0) { 
+       if (db_error != 0) {
                g_warning ("db->put failed with %d", db_error);
                return FALSE;
        }
-       else 
+       else
                return TRUE;
 }
 
@@ -208,7 +208,7 @@ e_book_backend_db_cache_add_contact (DB *db,
 gboolean
 e_book_backend_db_cache_remove_contact (DB *db,
                                    const char *uid)
-                                     
+
 {
        DBT        uid_dbt;
        int        db_error;
@@ -218,11 +218,11 @@ e_book_backend_db_cache_remove_contact (DB *db,
        string_to_dbt (uid, &uid_dbt);
        db_error = db->del (db, NULL, &uid_dbt, 0);
 
-       if (db_error != 0) { 
+       if (db_error != 0) {
                g_warning ("db->del failed with %d", db_error);
                return FALSE;
        }
-       else 
+       else
                return TRUE;
 
 }
@@ -236,7 +236,7 @@ e_book_backend_db_cache_remove_contact (DB *db,
  *
  * Return value: %TRUE if the cache contains the contact, %FALSE otherwise.
  **/
-gboolean 
+gboolean
 e_book_backend_db_cache_check_contact (DB *db, const char *uid)
 {
        DBT        uid_dbt, vcard_dbt;
@@ -247,9 +247,9 @@ e_book_backend_db_cache_check_contact (DB *db, const char *uid)
        string_to_dbt (uid, &uid_dbt);
        memset (&vcard_dbt, 0 , sizeof(vcard_dbt));
        vcard_dbt.flags = DB_DBT_MALLOC;
-       
+
        db_error = db->get (db, NULL, &uid_dbt, &vcard_dbt,0);
-       if (db_error != 0) 
+       if (db_error != 0)
                return FALSE;
        else {
                free (vcard_dbt.data);
@@ -285,7 +285,7 @@ e_book_backend_db_cache_get_contacts (DB *db, const char *query)
        }
 
        db_error = db->cursor (db, NULL, &dbc, 0);
-       if (db_error != 0) { 
+       if (db_error != 0) {
                g_warning ("db->cursor failed with %d", db_error);
                return NULL;
        }
@@ -309,7 +309,7 @@ e_book_backend_db_cache_get_contacts (DB *db, const char *query)
        db_error = dbc->c_close (dbc);
        if(db_error != 0)
                g_warning ("db->c_close failed with %d", db_error);
-               
+
        if (sexp)
                g_object_unref (sexp);
 
@@ -332,17 +332,17 @@ e_book_backend_db_cache_search (DB *db, const char *query)
 {
        GList *matching_contacts, *temp;
        GPtrArray *ptr_array;
-       
+
        matching_contacts = e_book_backend_db_cache_get_contacts (db, query);
        ptr_array = g_ptr_array_new ();
-       
+
        temp = matching_contacts;
        for (; matching_contacts != NULL; matching_contacts = g_list_next (matching_contacts)) {
                g_ptr_array_add (ptr_array, e_contact_get (matching_contacts->data, E_CONTACT_UID));
                g_object_unref (matching_contacts->data);
        }
        g_list_free (temp);
-       
+
        return ptr_array;
 }
 
@@ -354,13 +354,13 @@ e_book_backend_db_cache_search (DB *db, const char *query)
  *
  * Return value: %TRUE if cache exists, %FALSE if not.
  **/
-gboolean 
+gboolean
 e_book_backend_db_cache_exists (const char *uri)
 {
        char *file_name;
        gboolean exists = FALSE;
        file_name = get_filename_from_uri (uri);
-       
+
        if (file_name && g_file_test (file_name, G_FILE_TEST_EXISTS))
                exists = TRUE;
 
@@ -373,7 +373,7 @@ e_book_backend_db_cache_exists (const char *uri)
  * e_book_backend_db_cache_set_populated:
  * @backend: an #EBookBackend
  *
- * Flags @cache as being populated - that is, it is up-to-date on the 
+ * Flags @cache as being populated - that is, it is up-to-date on the
  * contents of the book it's caching.
  **/
 void
@@ -385,10 +385,10 @@ e_book_backend_db_cache_set_populated (DB *db)
        string_to_dbt ("populated", &uid_dbt);
        string_to_dbt ("TRUE", &vcard_dbt);
        db_error = db->put (db, NULL, &uid_dbt, &vcard_dbt, 0);
-       if (db_error != 0) { 
+       if (db_error != 0) {
                g_warning ("db->put failed with %d", db_error);
        }
-       
+
 }
 
 /**
@@ -404,7 +404,7 @@ e_book_backend_db_cache_is_populated (DB *db)
 {
        DBT        uid_dbt, vcard_dbt;
        int        db_error;
-       
+
        string_to_dbt ("populated", &uid_dbt);
        memset(&vcard_dbt, 0, sizeof(vcard_dbt));
        vcard_dbt.flags = DB_DBT_MALLOC;
index 382c0d5..6ea7ba9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * 
+/*
+ *
  * Copyright (C) 2004 Novell, Inc.
  *
  * Authors: Devashish Sharma <sdevashish@novell.com>
index 0457a7c..08ac427 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * pas-backend-card-sexp.c
  * Copyright 1999, 2000, 2001, Ximian, Inc.
  *
@@ -54,7 +54,7 @@ compare_im (EContact *contact, const char *str,
                        break;
                }
        }
-       
+
        g_list_foreach (aims, (GFunc)g_free, NULL);
        g_list_free (aims);
 
@@ -160,7 +160,7 @@ compare_name (EContact *contact, const char *str,
        name = e_contact_get_const (contact, E_CONTACT_FAMILY_NAME);
        if (name && compare (name, str))
                return TRUE;
-       
+
        name = e_contact_get_const (contact, E_CONTACT_GIVEN_NAME);
        if (name && compare (name, str))
                return TRUE;
@@ -176,7 +176,7 @@ static gboolean
 compare_address (EContact *contact, const char *str,
                 char *(*compare)(const char*, const char*))
 {
-       
+
        int i;
        gboolean rv = FALSE;
 
@@ -187,19 +187,19 @@ compare_address (EContact *contact, const char *str,
                                (address->street && compare(address->street, str)) ||
                                (address->ext && compare(address->ext, str)) ||
                                (address->locality && compare(address->locality, str)) ||
-                               (address->region && compare(address->region, str)) || 
+                               (address->region && compare(address->region, str)) ||
                                (address->code && compare(address->code, str)) ||
                                (address->country && compare(address->country, str));
-                       
+
                        e_contact_address_free (address);
-               
+
                        if (rv)
                                break;
                }
        }
 
        return rv;
-       
+
 }
 
 static gboolean
@@ -300,10 +300,10 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
                        if (any_field
                            || !strcmp (prop_info_table[i].query_prop, propname)) {
                                info = &prop_info_table[i];
-               
+
                                if (any_field && info->field_id == E_CONTACT_UID) {
                                        /* We need to skip UID from any field contains search
-                                        * any-field search should be supported for the 
+                                        * any-field search should be supported for the
                                         * visible fields only.
                                         */
                                        truth = FALSE;
@@ -311,7 +311,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
                                else if (info->prop_type == PROP_TYPE_NORMAL) {
                                        const char *prop = NULL;
                                        /* straight string property matches */
-                                       
+
                                        prop = e_contact_get_const (ctx->contact, info->field_id);
 
                                        if (prop && compare(prop, argv[1]->value.string)) {
@@ -334,7 +334,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
                                        break;
                        }
                }
-               
+
        }
        r = e_sexp_result_new(f, ESEXP_RES_BOOL);
        r->value.bool = truth;
@@ -423,12 +423,12 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                for (i = 0; i < G_N_ELEMENTS (prop_info_table); i ++) {
                        if (!strcmp (prop_info_table[i].query_prop, propname)) {
                                info = &prop_info_table[i];
-                               
+
                                if (info->prop_type == PROP_TYPE_NORMAL) {
                                        const char *prop = NULL;
                                        /* searches where the query's property
                                           maps directly to an ecard property */
-                                       
+
                                        prop = e_contact_get_const (ctx->contact, info->field_id);
 
                                        if (prop && *prop)
@@ -442,7 +442,7 @@ func_exists(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
                                break;
                        }
                }
-               
+
        }
        r = e_sexp_result_new(f, ESEXP_RES_BOOL);
        r->value.bool = truth;
@@ -475,7 +475,7 @@ func_exists_vcard(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *
                        }
                }
        }
-       
+
        r = e_sexp_result_new(f, ESEXP_RES_BOOL);
        r->value.bool = truth;
 
index 16550d7..77be05b 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * pas-backend-card-sexp.h
  * Copyright 2000, 2001, Ximian, Inc.
  *
index 21975b9..ae9b7bf 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * pas-backend-summary.c
  * Copyright 2000, 2001, Ximian, Inc.
  *
@@ -530,7 +530,7 @@ e_book_backend_summary_load (EBookBackendSummary *summary)
 {
        EBookBackendSummaryItem *new_item;
        int i;
-       
+
        clear_items (summary);
 
        if (!e_book_backend_summary_open (summary))
@@ -763,7 +763,7 @@ e_book_backend_summary_add_contact (EBookBackendSummary *summary, EContact *cont
 
        /* ID normally should not be NULL for a contact. */
        /* Added this check as groupwise server sometimes returns
-        * contacts with NULL id 
+        * contacts with NULL id
         */
        id = e_contact_get (contact, E_CONTACT_UID);
        if (!id) {
@@ -862,9 +862,9 @@ summary_flush_func (gpointer data)
                g_warning ("failed to flush summary file to disk");
                return TRUE; /* try again after the next timeout */
        }
-       
+
        g_message ("Flushed summary to disk");
-       
+
        /* we only want this to execute once, so return FALSE and set
           summary->flush_timeout to 0 */
        summary->priv->flush_timeout = 0;
@@ -929,7 +929,7 @@ func_check(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
 
        r = e_sexp_result_new(f, ESEXP_RES_BOOL);
        r->value.bool = truth;
-       
+
        return r;
 }
 
index 3cdb3f3..9c03624 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * pas-backend-summary.h
  * Copyright 2000, 2001, Ximian, Inc.
  *
index 0a07a52..793e869 100644 (file)
@@ -123,7 +123,7 @@ e_book_backend_sync_remove_contacts (EBookBackendSync *backend,
  * @opid: the unique ID of the operation
  * @vcard: the string representation of a contact
  * @contact: a pointer to a location to store the resulting #EContact
- * 
+ *
  * Modifies the contact specified by the ID embedded in @vcard, to
  * reflect the full contents of @vcard.
  *
@@ -185,7 +185,7 @@ e_book_backend_sync_get_contact (EBookBackendSync *backend,
  *
  * Gets a list of contacts from @book. The list and its elements must be freed
  * by the caller.
- * 
+ *
  * Return value: An #EBookBackendSyncStatus indicating the outcome of the operation.
  **/
 EBookBackendSyncStatus
@@ -288,7 +288,7 @@ e_book_backend_sync_get_required_fields (EBookBackendSync *backend,
        g_return_val_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), GNOME_Evolution_Addressbook_OtherError);
        g_return_val_if_fail (E_IS_DATA_BOOK (book), GNOME_Evolution_Addressbook_OtherError);
        g_return_val_if_fail (fields, GNOME_Evolution_Addressbook_OtherError);
-       
+
        g_assert (E_BOOK_BACKEND_SYNC_GET_CLASS (backend)->get_required_fields_sync);
 
        return (* E_BOOK_BACKEND_SYNC_GET_CLASS (backend)->get_required_fields_sync) (backend, book, opid, fields);
@@ -316,7 +316,7 @@ e_book_backend_sync_get_supported_fields (EBookBackendSync *backend,
        g_return_val_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), GNOME_Evolution_Addressbook_OtherError);
        g_return_val_if_fail (E_IS_DATA_BOOK (book), GNOME_Evolution_Addressbook_OtherError);
        g_return_val_if_fail (fields, GNOME_Evolution_Addressbook_OtherError);
-       
+
        g_assert (E_BOOK_BACKEND_SYNC_GET_CLASS (backend)->get_supported_fields_sync);
 
        return (* E_BOOK_BACKEND_SYNC_GET_CLASS (backend)->get_supported_fields_sync) (backend, book, opid, fields);
index 2f78163..097f6b5 100644 (file)
@@ -84,9 +84,9 @@ e_book_backend_load_source (EBookBackend           *backend,
 /**
  * e_book_backend_get_source:
  * @backend: An addressbook backend.
- * 
+ *
  * Queries the source that an addressbook backend is serving.
- * 
+ *
  * Return value: ESource for the backend.
  **/
 ESource *
@@ -603,7 +603,7 @@ e_book_backend_remove_client (EBookBackend *backend,
         */
        if (!backend->priv->clients)
                last_client_gone (backend);
-       
+
        g_mutex_unlock (backend->priv->clients_mutex);
 
        g_object_unref (backend);
@@ -626,18 +626,18 @@ e_book_backend_has_out_of_proc_clients (EBookBackend *backend)
 
        if (!backend->priv->clients) {
                g_mutex_unlock (backend->priv->clients_mutex);
-               
+
                return FALSE;
        }
-       
+
        for (l = backend->priv->clients; l; l = l->next) {
                if (ORBit_small_get_connection_status (e_data_book_get_listener (l->data)) != ORBIT_CONNECTION_IN_PROC) {
                        g_mutex_unlock (backend->priv->clients_mutex);
-                       
+
                        return TRUE;
                }
        }
-       
+
        g_mutex_unlock (backend->priv->clients_mutex);
 
        /* If we get here, all remaining clients are in proc */
@@ -657,7 +657,7 @@ char *
 e_book_backend_get_static_capabilities (EBookBackend *backend)
 {
        g_return_val_if_fail (E_IS_BOOK_BACKEND (backend), NULL);
-       
+
        g_assert (E_BOOK_BACKEND_GET_CLASS (backend)->get_static_capabilities);
 
        return E_BOOK_BACKEND_GET_CLASS (backend)->get_static_capabilities (backend);
@@ -708,7 +708,7 @@ gboolean
 e_book_backend_is_writable (EBookBackend *backend)
 {
        g_return_val_if_fail (E_IS_BOOK_BACKEND (backend), FALSE);
-       
+
        return backend->priv->writable;
 }
 
@@ -724,7 +724,7 @@ void
 e_book_backend_set_is_writable (EBookBackend *backend, gboolean is_writable)
 {
        g_return_if_fail (E_IS_BOOK_BACKEND (backend));
-       
+
        backend->priv->writable = is_writable;
 }
 
@@ -740,7 +740,7 @@ gboolean
 e_book_backend_is_removed (EBookBackend *backend)
 {
        g_return_val_if_fail (E_IS_BOOK_BACKEND (backend), FALSE);
-       
+
        return backend->priv->removed;
 }
 
@@ -756,7 +756,7 @@ void
 e_book_backend_set_is_removed (EBookBackend *backend, gboolean is_removed)
 {
        g_return_if_fail (E_IS_BOOK_BACKEND (backend));
-       
+
        backend->priv->removed = is_removed;
 }
 
@@ -768,7 +768,7 @@ e_book_backend_set_is_removed (EBookBackend *backend, gboolean is_removed)
  * Sets @backend's online/offline mode to @mode. Mode can be 1 for offline
  * or 2 indicating that it is connected and online.
  **/
-void 
+void
 e_book_backend_set_mode (EBookBackend *backend,
                         GNOME_Evolution_Addressbook_BookMode  mode)
 {
@@ -776,7 +776,7 @@ e_book_backend_set_mode (EBookBackend *backend,
 
        g_assert (E_BOOK_BACKEND_GET_CLASS (backend)->set_mode);
 
-        (* E_BOOK_BACKEND_GET_CLASS (backend)->set_mode) (backend,  mode);     
+        (* E_BOOK_BACKEND_GET_CLASS (backend)->set_mode) (backend,  mode);
 
 }
 
@@ -788,11 +788,11 @@ e_book_backend_set_mode (EBookBackend *backend,
  * circumstances (for example before a live backup) and should not be used in
  * normal use.
  */
-void 
+void
 e_book_backend_sync (EBookBackend *backend)
 {
        g_return_if_fail (E_IS_BOOK_BACKEND (backend));
-       
+
        if (E_BOOK_BACKEND_GET_CLASS (backend)->sync)
                (* E_BOOK_BACKEND_GET_CLASS (backend)->sync) (backend);
 }
@@ -964,16 +964,16 @@ e_book_backend_notify_complete (EBookBackend *backend)
  *
  * Notifies all backends clients about the current writable state.
  **/
-void 
+void
 e_book_backend_notify_writable (EBookBackend *backend, gboolean is_writable)
 {
        EBookBackendPrivate *priv;
        GList *clients;
-       
+
        priv = backend->priv;
        priv->writable = is_writable;
        g_mutex_lock (priv->clients_mutex);
-       
+
        for (clients = priv->clients; clients != NULL; clients = g_list_next (clients))
                e_data_book_report_writable (E_DATA_BOOK (clients->data), is_writable);
 
@@ -989,16 +989,16 @@ e_book_backend_notify_writable (EBookBackend *backend, gboolean is_writable)
  * Notifies clients of @backend's connection status indicated by @is_online.
  * Meant to be used by backend implementations.
  **/
-void 
+void
 e_book_backend_notify_connection_status (EBookBackend *backend, gboolean is_online)
 {
        EBookBackendPrivate *priv;
        GList *clients;
-       
+
        priv = backend->priv;
        priv->online = is_online;
        g_mutex_lock (priv->clients_mutex);
-       
+
        for (clients = priv->clients; clients != NULL; clients = g_list_next (clients))
                e_data_book_report_connection_status (E_DATA_BOOK (clients->data), is_online);
 
@@ -1017,10 +1017,10 @@ e_book_backend_notify_auth_required (EBookBackend *backend)
 {
        EBookBackendPrivate *priv;
        GList *clients;
-       
+
        priv = backend->priv;
        g_mutex_lock (priv->clients_mutex);
-       
+
        for (clients = priv->clients; clients != NULL; clients = g_list_next (clients))
                e_data_book_report_auth_required (E_DATA_BOOK (clients->data));
        g_mutex_unlock (priv->clients_mutex);
index 7248f8e..c5a24fe 100644 (file)
@@ -174,7 +174,7 @@ void        e_book_backend_notify_remove              (EBookBackend           *b
 void        e_book_backend_notify_complete            (EBookBackend           *backend);
 void        e_book_backend_notify_writable            (EBookBackend *backend, gboolean is_writable);
 void        e_book_backend_notify_connection_status   (EBookBackend *backend, gboolean is_online);
-void        e_book_backend_notify_auth_required       (EBookBackend *backend);    
+void        e_book_backend_notify_auth_required       (EBookBackend *backend);
 void        e_book_backend_sync                       (EBookBackend *backend);
 
 GType       e_book_backend_get_type                 (void);
index 8122941..08ae1af 100644 (file)
@@ -120,9 +120,9 @@ out_of_proc_check (gpointer key, gpointer value, gpointer data)
 /**
  * e_data_book_factory_get_n_backends:
  * @factory: An addressbook factory.
- * 
+ *
  * Queries the number of running addressbook backends in an addressbook factory.
- * 
+ *
  * Return value: Number of running backends.
  **/
 int
@@ -130,7 +130,7 @@ e_data_book_factory_get_n_backends (EDataBookFactory *factory)
 {
        int n_backends;
        gboolean out_of_proc = FALSE;
-       
+
        g_return_val_if_fail (factory != NULL, -1);
        g_return_val_if_fail (E_IS_DATA_BOOK_FACTORY (factory), -1);
 
@@ -257,7 +257,7 @@ e_data_book_factory_lookup_backend_factory (EDataBookFactory *factory,
 
        backend_factory = g_hash_table_lookup (factory->priv->backends, proto);
 
-       g_free (proto); 
+       g_free (proto);
        g_free (canonical_uri);
 
        return backend_factory;
@@ -328,7 +328,7 @@ impl_GNOME_Evolution_Addressbook_BookFactory_getBook (PortableServer_Servant
                EBookBackendFactory*  backend_factory;
 
                backend_factory = e_data_book_factory_lookup_backend_factory (factory, uri);
-       
+
                if (backend_factory == NULL) {
                        CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
                                             ex_GNOME_Evolution_Addressbook_BookFactory_ProtocolNotSupported,
@@ -396,7 +396,7 @@ e_data_book_factory_new (void)
        g_static_mutex_unlock (&mutex);
 
        factory = g_object_new (E_TYPE_DATA_BOOK_FACTORY, "poa", poa, NULL);
-       
+
        e_data_book_factory_construct (factory);
 
        return factory;
@@ -457,7 +457,7 @@ static void
 set_backend_online_status (gpointer key, gpointer value, gpointer data)
 {
        EBookBackend *backend;
-       
+
        backend = E_BOOK_BACKEND (value);
        e_book_backend_set_mode (backend, GPOINTER_TO_INT (data));
 }
@@ -475,8 +475,8 @@ void
 e_data_book_factory_set_backend_mode (EDataBookFactory *factory, int mode)
 {
        EDataBookFactoryPrivate *priv = factory->priv;
-       
-       
+
+
        g_mutex_lock (priv->map_mutex);
        priv->mode = mode;
        g_hash_table_foreach (priv->active_server_map, set_backend_online_status, GINT_TO_POINTER (priv->mode));
index 90f78f5..b2e166c 100644 (file)
@@ -251,7 +251,7 @@ e_data_book_view_notify_update (EDataBookView *book_view,
                g_mutex_unlock (book_view->priv->pending_mutex);
                return;
        }
-       
+
        currently_in_view =
                g_hash_table_lookup (book_view->priv->ids, id) != NULL;
        want_in_view = e_book_backend_sexp_match_contact (
@@ -295,9 +295,9 @@ e_data_book_view_notify_update_vcard (EDataBookView *book_view, char *vcard)
        gboolean currently_in_view, want_in_view;
        const char *id = NULL;
        EContact *contact;
-       
+
        g_mutex_lock (book_view->priv->pending_mutex);
-       
+
        contact = e_contact_new_from_vcard (vcard);
        id = e_contact_get_const (contact, E_CONTACT_UID);
        if (!id) {
@@ -306,12 +306,12 @@ e_data_book_view_notify_update_vcard (EDataBookView *book_view, char *vcard)
                g_mutex_unlock (book_view->priv->pending_mutex);
                return;
        }
-       
+
        currently_in_view =
                g_hash_table_lookup (book_view->priv->ids, id) != NULL;
        want_in_view =
                e_book_backend_sexp_match_contact (book_view->priv->card_sexp, contact);
-       
+
        if (want_in_view) {
                if (currently_in_view)
                        notify_change (book_view, vcard);
@@ -321,7 +321,7 @@ e_data_book_view_notify_update_vcard (EDataBookView *book_view, char *vcard)
                if (currently_in_view)
                        notify_remove (book_view, id);
        }
-       
+
        g_free (vcard);
        g_object_unref (contact);
        g_mutex_unlock (book_view->priv->pending_mutex);
@@ -351,12 +351,12 @@ void
 e_data_book_view_notify_update_prefiltered_vcard (EDataBookView *book_view, const char *id, char *vcard)
 {
        gboolean currently_in_view;
-       
+
        g_mutex_lock (book_view->priv->pending_mutex);
-       
+
        currently_in_view =
                g_hash_table_lookup (book_view->priv->ids, id) != NULL;
-       
+
        if (currently_in_view)
                notify_change (book_view, vcard);
        else
@@ -382,7 +382,7 @@ e_data_book_view_notify_remove (EDataBookView *book_view,
 
        if (g_hash_table_lookup (book_view->priv->ids, id))
                notify_remove (book_view, id);
-       
+
        g_mutex_unlock (book_view->priv->pending_mutex);
 }
 
@@ -550,7 +550,7 @@ e_data_book_view_get_card_sexp (EDataBookView *book_view)
 /**
  * e_data_book_view_get_max_results:
  * @book_view: an #EDataBookView
- * 
+ *
  * Gets the maximum number of results returned by
  * @book_view's query.
  *
@@ -639,7 +639,7 @@ e_data_book_view_set_thresholds (EDataBookView *book_view,
  * @backend: an #EBookBackend to view
  * @listener: a CORBA listener to reveive notifications
  * @card_query: an s-expression representing the query
- * @card_sexp: 
+ * @card_sexp:
  * @max_results: the maximum number of results for the query
  *
  * Return value: A new #EDataBookView.
@@ -661,7 +661,7 @@ e_data_book_view_new (EBookBackend *backend,
        g_static_mutex_unlock (&mutex);
 
        book_view = g_object_new (E_TYPE_DATA_BOOK_VIEW, "poa", poa, NULL);
-       
+
        e_data_book_view_construct (book_view, backend, listener, card_query, card_sexp, max_results);
 
        return book_view;
@@ -697,7 +697,7 @@ e_data_book_view_dispose (GObject *object)
        }
 
        if (G_OBJECT_CLASS (e_data_book_view_parent_class)->dispose)
-               G_OBJECT_CLASS (e_data_book_view_parent_class)->dispose (object);       
+               G_OBJECT_CLASS (e_data_book_view_parent_class)->dispose (object);
 }
 
 static void
index 8691235..bfe59f2 100644 (file)
@@ -112,7 +112,7 @@ impl_GNOME_Evolution_Addressbook_Book_removeContacts (PortableServer_Servant ser
        EDataBook *book = E_DATA_BOOK (bonobo_object (servant));
        int i;
        GList *id_list = NULL;
-       
+
        for (i = 0; i < ids->_length; i ++)
                id_list = g_list_append (id_list, ids->_buffer[i]);
 
@@ -168,7 +168,7 @@ impl_GNOME_Evolution_Addressbook_Book_getBookView (PortableServer_Servant servan
        }
 
        e_book_backend_add_book_view (backend, view);
-       
+
        e_data_book_respond_get_book_view (book, opid, GNOME_Evolution_Addressbook_Success, view);
 }
 
@@ -209,7 +209,7 @@ impl_GNOME_Evolution_Addressbook_Book_getRequiredFields (PortableServer_Servant
        EDataBook *book = E_DATA_BOOK (bonobo_object (servant));
 
        e_book_backend_get_required_fields (e_data_book_get_backend (book), book, opid);
-       
+
 }
 
 static void
@@ -838,7 +838,7 @@ e_data_book_report_writable (EDataBook                           *book,
  * Notify listeners that @book's online status has changed
  * to @is_online.
  **/
-void 
+void
 e_data_book_report_connection_status (EDataBook   *book,
                                      gboolean    is_online)
 {
@@ -848,7 +848,7 @@ e_data_book_report_connection_status (EDataBook   *book,
 
        GNOME_Evolution_Addressbook_BookListener_notifyConnectionStatus (
                book->priv->listener, (CORBA_boolean) is_online, &ev);
-       
+
        if (ev._major != CORBA_NO_EXCEPTION) {
                g_warning ("e_data_book_report_connection_status: Exception "
                           "responding to BookListener!\n");
@@ -864,17 +864,17 @@ e_data_book_report_connection_status (EDataBook   *book,
  *
  * Notify listeners that @book requires authentication.
  **/
-void 
+void
 e_data_book_report_auth_required (EDataBook *book)
 {
 
        CORBA_Environment ev;
 
        CORBA_exception_init (&ev);
-       
+
        GNOME_Evolution_Addressbook_BookListener_notifyAuthRequired (
                         book->priv->listener,  &ev);
-       
+
        if (ev._major != CORBA_NO_EXCEPTION) {
                g_warning ("e_data_book_report_auth_required: Exception "
                           "responding to BookListener!\n");
@@ -883,7 +883,7 @@ e_data_book_report_auth_required (EDataBook *book)
        CORBA_exception_free (&ev);
 
 }
-                                     
+
 static void
 e_data_book_construct (EDataBook                *book,
                       EBookBackend             *backend,
@@ -1000,7 +1000,7 @@ e_data_book_class_init (EDataBookClass *klass)
        epv->getBookView             = impl_GNOME_Evolution_Addressbook_Book_getBookView;
        epv->getChanges              = impl_GNOME_Evolution_Addressbook_Book_getChanges;
        epv->cancelOperation         = impl_GNOME_Evolution_Addressbook_Book_cancelOperation;
-       
+
 }
 
 static void
index e32764b..c016179 100644 (file)
@@ -27,6 +27,6 @@ main (int argc, char **argv)
          printf ("failed\n");
        else
          printf ("passed\n");
-       
+
        return 0;
 }
index d717b78..093d582 100644 (file)
@@ -41,14 +41,14 @@ contacts_removed (EBookView *book_view, const GList *ids)
 
   for (l = (GList*)ids; l; l = l->next) {
     printf ("Removed contact: %s\n", (char*)l->data);
-  }  
+  }
 }
 
 static void
 sequence_complete (EBookView *book_view, EBookViewStatus status)
 {
   printf ("sequence_complete (status == %d)\n", status);
-  
+
   g_main_loop_quit (loop);
 }
 
index c546d08..17a35ee 100644 (file)
@@ -75,7 +75,7 @@ main (int argc, char **argv)
        gboolean status;
 
        g_type_init ();
-       
+
        /*
        ** the actual ebook foo
        */
index fc3b044..d440adf 100644 (file)
@@ -1,6 +1,6 @@
 #include <libebook/e-book.h>
 
-int main (int argc, char **argv) 
+int main (int argc, char **argv)
 {
        GError *err = NULL;
        EBook *book = NULL;
index 3578e36..6299650 100644 (file)
@@ -43,15 +43,15 @@ main (int argc, char **argv)
 
        /* then get the photo */
        new_photo = e_contact_get (contact, E_CONTACT_PHOTO);
-       
+
        /* and compare */
        if (new_photo->data.inlined.length != photo->data.inlined.length)
          g_error ("photo lengths differ");
-        
+
        if (memcmp (new_photo->data.inlined.data, photo->data.inlined.data, photo->data.inlined.length))
          g_error ("photo data differs");
 
        printf ("photo test passed\n");
-       
+
        return 0;
 }
index 24beaab..fa3af13 100644 (file)
@@ -1,8 +1,8 @@
 #include <string.h>
 #include <libebook/e-book.h>
 
-#define QUERY_STRING1 
-#define QUERY_STRING2 
+#define QUERY_STRING1
+#define QUERY_STRING2
 
 static char* queries[] = {
        "(exists \"full_name\")",
@@ -20,7 +20,7 @@ main (int argc, char **argv)
        for (i = 0; i < G_N_ELEMENTS (queries); i ++) {
                EBookQuery *query = e_book_query_from_string (queries[i]);
                char *str;
-               
+
                str = e_book_query_to_string (query);
 
                if (strcmp (str, queries[i])) {
index af4b46c..93017f6 100644 (file)
@@ -39,7 +39,7 @@ contacts_removed (EBookView *book_view, const GList *ids)
 
   for (l = (GList*)ids; l; l = l->next) {
     printf ("Removed contact: %s\n", (char*)l->data);
-  }  
+  }
 }
 
 static void
index f5aecb6..7ac18be 100644 (file)
@@ -19,6 +19,6 @@ main (int argc, char **argv)
          printf ("passed\n");
        else
          printf ("failed\n");
-       
+
        return 0;
 }
index 9a02cdb..4d8cfea 100644 (file)
@@ -38,6 +38,6 @@ main (int argc, char **argv)
        phone = e_contact_get_const (contact, E_CONTACT_PHONE_OTHER_FAX);
        if (phone) printf ("other fax: %s\n", phone);
        check (phone && !strcmp ("321-321-4321", phone), "other fax");
-       
+
        return 0;
 }
index 949b10b..e969821 100644 (file)
@@ -16,22 +16,22 @@ add_account (const char *conf_key, const char *hostname, const char *username)
        ESource *source;
        char *group_name;
        char *ruri;
-       
+
        source_list = e_source_list_new_for_gconf (conf_client, conf_key);
 
        group = e_source_list_peek_group_by_name (source_list, "CalDAV");
-       
+
        if (group == NULL) {
                group = e_source_group_new ("CalDAV", "caldav://");
-               e_source_list_add_group (source_list, group, -1);       
+               e_source_list_add_group (source_list, group, -1);
        }
-       
+
        ruri = g_strdup_printf ("%s/%s", hostname, arg_path);
        source = e_source_new (arg_path, ruri);
        e_source_set_property (source, "auth", "1");
        e_source_set_property (source, "username", username);
        e_source_group_add_source (group, source, -1);
-       
+
        e_source_list_sync (source_list, NULL);
 
        g_object_unref (source);
index e846d80..2f41fa9 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * Author: Christian Kellner <gicmo@gnome.org> 
+ * Author: Christian Kellner <gicmo@gnome.org>
  */
 
 #ifdef HAVE_CONFIG_H
index fff54a0..0103b86 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * Author: Christian Kellner <gicmo@gnome.org> 
+ * Author: Christian Kellner <gicmo@gnome.org>
  */
 
 #ifndef E_CAL_BACKEND_CALDAV_FACTORY_H
index d7f2fdb..ba87451 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * Author: Christian Kellner <gicmo@gnome.org> 
+ * Author: Christian Kellner <gicmo@gnome.org>
  */
 
 #include <config.h>
@@ -38,7 +38,7 @@
 /* LibXML2 includes */
 #include <libxml/parser.h>
 #include <libxml/tree.h>
-#include <libxml/xpath.h>  
+#include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 
 /* LibSoup includes */
@@ -62,7 +62,7 @@ typedef enum {
 
 /* Private part of the ECalBackendHttp structure */
 struct _ECalBackendCalDAVPrivate {
-       
+
        /* online/offline */
        CalMode mode;
 
@@ -71,13 +71,13 @@ struct _ECalBackendCalDAVPrivate {
 
        /* should we sync for offline mode? */
        gboolean do_offline;
-       
+
        /* TRUE after caldav_open */
        gboolean loaded;
 
        /* the open status  */
        ECalBackendSyncStatus ostatus;
-       
+
        /* lock to protect cache */
        GMutex *lock;
 
@@ -89,19 +89,19 @@ struct _ECalBackendCalDAVPrivate {
        SlaveCommand slave_cmd;
        GTimeVal refresh_time;
        gboolean do_synch;
-       
+
        /* The main soup session  */
        SoupSession *session;
 
        /* well, guess what */
        gboolean read_only;
 
-       /* whehter the synch function 
+       /* whehter the synch function
         * should report changes to the
         * backend */
        gboolean report_changes;
 
-       /* clandar uri */       
+       /* clandar uri */
        char *uri;
 
        /* Authentication info */
@@ -147,7 +147,7 @@ add_debug_key (const char *start, const char *end)
        g_hash_table_insert (caldav_debug_table,
                             debug_key,
                             debug_value);
-                       
+
        g_debug ("Adding %s to enabled debugging keys", debug_key);
 }
 
@@ -170,7 +170,7 @@ caldav_debug_init_once (gpointer data)
 
                while (*ptr != '\0') {
                        if (*ptr == ',' || *ptr == ':') {
-                       
+
                                add_debug_key (dbg, ptr);
 
                                if (*ptr == ',') {
@@ -191,7 +191,7 @@ caldav_debug_init_once (gpointer data)
                        caldav_debug_table = NULL;
                }
        }
-       
+
        return NULL;
 }
 
@@ -199,7 +199,7 @@ static void
 caldav_debug_init ()
 {
        static GOnce debug_once = G_ONCE_INIT;
-  
+
        g_once (&debug_once,
                caldav_debug_init_once,
                NULL);
@@ -215,7 +215,7 @@ caldav_debug_show (const char *component)
                return TRUE;
        }
 
-       return FALSE; 
+       return FALSE;
 }
 
 static void
@@ -250,7 +250,7 @@ message_response_debug_handler (SoupMessage *msg, gpointer user_data)
                if (msg->response.length) {
                        char *body;
 
-                       //needed for null terminal and truncation       
+                       //needed for null terminal and truncation
                        body = g_strndup (msg->response.body,
                                          MIN (msg->response.length,
                                               DEBUG_MAX_BODY_SIZE));
@@ -307,7 +307,7 @@ message_setup_debug (SoupMessage *msg)
                if (msg->request.length) {
                        char *body;
 
-                       //needed for null terminal and truncation       
+                       //needed for null terminal and truncation
                        body = g_strndup (msg->request.body,
                                          MIN (msg->request.length,
                                               DEBUG_MAX_BODY_SIZE));
@@ -328,7 +328,7 @@ static ECalBackendSyncClass *parent_class = NULL;
 
 /* ************************************************************************* */
 /* Misc. utility functions */
-#define X_E_CALDAV "X-EVOLUTION-CALDAV-" 
+#define X_E_CALDAV "X-EVOLUTION-CALDAV-"
 
 static void
 icomp_x_prop_set (icalcomponent *comp, const char *key, const char *value)
@@ -340,7 +340,7 @@ icomp_x_prop_set (icalcomponent *comp, const char *key, const char *value)
 
        while (xprop) {
                const char *str = icalproperty_get_x_name (xprop);
-               
+
                if (!strcmp (str, key)) {
                        icalcomponent_remove_property (comp, xprop);
                        icalproperty_free (xprop);
@@ -351,7 +351,7 @@ icomp_x_prop_set (icalcomponent *comp, const char *key, const char *value)
        }
 
        /* couldnt we be a bit smarter here and reuse the property? */
-       
+
        xprop = icalproperty_new_x (value);
        icalproperty_set_x_name (xprop, key);
        icalcomponent_add_property (comp, xprop);
@@ -362,13 +362,13 @@ static const char *
 icomp_x_prop_get (icalcomponent *comp, const char *key)
 {
        icalproperty *xprop;
-       
+
        /* Find the old one first */
        xprop = icalcomponent_get_first_property (comp, ICAL_X_PROPERTY);
 
        while (xprop) {
                const char *str = icalproperty_get_x_name (xprop);
-               
+
                if (!strcmp (str, key)) {
                        break;
                }
@@ -377,9 +377,9 @@ icomp_x_prop_get (icalcomponent *comp, const char *key)
        }
 
        if (xprop) {
-               return icalproperty_get_value_as_string (xprop);        
+               return icalproperty_get_value_as_string (xprop);
        }
-       
+
        return NULL;
 }
 
@@ -390,7 +390,7 @@ e_cal_component_set_href (ECalComponent *comp, const char *href)
        icalcomponent *icomp;
 
        icomp = e_cal_component_get_icalcomponent (comp);
-       
+
        icomp_x_prop_set (icomp, X_E_CALDAV "HREF", href);
 }
 
@@ -399,12 +399,12 @@ e_cal_component_get_href (ECalComponent *comp)
 {
        icalcomponent *icomp;
        char          *str;
-       
+
        str = NULL;
        icomp = e_cal_component_get_icalcomponent (comp);
-       
+
        str = (char *) icomp_x_prop_get (icomp, X_E_CALDAV "HREF");
-               
+
        return str;
 }
 
@@ -415,7 +415,7 @@ e_cal_component_set_etag (ECalComponent *comp, const char *etag)
        icalcomponent *icomp;
 
        icomp = e_cal_component_get_icalcomponent (comp);
-       
+
        icomp_x_prop_set (icomp, X_E_CALDAV "ETAG", etag);
 
 
@@ -426,48 +426,48 @@ e_cal_component_get_etag (ECalComponent *comp)
 {
        icalcomponent *icomp;
        char          *str;
-       
+
        str = NULL;
        icomp = e_cal_component_get_icalcomponent (comp);
-       
+
        str = (char *) icomp_x_prop_get (icomp, X_E_CALDAV "ETAG");
-               
+
        return str;
 }
 
 typedef enum {
-       
+
        /* object is in synch,
         * now isnt that ironic? :) */
        E_CAL_COMPONENT_IN_SYNCH = 0,
-       
+
        /* local changes */
        E_CAL_COMPONENT_LOCALLY_CREATED,
        E_CAL_COMPONENT_LOCALLY_DELETED,
-       E_CAL_COMPONENT_LOCALLY_MODIFIED,       
+       E_CAL_COMPONENT_LOCALLY_MODIFIED,
 
 } ECalComponentSyncState;
 
 /* oos = out of synch */
 static void
-e_cal_component_set_synch_state (ECalComponent          *comp, 
+e_cal_component_set_synch_state (ECalComponent          *comp,
                                 ECalComponentSyncState  state)
 {
        icalcomponent *icomp;
        char          *state_string;
-       
+
        icomp = e_cal_component_get_icalcomponent (comp);
-       
+
        state_string = g_strdup_printf ("%d", state);
-       
+
        icomp_x_prop_set (icomp, X_E_CALDAV "ETAG", state_string);
 
        g_free (state_string);
 }
 
 
-/* gen uid, set it internally and report it back so we can instantly 
- * use it 
+/* gen uid, set it internally and report it back so we can instantly
+ * use it
  * and btw FIXME!!! */
 static char *
 e_cal_component_gen_href (ECalComponent *comp)
@@ -480,13 +480,13 @@ e_cal_component_gen_href (ECalComponent *comp)
 
        href = g_strconcat (iso, ".ics", NULL);
 
-       g_free (iso);   
-       
-       icomp = e_cal_component_get_icalcomponent (comp);       
+       g_free (iso);
+
+       icomp = e_cal_component_get_icalcomponent (comp);
        icomp_x_prop_set (icomp, X_E_CALDAV "HREF", href);
 
-       return href;    
-}      
+       return href;
+}
 
 /* ensure etag is quoted (to workaround potential server bugs) */
 static char *
@@ -499,7 +499,7 @@ quote_etag (const char *etag)
        } else {
                ret = g_strdup (etag);
        }
-       
+
        return ret;
 }
 
@@ -511,23 +511,23 @@ sm_join_and_split_header (SoupMessage *message, const char *header)
        char          *str;
        char         **sa;
        char          *tofree;
-       
-       sa   = NULL;    
+
+       sa   = NULL;
        list = soup_message_get_header_list (message->response_headers, header);
-       
+
        if (list == NULL || list->data == NULL) {
                return NULL;
        }
 
-       /* Only do string manipulation if really necessary */   
+       /* Only do string manipulation if really necessary */
        if (list->next) {
-               GString *stmp;          
+               GString *stmp;
                stmp = g_string_new ((gchar *) list->data);
-               
+
                while ((list = list->next)) {
                        g_string_append_printf (stmp, ",%s", (gchar *) list->data);
                }
-               
+
                str = tofree = g_string_free (stmp, FALSE);
        } else {
                str = (char *) list->data;
@@ -537,7 +537,7 @@ sm_join_and_split_header (SoupMessage *message, const char *header)
        g_assert (str != NULL);
        sa = g_strsplit (str, ",", 20);
        g_free (tofree);
-       
+
        return sa;
 }
 
@@ -545,11 +545,11 @@ static ECalBackendSyncStatus
 status_code_to_result (guint status_code)
 {
        ECalBackendSyncStatus result;
-       
+
        if (SOUP_STATUS_IS_SUCCESSFUL (status_code)) {
                return GNOME_Evolution_Calendar_Success;
        }
-       
+
        switch (status_code) {
 
        case 404:
@@ -563,23 +563,23 @@ status_code_to_result (guint status_code)
        case 401:
                result = GNOME_Evolution_Calendar_AuthenticationRequired;
                break;
-                       
+
        default:
                result = GNOME_Evolution_Calendar_OtherError;
        }
 
        return result;
 }
-       
+
 static gboolean
 match_header (const char *header, const char *string)
 {
        g_assert (string != NULL);
-       
+
        if (header == NULL || header[0] == '\0') {
                return FALSE;
        }
-       
+
        /* skip leading whitespaces */
        while (g_ascii_isspace (header[0])) {
                header++;
@@ -593,23 +593,23 @@ static ECalBackendSyncStatus
 check_state (ECalBackendCalDAV *cbdav, gboolean *online)
 {
        ECalBackendCalDAVPrivate *priv;
-       
+
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        *online = FALSE;
-       
+
        if (priv->loaded != TRUE) {
                return GNOME_Evolution_Calendar_OtherError;
        }
 
        if (priv->mode == CAL_MODE_LOCAL) {
-               
+
                if (! priv->do_offline) {
                        return GNOME_Evolution_Calendar_RepositoryOffline;
-               } 
-               
+               }
+
        } else {
-               *online = TRUE; 
+               *online = TRUE;
        }
 
        return  GNOME_Evolution_Calendar_Success;
@@ -626,34 +626,34 @@ xpath_eval (xmlXPathContextPtr ctx, char *format, ...)
        char              *expr;
 
        if (ctx == NULL) {
-               return NULL;    
-       }               
+               return NULL;
+       }
 
        va_start (args, format);
        expr = g_strdup_vprintf (format, args);
        va_end (args);
-       
+
        result = xmlXPathEvalExpression ((xmlChar *) expr, ctx);
        g_free (expr);
-       
+
        if (result == NULL) {
-               return NULL;    
+               return NULL;
        }
-       
-       if (result->type == XPATH_NODESET && 
+
+       if (result->type == XPATH_NODESET &&
            xmlXPathNodeSetIsEmpty (result->nodesetval)) {
                xmlXPathFreeObject (result);
-               
+
                g_print ("No result\n");
-               
+
                return NULL;
        }
-       
+
        return result;
 }
 
 #if 0
-static gboolean 
+static gboolean
 parse_status_node (xmlNodePtr node, guint *status_code)
 {
        xmlChar  *content;
@@ -661,7 +661,7 @@ parse_status_node (xmlNodePtr node, guint *status_code)
 
        content = xmlNodeGetContent (node);
 
-       res = soup_headers_parse_status_line ((char *) content, 
+       res = soup_headers_parse_status_line ((char *) content,
                                              NULL,
                                              status_code,
                                              NULL);
@@ -675,13 +675,13 @@ static char *
 xp_object_get_string (xmlXPathObjectPtr result)
 {
        char *ret;
-       
+
        if (result == NULL || result->type != XPATH_STRING) {
-               return NULL;    
+               return NULL;
        }
-       
+
        ret = g_strdup ((char *) result->stringval);
-       
+
        xmlXPathFreeObject (result);
        return ret;
 }
@@ -695,7 +695,7 @@ xp_object_get_href (xmlXPathObjectPtr result)
        char *val;
 
        if (result == NULL || result->type != XPATH_STRING) {
-               return NULL;    
+               return NULL;
        }
 
        val = (char *) result->stringval;
@@ -708,7 +708,7 @@ xp_object_get_href (xmlXPathObjectPtr result)
 
        ret = g_strdup (ret);
        g_debug ("found href: %s", ret);
-       
+
        xmlXPathFreeObject (result);
        return ret;
 }
@@ -719,15 +719,15 @@ xp_object_get_etag (xmlXPathObjectPtr result)
 {
        char *ret;
        char *str;
-       
+
        if (result == NULL || result->type != XPATH_STRING) {
-               return NULL;    
+               return NULL;
        }
 
        str = (char *) result->stringval;
 
        ret = quote_etag (str);
-               
+
        xmlXPathFreeObject (result);
        return ret;
 }
@@ -737,21 +737,21 @@ xp_object_get_status (xmlXPathObjectPtr result)
 {
        gboolean res;
        guint    ret;
-       
-       
+
+
        if (result == NULL || result->type != XPATH_STRING) {
-               return 0;       
+               return 0;
        }
-       
-       res = soup_headers_parse_status_line ((char *) result->stringval, 
+
+       res = soup_headers_parse_status_line ((char *) result->stringval,
                                              NULL,
                                              &ret,
                                              NULL);
-       
+
        if (res != TRUE) {
-               ret = 0;        
+               ret = 0;
        }
-       
+
        xmlXPathFreeObject (result);
        return ret;
 }
@@ -761,13 +761,13 @@ static int
 xp_object_get_number (xmlXPathObjectPtr result)
 {
        int ret;
-       
+
        if (result == NULL || result->type != XPATH_STRING) {
-               return -1;      
+               return -1;
        }
-       
+
        ret = result->boolval;
-       
+
        xmlXPathFreeObject (result);
        return ret;
 }
@@ -794,7 +794,7 @@ struct _CalDAVObject {
 };
 
 static void
-caldav_object_free (CalDAVObject *object, gboolean free_object_itself) 
+caldav_object_free (CalDAVObject *object, gboolean free_object_itself)
 {
        g_free (object->href);
        g_free (object->etag);
@@ -818,10 +818,10 @@ parse_report_response (SoupMessage *soup_message, CalDAVObject **objs, int *len)
        g_return_val_if_fail (objs != NULL || len != NULL, FALSE);
 
        res = TRUE;
-       doc = xmlReadMemory (soup_message->response.body, 
-                            soup_message->response.length, 
-                            "response.xml", 
-                            NULL, 
+       doc = xmlReadMemory (soup_message->response.body,
+                            soup_message->response.length,
+                            "response.xml",
+                            NULL,
                             0);
 
        if (doc == NULL) {
@@ -830,13 +830,13 @@ parse_report_response (SoupMessage *soup_message, CalDAVObject **objs, int *len)
 
        xpctx = xmlXPathNewContext (doc);
 
-       xmlXPathRegisterNs (xpctx, (xmlChar *) "D", 
+       xmlXPathRegisterNs (xpctx, (xmlChar *) "D",
                            (xmlChar *) "DAV:");
 
-       xmlXPathRegisterNs (xpctx, (xmlChar *) "C", 
+       xmlXPathRegisterNs (xpctx, (xmlChar *) "C",
                            (xmlChar *) "urn:ietf:params:xml:ns:caldav");
 
-       result = xpath_eval (xpctx, "/D:multistatus/D:response");       
+       result = xpath_eval (xpctx, "/D:multistatus/D:response");
 
        if (result == NULL || result->type != XPATH_NODESET) {
                *len = 0;
@@ -846,13 +846,13 @@ parse_report_response (SoupMessage *soup_message, CalDAVObject **objs, int *len)
 
        n = xmlXPathNodeSetGetLength (result->nodesetval);
        *len = n;
-       
+
        *objs = g_new0 (CalDAVObject, n);
-       
+
        for (i = 0; i < n; i++) {
                CalDAVObject *object;
                xmlXPathObjectPtr xpres;
-               
+
                object = *objs + i;
                /* see if we got a status child in the response element */
 
@@ -871,7 +871,7 @@ parse_report_response (SoupMessage *soup_message, CalDAVObject **objs, int *len)
                object->status = xp_object_get_status (xpres);
 
                if (object->status != 200) {
-                       continue;       
+                       continue;
                }
 
                xpres = xpath_eval (xpctx, XPATH_GETETAG, i + 1);
@@ -882,7 +882,7 @@ parse_report_response (SoupMessage *soup_message, CalDAVObject **objs, int *len)
        }
 
 out:
-       xmlXPathFreeContext (xpctx);            
+       xmlXPathFreeContext (xpctx);
        xmlFreeDoc (doc);
        return res;
 }
@@ -891,83 +891,83 @@ out:
 /* Authentication helpers for libsoup */
 
 static void
-soup_authenticate (SoupSession  *session, 
+soup_authenticate (SoupSession  *session,
                   SoupMessage  *msg,
-                  const char   *auth_type, 
+                  const char   *auth_type,
                   const char   *auth_realm,
-                  char        **username, 
-                  char        **password, 
+                  char        **username,
+                  char        **password,
                   gpointer      data)
 {
        ECalBackendCalDAVPrivate *priv;
        ECalBackendCalDAV        *cbdav;
-       
-       cbdav = E_CAL_BACKEND_CALDAV (data);    
+
+       cbdav = E_CAL_BACKEND_CALDAV (data);
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        *username = priv->username;
        *password = priv->password;
-       
+
        priv->username = NULL;
        priv->password = NULL;
 
 }
 
 static void
-soup_reauthenticate (SoupSession  *session, 
+soup_reauthenticate (SoupSession  *session,
                     SoupMessage  *msg,
-                    const char   *auth_type, 
+                    const char   *auth_type,
                     const char   *auth_realm,
-                    char        **username, 
-                    char        **password, 
+                    char        **username,
+                    char        **password,
                     gpointer      data)
 {
        ECalBackendCalDAVPrivate *priv;
        ECalBackendCalDAV        *cbdav;
-       
-       cbdav = E_CAL_BACKEND_CALDAV (data);    
+
+       cbdav = E_CAL_BACKEND_CALDAV (data);
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        *username = priv->username;
        *password = priv->password;
-       
+
        priv->username = NULL;
        priv->password = NULL;
 }
 
-static gint 
+static gint
 caldav_ignore_host(gconstpointer a, gconstpointer b)
 {
-       gchar *hostname = (gchar*)a, 
+       gchar *hostname = (gchar*)a,
              *ignore = (gchar*)b;
+
        if (hostname && ignore)
          return strcmp(hostname, ignore);
         return -1;
 }
 
-static void 
+static void
 caldav_set_session_proxy(ECalBackendCalDAVPrivate *priv)
 {
        GConfClient *conf_client;
        SoupUri *uri_base;
-       
+
        if (priv->session == NULL)
                return;
-               
+
        uri_base = soup_uri_new (priv->uri);
        if (uri_base == NULL)
                return;
-               
+
        /* set the outbound HTTP proxy, if configuration is set to do so */
        conf_client = gconf_client_get_default ();
        if (gconf_client_get_bool (conf_client, "/system/http_proxy/use_http_proxy", NULL)) {
                char *server, *proxy_uri;
                int port;
-               GSList *ignore = gconf_client_get_list (conf_client, 
+               GSList *ignore = gconf_client_get_list (conf_client,
                                                        "/system/http_proxy/ignore_hosts",
-                                                       GCONF_VALUE_STRING, NULL); 
-               if (ignore == NULL || 
+                                                       GCONF_VALUE_STRING, NULL);
+               if (ignore == NULL ||
                    g_slist_find_custom(ignore, uri_base->host, caldav_ignore_host) == NULL) {
                        server = gconf_client_get_string (conf_client, "/system/http_proxy/host", NULL);
                        port = gconf_client_get_int (conf_client, "/system/http_proxy/port", NULL);
@@ -1031,43 +1031,43 @@ caldav_server_open_calendar (ECalBackendCalDAV *cbdav)
        gboolean                   calendar_access;
        gboolean                   put_allowed;
        gboolean                   delete_allowed;
-       
+
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        /* FIXME: setup text_uri */
-       
+
        message = soup_message_new (SOUP_METHOD_OPTIONS, priv->uri);
-       soup_message_add_header (message->request_headers, 
+       soup_message_add_header (message->request_headers,
                                 "User-Agent", "Evolution/" VERSION);
 
        message_setup_debug (message);
        soup_session_send_message (priv->session, message);
-       
+
        if (! SOUP_STATUS_IS_SUCCESSFUL (message->status_code)) {
                g_object_unref (message);
 
                return status_code_to_result (message->status_code);
        }
-       
+
        /* parse the dav header, we are intreseted in the
         * calendar-access bit only at the moment */
        sa = sm_join_and_split_header (message, "DAV");
-       
+
        calendar_access = FALSE;
        for (siter = sa; siter && *siter; siter++) {
-               
+
                if (match_header (*siter, "calendar-access")) {
                        calendar_access = TRUE;
                        break;
                }
-       }       
-       
+       }
+
        g_strfreev (sa);
 
-       
+
        sa = sm_join_and_split_header (message, "Allow");
-       
-       /* parse the Allow header and look for PUT, DELETE at the 
+
+       /* parse the Allow header and look for PUT, DELETE at the
         * moment (maybe we should check more here, for REPORT eg) */
        put_allowed = delete_allowed = FALSE;
        for (siter = sa; siter && *siter; siter++) {
@@ -1080,10 +1080,10 @@ caldav_server_open_calendar (ECalBackendCalDAV *cbdav)
                if (put_allowed && delete_allowed) {
                        break;
                }
-       }       
-       
+       }
+
        g_strfreev (sa);
-       
+
        g_object_unref (message);
 
        if (calendar_access) {
@@ -1091,14 +1091,14 @@ caldav_server_open_calendar (ECalBackendCalDAV *cbdav)
                priv->do_synch = TRUE;
                return GNOME_Evolution_Calendar_Success;
        }
-       
-       return GNOME_Evolution_Calendar_NoSuchCal;      
+
+       return GNOME_Evolution_Calendar_NoSuchCal;
 }
 
 
 static gboolean
 caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, int *len)
-{      
+{
        ECalBackendCalDAVPrivate *priv;
        xmlOutputBufferPtr   buf;
        SoupMessage         *message;
@@ -1109,17 +1109,17 @@ caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, int *
        xmlNsPtr             nsdav;
        xmlNsPtr             nscd;
        gboolean             result;
-       
+
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
-       
-       /* Maybe we should just do a g_strdup_printf here? */   
+
+       /* Maybe we should just do a g_strdup_printf here? */
        /* Prepare request body */
        doc = xmlNewDoc ((xmlChar *) "1.0");
        root = xmlNewNode (NULL, (xmlChar *) "calendar-query");
-       nscd = xmlNewNs (root, (xmlChar *) "urn:ietf:params:xml:ns:caldav", 
+       nscd = xmlNewNs (root, (xmlChar *) "urn:ietf:params:xml:ns:caldav",
                         (xmlChar *) "C");
        xmlSetNs (root, nscd);
-       
+
        /* Add webdav tags */
        nsdav = xmlNewNs (root, (xmlChar *) "DAV:", (xmlChar *) "D");
        node = xmlNewTextChild (root, nsdav, (xmlChar *) "prop", NULL);
@@ -1128,24 +1128,24 @@ caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, int *
        node = xmlNewTextChild (root, nscd, (xmlChar *) "filter", NULL);
        node = xmlNewTextChild (node, nscd, (xmlChar *) "comp-filter", NULL);
        xmlSetProp (node, (xmlChar *) "name", (xmlChar *) "VCALENDAR");
-       
+
        sn = xmlNewTextChild (node, nscd, (xmlChar *) "comp-filter", NULL);
        xmlSetProp (sn, (xmlChar *) "name", (xmlChar *) "VEVENT");
        /* ^^^ add timerange for performance?  */
-       
-       
+
+
        buf = xmlAllocOutputBuffer (NULL);
        xmlNodeDumpOutput (buf, doc, root, 0, 1, NULL);
        xmlOutputBufferFlush (buf);
 
        /* Prepare the soup message */
        message = soup_message_new ("REPORT", priv->uri);
-       soup_message_add_header (message->request_headers, 
+       soup_message_add_header (message->request_headers,
                                 "User-Agent", "Evolution/" VERSION);
-       soup_message_add_header (message->request_headers, 
+       soup_message_add_header (message->request_headers,
                                 "Depth", "1");
 
-       soup_message_set_request (message, 
+       soup_message_set_request (message,
                                  "application/xml",
                                  SOUP_BUFFER_USER_OWNED,
                                  (char *) buf->buffer->content,
@@ -1155,7 +1155,7 @@ caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, int *
 
        /* Send the request now */
        soup_session_send_message (priv->session, message);
-       
+
        /* Clean up the memory */
        xmlOutputBufferClose (buf);
        xmlFreeDoc (doc);
@@ -1165,7 +1165,7 @@ caldav_server_list_objects (ECalBackendCalDAV *cbdav, CalDAVObject **objs, int *
                g_warning ("Sever did not response with 207\n");
                return FALSE;
        }
-       
+
        /* Parse the response body */
        result = parse_report_response (message, objs, len);
 
@@ -1183,22 +1183,22 @@ caldav_server_get_object (ECalBackendCalDAV *cbdav, CalDAVObject *object)
        const char               *hdr;
        char                     *uri;
 
-       priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);        
+       priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
        result = GNOME_Evolution_Calendar_Success;
 
        g_assert (object != NULL && object->href != NULL);
-       
+
        uri = caldav_generate_uri (cbdav, object->href);
        message = soup_message_new (SOUP_METHOD_GET, uri);
        g_free (uri);
 
-       soup_message_add_header (message->request_headers, 
+       soup_message_add_header (message->request_headers,
                                 "User-Agent", "Evolution/" VERSION);
 
        message_setup_debug (message);
 
        soup_session_send_message (priv->session, message);
-       
+
        if (! SOUP_STATUS_IS_SUCCESSFUL (message->status_code)) {
                result = status_code_to_result (message->status_code);
                g_object_unref (message);
@@ -1216,19 +1216,19 @@ caldav_server_get_object (ECalBackendCalDAV *cbdav, CalDAVObject *object)
        }
 
        hdr = soup_message_get_header (message->response_headers, "ETag");
-       
+
        if (hdr == NULL) {
                g_warning ("UUHH no ETag, now that's bad!");
                object->etag = NULL;
        } else {
                object->etag = quote_etag (hdr);
        }
-       
+
        /* Need to NULL terminate the string, do we? */
        object->cdata = g_malloc0 (message->response.length + 1);
        memcpy (object->cdata, message->response.body, message->response.length);
        g_object_unref (message);
-       
+
        return result;
 }
 
@@ -1241,50 +1241,50 @@ caldav_server_put_object (ECalBackendCalDAV *cbdav, CalDAVObject *object)
        const char               *hdr;
        char                     *uri;
 
-       priv   = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);      
+       priv   = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
        result = GNOME_Evolution_Calendar_Success;
        hdr    = NULL;
-       
+
        g_assert (object != NULL && object->cdata != NULL);
 
        uri = caldav_generate_uri (cbdav, object->href);
        message = soup_message_new (SOUP_METHOD_PUT, uri);
        g_free (uri);
 
-       soup_message_add_header (message->request_headers, 
+       soup_message_add_header (message->request_headers,
                                 "User-Agent", "Evolution/" VERSION);
 
        /* For new items we use the If-None-Match so we don't
         * acidently override resources, for item updates we
-        * use the If-Match header to avoid the Lost-update 
+        * use the If-Match header to avoid the Lost-update
         * problem */
        if (object->etag == NULL) {
-               soup_message_add_header (message->request_headers, 
+               soup_message_add_header (message->request_headers,
                                         "If-None-Match", "*");
        } else {
-               soup_message_add_header (message->request_headers, 
+               soup_message_add_header (message->request_headers,
                                         "If-Match", object->etag);
        }
-       
-       soup_message_set_request (message, 
-                                 "text/calendar", 
-                                 SOUP_BUFFER_USER_OWNED, 
+
+       soup_message_set_request (message,
+                                 "text/calendar",
+                                 SOUP_BUFFER_USER_OWNED,
                                  object->cdata,
                                  strlen (object->cdata));
 
-       
+
        message_setup_debug (message);
 
        soup_session_send_message (priv->session, message);
 
        /* FIXME: sepcial case precondition errors ?*/
-       result = status_code_to_result (message->status_code);  
+       result = status_code_to_result (message->status_code);
 
-       if (result == GNOME_Evolution_Calendar_Success) {       
+       if (result == GNOME_Evolution_Calendar_Success) {
                hdr = soup_message_get_header (message->response_headers,
                                               "ETag");
        }
-       
+
        if (hdr != NULL) {
                g_free (object->etag);
                object->etag = quote_etag (hdr);
@@ -1292,9 +1292,9 @@ caldav_server_put_object (ECalBackendCalDAV *cbdav, CalDAVObject *object)
                g_warning ("Ups no Etag in put response");
        }
 
-       
+
        g_object_unref (message);
-       return result;  
+       return result;
 }
 
 static ECalBackendSyncStatus
@@ -1305,39 +1305,39 @@ caldav_server_delete_object (ECalBackendCalDAV *cbdav, CalDAVObject *object)
        SoupMessage              *message;
        char                     *uri;
 
-       priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);        
+       priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
        result = GNOME_Evolution_Calendar_Success;
-       
+
        g_assert (object != NULL && object->href != NULL);
 
        uri = caldav_generate_uri (cbdav, object->href);
        message = soup_message_new (SOUP_METHOD_DELETE, uri);
        g_free (uri);
-       
-       soup_message_add_header (message->request_headers, 
+
+       soup_message_add_header (message->request_headers,
                                 "User-Agent", "Evolution/" VERSION);
 
        if (object->etag != NULL) {
-               soup_message_add_header (message->request_headers, 
+               soup_message_add_header (message->request_headers,
                                        "If-Match", object->etag);
        }
-       
+
        message_setup_debug (message);
 
        soup_session_send_message (priv->session, message);
-       
-       result = status_code_to_result (message->status_code);  
-       
+
+       result = status_code_to_result (message->status_code);
+
        g_object_unref (message);
 
        return result;
 }
-       
+
 /* ************************************************************************* */
 /* Synchronization foo */
 
 static gboolean
-synchronize_object (ECalBackendCalDAV *cbdav, 
+synchronize_object (ECalBackendCalDAV *cbdav,
                    CalDAVObject      *object,
                    ECalComponent     *old_comp)
 {
@@ -1351,51 +1351,51 @@ synchronize_object (ECalBackendCalDAV *cbdav,
        gboolean                  do_report;
        gboolean                  res;
 
-       comp = NULL;    
+       comp = NULL;
        res  = TRUE;
        result  = caldav_server_get_object (cbdav, object);
-       
+
        if (result != GNOME_Evolution_Calendar_Success) {
                g_warning ("Could not fetch object from server");
                return FALSE;
        }
 
-       priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);        
+       priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        icomp = icalparser_parse_string (object->cdata);
        kind  = icalcomponent_isa (icomp);
        bkend = E_CAL_BACKEND (cbdav);
-       
+
        if (kind == ICAL_VCALENDAR_COMPONENT) {
-       
+
                kind = e_cal_backend_get_kind (bkend);
                subcomp = icalcomponent_get_first_component (icomp, kind);
 
                comp = e_cal_component_new ();
-               res = e_cal_component_set_icalcomponent (comp, 
+               res = e_cal_component_set_icalcomponent (comp,
                                                   icalcomponent_new_clone (subcomp));
-               if (res == TRUE) { 
+               if (res == TRUE) {
                        e_cal_component_set_href (comp, object->href);
                        e_cal_component_set_etag (comp, object->etag);
                } else {
                        g_object_unref (comp);
                        comp = NULL;
                }
-               
+
        } else {
-               res = FALSE;    
+               res = FALSE;
        }
-       
+
        icalcomponent_free (icomp);
 
        if (res == FALSE) {
                return res;
        }
-               
+
        bcache = priv->cache;
        do_report = priv->report_changes;
-       
-       if ((res = e_cal_backend_cache_put_component (bcache, comp)) 
+
+       if ((res = e_cal_backend_cache_put_component (bcache, comp))
            && do_report) {
                char *new_cs = NULL;
                char *old_cs = NULL;
@@ -1406,21 +1406,21 @@ synchronize_object (ECalBackendCalDAV *cbdav,
                        e_cal_backend_notify_object_created (bkend, new_cs);
                } else {
                        old_cs = e_cal_component_get_as_string (old_comp);
-                       e_cal_backend_notify_object_modified (bkend, old_cs, new_cs);   
+                       e_cal_backend_notify_object_modified (bkend, old_cs, new_cs);
                }
-               
+
                g_free (new_cs);
                g_free (old_cs);
        }
 
        g_object_unref (comp);
-       
+
        return res;
 }
 
 #define etags_match(_tag1, _tag2) ((_tag1 == _tag2) ? TRUE :                 \
                                   g_str_equal (_tag1 != NULL ? _tag1 : "",  \
-                                               _tag2 != NULL ? _tag2 : "")) 
+                                               _tag2 != NULL ? _tag2 : ""))
 
 static void
 synchronize_cache (ECalBackendCalDAV *cbdav)
@@ -1435,14 +1435,14 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
        gboolean                  res;
        int                       len;
        int                       i;
-       
-       priv   = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);      
+
+       priv   = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
        bcache = priv->cache;
        len    = 0;
        sobjs  = NULL;
-       
+
        res = caldav_server_list_objects (cbdav, &sobjs, &len);
-       
+
        if (res == FALSE) {
                /* FIXME: bloek! */
                g_warning ("Could not synch server BLehh!");
@@ -1452,21 +1452,21 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
        hindex = g_hash_table_new (g_str_hash, g_str_equal);
        cobjs = e_cal_backend_cache_get_components (bcache);
 
-       /* build up a index for the href entry */       
+       /* build up a index for the href entry */
        for (citer = cobjs; citer; citer = g_list_next (citer)) {
                ECalComponent *ccomp = E_CAL_COMPONENT (citer->data);
-               const char *href;       
-               
+               const char *href;
+
                href = e_cal_component_get_href (ccomp);
-               
+
                if (href == NULL) {
                        g_warning ("href of object NULL :(");
                        continue;
                }
-                       
+
                g_hash_table_insert (hindex, (gpointer) href, ccomp);
        }
-       
+
        /* see if we have to upate or add some objects */
        for (i = 0, object = sobjs; i < len; i++, object++) {
                ECalComponent *ccomp;
@@ -1481,15 +1481,15 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
 
                res = TRUE;
                ccomp = g_hash_table_lookup (hindex, object->href);
-               
+
                if (ccomp != NULL) {
-                       etag = e_cal_component_get_etag (ccomp);        
-               } 
-               
+                       etag = e_cal_component_get_etag (ccomp);
+               }
+
                if (!etag || !etags_match (etag, object->etag)) {
                        res = synchronize_object (cbdav, object, ccomp);
                }
-               
+
                if (res == TRUE) {
                        cobjs = g_list_remove (cobjs, ccomp);
                }
@@ -1501,16 +1501,16 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
        for (citer = cobjs; citer; citer = g_list_next (citer)) {
                ECalComponent *comp;
                const char *uid;
-               
+
                comp = E_CAL_COMPONENT (citer->data);
                e_cal_component_get_uid (comp, &uid);
 
-               if (e_cal_backend_cache_remove_component (bcache, uid, NULL) && 
+               if (e_cal_backend_cache_remove_component (bcache, uid, NULL) &&
                    priv->report_changes) {
                        char *str = e_cal_component_get_as_string (comp);
                        ECalComponentId *id = e_cal_component_get_id (comp);
-                       
-                       e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbdav), 
+
+                       e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbdav),
                                                             id, str, NULL);
                        e_cal_component_free_id (id);
                        g_free (str);
@@ -1518,60 +1518,60 @@ synchronize_cache (ECalBackendCalDAV *cbdav)
 
                g_object_unref (comp);
        }
-       
+
        g_hash_table_destroy (hindex);
        g_list_free (cobjs);
-       
+
 }
 
 /* ************************************************************************* */
-static gpointer 
+static gpointer
 synch_slave_loop (gpointer data)
 {
        ECalBackendCalDAVPrivate *priv;
        ECalBackendCalDAV        *cbdav;
-       
-       cbdav = E_CAL_BACKEND_CALDAV (data);    
+
+       cbdav = E_CAL_BACKEND_CALDAV (data);
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
-       g_mutex_lock (priv->lock);      
+       g_mutex_lock (priv->lock);
 
        while (priv->slave_cmd != SLAVE_SHOULD_DIE) {
-               GTimeVal alarm_clock;   
+               GTimeVal alarm_clock;
                if (priv->slave_cmd == SLAVE_SHOULD_SLEEP) {
                        /* just sleep until we get woken up again */
                        g_cond_wait (priv->cond, priv->lock);
-                       
+
                        /* check if we should die, work or sleep again */
                        continue;
                }
 
-               /* Ok here we go, do some real work 
+               /* Ok here we go, do some real work
                 * Synch it baby one more time ...
                 */
                //d(g_print ("Synch-Slave: Goint to work ...\n")); XXX re-enable output please
-               synchronize_cache (cbdav); 
+               synchronize_cache (cbdav);
 
                /* puhh that was hard, get some rest :) */
                g_get_current_time (&alarm_clock);
                alarm_clock.tv_sec += priv->refresh_time.tv_sec;
-               g_cond_timed_wait (priv->cond, 
-                                  priv->lock, 
+               g_cond_timed_wait (priv->cond,
+                                  priv->lock,
                                   &alarm_clock);
 
        }
 
-       /* we got killed ... */ 
+       /* we got killed ... */
        g_mutex_unlock (priv->lock);
-       return NULL;    
+       return NULL;
 }
 
 /* ************************************************************************* */
 /* ********** ECalBackendSync virtual function implementation *************  */
 
 static ECalBackendSyncStatus
-caldav_is_read_only (ECalBackendSync *backend, 
-                    EDataCal        *cal, 
+caldav_is_read_only (ECalBackendSync *backend,
+                    EDataCal        *cal,
                     gboolean        *read_only)
 {
        ECalBackendCalDAV        *cbdav;
@@ -1587,13 +1587,13 @@ caldav_is_read_only (ECalBackendSync *backend,
                *read_only = priv->read_only;
        }
 
-       return GNOME_Evolution_Calendar_Success;        
+       return GNOME_Evolution_Calendar_Success;
 }
 
 
 static ECalBackendSyncStatus
-caldav_get_cal_address (ECalBackendSync  *backend, 
-                       EDataCal         *cal, 
+caldav_get_cal_address (ECalBackendSync  *backend,
+                       EDataCal         *cal,
                        char            **address)
 {
        *address = NULL;
@@ -1603,8 +1603,8 @@ caldav_get_cal_address (ECalBackendSync  *backend,
 
 
 static ECalBackendSyncStatus
-caldav_get_ldap_attribute (ECalBackendSync  *backend, 
-                          EDataCal         *cal, 
+caldav_get_ldap_attribute (ECalBackendSync  *backend,
+                          EDataCal         *cal,
                           char           **attribute)
 {
        *attribute = NULL;
@@ -1612,8 +1612,8 @@ caldav_get_ldap_attribute (ECalBackendSync  *backend,
 }
 
 static ECalBackendSyncStatus
-caldav_get_alarm_email_address (ECalBackendSync  *backend, 
-                               EDataCal         *cal, 
+caldav_get_alarm_email_address (ECalBackendSync  *backend,
+                               EDataCal         *cal,
                                char            **address)
 {
        *address = NULL;
@@ -1621,20 +1621,20 @@ caldav_get_alarm_email_address (ECalBackendSync  *backend,
 }
 
 static ECalBackendSyncStatus
-caldav_get_static_capabilities (ECalBackendSync  *backend, 
-                               EDataCal         *cal, 
+caldav_get_static_capabilities (ECalBackendSync  *backend,
+                               EDataCal         *cal,
                                char            **capabilities)
 {
        *capabilities = g_strdup (CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS ","
                                  CAL_STATIC_CAPABILITY_NO_THISANDFUTURE ","
                                  CAL_STATIC_CAPABILITY_NO_THISANDPRIOR);
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
 static ECalBackendSyncStatus
 initialize_backend (ECalBackendCalDAV *cbdav)
-{      
+{
        ECalBackendSyncStatus     result;
        ECalBackendCalDAVPrivate *priv;
        ESource                  *source;
@@ -1642,9 +1642,9 @@ initialize_backend (ECalBackendCalDAV *cbdav)
        const char               *os_val;
        const char               *uri;
        gsize                     len;
-       
+
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
-       
+
        result = GNOME_Evolution_Calendar_Success;
        source = e_cal_backend_get_source (E_CAL_BACKEND (cbdav));
 
@@ -1655,11 +1655,11 @@ initialize_backend (ECalBackendCalDAV *cbdav)
        }
 
        os_val = e_source_get_property (source, "auth");
-       
+
        if (os_val) {
                priv->need_auth = TRUE;
        }
-       
+
        os_val = e_source_get_property(source, "ssl");
        uri = e_cal_backend_get_uri (E_CAL_BACKEND (cbdav));
 
@@ -1679,7 +1679,7 @@ initialize_backend (ECalBackendCalDAV *cbdav)
        } else {
 
                priv->uri = g_strdup (uri);
-       } 
+       }
 
        /* remove trailing slashes */
        len = strlen (priv->uri);
@@ -1698,7 +1698,7 @@ initialize_backend (ECalBackendCalDAV *cbdav)
                        result = GNOME_Evolution_Calendar_OtherError;
                        goto out;
                }
-               
+
        }
 
        priv->slave_cmd = SLAVE_SHOULD_SLEEP;
@@ -1708,37 +1708,37 @@ initialize_backend (ECalBackendCalDAV *cbdav)
                g_warning ("Could not create synch slave");
                result = GNOME_Evolution_Calendar_OtherError;
        }
-       
-       priv->report_changes = TRUE;    
+
+       priv->report_changes = TRUE;
        priv->synch_slave = slave;
-       priv->loaded = TRUE;    
+       priv->loaded = TRUE;
 out:
        return result;
 }
 
 
 static ECalBackendSyncStatus
-caldav_do_open (ECalBackendSync *backend, 
-               EDataCal        *cal, 
+caldav_do_open (ECalBackendSync *backend,
+               EDataCal        *cal,
                gboolean         only_if_exists,
-               const char      *username, 
+               const char      *username,
                const char      *password)
 {
        ECalBackendCalDAV        *cbdav;
        ECalBackendCalDAVPrivate *priv;
        ECalBackendSyncStatus     status;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        status = GNOME_Evolution_Calendar_Success;
-       
+
        g_mutex_lock (priv->lock);
-       
+
        if (priv->loaded != TRUE) {
                priv->ostatus = initialize_backend (cbdav);
-       }       
-       
+       }
+
        if (priv->ostatus != GNOME_Evolution_Calendar_Success) {
                g_mutex_unlock (priv->lock);
                return status;
@@ -1750,21 +1750,21 @@ caldav_do_open (ECalBackendSync *backend,
                        g_mutex_unlock (priv->lock);
                        return GNOME_Evolution_Calendar_AuthenticationRequired;
                }
-               
+
                priv->username = g_strdup (username);
                priv->password = g_strdup (password);
                priv->need_auth = FALSE;
        }
-       
+
        if (! priv->do_offline && priv->mode == CAL_MODE_LOCAL) {
                g_mutex_unlock (priv->lock);
-               return GNOME_Evolution_Calendar_RepositoryOffline; 
+               return GNOME_Evolution_Calendar_RepositoryOffline;
        }
 
        if (priv->mode == CAL_MODE_REMOTE) {
                /* set forward proxy */
                caldav_set_session_proxy (priv);
-       
+
                status = caldav_server_open_calendar (cbdav);
 
                if (status == GNOME_Evolution_Calendar_Success) {
@@ -1776,29 +1776,29 @@ caldav_do_open (ECalBackendSync *backend,
        }
 
        g_mutex_unlock (priv->lock);
-       
+
        return status;
 }
 
 static ECalBackendSyncStatus
-caldav_remove (ECalBackendSync *backend, 
+caldav_remove (ECalBackendSync *backend,
               EDataCal        *cal)
 {
        ECalBackendCalDAV        *cbdav;
        ECalBackendCalDAVPrivate *priv;
        ECalBackendSyncStatus     status;
-       gboolean                  online;       
-       
+       gboolean                  online;
+
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        g_mutex_lock (priv->lock);
-       
+
        if (priv->loaded != TRUE) {
                g_mutex_unlock (priv->lock);
                return GNOME_Evolution_Calendar_Success;
        }
-       
+
        status = check_state (cbdav, &online);
 
        if (status != GNOME_Evolution_Calendar_Success) {
@@ -1808,23 +1808,23 @@ caldav_remove (ECalBackendSync *backend,
 
        e_file_cache_remove (E_FILE_CACHE (priv->cache));
        priv->cache  = NULL;
-       priv->loaded = FALSE;   
+       priv->loaded = FALSE;
        priv->slave_cmd = SLAVE_SHOULD_DIE;
        g_cond_signal (priv->cond);
        g_mutex_unlock (priv->lock);
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
 
 static char *
-pack_cobj (ECalBackendCalDAV *cbdav, ECalComponent *ecomp) 
+pack_cobj (ECalBackendCalDAV *cbdav, ECalComponent *ecomp)
 {
        ECalBackendCalDAVPrivate *priv;
        icalcomponent *calcomp;
        icalcomponent *icomp;
        char          *objstr;
-       
+
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        icomp = e_cal_component_get_icalcomponent (ecomp);
@@ -1842,18 +1842,18 @@ pack_cobj (ECalBackendCalDAV *cbdav, ECalComponent *ecomp)
        }
 
        objstr = icalcomponent_as_ical_string (calcomp);
-       
+
        g_assert (objstr);
-       
+
        return g_strdup (objstr);
-               
+
 }
 
 
 static ECalBackendSyncStatus
-caldav_create_object (ECalBackendSync  *backend, 
-                     EDataCal         *cal, 
-                     char            **calobj, 
+caldav_create_object (ECalBackendSync  *backend,
+                     EDataCal         *cal,
+                     char            **calobj,
                      char            **uid)
 {
        ECalBackendCalDAV        *cbdav;
@@ -1862,7 +1862,7 @@ caldav_create_object (ECalBackendSync  *backend,
        ECalComponent            *comp;
        gboolean                  online;
        char                     *href;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -1881,12 +1881,12 @@ caldav_create_object (ECalBackendSync  *backend,
                g_mutex_unlock (priv->lock);
                return GNOME_Evolution_Calendar_InvalidObject;
        }
-       
+
        if (online) {
                CalDAVObject object;
-       
-               href = e_cal_component_gen_href (comp); 
-       
+
+               href = e_cal_component_gen_href (comp);
+
                object.href  = href;
                object.etag  = NULL;
                object.cdata = pack_cobj (cbdav, comp);
@@ -1895,34 +1895,34 @@ caldav_create_object (ECalBackendSync  *backend,
 
                e_cal_component_set_etag (comp, object.etag);
                caldav_object_free (&object, FALSE);
-               
+
        } else {
                /* mark component as out of synch */
-               e_cal_component_set_synch_state (comp, 
+               e_cal_component_set_synch_state (comp,
                                E_CAL_COMPONENT_LOCALLY_CREATED);
        }
 
        if (status != GNOME_Evolution_Calendar_Success) {
                g_object_unref (comp);
                g_mutex_unlock (priv->lock);
-               return status;  
+               return status;
        }
-       
+
        /* We should prolly check for cache errors
         * but when that happens we are kinda hosed anyway */
        e_cal_backend_cache_put_component (priv->cache, comp);
        *calobj = e_cal_component_get_as_string (comp);
-       
+
        g_mutex_unlock (priv->lock);
-       
-       return status;  
+
+       return status;
 }
 
 static ECalBackendSyncStatus
-caldav_modify_object (ECalBackendSync  *backend, 
-                     EDataCal         *cal, 
+caldav_modify_object (ECalBackendSync  *backend,
+                     EDataCal         *cal,
                      const char       *calobj,
-                     CalObjModType     mod, 
+                     CalObjModType     mod,
                      char            **old_object,
                      char            **new_object)
 {
@@ -1933,7 +1933,7 @@ caldav_modify_object (ECalBackendSync  *backend,
        ECalComponent            *cache_comp;
        gboolean                  online;
        const char               *uid = NULL;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -1952,9 +1952,9 @@ caldav_modify_object (ECalBackendSync  *backend,
                g_mutex_unlock (priv->lock);
                return GNOME_Evolution_Calendar_InvalidObject;
        }
-       
+
        e_cal_component_get_uid (comp, &uid);
-       
+
        cache_comp = e_cal_backend_cache_get_component (priv->cache, uid, NULL);
        if (cache_comp == NULL) {
                g_mutex_unlock (priv->lock);
@@ -1963,7 +1963,7 @@ caldav_modify_object (ECalBackendSync  *backend,
 
        if (online) {
                CalDAVObject object;
-       
+
                object.href  = g_strdup (e_cal_component_get_href (cache_comp));
                object.etag  = g_strdup (e_cal_component_get_etag (cache_comp));
                object.cdata = pack_cobj (cbdav, comp);
@@ -1972,36 +1972,36 @@ caldav_modify_object (ECalBackendSync  *backend,
 
                e_cal_component_set_etag (comp, object.etag);
                caldav_object_free (&object, FALSE);
-               
+
        } else {
                /* mark component as out of synch */
-               e_cal_component_set_synch_state (comp, 
+               e_cal_component_set_synch_state (comp,
                                E_CAL_COMPONENT_LOCALLY_MODIFIED);
        }
 
        if (status != GNOME_Evolution_Calendar_Success) {
                g_object_unref (comp);
                g_mutex_unlock (priv->lock);
-               return status;  
+               return status;
        }
-       
+
        /* We should prolly check for cache errors
         * but when that happens we are kinda hosed anyway */
        e_cal_backend_cache_put_component (priv->cache, comp);
        *old_object = e_cal_component_get_as_string (cache_comp);
        *new_object = e_cal_component_get_as_string (comp);
-       
+
        g_mutex_unlock (priv->lock);
-       
-       return status;  
+
+       return status;
 }
 
 static ECalBackendSyncStatus
-caldav_remove_object (ECalBackendSync  *backend, 
+caldav_remove_object (ECalBackendSync  *backend,
                      EDataCal         *cal,
-                     const char       *uid, 
+                     const char       *uid,
                      const char       *rid,
-                     CalObjModType     mod, 
+                     CalObjModType     mod,
                      char            **old_object,
                      char            **object)
 {
@@ -2010,7 +2010,7 @@ caldav_remove_object (ECalBackendSync  *backend,
        ECalBackendSyncStatus     status;
        ECalComponent            *cache_comp;
        gboolean                  online;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -2031,7 +2031,7 @@ caldav_remove_object (ECalBackendSync  *backend,
 
        if (online) {
                CalDAVObject caldav_object;
-       
+
                caldav_object.href  = g_strdup (e_cal_component_get_href (cache_comp));
                caldav_object.etag  = g_strdup (e_cal_component_get_etag (cache_comp));
                caldav_object.cdata = NULL;
@@ -2039,18 +2039,18 @@ caldav_remove_object (ECalBackendSync  *backend,
                status = caldav_server_delete_object (cbdav, &caldav_object);
 
                caldav_object_free (&caldav_object, FALSE);
-               
+
        } else {
                /* mark component as out of synch */
-               e_cal_component_set_synch_state (cache_comp, 
+               e_cal_component_set_synch_state (cache_comp,
                                E_CAL_COMPONENT_LOCALLY_DELETED);
        }
 
        if (status != GNOME_Evolution_Calendar_Success) {
                g_mutex_unlock (priv->lock);
-               return status;  
+               return status;
        }
-       
+
        *old_object = e_cal_component_get_as_string (cache_comp);
 
        /* We should prolly check for cache errors
@@ -2058,10 +2058,10 @@ caldav_remove_object (ECalBackendSync  *backend,
        e_cal_backend_cache_remove_component (priv->cache, uid, rid);
 
        /* FIXME: set new_object when removing instances of a recurring appointment */
-       
+
        g_mutex_unlock (priv->lock);
-       
-       return status;  
+
+       return status;
 }
 
 static ECalBackendSyncStatus
@@ -2081,12 +2081,12 @@ extract_objects (icalcomponent       *icomp,
 {
        icalcomponent         *scomp;
        icalcomponent_kind     kind;
-       
+
        g_return_val_if_fail (icomp, GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (objects, GNOME_Evolution_Calendar_OtherError);
-       
+
        kind = icalcomponent_isa (icomp);
-       
+
        if (kind == ekind) {
                *objects = g_list_prepend (NULL, icomp);
                return GNOME_Evolution_Calendar_Success;
@@ -2097,15 +2097,15 @@ extract_objects (icalcomponent       *icomp,
        }
 
        *objects = NULL;
-       scomp = icalcomponent_get_first_component (icomp, 
+       scomp = icalcomponent_get_first_component (icomp,
                                                   ekind);
 
        while (scomp) {
-               
+
                /* Remove components from toplevel here */
                *objects = g_list_prepend (*objects, scomp);
                icalcomponent_remove_component (icomp, scomp);
-               
+
                scomp = icalcomponent_get_next_component (icomp, ekind);
        }
 
@@ -2126,14 +2126,14 @@ process_object (ECalBackendCalDAV   *cbdav,
        ECalComponent            *ccomp;
        struct icaltimetype       now;
        ECalComponentId          *id;
-       const char               *uid;  
+       const char               *uid;
        const char               *rid;
        char                     *ostr;
        char                     *oostr;
-       
+
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
        backend = E_CAL_BACKEND (cbdav);
-       
+
        /* ctime, mtime */
        now = icaltime_from_timet (time (NULL), 0);
        e_cal_component_set_created (ecomp, &now);
@@ -2145,17 +2145,17 @@ process_object (ECalBackendCalDAV   *cbdav,
        ccomp = e_cal_backend_cache_get_component (priv->cache, uid, NULL);
 
        if (ccomp != NULL) {
-               oostr = e_cal_component_get_as_string (ccomp);  
+               oostr = e_cal_component_get_as_string (ccomp);
        } else {
                oostr = NULL;
        }
-       
-       ostr = e_cal_component_get_as_string (ecomp);   
-       
+
+       ostr = e_cal_component_get_as_string (ecomp);
+
        status = GNOME_Evolution_Calendar_Success;
-       
+
        switch (method) {
-       
+
                case ICAL_METHOD_PUBLISH:
                case ICAL_METHOD_REQUEST:
                case ICAL_METHOD_REPLY:
@@ -2169,37 +2169,37 @@ process_object (ECalBackendCalDAV   *cbdav,
 
                                href = e_cal_component_get_href (ccomp);
                                etag = e_cal_component_get_etag (ccomp);
-                               
+
                                object.href  = g_strdup (href);
                                object.etag  = g_strdup (etag);
 
                        } else {
                                object.href = e_cal_component_gen_href (ecomp);
                        }
-                       
+
                        object.cdata = pack_cobj (cbdav, ecomp);
                        status = caldav_server_put_object (cbdav, &object);
                        e_cal_component_set_etag (ecomp, object.etag);
                        caldav_object_free (&object, FALSE);
                } else {
                        ECalComponentSyncState sstate;
-                       
+
                        if (ccomp) {
                                sstate = E_CAL_COMPONENT_LOCALLY_MODIFIED;
                        } else {
                                sstate = E_CAL_COMPONENT_LOCALLY_CREATED;
                        }
 
-                       e_cal_component_set_synch_state (ecomp, sstate); 
+                       e_cal_component_set_synch_state (ecomp, sstate);
 
                }
-               
+
                if (status != GNOME_Evolution_Calendar_Success) {
                        break;
                }
 
                e_cal_backend_cache_put_component (priv->cache, ecomp);
-                       
+
                if (ccomp) {
 
                        e_cal_backend_notify_object_modified (backend,
@@ -2207,23 +2207,23 @@ process_object (ECalBackendCalDAV   *cbdav,
                                                              oostr);
 
                } else {
-                               
+
                        e_cal_backend_notify_object_created (backend,
                                                             ostr);
                }
-               
+
                break;
 
 
                case ICAL_METHOD_CANCEL:
-       
+
                        if (ccomp == NULL) {
                                status = GNOME_Evolution_Calendar_ObjectNotFound;
                                break;
                        }
-       
+
                        /* FIXME: this is not working for instances
-                        * of recurring appointments - yet - */ 
+                        * of recurring appointments - yet - */
                        if (online) {
                                CalDAVObject object;
                                const char *href;
@@ -2231,23 +2231,23 @@ process_object (ECalBackendCalDAV   *cbdav,
 
                                href = e_cal_component_get_href (ccomp);
                                etag = e_cal_component_get_etag (ccomp);
-                               
+
                                object.href  = g_strdup (href);
                                object.etag  = g_strdup (etag);
                                object.cdata = NULL;
 
                                status = caldav_server_delete_object (cbdav,
                                                                      &object);
-                       
+
                                caldav_object_free (&object, FALSE);
-                               
+
                        } else {
                                /* mark component as out of synch */
-                               e_cal_component_set_synch_state (ecomp, 
+                               e_cal_component_set_synch_state (ecomp,
                                E_CAL_COMPONENT_LOCALLY_DELETED);
-                               
-                       }       
-               
+
+                       }
+
                        if (status != GNOME_Evolution_Calendar_Success) {
                                break;
                        }
@@ -2257,7 +2257,7 @@ process_object (ECalBackendCalDAV   *cbdav,
                                                              rid);
 
                        id = e_cal_component_get_id (ccomp);
-                       
+
                        e_cal_backend_notify_object_removed (E_CAL_BACKEND (backend),
                                                             id,
                                                             oostr,
@@ -2273,7 +2273,7 @@ process_object (ECalBackendCalDAV   *cbdav,
        g_object_unref (ecomp);
        g_free (ostr);
        g_free (oostr);
-       
+
        if (ccomp) {
                g_object_unref (ccomp);
        }
@@ -2283,7 +2283,7 @@ process_object (ECalBackendCalDAV   *cbdav,
 
 static ECalBackendSyncStatus
 caldav_receive_objects (ECalBackendSync *backend,
-                       EDataCal        *cal, 
+                       EDataCal        *cal,
                        const char      *calobj)
 {
        ECalBackendCalDAV        *cbdav;
@@ -2296,12 +2296,12 @@ caldav_receive_objects (ECalBackendSync *backend,
        GList                    *timezones;
        GList                    *objects;
        GList                    *iter;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
-       
+
        icomp = icalparser_parse_string (calobj);
-       
+
        /* Try to parse cal object string */
        if (icomp == NULL) {
                return GNOME_Evolution_Calendar_InvalidObject;
@@ -2318,12 +2318,12 @@ caldav_receive_objects (ECalBackendSync *backend,
        /* Extract optional timezone compnents */
        kind = ICAL_VTIMEZONE_COMPONENT;
        status = extract_objects (icomp, kind, &timezones);
-       
+
        if (status == GNOME_Evolution_Calendar_Success) {
                /* FIXME: */
                /* Do something usefull with the timezone */
        }
-       
+
        /*   */
        g_mutex_lock (priv->lock);
 
@@ -2334,14 +2334,14 @@ caldav_receive_objects (ECalBackendSync *backend,
                g_mutex_unlock (priv->lock);
                return status;
        }
-       
+
        tmethod = icalcomponent_get_method (icomp);
-       
+
        for (iter = objects; iter && ! is_error (status); iter = iter->next) {
                icalcomponent       *scomp;
                ECalComponent       *ecomp;
                icalproperty_method  method;
-               
+
                scomp = (icalcomponent *) iter->data;
                ecomp = e_cal_component_new ();
 
@@ -2349,32 +2349,32 @@ caldav_receive_objects (ECalBackendSync *backend,
 
                if (icalcomponent_get_first_property (scomp,
                                                      ICAL_METHOD_PROPERTY)) {
-                       
+
                        method = icalcomponent_get_method (scomp);
                } else {
                        method = tmethod;
                }
-               
-               status = process_object (cbdav, ecomp, online, method);         
-               
+
+               status = process_object (cbdav, ecomp, online, method);
+
                g_object_unref (ecomp);
        }
 
        g_list_free (objects);
        g_list_free (timezones);
-       
+
        g_mutex_unlock (priv->lock);
 
-       return status;  
+       return status;
 }
 
 static ECalBackendSyncStatus
-caldav_send_objects (ECalBackendSync  *backend, 
+caldav_send_objects (ECalBackendSync  *backend,
                     EDataCal         *cal,
-                    const char       *calobj, 
+                    const char       *calobj,
                     GList           **users,
                     char            **modified_calobj)
-{      
+{
        *users = NULL;
        *modified_calobj = g_strdup (calobj);
 
@@ -2382,17 +2382,17 @@ caldav_send_objects (ECalBackendSync  *backend,
 }
 
 static ECalBackendSyncStatus
-caldav_get_default_object (ECalBackendSync  *backend, 
-                          EDataCal         *cal, 
+caldav_get_default_object (ECalBackendSync  *backend,
+                          EDataCal         *cal,
                           char            **object)
 {
        ECalComponent *comp;
-       
+
        comp = e_cal_component_new ();
        e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
        *object = e_cal_component_get_as_string (comp);
        g_object_unref (comp);
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -2406,14 +2406,14 @@ caldav_get_object (ECalBackendSync  *backend,
        ECalBackendCalDAV        *cbdav;
        ECalBackendCalDAVPrivate *priv;
        ECalComponent            *comp;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        g_mutex_lock (priv->lock);
        comp = e_cal_backend_cache_get_component (priv->cache, uid, rid);
        g_mutex_unlock (priv->lock);
-       
+
        if (comp == NULL) {
                *object = NULL;
                return GNOME_Evolution_Calendar_ObjectNotFound;
@@ -2421,12 +2421,12 @@ caldav_get_object (ECalBackendSync  *backend,
 
        *object = e_cal_component_get_as_string (comp);
        g_object_unref (comp);
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
 static ECalBackendSyncStatus
-caldav_get_timezone (ECalBackendSync  *backend, 
+caldav_get_timezone (ECalBackendSync  *backend,
                     EDataCal         *cal,
                     const char       *tzid,
                     char            **object)
@@ -2448,44 +2448,44 @@ caldav_get_timezone (ECalBackendSync  *backend,
 
        if (!zone) {
                zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
-               if (!zone) { 
+               if (!zone) {
                        return GNOME_Evolution_Calendar_ObjectNotFound;
                }
        }
 
        icalcomp = icaltimezone_get_component ((icaltimezone *) zone);
-       
+
        if (!icalcomp) {
                return GNOME_Evolution_Calendar_InvalidObject;
        }
-               
+
        *object = g_strdup (icalcomponent_as_ical_string (icalcomp));
 
        return GNOME_Evolution_Calendar_Success;
 }
 
 static ECalBackendSyncStatus
-caldav_add_timezone (ECalBackendSync *backend, 
+caldav_add_timezone (ECalBackendSync *backend,
                     EDataCal        *cal,
                     const char      *tzobj)
 {
        /* FIXME: implement me! */
        g_warning ("function not implemented %s", G_STRFUNC);
-       return GNOME_Evolution_Calendar_Success;        
+       return GNOME_Evolution_Calendar_Success;
 }
 
 static ECalBackendSyncStatus
-caldav_set_default_zone (ECalBackendSync *backend, 
+caldav_set_default_zone (ECalBackendSync *backend,
                             EDataCal        *cal,
                             const char      *tzobj)
 {
        /* FIXME: implement me! */
        g_warning ("function not implemented %s", G_STRFUNC);
-       return GNOME_Evolution_Calendar_Success;        
+       return GNOME_Evolution_Calendar_Success;
 }
 
 static ECalBackendSyncStatus
-caldav_get_object_list (ECalBackendSync  *backend, 
+caldav_get_object_list (ECalBackendSync  *backend,
                        EDataCal         *cal,
                        const char       *sexp_string,
                        GList           **objects)
@@ -2497,7 +2497,7 @@ caldav_get_object_list (ECalBackendSync  *backend,
        ECalBackend              *bkend;
        gboolean                  do_search;
        GList                    *list, *iter;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -2506,7 +2506,7 @@ caldav_get_object_list (ECalBackendSync  *backend,
        if (sexp == NULL) {
                return GNOME_Evolution_Calendar_InvalidQuery;
        }
-       
+
        if (g_str_equal (sexp, "#t")) {
                do_search = FALSE;
        } else {
@@ -2516,15 +2516,15 @@ caldav_get_object_list (ECalBackendSync  *backend,
        *objects = NULL;
        bcache = priv->cache;
 
-       g_mutex_lock (priv->lock);      
-       
+       g_mutex_lock (priv->lock);
+
        list = e_cal_backend_cache_get_components (bcache);
        bkend = E_CAL_BACKEND (backend);
-       
+
        for (iter = list; iter; iter = g_list_next (iter)) {
-               ECalComponent *comp = E_CAL_COMPONENT (iter->data);     
-       
-               if (do_search == FALSE || 
+               ECalComponent *comp = E_CAL_COMPONENT (iter->data);
+
+               if (do_search == FALSE ||
                    e_cal_backend_sexp_match_comp (sexp, comp, bkend)) {
                        char *str = e_cal_component_get_as_string (comp);
                        *objects = g_list_prepend (*objects, str);
@@ -2537,12 +2537,12 @@ caldav_get_object_list (ECalBackendSync  *backend,
        g_list_free (list);
 
        g_mutex_unlock (priv->lock);
-       
-       return GNOME_Evolution_Calendar_Success;                
+
+       return GNOME_Evolution_Calendar_Success;
 }
 
 static void
-caldav_start_query (ECalBackend  *backend, 
+caldav_start_query (ECalBackend  *backend,
                    EDataCalView *query)
 {
        ECalBackendCalDAV        *cbdav;
@@ -2555,27 +2555,27 @@ caldav_start_query (ECalBackend  *backend,
 
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
-       
+
        sexp_string = e_data_cal_view_get_text (query);
        sexp = e_cal_backend_sexp_new (sexp_string);
 
        /* FIXME:check invalid sexp */
-       
+
        if (g_str_equal (sexp, "#t")) {
                do_search = FALSE;
        } else {
                do_search = TRUE;
        }
-       
+
        g_mutex_lock (priv->lock);
 
        list = e_cal_backend_cache_get_components (priv->cache);
        bkend = E_CAL_BACKEND (backend);
-       
+
        for (iter = list; iter; iter = g_list_next (iter)) {
-               ECalComponent *comp = E_CAL_COMPONENT (iter->data);     
-       
-               if (do_search == FALSE || 
+               ECalComponent *comp = E_CAL_COMPONENT (iter->data);
+
+               if (do_search == FALSE ||
                    e_cal_backend_sexp_match_comp (sexp, comp, bkend)) {
                        char *str = e_cal_component_get_as_string (comp);
                        e_data_cal_view_notify_objects_added_1 (query, str);
@@ -2588,44 +2588,44 @@ caldav_start_query (ECalBackend  *backend,
        g_object_unref (sexp);
        g_list_free (list);
 
-       
+
        e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_Success);
        g_mutex_unlock (priv->lock);
        return;
 }
 
 static ECalBackendSyncStatus
-caldav_get_free_busy (ECalBackendSync  *backend, 
-                     EDataCal         *cal, 
+caldav_get_free_busy (ECalBackendSync  *backend,
+                     EDataCal         *cal,
                      GList            *users,
-                     time_t            start, 
-                     time_t            end, 
+                     time_t            start,
+                     time_t            end,
                      GList           **freebusy)
 {
        /* FIXME: implement me! */
        g_warning ("function not implemented %s", G_STRFUNC);
-       return GNOME_Evolution_Calendar_OtherError;     
+       return GNOME_Evolution_Calendar_OtherError;
 }
 
 static ECalBackendSyncStatus
 caldav_get_changes (ECalBackendSync  *backend,
                    EDataCal         *cal,
                    const char       *change_id,
-                   GList           **adds, 
-                   GList           **modifies, 
+                   GList           **adds,
+                   GList           **modifies,
                    GList **deletes)
 {
        /* FIXME: implement me! */
        g_warning ("function not implemented %s", G_STRFUNC);
-       return GNOME_Evolution_Calendar_OtherError;     
+       return GNOME_Evolution_Calendar_OtherError;
 }
 
 static gboolean
 caldav_is_loaded (ECalBackend *backend)
-       
+
 {      ECalBackendCalDAV        *cbdav;
 ECalBackendCalDAVPrivate *priv;
-       
+
 cbdav = E_CAL_BACKEND_CALDAV (backend);
 priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -2640,8 +2640,8 @@ caldav_get_mode (ECalBackend *backend)
 
        cbdav = E_CAL_BACKEND_CALDAV (backend);
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
-       
-       return priv->mode;      
+
+       return priv->mode;
 }
 
 static void
@@ -2654,19 +2654,19 @@ caldav_set_mode (ECalBackend *backend, CalMode mode)
        priv  = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        g_mutex_lock (priv->lock);
-       
-       /* We only support online and offline 
+
+       /* We only support online and offline
         * (is there something else?) */
        if (mode != CAL_MODE_REMOTE &&
            mode != CAL_MODE_LOCAL) {
-               e_cal_backend_notify_mode (backend, 
+               e_cal_backend_notify_mode (backend,
                                           GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED,
                                           cal_mode_to_corba (mode));
        }
 
        if (priv->mode == mode || priv->loaded == FALSE) {
                priv->mode = mode;
-               e_cal_backend_notify_mode (backend, 
+               e_cal_backend_notify_mode (backend,
                                           GNOME_Evolution_Calendar_CalListener_MODE_SET,
                                           cal_mode_to_corba (mode));
                g_mutex_unlock (priv->lock);
@@ -2682,7 +2682,7 @@ caldav_set_mode (ECalBackend *backend, CalMode mode)
                priv->slave_cmd = SLAVE_SHOULD_SLEEP;
        }
 
-       e_cal_backend_notify_mode (backend, 
+       e_cal_backend_notify_mode (backend,
                                   GNOME_Evolution_Calendar_CalListener_MODE_SET,
                                   cal_mode_to_corba (mode));
 
@@ -2696,7 +2696,7 @@ caldav_internal_get_default_timezone (ECalBackend *backend)
 }
 
 static icaltimezone *
-caldav_internal_get_timezone (ECalBackend *backend, 
+caldav_internal_get_timezone (ECalBackend *backend,
                              const char *tzid)
 {
        icaltimezone *zone;
@@ -2706,7 +2706,7 @@ caldav_internal_get_timezone (ECalBackend *backend,
        if (!zone) {
                zone = icaltimezone_get_utc_timezone ();
        }
-       
+
        return zone;
 }
 
@@ -2720,7 +2720,7 @@ e_cal_backend_caldav_dispose (GObject *object)
 {
        ECalBackendCalDAV        *cbdav;
        ECalBackendCalDAVPrivate *priv;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (object);
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
@@ -2730,7 +2730,7 @@ e_cal_backend_caldav_dispose (GObject *object)
                g_mutex_unlock (priv->lock);
                return;
        }
-       
+
        /* stop the slave  */
        priv->slave_cmd = SLAVE_SHOULD_DIE;
        g_cond_signal (priv->cond);
@@ -2740,7 +2740,7 @@ e_cal_backend_caldav_dispose (GObject *object)
        g_mutex_lock (priv->lock);
 
        g_object_unref (priv->session);
-       
+
        g_free (priv->username);
        g_free (priv->password);
        g_free (priv->uri);
@@ -2748,10 +2748,10 @@ e_cal_backend_caldav_dispose (GObject *object)
        if (priv->cache != NULL) {
                g_object_unref (priv->cache);
        }
-       
+
        priv->disposed = TRUE;
        g_mutex_unlock (priv->lock);
-               
+
        if (G_OBJECT_CLASS (parent_class)->dispose)
                (* G_OBJECT_CLASS (parent_class)->dispose) (object);
 }
@@ -2761,13 +2761,13 @@ e_cal_backend_caldav_finalize (GObject *object)
 {
        ECalBackendCalDAV        *cbdav;
        ECalBackendCalDAVPrivate *priv;
-       
+
        cbdav = E_CAL_BACKEND_CALDAV (object);
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        g_mutex_free (priv->lock);
        g_cond_free (priv->cond);
-       
+
        if (G_OBJECT_CLASS (parent_class)->finalize)
                (* G_OBJECT_CLASS (parent_class)->finalize) (object);
 }
@@ -2780,11 +2780,11 @@ e_cal_backend_caldav_init (ECalBackendCalDAV *cbdav)
        priv = E_CAL_BACKEND_CALDAV_GET_PRIVATE (cbdav);
 
        priv->session = soup_session_sync_new ();
-       
+
        priv->disposed = FALSE;
        priv->do_synch = FALSE;
        priv->loaded   = FALSE;
-       
+
        priv->cond = g_cond_new ();
        priv->lock = g_mutex_new ();
 
@@ -2792,12 +2792,12 @@ e_cal_backend_caldav_init (ECalBackendCalDAV *cbdav)
        priv->slave_cmd = SLAVE_SHOULD_SLEEP;
        priv->refresh_time.tv_usec = 0;
        priv->refresh_time.tv_sec  = DEFAULT_REFRESH_TIME;
-       
+
        g_signal_connect (priv->session, "authenticate",
                          G_CALLBACK (soup_authenticate), cbdav);
        g_signal_connect (priv->session, "reauthenticate",
                          G_CALLBACK (soup_reauthenticate), cbdav);
-       
+
        e_cal_backend_sync_set_lock (E_CAL_BACKEND_SYNC (cbdav), FALSE);
 }
 
@@ -2820,20 +2820,20 @@ e_cal_backend_caldav_class_init (ECalBackendCalDAVClass *class)
 
        object_class->dispose  = e_cal_backend_caldav_dispose;
        object_class->finalize = e_cal_backend_caldav_finalize;
-       
+
        sync_class->is_read_only_sync            = caldav_is_read_only;
        sync_class->get_cal_address_sync         = caldav_get_cal_address;
        sync_class->get_alarm_email_address_sync = caldav_get_alarm_email_address;
        sync_class->get_ldap_attribute_sync      = caldav_get_ldap_attribute;
        sync_class->get_static_capabilities_sync = caldav_get_static_capabilities;
-       
+
        sync_class->open_sync                    = caldav_do_open;
        sync_class->remove_sync                  = caldav_remove;
-       
+
        sync_class->create_object_sync = caldav_create_object;
        sync_class->modify_object_sync = caldav_modify_object;
        sync_class->remove_object_sync = caldav_remove_object;
-       
+
        sync_class->discard_alarm_sync        = caldav_discard_alarm;
        sync_class->receive_objects_sync      = caldav_receive_objects;
        sync_class->send_objects_sync         = caldav_send_objects;
index 3f0c7e9..97e3bad 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * Author: Christian Kellner <gicmo@gnome.org> 
+ * Author: Christian Kellner <gicmo@gnome.org>
  */
 
 #ifndef E_CAL_BACKEND_CALDAV_H
index 4cc027b..b951c34 100644 (file)
@@ -46,14 +46,14 @@ static ECalBackendSyncClass *parent_class;
 /* Private part of the ECalBackendContacts structure */
 struct _ECalBackendContactsPrivate {
         ESourceList  *addressbook_sources;
-        
+
         GHashTable   *addressbooks;       /* UID -> BookRecord */
         gboolean      addressbook_loaded;
 
         EBookView    *book_view;
         GHashTable   *tracked_contacts;   /* UID -> ContactRecord */
 
-       GHashTable *zones;      
+       GHashTable *zones;
        icaltimezone *default_zone;
 };
 
@@ -91,10 +91,10 @@ book_record_new (ECalBackendContacts *cbc, ESource *source)
         EBookQuery *query;
         EBookView  *book_view;
         BookRecord *br;
-        
+
        book = e_book_new (source, NULL);
         e_book_open (book, TRUE, NULL);
-        
+
         /* Create book view */
         fields = g_list_append (fields, (char*)e_contact_field_name (E_CONTACT_FILE_AS));
         fields = g_list_append (fields, (char*)e_contact_field_name (E_CONTACT_BIRTH_DATE));
@@ -129,7 +129,7 @@ book_record_free (BookRecord *br)
 {
         if (!br)
                 return;
-        
+
         g_object_unref (br->book_view);
         g_object_unref (br->book);
 
@@ -142,7 +142,7 @@ contact_record_new (ECalBackendContacts *cbc, EContact *contact)
 {
         ContactRecord *cr = g_new0 (ContactRecord, 1);
        char *comp_str;
-        
+
         cr->cbc = g_object_ref (cbc);
         cr->contact = contact;
         cr->comp_birthday = create_birthday (cbc, contact);
@@ -154,7 +154,7 @@ contact_record_new (ECalBackendContacts *cbc, EContact *contact)
                                                     comp_str);
                g_free (comp_str);
        }
-        
+
        if (cr->comp_anniversary) {
 
                comp_str = e_cal_component_get_as_string (cr->comp_anniversary);
@@ -164,7 +164,7 @@ contact_record_new (ECalBackendContacts *cbc, EContact *contact)
        }
 
         g_object_ref (G_OBJECT (contact));
-        
+
         return cr;
 }
 
@@ -193,7 +193,7 @@ contact_record_free (ContactRecord *cr)
                id = e_cal_component_get_id (cr->comp_anniversary);
 
                e_cal_backend_notify_object_removed (E_CAL_BACKEND (cr->cbc), id, comp_str, NULL);
-               
+
                e_cal_component_free_id (id);
                g_free (comp_str);
                g_object_unref (G_OBJECT (cr->comp_anniversary));
@@ -206,7 +206,7 @@ contact_record_free (ContactRecord *cr)
 /* ContactRecordCB methods */
 typedef struct _ContactRecordCB {
         ECalBackendContacts *cbc;
-        ECalBackendSExp     *sexp;        
+        ECalBackendSExp     *sexp;
         GList               *result;
 } ContactRecordCB;
 
@@ -227,7 +227,7 @@ contact_record_cb_free (ContactRecordCB *cb_data)
 {
         g_list_foreach (cb_data->result, (GFunc) g_free, NULL);
         g_list_free (cb_data->result);
-        
+
         g_free (cb_data);
 }
 
@@ -262,7 +262,7 @@ static void
 source_added_cb (ESourceGroup *group, ESource *source, gpointer user_data)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
-        
+
         g_return_if_fail (cbc);
 
         add_source (cbc, source);
@@ -273,7 +273,7 @@ source_removed_cb (ESourceGroup *group, ESource *source, gpointer user_data)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
         const char          *uid = e_source_peek_uid (source);
-        
+
         g_return_if_fail (cbc);
 
         g_hash_table_remove (cbc->priv->addressbooks, uid);
@@ -285,7 +285,7 @@ source_group_added_cb (ESourceList *source_list, ESourceGroup *group, gpointer u
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
         const gchar *base_uri;
         GSList *i;
-        
+
         g_return_if_fail (cbc);
 
         base_uri = e_source_group_peek_base_uri (group);
@@ -310,14 +310,14 @@ source_group_removed_cb (ESourceList *source_list, ESourceGroup *group, gpointer
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
         GSList *i = NULL;
-        
+
         g_return_if_fail (cbc);
-        
+
         /* Unload all address books from this group */
         for (i = e_source_group_peek_sources (group); i; i = i->next) {
                 ESource *source = E_SOURCE (i->data);
                 const char *uid = e_source_peek_uid (source);
-                
+
                 g_hash_table_remove (cbc->priv->addressbooks, uid);
         }
 }
@@ -333,7 +333,7 @@ contacts_changed_cb (EBookView *book_view, const GList *contacts, gpointer user_
         for (i = contacts; i; i = i->next) {
                 EContact *contact = E_CONTACT (i->data);
                 const char *uid = e_contact_get_const (contact, E_CONTACT_UID);
-                
+
                 /* Because this is a change of contact, then always remove old tracked data
                   and if possible, add with (possibly) new values.
                */
@@ -358,17 +358,17 @@ contacts_added_cb (EBookView *book_view, const GList *contacts, gpointer user_da
         {
                 EContact *contact = E_CONTACT (i->data);
                 EContactDate *birthday, *anniversary;
-                
+
                 birthday = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
                 anniversary = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
-                                             
+
                 if (birthday || anniversary) {
                         ContactRecord *cr = contact_record_new (cbc, contact);
                         const char    *uid = e_contact_get_const (contact, E_CONTACT_UID);
-                        
+
                         g_hash_table_insert (cbc->priv->tracked_contacts, g_strdup (uid), cr);
                 }
-                
+
                 e_contact_date_free (birthday);
                 e_contact_date_free (anniversary);
         }
@@ -402,7 +402,7 @@ cdate_to_icaltime (EContactDate *cdate)
        ret.is_utc = FALSE;
        ret.zone = NULL;
        ret.is_daylight = FALSE;
-       
+
        ret.hour = ret.minute = ret.second = 0;
 
        return ret;
@@ -426,7 +426,7 @@ create_component (ECalBackendContacts *cbc, const char *uid, EContactDate *cdate
                 return NULL;
 
         ical_comp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
-       
+
         /* Create the event object */
         cal_comp = e_cal_component_new ();
        e_cal_component_set_icalcomponent (cal_comp, ical_comp);
@@ -434,47 +434,47 @@ create_component (ECalBackendContacts *cbc, const char *uid, EContactDate *cdate
        /* Set uid */
        d(g_message ("Creating UID: %s", uid));
        e_cal_component_set_uid (cal_comp, uid);
-       
+
         /* Set all-day event's date from contact data */
         itt = cdate_to_icaltime (cdate);
         dt.value = &itt;
         dt.tzid = NULL;
         e_cal_component_set_dtstart (cal_comp, &dt);
-        
+
        itt = cdate_to_icaltime (cdate);
        icaltime_adjust (&itt, 1, 0, 0, 0);
        dt.value = &itt;
        dt.tzid = NULL;
        /* We have to add 1 day to DTEND, as it is not inclusive. */
        e_cal_component_set_dtend (cal_comp, &dt);
+
         /* Create yearly recurrence */
         icalrecurrencetype_clear (&r);
         r.freq = ICAL_YEARLY_RECURRENCE;
        r.interval = 1;
         recur_list.data = &r;
-        recur_list.next = NULL;        
+        recur_list.next = NULL;
         e_cal_component_set_rrule_list (cal_comp, &recur_list);
 
         /* Create summary */
         comp_summary.value = summary;
         comp_summary.altrep = NULL;
         e_cal_component_set_summary (cal_comp, &comp_summary);
-       
+
        /* Set category and visibility */
        if (g_str_has_suffix (uid, ANNIVERSARY_UID_EXT))
                e_cal_component_set_categories (cal_comp, _("Anniversary"));
        else if (g_str_has_suffix (uid, BIRTHDAY_UID_EXT))
                e_cal_component_set_categories (cal_comp, _("Birthday"));
-       
+
        e_cal_component_set_classification (cal_comp, E_CAL_COMPONENT_CLASS_PRIVATE);
 
        /* Birthdays/anniversaries are shown as free time */
        e_cal_component_set_transparency (cal_comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
-       
+
         /* Don't forget to call commit()! */
        e_cal_component_commit_sequence (cal_comp);
-        
+
         return cal_comp;
 }
 
@@ -492,13 +492,13 @@ create_birthday (ECalBackendContacts *cbc, EContact *contact)
 
        uid = g_strdup_printf ("%s%s", (char *) e_contact_get_const (contact, E_CONTACT_UID), BIRTHDAY_UID_EXT);
         summary = g_strdup_printf (_("Birthday: %s"), name);
-        
+
         cal_comp = create_component (cbc, uid, cdate, summary);
 
         e_contact_date_free (cdate);
         g_free (uid);
         g_free (summary);
-        
+
         return cal_comp;
 }
 
@@ -510,13 +510,13 @@ create_anniversary (ECalBackendContacts *cbc, EContact *contact)
        char          *summary;
         const char    *name;
         char *uid;
-        
+
         cdate = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
         name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
 
        uid = g_strdup_printf ("%s%s", (char *) e_contact_get_const (contact, E_CONTACT_UID), ANNIVERSARY_UID_EXT);
         summary = g_strdup_printf (_("Anniversary: %s"), name);
-        
+
         cal_comp = create_component (cbc, uid, cdate, summary);
 
         e_contact_date_free (cdate);
@@ -548,7 +548,7 @@ e_cal_backend_contacts_get_ldap_attribute (ECalBackendSync *backend, EDataCal *c
                                           char **attribute)
 {
        *attribute = NULL;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -593,10 +593,10 @@ e_cal_backend_contacts_get_object (ECalBackendSync *backend, EDataCal *cal,
                                   char **object)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
-        ECalBackendContactsPrivate *priv = cbc->priv;  
+        ECalBackendContactsPrivate *priv = cbc->priv;
        ContactRecord *record;
        char *real_uid;
-       
+
        if (!uid)
                return GNOME_Evolution_Calendar_ObjectNotFound;
        else if (g_str_has_suffix (uid, ANNIVERSARY_UID_EXT))
@@ -608,17 +608,17 @@ e_cal_backend_contacts_get_object (ECalBackendSync *backend, EDataCal *cal,
 
        record = g_hash_table_lookup (priv->tracked_contacts, real_uid);
        g_free (real_uid);
-       
+
        if (!record)
                return GNOME_Evolution_Calendar_ObjectNotFound;
 
         if (record->comp_birthday && g_str_has_suffix (uid, BIRTHDAY_UID_EXT)) {
                 *object = e_cal_component_get_as_string (record->comp_birthday);
-               
+
                d(g_message ("Return birthday: %s", *object));
                return GNOME_Evolution_Calendar_Success;
        }
-       
+
         if (record->comp_anniversary && g_str_has_suffix (uid, ANNIVERSARY_UID_EXT)) {
                 *object = e_cal_component_get_as_string (record->comp_anniversary);
 
@@ -645,23 +645,23 @@ e_cal_backend_contacts_get_free_busy (ECalBackendSync *backend, EDataCal *cal,
 #if 0
        icalproperty *prop;
        icalparameter *param;
-               
+
        prop = icalproperty_new_organizer (address);
        if (prop != NULL && cn != NULL) {
                param = icalparameter_new_cn (cn);
-               icalproperty_add_parameter (prop, param);                       
+               icalproperty_add_parameter (prop, param);
        }
        if (prop != NULL)
-               icalcomponent_add_property (vfb, prop);         
+               icalcomponent_add_property (vfb, prop);
 #endif
-       
+
        icalcomponent_set_dtstart (vfb, icaltime_from_timet_with_zone (start, FALSE, utc_zone));
        icalcomponent_set_dtend (vfb, icaltime_from_timet_with_zone (end, FALSE, utc_zone));
 
        calobj = icalcomponent_as_ical_string (vfb);
        *freebusy = g_list_append (NULL, g_strdup (calobj));
-       icalcomponent_free (vfb);       
-       
+       icalcomponent_free (vfb);
+
        /* WRITE ME */
        return GNOME_Evolution_Calendar_Success;
 }
@@ -687,7 +687,7 @@ static ECalBackendSyncStatus
 e_cal_backend_contacts_receive_objects (ECalBackendSync *backend, EDataCal *cal,
                                        const char *calobj)
 {
-       return GNOME_Evolution_Calendar_PermissionDenied;       
+       return GNOME_Evolution_Calendar_PermissionDenied;
 }
 
 static ECalBackendSyncStatus
@@ -705,7 +705,7 @@ e_cal_backend_contacts_send_objects (ECalBackendSync *backend, EDataCal *cal,
 static CalMode
 e_cal_backend_contacts_get_mode (ECalBackend *backend)
 {
-       return CAL_MODE_LOCAL;  
+       return CAL_MODE_LOCAL;
 }
 
 static void
@@ -714,7 +714,7 @@ e_cal_backend_contacts_set_mode (ECalBackend *backend, CalMode mode)
        e_cal_backend_notify_mode (backend,
                                   GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED,
                                   GNOME_Evolution_Calendar_MODE_LOCAL);
-       
+
 }
 
 static ECalBackendSyncStatus
@@ -722,7 +722,7 @@ e_cal_backend_contacts_is_read_only (ECalBackendSync *backend, EDataCal *cal,
                                     gboolean *read_only)
 {
        *read_only = TRUE;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -738,7 +738,7 @@ e_cal_backend_contacts_open (ECalBackendSync *backend, EDataCal *cal,
 
         if (priv->addressbook_loaded)
                 return GNOME_Evolution_Calendar_Success;
-               
+
         if (priv->default_zone && priv->default_zone != icaltimezone_get_utc_timezone ()) {
                icalcomponent *icalcomp = icaltimezone_get_component (priv->default_zone);
                icaltimezone *zone = icaltimezone_new ();
@@ -806,7 +806,7 @@ e_cal_backend_contacts_add_timezone (ECalBackendSync *backend, EDataCal *cal, co
        ECalBackendContactsPrivate *priv;
        icalcomponent *tz_comp;
        icaltimezone *zone;
-       char *tzid;     
+       char *tzid;
 
        cbcontacts = (ECalBackendContacts *) backend;
 
@@ -814,24 +814,24 @@ e_cal_backend_contacts_add_timezone (ECalBackendSync *backend, EDataCal *cal, co
        g_return_val_if_fail (tzobj != NULL, GNOME_Evolution_Calendar_OtherError);
 
        priv = cbcontacts->priv;
-       
+
        tz_comp = icalparser_parse_string (tzobj);
        if (!tz_comp)
                return GNOME_Evolution_Calendar_InvalidObject;
 
        if (icalcomponent_isa (tz_comp) != ICAL_VTIMEZONE_COMPONENT)
                return GNOME_Evolution_Calendar_InvalidObject;
-       
+
        zone = icaltimezone_new ();
        icaltimezone_set_component (zone, tz_comp);
        tzid = icaltimezone_get_tzid (zone);
-       
+
        if (g_hash_table_lookup (priv->zones, tzid)) {
                icaltimezone_free (zone, TRUE);
-               
+
                return GNOME_Evolution_Calendar_Success;
        }
-       
+
        g_hash_table_insert (priv->zones, g_strdup (tzid), zone);
 
        return GNOME_Evolution_Calendar_Success;
@@ -887,8 +887,8 @@ e_cal_backend_contacts_get_object_list (ECalBackendSync *backend, EDataCal *cal,
        /* Don't call cb_data_free as that would destroy the results
         * in *objects */
        g_free (cb_data);
-       
-       return GNOME_Evolution_Calendar_Success;        
+
+       return GNOME_Evolution_Calendar_Success;
 }
 
 static void
@@ -898,7 +898,7 @@ e_cal_backend_contacts_start_query (ECalBackend *backend, EDataCalView *query)
         ECalBackendContactsPrivate *priv = cbc->priv;
         ECalBackendSExp *sexp;
         ContactRecordCB *cb_data;
-        
+
         sexp = e_data_cal_view_get_object_sexp (query);
        if (!sexp) {
                e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_InvalidQuery);
@@ -906,12 +906,12 @@ e_cal_backend_contacts_start_query (ECalBackend *backend, EDataCalView *query)
        }
 
         cb_data = contact_record_cb_new (cbc, sexp);
-        
+
         g_hash_table_foreach (priv->tracked_contacts, contact_record_cb, cb_data);
         e_data_cal_view_notify_objects_added (query, cb_data->result);
 
         contact_record_cb_free (cb_data);
-        
+
        e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_Success);
 }
 
@@ -956,13 +956,13 @@ e_cal_backend_contacts_finalize (GObject *object)
        if (priv->default_zone && priv->default_zone != icaltimezone_get_utc_timezone ()) {
                icaltimezone_free (priv->default_zone, 1);
        }
-       
+
        priv->default_zone = NULL;
        g_object_unref (priv->addressbook_sources);
        g_hash_table_destroy (priv->addressbooks);
         g_hash_table_destroy (priv->tracked_contacts);
         g_hash_table_destroy (priv->zones);
-        
+
        g_free (priv);
        cbc->priv = NULL;
 
@@ -984,10 +984,10 @@ e_cal_backend_contacts_init (ECalBackendContacts *cbc, ECalBackendContactsClass
                                                     g_free, (GDestroyNotify) book_record_free);
         priv->tracked_contacts = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                         g_free, (GDestroyNotify)contact_record_free);
-        
+
        priv->zones = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_zone);
        priv->default_zone = icaltimezone_get_utc_timezone ();
-        
+
        cbc->priv = priv;
 
        e_cal_backend_sync_set_lock (E_CAL_BACKEND_SYNC (cbc), TRUE);
@@ -1052,11 +1052,11 @@ e_cal_backend_contacts_class_init (ECalBackendContactsClass *class)
 
 /**
  * e_cal_backend_contacts_get_type:
- * @void: 
- * 
+ * @void:
+ *
  * Registers the #ECalBackendContacts class if necessary, and returns
  * the type ID associated to it.
- * 
+ *
  * Return value: The type ID of the #ECalBackendContacts class.
  **/
 GType
index fd527a2..2b5525c 100644 (file)
@@ -46,11 +46,11 @@ static GObjectClass *parent_class;
 
 /**
  * e_cal_backend_file_events_get_type:
- * @void: 
- * 
+ * @void:
+ *
  * Registers the #ECalBackendFileEvents class if necessary, and returns the type ID
  * associated to it.
- * 
+ *
  * Return value: The type ID of the #ECalBackendFileEvents class.
  **/
 GType
index f3adc24..4b92878 100644 (file)
@@ -33,11 +33,11 @@ static ECalBackendFileClass *parent_class;
 
 /**
  * e_cal_backend_file_journal_get_type:
- * @void: 
- * 
+ * @void:
+ *
  * Registers the #ECalBackendFileJournal class if necessary, and returns the type ID
  * associated to it.
- * 
+ *
  * Return value: The type ID of the #ECalBackendFileJournal class.
  **/
 GType
index 99eaa8d..d74a76c 100644 (file)
@@ -46,11 +46,11 @@ static ECalBackendFileClass *parent_class;
 
 /**
  * e_cal_backend_file_todos_get_type:
- * @void: 
- * 
+ * @void:
+ *
  * Registers the #ECalBackendFileTodos class if necessary, and returns the type ID
  * associated to it.
- * 
+ *
  * Return value: The type ID of the #ECalBackendFileTodos class.
  **/
 GType
index c60ef15..3bc74b6 100644 (file)
@@ -59,7 +59,7 @@ struct _ECalBackendFilePrivate {
        char *uri;
 
        /* Filename in the dir */
-       char *file_name;        
+       char *file_name;
        gboolean read_only;
        gboolean is_dirty;
        guint dirty_idle_id;
@@ -82,7 +82,7 @@ struct _ECalBackendFilePrivate {
        GHashTable *comp_uid_hash;
 
        GList *comp;
-       
+
        /* The calendar's default timezone, used for resolving DATE and
           floating DATE-TIME values. */
        icaltimezone *default_zone;
@@ -129,7 +129,7 @@ save_file_when_idle (gpointer user_data)
        gchar *tmp, *backup_uristr;
        char *buf;
        ECalBackendFile *cbfile = user_data;
-       
+
        priv = cbfile->priv;
        g_assert (priv->uri != NULL);
        g_assert (priv->icalcomp != NULL);
@@ -151,7 +151,7 @@ save_file_when_idle (gpointer user_data)
                gnome_vfs_uri_unref (uri);
                goto error_malformed_uri;
        }
-               
+
        backup_uristr = g_strconcat (tmp, "~", NULL);
        backup_uri = gnome_vfs_uri_new (backup_uristr);
 
@@ -162,7 +162,7 @@ save_file_when_idle (gpointer user_data)
                gnome_vfs_uri_unref (uri);
                goto error_malformed_uri;
        }
-       
+
        result = gnome_vfs_create_uri (&handle, backup_uri,
                                        GNOME_VFS_OPEN_WRITE,
                                        FALSE, 0666);
@@ -304,7 +304,7 @@ e_cal_backend_file_finalize (GObject *object)
        if (priv->file_name) {
                g_free (priv->file_name);
                priv->file_name = NULL;
-       }       
+       }
        g_free (priv);
        cbfile->priv = NULL;
 
@@ -338,7 +338,7 @@ e_cal_backend_file_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboole
        ECalBackendFile *cbfile = (ECalBackendFile *) backend;
 
        *read_only = cbfile->priv->read_only;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -358,7 +358,7 @@ static ECalBackendSyncStatus
 e_cal_backend_file_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
 {
        *attribute = NULL;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -369,7 +369,7 @@ e_cal_backend_file_get_alarm_email_address (ECalBackendSync *backend, EDataCal *
         * with it (although that would be a useful feature some day).
         */
        *address = NULL;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -380,7 +380,7 @@ e_cal_backend_file_get_static_capabilities (ECalBackendSync *backend, EDataCal *
                                  CAL_STATIC_CAPABILITY_NO_THISANDFUTURE ","
                                  CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED ","
                                  CAL_STATIC_CAPABILITY_NO_THISANDPRIOR);
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -438,13 +438,13 @@ get_rid_icaltime (ECalComponent *comp)
 {
        ECalComponentRange range;
         struct icaltimetype tt;
-                                                                                   
+
         e_cal_component_get_recurid (comp, &range);
         if (!range.datetime.value)
                 return icaltime_null_time ();
         tt = *range.datetime.value;
         e_cal_component_free_range (&range);
-                                                                                   
+
         return tt;
 }
 
@@ -467,11 +467,11 @@ add_component (ECalBackendFile *cbfile, ECalComponent *comp, gboolean add_to_top
                g_warning ("The component does not have a valid UID skipping it\n");
                return;
        }
-               
+
        obj_data = g_hash_table_lookup (priv->comp_uid_hash, uid);
        if (e_cal_component_is_instance (comp)) {
                const char *rid;
-       
+
                rid = e_cal_component_get_recurid_as_string (comp);
                if (obj_data) {
                        if (g_hash_table_lookup (obj_data->recurrences, rid)) {
@@ -603,7 +603,7 @@ scan_vcalendar (ECalBackendFile *cbfile)
                ECalComponent *comp;
 
                icalcomp = icalcompiter_deref (&iter);
-               
+
                kind = icalcomponent_isa (icalcomp);
 
                if (!(kind == ICAL_VEVENT_COMPONENT
@@ -631,7 +631,7 @@ get_uri_string_for_gnome_vfs (ECalBackend *backend)
 
        cbfile = E_CAL_BACKEND_FILE (backend);
        priv = cbfile->priv;
-       
+
        master_uri = e_cal_backend_get_uri (backend);
 
        /* FIXME Check the error conditions a little more elegantly here */
@@ -640,11 +640,11 @@ get_uri_string_for_gnome_vfs (ECalBackend *backend)
 
                return NULL;
        }
-       
+
        full_uri = g_strdup_printf ("%s/%s", master_uri, priv->file_name);
        uri = gnome_vfs_uri_new (full_uri);
        g_free (full_uri);
-       
+
        if (!uri)
                return NULL;
 
@@ -660,7 +660,7 @@ get_uri_string_for_gnome_vfs (ECalBackend *backend)
                g_free (str_uri);
 
                return NULL;
-       }       
+       }
 
        return str_uri;
 }
@@ -715,7 +715,7 @@ notify_removals_cb (gpointer key, gpointer value, gpointer data)
        if (!g_hash_table_lookup (context->new_uid_hash, uid)) {
                icalcomponent *old_icomp;
                gchar *old_obj_str;
-               ECalComponent *comp; 
+               ECalComponent *comp;
                ECalComponentId *id;
 
                /* Object was removed */
@@ -727,13 +727,13 @@ notify_removals_cb (gpointer key, gpointer value, gpointer data)
                old_obj_str = icalcomponent_as_ical_string (old_icomp);
                if (!old_obj_str)
                        return;
-               
+
                comp = e_cal_component_new_from_string (old_obj_str);
                id = e_cal_component_get_id (comp);
-               
+
 
                e_cal_backend_notify_object_removed (context->backend, id, old_obj_str, NULL);
-       
+
                e_cal_component_free_id (id);
                g_object_unref (comp);
        }
@@ -898,7 +898,7 @@ e_cal_backend_file_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
        ECalBackendFilePrivate *priv;
        char *str_uri;
        ECalBackendSyncStatus status;
-       
+
        cbfile = E_CAL_BACKEND_FILE (backend);
        priv = cbfile->priv;
         g_static_rec_mutex_lock (&priv->idle_save_rmutex);
@@ -908,13 +908,13 @@ e_cal_backend_file_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
                status = GNOME_Evolution_Calendar_Success;
                goto done;
         }
-       
+
        str_uri = get_uri_string (E_CAL_BACKEND (backend));
        if (!str_uri) {
                status = GNOME_Evolution_Calendar_OtherError;
                goto done;
         }
-       
+
        if (g_access (str_uri, R_OK) == 0) {
                status = open_cal (cbfile, str_uri);
                if (g_access (str_uri, W_OK) != 0)
@@ -953,7 +953,7 @@ e_cal_backend_file_remove (ECalBackendSync *backend, EDataCal *cal)
        GDir *dir = NULL;
        GError *error = NULL;
         ECalBackendSyncStatus status = GNOME_Evolution_Calendar_Success;
-       
+
        cbfile = E_CAL_BACKEND_FILE (backend);
        priv = cbfile->priv;
         g_static_rec_mutex_lock (&priv->idle_save_rmutex);
@@ -992,7 +992,7 @@ e_cal_backend_file_remove (ECalBackendSync *backend, EDataCal *cal)
        if (g_rmdir (dirname) != 0) {
                status = GNOME_Evolution_Calendar_OtherError;
         }
-               
+
   done:
         if (dir) {
             g_dir_close (dir);
@@ -1028,7 +1028,7 @@ e_cal_backend_file_get_mode (ECalBackend *backend)
        cbfile = E_CAL_BACKEND_FILE (backend);
        priv = cbfile->priv;
 
-       return CAL_MODE_LOCAL;  
+       return CAL_MODE_LOCAL;
 }
 
 /* Set_mode handler for the file backend */
@@ -1038,14 +1038,14 @@ e_cal_backend_file_set_mode (ECalBackend *backend, CalMode mode)
        e_cal_backend_notify_mode (backend,
                                   GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED,
                                   GNOME_Evolution_Calendar_MODE_LOCAL);
-       
+
 }
 
 static ECalBackendSyncStatus
 e_cal_backend_file_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
 {
        ECalComponent *comp;
-       
+
        comp = e_cal_component_new ();
 
        switch (e_cal_backend_get_kind (E_CAL_BACKEND (backend))) {
@@ -1062,10 +1062,10 @@ e_cal_backend_file_get_default_object (ECalBackendSync *backend, EDataCal *cal,
                g_object_unref (comp);
                return GNOME_Evolution_Calendar_ObjectNotFound;
        }
-       
+
        *object = e_cal_component_get_as_string (comp);
        g_object_unref (comp);
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -1077,7 +1077,7 @@ add_detached_recur_to_vcalendar (gpointer key, gpointer value, gpointer user_dat
 
        icalcomponent_add_component (
                vcalendar,
-               icalcomponent_new_clone (e_cal_component_get_icalcomponent (recurrence)));                   
+               icalcomponent_new_clone (e_cal_component_get_icalcomponent (recurrence)));
 }
 
 /* Get_object_component handler for the file backend */
@@ -1179,7 +1179,7 @@ e_cal_backend_file_get_timezone (ECalBackendSync *backend, EDataCal *cal, const
                        }
                }
        }
-       
+
        icalcomp = icaltimezone_get_component (zone);
        if (!icalcomp) {
                g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
@@ -1339,15 +1339,15 @@ e_cal_backend_file_get_object_list (ECalBackendSync *backend, EDataCal *cal, con
        *objects = match_data.obj_list;
 
        g_object_unref (match_data.obj_sexp);
-       
-       return GNOME_Evolution_Calendar_Success;        
+
+       return GNOME_Evolution_Calendar_Success;
 }
 
 /* Gets the list of attachments */
 static ECalBackendSyncStatus
-e_cal_backend_file_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **list) 
+e_cal_backend_file_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **list)
 {
-        
+
        /* TODO implement the function */
        return GNOME_Evolution_Calendar_Success;
 }
@@ -1415,14 +1415,14 @@ free_busy_instance (ECalComponent *comp,
        ipt.start = icaltime_from_timet_with_zone (instance_start, FALSE, utc_zone);
        ipt.end = icaltime_from_timet_with_zone (instance_end, FALSE, utc_zone);
        ipt.duration = icaldurationtype_null_duration ();
-       
+
         /* add busy information to the vfb component */
        prop = icalproperty_new (ICAL_FREEBUSY_PROPERTY);
        icalproperty_set_freebusy (prop, ipt);
-       
+
        param = icalparameter_new_fbtype (ICAL_FBTYPE_BUSY);
        icalproperty_add_parameter (prop, param);
-       
+
        icalcomponent_add_property (vfb, prop);
 
        return TRUE;
@@ -1431,14 +1431,14 @@ free_busy_instance (ECalComponent *comp,
 static icalcomponent *
 create_user_free_busy (ECalBackendFile *cbfile, const char *address, const char *cn,
                       time_t start, time_t end)
-{      
+{
        ECalBackendFilePrivate *priv;
        GList *l;
        icalcomponent *vfb;
        icaltimezone *utc_zone;
        ECalBackendSExp *obj_sexp;
        char *query, *iso_start, *iso_end;
-       
+
        priv = cbfile->priv;
 
        /* create the (unique) VFREEBUSY object that we'll return */
@@ -1446,14 +1446,14 @@ create_user_free_busy (ECalBackendFile *cbfile, const char *address, const char
        if (address != NULL) {
                icalproperty *prop;
                icalparameter *param;
-               
+
                prop = icalproperty_new_organizer (address);
                if (prop != NULL && cn != NULL) {
                        param = icalparameter_new_cn (cn);
-                       icalproperty_add_parameter (prop, param);                       
+                       icalproperty_add_parameter (prop, param);
                }
                if (prop != NULL)
-                       icalcomponent_add_property (vfb, prop);         
+                       icalcomponent_add_property (vfb, prop);
        }
        utc_zone = icaltimezone_get_utc_timezone ();
        icalcomponent_set_dtstart (vfb, icaltime_from_timet_with_zone (start, FALSE, utc_zone));
@@ -1476,7 +1476,7 @@ create_user_free_busy (ECalBackendFile *cbfile, const char *address, const char
                ECalComponent *comp = l->data;
                icalcomponent *icalcomp, *vcalendar_comp;
                icalproperty *prop;
-               
+
                icalcomp = e_cal_component_get_icalcomponent (comp);
                if (!icalcomp)
                        continue;
@@ -1490,10 +1490,10 @@ create_user_free_busy (ECalBackendFile *cbfile, const char *address, const char
                            transp_val == ICAL_TRANSP_TRANSPARENTNOCONFLICT)
                                continue;
                }
-       
+
                if (!e_cal_backend_sexp_match_comp (obj_sexp, l->data, E_CAL_BACKEND (cbfile)))
                        continue;
-               
+
                vcalendar_comp = icalcomponent_get_parent (icalcomp);
                e_cal_recur_generate_instances (comp, start, end,
                                                free_busy_instance,
@@ -1504,7 +1504,7 @@ create_user_free_busy (ECalBackendFile *cbfile, const char *address, const char
        }
        g_object_unref (obj_sexp);
 
-       return vfb;     
+       return vfb;
 }
 
 /* Get_free_busy handler for the file backend */
@@ -1514,7 +1514,7 @@ e_cal_backend_file_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
 {
        ECalBackendFile *cbfile;
        ECalBackendFilePrivate *priv;
-       gchar *address, *name;  
+       gchar *address, *name;
        icalcomponent *vfb;
        char *calobj;
        GList *l;
@@ -1529,7 +1529,7 @@ e_cal_backend_file_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
        g_static_rec_mutex_lock (&priv->idle_save_rmutex);
 
        *freebusy = NULL;
-       
+
        if (users == NULL) {
                if (e_cal_backend_mail_account_get_default (&address, &name)) {
                        vfb = create_user_free_busy (cbfile, address, name, start, end);
@@ -1538,10 +1538,10 @@ e_cal_backend_file_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
                        icalcomponent_free (vfb);
                        g_free (address);
                        g_free (name);
-               }               
+               }
        } else {
                for (l = users; l != NULL; l = l->next ) {
-                       address = l->data;                      
+                       address = l->data;
                        if (e_cal_backend_mail_account_is_valid (address, &name)) {
                                vfb = create_user_free_busy (cbfile, address, name, start, end);
                                calobj = icalcomponent_as_ical_string (vfb);
@@ -1549,7 +1549,7 @@ e_cal_backend_file_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
                                icalcomponent_free (vfb);
                                g_free (name);
                        }
-               }               
+               }
        }
 
        g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
@@ -1557,7 +1557,7 @@ e_cal_backend_file_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
        return GNOME_Evolution_Calendar_Success;
 }
 
-typedef struct 
+typedef struct
 {
        ECalBackendFile *backend;
        icalcomponent_kind kind;
@@ -1569,7 +1569,7 @@ static gboolean
 e_cal_backend_file_compute_changes_foreach_key (const char *key, gpointer value, gpointer data)
 {
        ECalBackendFileComputeChangesData *be_data = data;
-       
+
        if (!lookup_component (be_data->backend, key)) {
                ECalComponent *comp;
 
@@ -1610,9 +1610,9 @@ e_cal_backend_file_compute_changes (ECalBackendFile *cbfile, const char *change_
                g_free (filename);
                return GNOME_Evolution_Calendar_OtherError;
        }
-       
+
        g_free (filename);
-       
+
        g_static_rec_mutex_lock (&priv->idle_save_rmutex);
 
        /* Calculate adds and modifies */
@@ -1647,14 +1647,14 @@ e_cal_backend_file_compute_changes (ECalBackendFile *cbfile, const char *change_
        be_data.kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbfile));
        be_data.deletes = NULL;
        be_data.ehash = ehash;
-       
+
        e_xmlhash_foreach_key_remove (ehash, (EXmlHashRemoveFunc)e_cal_backend_file_compute_changes_foreach_key, &be_data);
-       
+
        *deletes = be_data.deletes;
 
        e_xmlhash_write (ehash);
        e_xmlhash_destroy (ehash);
-       
+
        g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
        return GNOME_Evolution_Calendar_Success;
 }
@@ -1730,7 +1730,7 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
        ECalComponentDateTime dt;
        icaltimezone *zone, *default_zone;
 
-       /* Check dtstart, dtend and due's timezone, and convert it to local 
+       /* Check dtstart, dtend and due's timezone, and convert it to local
         * default timezone if the timezone is not in our builtin timezone
         * list */
        e_cal_component_get_dtstart (comp, &dt);
@@ -1756,7 +1756,7 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
                }
        }
        e_cal_component_free_datetime (&dt);
-        
+
        e_cal_component_get_due (comp, &dt);
        if (dt.value && dt.tzid) {
                zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *)cbfile, dt.tzid);
@@ -1770,7 +1770,7 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
        e_cal_component_free_datetime (&dt);
        e_cal_component_abort_sequence (comp);
 
-}      
+}
 
 static ECalBackendSyncStatus
 e_cal_backend_file_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
@@ -1781,7 +1781,7 @@ e_cal_backend_file_create_object (ECalBackendSync *backend, EDataCal *cal, char
        ECalComponent *comp;
        const char *comp_uid;
        struct icaltimetype current;
-       
+
        cbfile = E_CAL_BACKEND_FILE (backend);
        priv = cbfile->priv;
 
@@ -1888,7 +1888,7 @@ remove_object_instance_cb (gpointer key, gpointer value, gpointer user_data)
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj, 
+e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj,
                                  CalObjModType mod, char **old_object, char **new_object)
 {
        RemoveRecurrenceData rrdata;
@@ -1903,7 +1903,7 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 
        cbfile = E_CAL_BACKEND_FILE (backend);
        priv = cbfile->priv;
-               
+
        g_return_val_if_fail (priv->icalcomp != NULL, GNOME_Evolution_Calendar_NoSuchCal);
        g_return_val_if_fail (calobj != NULL, GNOME_Evolution_Calendar_ObjectNotFound);
 
@@ -1981,7 +1981,7 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
                }
 
                /* add the detached instance */
-               g_hash_table_insert (obj_data->recurrences, 
+               g_hash_table_insert (obj_data->recurrences,
                                     g_strdup (rid),
                                     comp);
                icalcomponent_add_component (priv->icalcomp,
@@ -2039,7 +2039,7 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
                priv->comp = g_list_prepend (priv->comp, obj_data->full_object);
 
                /* add the new detached recurrence */
-               g_hash_table_insert (obj_data->recurrences, 
+               g_hash_table_insert (obj_data->recurrences,
                                     g_strdup (e_cal_component_get_recurid_as_string (comp)),
                                     comp);
                icalcomponent_add_component (priv->icalcomp,
@@ -2056,11 +2056,11 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 
                        start = icalcomponent_get_dtstart (icalcomp);
 
-                       /* This means its a instance generated from master object. So replace 
+                       /* This means its a instance generated from master object. So replace
                            the dates stored dates from the master object */
-                       if (!recur.zone)   
+                       if (!recur.zone)
                                recur.zone = start.zone;
-                       
+
                        if (icaltime_compare_date_only (start, recur) == 0) {
                                ECalComponentDateTime m_sdate, m_endate;
 
@@ -2069,11 +2069,11 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
 
                                if (icaltime_compare (start, recur) != 0) {
                                        icaltimetype end = icalcomponent_get_dtend (icalcomp);
-                                       
+
                                        m_sdate.value->hour = start.hour;
                                        m_sdate.value->minute = start.minute;
-                                       m_sdate.value->second = 
-                                               
+                                       m_sdate.value->second =
+
                                        m_endate.value->hour = end.hour;
                                        m_endate.value->minute = end.minute;
                                        m_endate.value->second = end.second;
@@ -2083,11 +2083,11 @@ e_cal_backend_file_modify_object (ECalBackendSync *backend, EDataCal *cal, const
                                e_cal_component_set_dtend (comp, &m_endate);
                                e_cal_component_set_recurid (comp, NULL);
                                e_cal_component_commit_sequence (comp);
-                       } 
+                       }
                        e_cal_component_set_recurid (comp, NULL);
                        *new_object = e_cal_component_get_as_string (comp);
                }
-               
+
                /* Remove the old version */
                if (old_object)
                        *old_object = e_cal_component_get_as_string (obj_data->full_object);
@@ -2131,7 +2131,7 @@ remove_instance (ECalBackendFile *cbfile, ECalBackendFileObject *obj_data, const
        e_cal_util_remove_instances (e_cal_component_get_icalcomponent (obj_data->full_object),
                                     icaltime_from_string (rid), CALOBJ_MOD_THIS);
 
-       /* add the modified object to the beginning of the list, 
+       /* add the modified object to the beginning of the list,
           so that it's always before any detached instance we
           might have */
        icalcomponent_add_component (cbfile->priv->icalcomp,
@@ -2154,7 +2154,7 @@ get_object_string_from_fileobject (ECalBackendFileObject *obj_data, const char *
                        /* FIXME remove this once we delete an instance from master object through
                           modify request by setting exception */
                        return e_cal_component_get_as_string (comp);
-               }       
+               }
        }
 
        return NULL;
@@ -2189,10 +2189,10 @@ e_cal_backend_file_remove_object (ECalBackendSync *backend, EDataCal *cal,
                g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
                return GNOME_Evolution_Calendar_ObjectNotFound;
        }
-       
+
        if (rid && *rid)
                recur_id = rid;
-       
+
        comp = obj_data->full_object;
 
        switch (mod) {
@@ -2239,7 +2239,7 @@ e_cal_backend_file_remove_object (ECalBackendSync *backend, EDataCal *cal,
                rrdata.mod = mod;
                g_hash_table_foreach_remove (obj_data->recurrences, (GHRFunc) remove_object_instance_cb, &rrdata);
 
-               /* add the modified object to the beginning of the list, 
+               /* add the modified object to the beginning of the list,
                   so that it's always before any detached instance we
                   might have */
                priv->comp = g_list_prepend (priv->comp, comp);
@@ -2287,7 +2287,7 @@ cancel_received_object (ECalBackendFile *cbfile, icalcomponent *icalcomp)
 
 typedef struct {
        GHashTable *zones;
-       
+
        gboolean found;
 } ECalBackendFileTzidData;
 
@@ -2296,7 +2296,7 @@ check_tzids (icalparameter *param, void *data)
 {
        ECalBackendFileTzidData *tzdata = data;
        const char *tzid;
-       
+
        tzid = icalparameter_get_tzid (param);
        if (!tzid || g_hash_table_lookup (tzdata->zones, tzid))
                tzdata->found = FALSE;
@@ -2321,7 +2321,7 @@ fetch_attachments (ECalBackendSync *backend, ECalComponent *comp)
        /*FIXME  get the uri rather than computing the path */
        attach_store = g_build_filename (g_get_home_dir (),
                        ".evolution/calendar/local/system", NULL);
-       
+
        for (l = attach_list; l ; l = l->next) {
                char *sfname = (char *)l->data;
                char *filename, *new_filename;
@@ -2414,13 +2414,13 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
        subcomp = icalcomponent_get_first_component (toplevel_comp, ICAL_VTIMEZONE_COMPONENT);
        while (subcomp) {
                icaltimezone *zone;
-               
+
                zone = icaltimezone_new ();
                if (icaltimezone_set_component (zone, subcomp))
                        g_hash_table_insert (tzdata.zones, g_strdup (icaltimezone_get_tzid (zone)), NULL);
-               
+
                subcomp = icalcomponent_get_next_component (toplevel_comp, ICAL_VTIMEZONE_COMPONENT);
-       }       
+       }
 
        /* First we make sure all the components are usuable */
        comps = del_comps = NULL;
@@ -2429,7 +2429,7 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
        subcomp = icalcomponent_get_first_component (toplevel_comp, ICAL_ANY_COMPONENT);
        while (subcomp) {
                icalcomponent_kind child_kind = icalcomponent_isa (subcomp);
-               
+
                if (child_kind != kind) {
                        /* remove the component from the toplevel VCALENDAR */
                        if (child_kind != ICAL_VTIMEZONE_COMPONENT)
@@ -2438,7 +2438,7 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
                        subcomp = icalcomponent_get_next_component (toplevel_comp, ICAL_ANY_COMPONENT);
                        continue;
                }
-                       
+
                tzdata.found = TRUE;
                icalcomponent_foreach_tzid (subcomp, check_tzids, &tzdata);
 
@@ -2446,7 +2446,7 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
                        status = GNOME_Evolution_Calendar_InvalidObject;
                        goto error;
                }
-               
+
                if (!icalcomponent_get_uid (subcomp)) {
                        if (toplevel_method == ICAL_METHOD_PUBLISH) {
 
@@ -2459,9 +2459,9 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
                                status = GNOME_Evolution_Calendar_InvalidObject;
                                goto error;
                        }
-                       
+
                }
-               
+
                comps = g_list_prepend (comps, subcomp);
                subcomp = icalcomponent_get_next_component (toplevel_comp, ICAL_ANY_COMPONENT);
        }
@@ -2473,7 +2473,7 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
                ECalBackendFileObject *obj_data;
 
                subcomp = l->data;
-       
+
                /* Create the cal component */
                comp = e_cal_component_new ();
                e_cal_component_set_icalcomponent (comp, subcomp);
@@ -2527,8 +2527,8 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
                case ICAL_METHOD_COUNTER:
                        status = GNOME_Evolution_Calendar_UnsupportedMethod;
                        goto error;
-                       break;                  
-               case ICAL_METHOD_DECLINECOUNTER:                        
+                       break;
+               case ICAL_METHOD_DECLINECOUNTER:
                        status = GNOME_Evolution_Calendar_UnsupportedMethod;
                        goto error;
                        break;
@@ -2561,15 +2561,15 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend, EDataCal *cal, con
        }
 
        g_list_free (comps);
-       
+
        /* Now we remove the components we don't care about */
        for (l = del_comps; l; l = l->next) {
                subcomp = l->data;
-               
+
                icalcomponent_remove_component (toplevel_comp, subcomp);
-               icalcomponent_free (subcomp);           
+               icalcomponent_free (subcomp);
        }
-       
+
        g_list_free (del_comps);
 
        /* Merge the iCalendar components with our existing VCALENDAR,
@@ -2675,11 +2675,11 @@ e_cal_backend_file_class_init (ECalBackendFileClass *class)
 
 /**
  * e_cal_backend_file_get_type:
- * @void: 
- * 
+ * @void:
+ *
  * Registers the #ECalBackendFile class if necessary, and returns the type ID
  * associated to it.
- * 
+ *
  * Return value: The type ID of the #ECalBackendFile class.
  **/
 GType
@@ -2709,7 +2709,7 @@ void
 e_cal_backend_file_set_file_name (ECalBackendFile *cbfile, const char *file_name)
 {
        ECalBackendFilePrivate *priv;
-       
+
        g_return_if_fail (cbfile != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_FILE (cbfile));
        g_return_if_fail (file_name != NULL);
@@ -2719,7 +2719,7 @@ e_cal_backend_file_set_file_name (ECalBackendFile *cbfile, const char *file_name
 
        if (priv->file_name)
                g_free (priv->file_name);
-       
+
        priv->file_name = g_strdup (file_name);
 
         g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
@@ -2733,7 +2733,7 @@ e_cal_backend_file_get_file_name (ECalBackendFile *cbfile)
        g_return_val_if_fail (cbfile != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_FILE (cbfile), NULL);
 
-       priv = cbfile->priv;    
+       priv = cbfile->priv;
 
        return priv->file_name;
 }
@@ -2744,7 +2744,7 @@ e_cal_backend_file_reload (ECalBackendFile *cbfile)
        ECalBackendFilePrivate *priv;
        char *str_uri;
        ECalBackendSyncStatus status;
-       
+
        priv = cbfile->priv;
         g_static_rec_mutex_lock (&priv->idle_save_rmutex);
 
index 0ed6323..1e38f2e 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
 
-#ifdef CONFIG_H        
+#ifdef CONFIG_H
 #include <config.h>
 #endif
 
@@ -47,7 +47,7 @@ e_cal_backend_google_factory_instance_init (ECalBackendGoogleFactory *factory)
 static const gchar *
 get_protocol (ECalBackendFactory *factory)
 {
-       return "google"; 
+       return "google";
 }
 
 static ECalBackend *
index 312ffa3..c94a624 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -16,7 +16,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -35,5 +35,5 @@ void eds_module_list_types (const GType **types, int *num_types);
 
 G_END_DECLS
 
-#endif 
+#endif
 
index 6b6a4b5..9064ecf 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -16,7 +16,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  */
 
@@ -64,7 +64,7 @@
 #endif
 
 #define GDATA_SCHEMA "http://schemas.google.com/g/2005#"
-#define CACHE_REFRESH_INTERVAL 10000 
+#define CACHE_REFRESH_INTERVAL 10000
 
 /****************************************************** Google Connection Helper Functions ***********************************************/
 
@@ -76,15 +76,15 @@ static gboolean get_deltas_timeout (gpointer cbgo);
 static void utils_update_insertion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, EGoItem *item, GSList *cache_keys);
 static void utils_update_deletion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, GSList *cache_keys);
 
-/** 
+/**
  *
  * e_cal_backend_google_utils_populate_cache:
  * @cbgo ECalBackendGoogle Object
  * Populates the cache with intial values
- * 
+ *
  **/
 static void
-e_cal_backend_google_utils_populate_cache (ECalBackendGoogle *cbgo) 
+e_cal_backend_google_utils_populate_cache (ECalBackendGoogle *cbgo)
 {
        ECalComponent *comp=NULL;
        ECalBackendCache *cache;
@@ -97,8 +97,8 @@ e_cal_backend_google_utils_populate_cache (ECalBackendGoogle *cbgo)
        cache = e_cal_backend_google_get_cache (cbgo);
        kind = e_cal_backend_get_kind (E_CAL_BACKEND(cbgo));
        temp = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
-       
-       item = e_cal_backend_google_get_item (cbgo);            
+
+       item = e_cal_backend_google_get_item (cbgo);
        entries = gdata_feed_get_entries (item->feed);
        priv = cbgo->priv;
 
@@ -109,25 +109,25 @@ e_cal_backend_google_utils_populate_cache (ECalBackendGoogle *cbgo)
                        gchar *comp_str;
                        e_cal_component_commit_sequence (comp);
                        comp_str = e_cal_component_get_as_string (comp);
-                       
+
                        e_cal_backend_notify_object_created (E_CAL_BACKEND(cbgo), (const char *)comp_str);
                        e_cal_backend_cache_put_component (cache, comp);
                        g_object_unref (comp);
                }
        }
-       
-       e_cal_backend_notify_view_done (E_CAL_BACKEND(cbgo), GNOME_Evolution_Calendar_Success);  
+
+       e_cal_backend_notify_view_done (E_CAL_BACKEND(cbgo), GNOME_Evolution_Calendar_Success);
 }
 
 
 /**
- * 
+ *
  * e_cal_backend_google_utils_create_cache:
- * @cbgo: ECalBackendGoogle 
- * Creates / Updates Cache 
- * 
+ * @cbgo: ECalBackendGoogle
+ * Creates / Updates Cache
+ *
  **/
-static gpointer 
+static gpointer
 e_cal_backend_google_utils_create_cache (ECalBackendGoogle *cbgo)
 {
        ESource *source;
@@ -136,7 +136,7 @@ e_cal_backend_google_utils_create_cache (ECalBackendGoogle *cbgo)
        const gchar *refresh_interval = NULL;
        ECalBackendCache *cache;
 
-       source = e_cal_backend_get_source (E_CAL_BACKEND (cbgo));       
+       source = e_cal_backend_get_source (E_CAL_BACKEND (cbgo));
        refresh_interval = e_source_get_property (source, "refresh");
 
        cache = e_cal_backend_google_get_cache (cbgo);
@@ -145,7 +145,7 @@ e_cal_backend_google_utils_create_cache (ECalBackendGoogle *cbgo)
                e_cal_backend_cache_set_marker (cache);
        } else
                get_deltas_timeout (cbgo);
-       
+
        if (refresh_interval)
                x = atoi (refresh_interval);
 
@@ -154,19 +154,19 @@ e_cal_backend_google_utils_create_cache (ECalBackendGoogle *cbgo)
                                  (gpointer)cbgo);
        e_cal_backend_google_set_timeout_id (cbgo, timeout_id);
 
-       return GINT_TO_POINTER (GNOME_Evolution_Calendar_Success);      
+       return GINT_TO_POINTER (GNOME_Evolution_Calendar_Success);
 }
 
 
 /**
  * e_cal_backend_google_utils_update:
  *
- * @handle: 
- * Call this to Update changes, made to the calendar.  
+ * @handle:
+ * Call this to Update changes, made to the calendar.
  *
- * Return value: TRUE if update is successful FALSE otherwise . 
+ * Return value: TRUE if update is successful FALSE otherwise .
  **/
-gboolean               
+gboolean
 e_cal_backend_google_utils_update (gpointer handle)
 {
        ECalBackendGoogle *cbgo;
@@ -193,17 +193,17 @@ e_cal_backend_google_utils_update (gpointer handle)
 
        cbgo = (ECalBackendGoogle *)handle;
        priv = cbgo->priv;
-       
+
        cache = e_cal_backend_google_get_cache (cbgo);
        item =  e_cal_backend_google_get_item (cbgo);
        service = e_cal_backend_google_get_service (cbgo);
        uri = e_cal_backend_google_get_uri (cbgo);
-       
+
        item->feed = gdata_service_get_feed (GDATA_SERVICE(service), uri);
        entries_list = gdata_feed_get_entries (item->feed);
        cache_keys = e_cal_backend_cache_get_keys (cache);
-       kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgo));   
-       
+       kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgo));
+
        for (iter_list = entries_list; iter_list != NULL; iter_list = iter_list->next) {
                gchar *id;
                id = gdata_entry_get_id ((GDataEntry *)iter_list->data);
@@ -220,12 +220,12 @@ e_cal_backend_google_utils_update (gpointer handle)
 
                if (!(remove = g_slist_find_custom (cache_keys, iter_list->data, func))) {
                        uid_list = g_slist_prepend (uid_list, g_strdup ((gchar *)iter_list->data));
-                       needs_to_insert = TRUE; 
+                       needs_to_insert = TRUE;
                }else {
-                       cache_keys = g_slist_remove_link (cache_keys, remove); 
+                       cache_keys = g_slist_remove_link (cache_keys, remove);
                }
 
-               if (remove)     
+               if (remove)
                        g_slist_free (remove);
        }
 
@@ -237,18 +237,18 @@ e_cal_backend_google_utils_update (gpointer handle)
                utils_update_insertion (cbgo, cache, item,uid_list);
                needs_to_insert = FALSE;
        }
-       
+
        if (ids_list) {
                ids_list = NULL;
                g_slist_free (ids_list);
        }
-       
+
        if (uid_list) {
                /*FIXME could crash while freeing*/
                uid_list = NULL;
                g_slist_free (uid_list);
        }
-       
+
        if (entries_list) {
                /* FIXME could crash while freeing */
                entries_list = NULL;
@@ -265,14 +265,14 @@ e_cal_backend_google_utils_update (gpointer handle)
 }
 
 ECalBackendSyncStatus
-e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo) 
+e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo)
 {
        ECalBackendCache *cache;
        EGoItem *item;
        ESource *source;
        GDataFeed *feed;
        GDataGoogleService *service;
-       
+
        ECalSourceType source_type;
        icalcomponent_kind kind;
        icaltimezone *default_zone;
@@ -285,7 +285,7 @@ e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo)
        gchar *uri, *suri;
 
        source = e_cal_backend_get_source (E_CAL_BACKEND(cbgo));
-       
+
        service = gdata_google_service_new ("cl", "evolution-client-0.0.1");
        e_cal_backend_google_set_service (cbgo, service);
 
@@ -294,39 +294,39 @@ e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo)
        e_cal_backend_google_set_uri (cbgo, uri);
 
        g_free (suri);
-       
+
        username = e_cal_backend_google_get_username (cbgo);
        password = e_cal_backend_google_get_password (cbgo);
        gdata_service_set_credentials (GDATA_SERVICE(service), username, password);
        feed = gdata_service_get_feed (GDATA_SERVICE(service), uri);
-       
+
        if (!feed) {
                g_critical ("%s, Authentication Failed \n ", G_STRLOC);
                return GNOME_Evolution_Calendar_AuthenticationFailed;
        }
-       
+
        entries = gdata_feed_get_entries (feed);
-       
+
        item = g_new0 (EGoItem, 1);
        item->entry = e_cal_backend_google_get_entry (cbgo);
        item->feed = feed;
-       
+
        cache = e_cal_backend_google_get_cache (cbgo);
        service = e_cal_backend_google_get_service (cbgo);
 
        e_cal_backend_google_set_item (cbgo, item);
-       
+
        /* For event sync */
        if (cache && service) {
-               
+
                /* FIXME Get the current mode */
                mode_changed = FALSE;
                timeout_id = e_cal_backend_google_get_timeout_id (cbgo);
 
                if (!mode_changed && !timeout_id) {
-                       GThread *t1;    
+                       GThread *t1;
 
-                       /*FIXME Set the mode to be changed */   
+                       /*FIXME Set the mode to be changed */
                        t1 = g_thread_create ((GThreadFunc)e_cal_backend_google_utils_update, cbgo, FALSE, NULL);
                        if (!t1) {
                                e_cal_backend_notify_error (E_CAL_BACKEND (cbgo), _("Could not create thread for getting deltas"));
@@ -336,9 +336,9 @@ e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo)
                        timeout_id = g_timeout_add (CACHE_REFRESH_INTERVAL, (GSourceFunc) get_deltas_timeout, (gpointer)cbgo);
                        e_cal_backend_google_set_timeout_id (cbgo, timeout_id);
                }
-               
-               return GNOME_Evolution_Calendar_Success; 
-       } 
+
+               return GNOME_Evolution_Calendar_Success;
+       }
        /* FIXME Set the mode to be changed */
        kind = e_cal_backend_get_kind (E_CAL_BACKEND(cbgo));
        switch (kind) {
@@ -354,7 +354,7 @@ e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo)
                default:
                        source_type = E_CAL_SOURCE_TYPE_EVENT;
        }
-       
+
        /* Creating cache when in remote  */
        if (GDATA_IS_GOOGLE_SERVICE (service)) {
                cache = e_cal_backend_cache_new (e_cal_backend_get_uri (E_CAL_BACKEND (cbgo)),source_type);
@@ -365,7 +365,7 @@ e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo)
                return GNOME_Evolution_Calendar_OtherError;
        }
 
-       default_zone = e_cal_backend_google_get_default_zone (cbgo);    
+       default_zone = e_cal_backend_google_get_default_zone (cbgo);
        e_cal_backend_cache_put_default_timezone (cache, default_zone);
        e_cal_backend_google_utils_create_cache (cbgo);
        thread = g_thread_create ((GThreadFunc)e_cal_backend_google_utils_create_cache, (gpointer) cbgo, FALSE, &error);
@@ -376,20 +376,20 @@ e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo)
 
                e_cal_backend_notify_error (E_CAL_BACKEND (cbgo), _("Could not create thread for populating cache"));
                return GNOME_Evolution_Calendar_OtherError;
-       } 
+       }
 
        return GNOME_Evolution_Calendar_Success;
 
 }
 
 
-/*************************************************** EGoItem Functions*********************************************/ 
+/*************************************************** EGoItem Functions*********************************************/
 
 /**
  * e_go_item_to_cal_component:
  * @item a EGoItem object
  * @cbgo a ECalBackendGoogle object
- * 
+ *
  * Creates a EGoItem from ECalComponent
  **/
 
@@ -400,22 +400,22 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
        ECalComponentText text;
        ECalComponentDateTime dt;
        icaltimezone *default_zone;
-       const char *description, *uid, *temp;   
+       const char *description, *uid, *temp;
        struct icaltimetype itt_utc, itt;
        GSList *category_ids;
 
        comp = e_cal_component_new ();
        default_zone = e_cal_backend_google_get_default_zone (cbgo);
-       
+
        if (!default_zone)
                g_message("Critical Default zone not set %s", G_STRLOC);
+
        e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
 
        /* Description*/
        description = gdata_entry_get_content (item->entry);
        if (description) {
-               GSList l;       
+               GSList l;
                text.value = description;
                text.altrep = NULL;
                l.data = &text;
@@ -423,11 +423,11 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
                e_cal_component_set_description_list (comp, &l);
 
        }
-               
+
        /*Creation*/
        temp = gdata_entry_get_start_time (item->entry);
        temp = gd_date_to_ical (g_strdup(temp));
-       
+
        if (temp) {
                itt_utc = icaltime_from_string (temp);
                itt_utc.zone = default_zone;
@@ -435,7 +435,7 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
                if (!icaltime_get_timezone (itt_utc))
                        icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
                if (default_zone) {
-                       itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+                       itt = icaltime_convert_to_zone (itt_utc, default_zone);
                        icaltime_set_timezone (&itt, default_zone);
                        e_cal_component_set_created (comp, &itt);
                        e_cal_component_set_dtstamp (comp, &itt);
@@ -448,12 +448,12 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
        }
        dt.value = &itt;
        dt.tzid = icaltimezone_get_tzid (default_zone);
-       e_cal_component_set_dtstart (comp, &dt);        
+       e_cal_component_set_dtstart (comp, &dt);
        e_cal_component_set_created (comp, &itt_utc);
        e_cal_component_set_dtstamp (comp, &itt_utc);
-       
+
        /* Summary of the Entry */
-       text.value = gdata_entry_get_title (item->entry); 
+       text.value = gdata_entry_get_title (item->entry);
        text.altrep = NULL;
        if (text.value != NULL)
                e_cal_component_set_summary (comp, &text);
@@ -468,7 +468,7 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
        temp = NULL;
        temp = gdata_entry_get_visibility (item->entry);
 
-       if (temp) 
+       if (temp)
                e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_PUBLIC);
        else
                e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_NONE);
@@ -483,25 +483,25 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
        /* Attendees */
        GSList *go_attendee_list = NULL, *l = NULL, *attendee_list = NULL;
        go_attendee_list = gdata_entry_get_attendee_list (item->entry);
-       
+
        if (go_attendee_list != NULL) {
-               
+
                for (l = go_attendee_list; l != NULL; l = l->next) {
-                       Attendee *go_attendee; 
+                       Attendee *go_attendee;
                        go_attendee = (Attendee *)l->data;
-                       
+
                        ECalComponentAttendee *attendee = g_new0 (ECalComponentAttendee, 1);
-       
+
                        attendee->cn = g_strdup (go_attendee->attendee_value);
 
                        attendee->value = g_strconcat ("MAILTO:", go_attendee->attendee_email, NULL);
                        attendee->role = ICAL_ROLE_OPTPARTICIPANT;
                        attendee->status = ICAL_PARTSTAT_ACCEPTED;
-                       
-                       attendee_list = g_slist_prepend (attendee_list, attendee);      
+
+                       attendee_list = g_slist_prepend (attendee_list, attendee);
                }
                e_cal_component_set_attendee_list (comp, attendee_list);
-       } 
+       }
 
        /* Location */
        e_cal_component_set_location (comp, gdata_entry_get_location (item->entry));
@@ -514,15 +514,15 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
                itt_utc = icaltime_from_string (temp);
 
        /*
-        * TODO : Write a small func to check if its all day and set it to true , and check for it here . 
-        * Evolution Automatically recognises all day event from google . so why bother ? 
-        * Considering not to be a all day event . FIXME needs further work . 
+        * TODO : Write a small func to check if its all day and set it to true , and check for it here .
+        * Evolution Automatically recognises all day event from google . so why bother ?
+        * Considering not to be a all day event . FIXME needs further work .
         */
                if (FALSE) {
                        if (!icaltime_get_timezone (itt_utc))
                                icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
                        if (default_zone) {
-                               itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+                               itt = icaltime_convert_to_zone (itt_utc, default_zone);
                                icaltime_set_timezone (&itt, default_zone);
                                dt.value = &itt;
                                dt.tzid = icaltimezone_get_tzid (default_zone);
@@ -531,10 +531,10 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
                                dt.tzid = g_strdup ("UTC");
                        }
                } else {
-                       itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+                       itt = icaltime_convert_to_zone (itt_utc, default_zone);
                        icaltime_set_timezone (&itt, default_zone);
                        dt.value = &itt;
-                       dt.tzid = icaltimezone_get_tzid (default_zone); 
+                       dt.tzid = icaltimezone_get_tzid (default_zone);
                }
        }
 
@@ -549,9 +549,9 @@ e_go_item_to_cal_component (EGoItem *item, ECalBackendGoogle *cbgo)
 
 
 /**
- * 
+ *
  * e_go_item_from_cal_component:
- * @cbgo a ECalBackendGoogle 
+ * @cbgo a ECalBackendGoogle
  * @comp a ECalComponent object
  * Creates a ECalComponent from EGoItem
  *
@@ -568,68 +568,68 @@ e_go_item_from_cal_component (ECalBackendGoogle *cbgo, ECalComponent *comp)
        icaltimetype itt;
        const char *uid;
        const char *location;
-       
+
        priv = cbgo->priv;
        GSList *list = NULL;
        GDataEntry *entry;
 
        item = g_new0 (EGoItem, 1);
-       entry = gdata_entry_new (); 
+       entry = gdata_entry_new ();
 
        /* Summary */
        e_cal_component_get_summary (comp, &text);
-       if (text.value!=NULL) 
+       if (text.value!=NULL)
                gdata_entry_set_title (entry, text.value);
 
        default_zone = e_cal_backend_google_get_default_zone (cbgo);
 
        /* Start time */
        e_cal_component_get_dtstart (comp, &dt);
-       itt = icaltime_convert_to_zone (*dt.value, default_zone); 
+       itt = icaltime_convert_to_zone (*dt.value, default_zone);
        dt.value = &itt;
        temp = g_strdup (get_date (dt));
        gdata_entry_set_start_time (entry, temp);
 
        /* End Time */
        e_cal_component_get_dtend (comp, &dt);
-       itt = icaltime_convert_to_zone (*dt.value, default_zone); 
+       itt = icaltime_convert_to_zone (*dt.value, default_zone);
        dt.value = &itt;
        temp = g_strdup (get_date (dt));
        gdata_entry_set_end_time (entry, temp);
 
        /* Content / Description */
        e_cal_component_get_description_list (comp, &list);
-       ECalComponentText *t;   
+       ECalComponentText *t;
        if (list != NULL) {
                t = (ECalComponentText *)list->data;
                gdata_entry_set_content (entry, t->value);
        }
-       else 
+       else
                gdata_entry_set_content (entry, "");
 
-       e_cal_component_get_uid (comp, &uid); 
-       gdata_entry_set_id (entry, g_strdup(uid));      
+       e_cal_component_get_uid (comp, &uid);
+       gdata_entry_set_id (entry, g_strdup(uid));
 
        /* Location */
        e_cal_component_get_location (comp, &location);
        if (location)
                gdata_entry_set_location (entry , location);
 
-       if (e_cal_backend_get_kind (E_CAL_BACKEND(cbgo)) == ICAL_VEVENT_COMPONENT)      
+       if (e_cal_backend_get_kind (E_CAL_BACKEND(cbgo)) == ICAL_VEVENT_COMPONENT)
                term = g_strconcat (GDATA_SCHEMA, "event", NULL);
 
-       gdata_entry_create_categories (entry, g_strconcat (GDATA_SCHEMA, "kind", NULL), 
+       gdata_entry_create_categories (entry, g_strconcat (GDATA_SCHEMA, "kind", NULL),
                        "label",
                        term);
        /* Attendee */
        GSList *attendee_list = NULL, *l = NULL;
-       e_cal_component_get_attendee_list (comp, &attendee_list);               
-       
+       e_cal_component_get_attendee_list (comp, &attendee_list);
+
        for (l = attendee_list; l!=NULL; l=l->next) {
                ECalComponentAttendee *ecal_att;
                ecal_att = (ECalComponentAttendee *)l->data;
                /* TODO Convert ECalComponentAttendee to Attendee, and change during parsing to store the types */
-               
+
        }
 
        /* FIXME For transparency and status */
@@ -638,11 +638,11 @@ e_go_item_from_cal_component (ECalBackendGoogle *cbgo, ECalComponent *comp)
 }
 
 /**
- * 
+ *
  * e_go_item_get_entry:
  * @item a EGoItem
  * Returns the GDataEntry object
- * 
+ *
  **/
 
 GDataEntry *
@@ -654,12 +654,12 @@ e_go_item_get_entry (EGoItem *item)
 
 
 /**
- * 
+ *
  * e_go_item_set_entry:
- * @item  a EGoItem 
- * @entry a GDataEntry 
- * Sets the GDataEntry of EGoItem to entry 
- * 
+ * @item  a EGoItem
+ * @entry a GDataEntry
+ * Sets the GDataEntry of EGoItem to entry
+ *
  **/
 void
 e_go_item_set_entry (EGoItem *item, GDataEntry *entry)
@@ -675,11 +675,11 @@ e_go_item_set_entry (EGoItem *item, GDataEntry *entry)
  * gdata_entry_get_entry_by_id:
  * @entries List of entries
  * @id id to retreive
- * Gets the specified entry 
+ * Gets the specified entry
  *
  **/
 GDataEntry *
-gdata_entry_get_entry_by_id (GSList *entries, const gchar *id) 
+gdata_entry_get_entry_by_id (GSList *entries, const gchar *id)
 {
        GSList *l = NULL;
 
@@ -688,20 +688,20 @@ gdata_entry_get_entry_by_id (GSList *entries, const gchar *id)
                        return l->data;
                }
        }
-       
+
        return NULL;
 }
 
 
 /***************************************************************** Utility Functions *********************************************/
 
-static gint 
-utils_compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id) 
+static gint
+utils_compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id)
 {
        return strcmp ((char *)cache_id, (char *)modified_cache_id);
 }
 
-static gchar * 
+static gchar *
 utils_form_query (const gchar *query)
 {
        if (query!=NULL) {
@@ -711,13 +711,13 @@ utils_form_query (const gchar *query)
 }
 
 static void
-utils_update_insertion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, EGoItem *item, GSList *uid_list) 
+utils_update_insertion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, EGoItem *item, GSList *uid_list)
 {
        EGoItem *item_t;
        ECalComponent *comp;
        GSList *list = NULL, *entries_list = NULL;
        GDataEntry *entry;
-       gchar *temp;    
+       gchar *temp;
 
        comp = e_cal_component_new ();
        item_t = g_new0 (EGoItem, 1);
@@ -726,23 +726,23 @@ utils_update_insertion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, EGoIte
        for (list = uid_list; list != NULL; list = list->next) {
                entry = gdata_entry_get_entry_by_id (entries_list, list->data);
                item_t->entry = entry;
-               comp = e_go_item_to_cal_component (item_t, cbgo);       
-               
+               comp = e_go_item_to_cal_component (item_t, cbgo);
+
                if (comp) {
                        e_cal_component_commit_sequence (comp);
                        e_cal_backend_cache_put_component (cache, comp);
 
                        temp = e_cal_component_get_as_string (comp);
-                       
+
                        e_cal_backend_notify_object_created (E_CAL_BACKEND(cbgo), temp);
-                       
+
                        g_free (temp);
                        g_object_unref (comp);
                }
        }
-       
+
        g_free (item_t);
-       if (list)       
+       if (list)
                g_slist_free (list);
        if (entries_list)
                g_slist_free (entries_list);
@@ -750,7 +750,7 @@ utils_update_insertion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, EGoIte
 
 
 static void
-utils_update_deletion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, GSList *cache_keys) 
+utils_update_deletion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, GSList *cache_keys)
 {
        ECalComponent *comp;
        GSList *list;
@@ -760,11 +760,11 @@ utils_update_deletion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, GSList
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE (cbgo));
        g_return_if_fail (cache != NULL && cbgo != NULL);
        g_return_if_fail (cache_keys != NULL);
-       
+
        for (list = cache_keys; list; list = g_slist_next (list)) {
                ECalComponentId *id = NULL;
                char *comp_str = NULL;
-               comp = e_cal_backend_cache_get_component (cache, (const char *)list->data, NULL);       
+               comp = e_cal_backend_cache_get_component (cache, (const char *)list->data, NULL);
                comp_str = e_cal_component_get_as_string (comp);
                id = e_cal_component_get_id (comp);
 
@@ -779,7 +779,7 @@ utils_update_deletion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, GSList
 
 /**
  * get_date: Returns date in gdata format '2006-04-17T17:00:00.000Z'
- * @dt a #ECalComponentDateTime value 
+ * @dt a #ECalComponentDateTime value
  **/
 /* FIXME use proper functions to manipulate the dates */
 gchar *
@@ -801,7 +801,7 @@ get_date (ECalComponentDateTime dt)
        itt.is_utc = itt_u->is_utc;
        itt.is_date = itt_u->is_date;
        itt.is_daylight = itt_u->is_daylight;
-       itt.zone = itt_u->zone; 
+       itt.zone = itt_u->zone;
 
        temp = icaltime_as_ical_string(itt);
 
@@ -813,15 +813,15 @@ get_date (ECalComponentDateTime dt)
        second = (itt.second<10) ? g_strdup_printf ("0%d", itt.second):g_strdup_printf ("%d", itt.second);
 
        temp =  g_strdup_printf ("%d-%s-%sT%s:%s:%s.000", itt.year, month, day, hour, minute, second);
-       
+
        return g_strdup(temp);
 }
 
 static gboolean
-get_deltas_timeout (gpointer cbgo) 
+get_deltas_timeout (gpointer cbgo)
 {
        GThread *thread;
-       
+
        if (!cbgo)
                return FALSE;
 
@@ -831,16 +831,16 @@ get_deltas_timeout (gpointer cbgo)
                 /* FIXME */
        }
 
-       return TRUE;    
+       return TRUE;
 }
 
 /**
- * 
- * gd_date_to_ical: 
+ *
+ * gd_date_to_ical:
  * Helper Function to convert a gdata format date to ical date
- * @string date in gdata format eg: '2006-04-17T17:00:00.000Z' 
- * 
- **/    
+ * @string date in gdata format eg: '2006-04-17T17:00:00.000Z'
+ *
+ **/
 /* FIXME use proper functions to manipulate the dates */
 static gchar *
 gd_date_to_ical (gchar *string)
@@ -852,21 +852,21 @@ gd_date_to_ical (gchar *string)
 
        g_return_val_if_fail (string != NULL, "");
 
-       /* Strip of the string to the gdata format */   
-       while (s[0] != '\0') {  
+       /* Strip of the string to the gdata format */
+       while (s[0] != '\0') {
                if ((s[0] != '-') && (s[0] != '+') && (s[0] != ':') && (s[0] != '.')) {
                        *string = *s;
                        string = string + 1;
                        s = s + 1;
                        count = count + 1;
-               }else 
+               }else
                        s = s + 1;
 
                if (count == 15) {
-                       string[0] = '\0';       
+                       string[0] = '\0';
                        break;
                }
-               if (s[1] == '\0') 
+               if (s[1] == '\0')
                        string[0] = '\0';
        }
 
index 5b087fc..ccee9b2 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -16,7 +16,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  */
 
@@ -49,5 +49,5 @@ GDataEntry *
 gdata_entry_get_entry_by_id (GSList *entries, const gchar *id);
 
 ECalBackendSyncStatus
-e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo); 
+e_cal_backend_google_utils_connect (ECalBackendGoogle *cbgo);
 
index 47050b8..b8c0e76 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -16,7 +16,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -72,23 +72,23 @@ struct _ECalBackendGooglePrivate {
        icaltimezone *default_zone;
        CalMode mode;
        EGoItem *item;
-       
+
        gint timeout_id;
        gchar *username;
        gchar *password;
-       gchar *uri;     
+       gchar *uri;
        gchar *feed;
-       
+
        gboolean read_only;
        gboolean mode_changed;
-       
+
 };
 
 gint compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id);
 gchar * form_query (const char *query);
 
-gint 
-compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id) 
+gint
+compare_ids (gconstpointer cache_id, gconstpointer modified_cache_id)
 {
        return strcmp (cache_id, modified_cache_id);
 }
@@ -106,7 +106,7 @@ static icaltimezone *
 e_cal_backend_google_internal_get_default_timezone (ECalBackend *backend)
 {
        ECalBackendGoogle *cbgo = E_CAL_BACKEND_GOOGLE (backend);
-       return cbgo->priv->default_zone;        
+       return cbgo->priv->default_zone;
 }
 
 static icaltimezone *
@@ -122,14 +122,14 @@ e_cal_backend_google_internal_get_timezone (ECalBackend *backend, const char *tz
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_get_free_busy (ECalBackendSync *backend, 
-                                   EDataCal *cal, 
-                                   GList *users, 
-                                   time_t start,       
-                                   time_t end, 
+e_cal_backend_google_get_free_busy (ECalBackendSync *backend,
+                                   EDataCal *cal,
+                                   GList *users,
+                                   time_t start,
+                                   time_t end,
                                    GList **free_busy)
 {
-       
+
        /*FIXME*/
        return GNOME_Evolution_Calendar_Success;
 }
@@ -140,17 +140,17 @@ e_cal_backend_google_remove (ECalBackendSync *backend, EDataCal *cal)
 {
        ECalBackendGoogle *cbgo;
        ECalBackendGooglePrivate *priv;
-       
+
        cbgo = E_CAL_BACKEND_GOOGLE (backend);
        priv = cbgo->priv;
-       
+
        g_mutex_lock (priv->mutex);
 
        /* Remove the cache */
        if (priv->cache) {
                e_file_cache_remove (E_FILE_CACHE (priv->cache));
        }
-       
+
        g_mutex_unlock (priv->mutex);
 
        return GNOME_Evolution_Calendar_Success;
@@ -216,11 +216,11 @@ e_cal_backend_google_get_mode (ECalBackend *backend)
 
        cbgo = E_CAL_BACKEND_GOOGLE (backend);
        priv = cbgo->priv;
-       
+
        return priv->mode;
 }
 
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus
 e_cal_backend_google_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
 {
        ECalBackendGoogle *cbgo;
@@ -286,7 +286,7 @@ e_cal_backend_google_get_object (ECalBackendSync *backend, EDataCal *cal, const
        return GNOME_Evolution_Calendar_ObjectNotFound;
 }
 
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus
 e_cal_backend_google_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects)
 {
        ECalBackendGoogle *cbgo;
@@ -295,7 +295,7 @@ e_cal_backend_google_get_object_list (ECalBackendSync *backend, EDataCal *cal, c
        ECalBackendSExp *cbsexp;
        gboolean search_needed = TRUE;
 
-       cbgo = E_CAL_BACKEND_GOOGLE (backend);  
+       cbgo = E_CAL_BACKEND_GOOGLE (backend);
        priv = cbgo->priv;
 
        g_mutex_lock (priv->mutex);
@@ -318,10 +318,10 @@ e_cal_backend_google_get_object_list (ECalBackendSync *backend, EDataCal *cal, c
                        if ((!search_needed) ||
                                        (e_cal_backend_sexp_match_comp (cbsexp, comp, E_CAL_BACKEND (backend)))) {
                                *objects = g_list_append (*objects, e_cal_component_get_as_string (comp));
-                       } 
-               }  
-       }       
-       
+                       }
+               }
+       }
+
        g_object_unref (cbsexp);
        g_list_foreach (components, (GFunc) g_object_unref, NULL);
        g_list_free (components);
@@ -329,7 +329,7 @@ e_cal_backend_google_get_object_list (ECalBackendSync *backend, EDataCal *cal, c
        return GNOME_Evolution_Calendar_Success;
 }
 
-static void 
+static void
 e_cal_backend_google_start_query (ECalBackend *backend, EDataCalView *query)
 {
        ECalBackendSyncStatus status;
@@ -352,7 +352,7 @@ e_cal_backend_google_start_query (ECalBackend *backend, EDataCalView *query)
                /* free memory */
                g_list_foreach (objects, (GFunc)g_free, NULL);
                g_list_free (objects);
-       } 
+       }
 
        e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_Success);
 }
@@ -361,7 +361,7 @@ static ECalBackendSyncStatus
 e_cal_backend_google_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
 {
        ECalComponent *comp;
-       
+
         comp = e_cal_component_new ();
        switch (e_cal_backend_get_kind (E_CAL_BACKEND (backend))) {
        case ICAL_VEVENT_COMPONENT:
@@ -376,7 +376,7 @@ e_cal_backend_google_get_default_object (ECalBackendSync *backend, EDataCal *cal
        }
 
        *object = e_cal_component_get_as_string (comp);
-       
+
        if (comp)
                g_object_unref (comp);
        return GNOME_Evolution_Calendar_Success;
@@ -403,7 +403,7 @@ e_cal_backend_google_set_default_zone (ECalBackendSync *backend, EDataCal *cal,
        zone = icaltimezone_new ();
        icaltimezone_set_component (zone, tz_comp);
 
-       if (priv->default_zone)         
+       if (priv->default_zone)
                icaltimezone_free (priv->default_zone, 1);
 
        priv->default_zone = zone;
@@ -424,7 +424,7 @@ e_cal_backend_google_set_mode (ECalBackend *backend, CalMode mode)
                e_cal_backend_notify_mode (backend, GNOME_Evolution_Calendar_CalListener_MODE_SET,
                                           cal_mode_to_corba (mode));
                return;
-       }       
+       }
 
        g_mutex_lock (priv->mutex);
 
@@ -449,13 +449,13 @@ e_cal_backend_google_set_mode (ECalBackend *backend, CalMode mode)
                default:
                        e_cal_backend_notify_mode (backend, GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED,
                                        cal_mode_to_corba (mode));
-       }       
+       }
 
        g_mutex_unlock (priv->mutex);
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_google_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj) 
+e_cal_backend_google_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
 {
        /* FIXME Not implemented */
        return GNOME_Evolution_Calendar_Success;
@@ -476,11 +476,11 @@ e_cal_backend_google_get_changes (ECalBackend *backend, EDataCal *cal, const cha
 }
 
 /* Is read only handler for the google backend */
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus
 e_cal_backend_google_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboolean *read_only)
 {
        /* FIXME */
-       *read_only = FALSE; 
+       *read_only = FALSE;
 
        return GNOME_Evolution_Calendar_Success;
 }
@@ -497,15 +497,15 @@ e_cal_backend_google_get_cal_address (ECalBackendSync *backend, EDataCal *cal, c
        priv = cbgo->priv;
 
        /* FIXME */
-       *address = g_strdup (priv->username); 
+       *address = g_strdup (priv->username);
        return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus
 e_cal_backend_google_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
 {
        /* Support email based alarms ? */
-       
+
        /* FIXME */
        *address = NULL;
        return GNOME_Evolution_Calendar_Success;
@@ -522,18 +522,18 @@ e_cal_backend_google_modify_object (ECalBackendSync *backend, EDataCal *cal, con
        const char *uid=NULL, *rid=NULL;
        GDataEntry *entry, *entry_from_server=NULL;
        gchar *edit_link;
-       
+
        *old_object = NULL;
        cbgo = E_CAL_BACKEND_GOOGLE (backend);
        priv = cbgo->priv;
-       
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE (cbgo), GNOME_Evolution_Calendar_InvalidObject);
        g_return_val_if_fail (calobj != NULL, GNOME_Evolution_Calendar_InvalidObject);
 
        if (priv->mode == CAL_MODE_LOCAL) {
                /* FIXME */
                return GNOME_Evolution_Calendar_RepositoryOffline;
-       }       
+       }
 
        icalcomp = icalparser_parse_string (calobj);
        if (!icalcomp)
@@ -560,7 +560,7 @@ e_cal_backend_google_modify_object (ECalBackendSync *backend, EDataCal *cal, con
                        item->feed = gdata_service_get_feed (GDATA_SERVICE(priv->service), priv->uri);
                        entry = item->entry;
 
-                       if (!item->feed) { 
+                       if (!item->feed) {
                                g_message ("CRITICAL: Could not find feed in EGoItem %s", G_STRLOC);
                                g_object_unref (comp);
                                return GNOME_Evolution_Calendar_OtherError;
@@ -574,8 +574,8 @@ e_cal_backend_google_modify_object (ECalBackendSync *backend, EDataCal *cal, con
                                return GNOME_Evolution_Calendar_OtherError;
                        }
 
-                       edit_link = gdata_entry_get_edit_link (entry_from_server);      
-                       gdata_service_update_entry_with_link (GDATA_SERVICE (priv->service), entry, edit_link); 
+                       edit_link = gdata_entry_get_edit_link (entry_from_server);
+                       gdata_service_update_entry_with_link (GDATA_SERVICE (priv->service), entry, edit_link);
                        break;
                case CAL_MODE_LOCAL:
                        e_cal_backend_cache_put_component (priv->cache, comp);
@@ -586,9 +586,9 @@ e_cal_backend_google_modify_object (ECalBackendSync *backend, EDataCal *cal, con
 
        *old_object = e_cal_component_get_as_string (cache_comp);
        *new_object = e_cal_component_get_as_string (comp);
-       g_object_unref (cache_comp);    
+       g_object_unref (cache_comp);
        g_object_unref (comp);
-       return GNOME_Evolution_Calendar_Success;        
+       return GNOME_Evolution_Calendar_Success;
 }
 
 
@@ -609,26 +609,26 @@ e_cal_backend_google_remove_object (ECalBackendSync *backend, EDataCal *cal,
        cbgo = E_CAL_BACKEND_GOOGLE (backend);
        priv = cbgo->priv;
        item = priv->item;
-       
+
        *old_object = *object = NULL;
-       /* FIXME */     
-       item->feed = gdata_service_get_feed (GDATA_SERVICE(priv->service), priv->uri); 
-       
+       /* FIXME */
+       item->feed = gdata_service_get_feed (GDATA_SERVICE(priv->service), priv->uri);
+
        entries = gdata_feed_get_entries (item->feed);
-       
+
        if (priv->mode == CAL_MODE_REMOTE) {
                ECalBackendSyncStatus status;
                icalcomponent *icalcomp;
                ECalComponentId *id;
-               
+
                status = e_cal_backend_google_get_object (backend, cal, uid, rid, &calobj);
-       
+
                if (status != GNOME_Evolution_Calendar_Success)
                        return status;
-               
+
                comp = e_cal_backend_cache_get_component (priv->cache, uid, rid);
                id = e_cal_component_get_id (comp);
-               
+
                icalcomp = icalparser_parse_string (calobj);
 
                if (!icalcomp) {
@@ -638,12 +638,12 @@ e_cal_backend_google_remove_object (ECalBackendSync *backend, EDataCal *cal,
 
                e_cal_backend_cache_remove_component (priv->cache, uid, rid);
                e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgo), id, e_cal_component_get_as_string (comp), NULL);
-               
+
                entry = gdata_entry_get_entry_by_id (entries, uid);
-               
-               if (!entry) 
-                       return GNOME_Evolution_Calendar_InvalidObject;  
-               
+
+               if (!entry)
+                       return GNOME_Evolution_Calendar_InvalidObject;
+
                gdata_service_delete_entry (GDATA_SERVICE(priv->service), entry);
                *object = NULL;
                *old_object = strdup (calobj);
@@ -651,10 +651,10 @@ e_cal_backend_google_remove_object (ECalBackendSync *backend, EDataCal *cal,
        }
 
        if (calobj)
-               g_free (calobj); 
-       if (entries)    
+               g_free (calobj);
+       if (entries)
                g_slist_free (entries);
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -665,14 +665,14 @@ e_cal_backend_google_create_object (ECalBackendSync *backend, EDataCal *cal, cha
        ECalBackendGooglePrivate *priv;
        icalcomponent *icalcomp;
        ECalComponent *comp;
-       EGoItem *item;  
+       EGoItem *item;
        GDataEntry *entry;
-       const gchar *id;        
+       const gchar *id;
 
        cbgo = E_CAL_BACKEND_GOOGLE (backend);
-       
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), GNOME_Evolution_Calendar_InvalidObject);
-       g_return_val_if_fail (calobj != NULL && *calobj!=NULL,GNOME_Evolution_Calendar_InvalidObject);                                                                                          
+       g_return_val_if_fail (calobj != NULL && *calobj!=NULL,GNOME_Evolution_Calendar_InvalidObject);
        priv = cbgo->priv;
        if (priv->mode == CAL_MODE_LOCAL) {
                /*FIXME call offline method */
@@ -691,14 +691,14 @@ e_cal_backend_google_create_object (ECalBackendSync *backend, EDataCal *cal, cha
 
        comp = e_cal_component_new ();
        e_cal_component_set_icalcomponent (comp, icalcomp);
-       
+
        /* Check if object exists */
        switch (priv->mode) {
 
                case CAL_MODE_ANY:
                case CAL_MODE_REMOTE:
                        /* Create an appointment */
-                               
+
                        item = e_go_item_from_cal_component (cbgo, comp);
                        entry = e_go_item_get_entry (item);
 
@@ -713,32 +713,32 @@ e_cal_backend_google_create_object (ECalBackendSync *backend, EDataCal *cal, cha
 
                        break;
                default:
-                       break;  
-       }       
+                       break;
+       }
 
        /* Go through the uid list to create the objects */
        e_cal_component_commit_sequence (comp);
        e_cal_backend_cache_put_component (priv->cache, comp);
-       *calobj = e_cal_component_get_as_string (comp); 
+       *calobj = e_cal_component_get_as_string (comp);
        e_cal_backend_notify_object_created (E_CAL_BACKEND(cbgo), *calobj);
 
        g_object_unref (comp);
        return GNOME_Evolution_Calendar_Success;
 }
 
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus
 e_cal_backend_google_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
 {
        /* ldap attribute is specific to Sun ONE connector to get free busy information*/
        /* return NULL here as google backend know how to get free busy information */
-       
+
        /* FIXME */
        *attribute = NULL;
        return GNOME_Evolution_Calendar_Success;
 }
 
 
-static ECalBackendSyncStatus 
+static ECalBackendSyncStatus
 e_cal_backend_google_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
 {
        /* FIXME */
@@ -769,15 +769,15 @@ e_cal_backend_google_open (ECalBackendSync *backend, EDataCal *cal, gboolean onl
                        source_type = E_CAL_SOURCE_TYPE_TODO;
                        source = "tasks";
                        break;
-               case ICAL_VJOURNAL_COMPONENT:   
-                       source_type = E_CAL_SOURCE_TYPE_JOURNAL;        
+               case ICAL_VJOURNAL_COMPONENT:
+                       source_type = E_CAL_SOURCE_TYPE_JOURNAL;
                        source = "journal";
                        break;
                default:
                        source_type = E_CAL_SOURCE_TYPE_EVENT;
        }
 
-       /* Not for remote */    
+       /* Not for remote */
        if (priv->mode == CAL_MODE_LOCAL) {
                ESource *esource;
                const char *display_contents = NULL;
@@ -817,7 +817,7 @@ e_cal_backend_google_open (ECalBackendSync *backend, EDataCal *cal, gboolean onl
 }
 
 /* Dipose handler for google backend */
-static void 
+static void
 e_cal_backend_google_dispose (GObject *object)
 {
        ECalBackendGoogle *cbgo;
@@ -847,7 +847,7 @@ e_cal_backend_google_finalize (GObject *object)
 
        if (priv->mutex) {
                g_mutex_free (priv->mutex);
-               priv->mutex = NULL;             
+               priv->mutex = NULL;
        }
 
        if (priv->username) {
@@ -875,7 +875,7 @@ e_cal_backend_google_finalize (GObject *object)
                icaltimezone_free (priv->default_zone, 1);
                priv->default_zone = NULL;
        }
-       
+
        if (priv->timeout_id) {
                g_source_remove (priv->timeout_id);
                priv->timeout_id = 0;
@@ -893,7 +893,7 @@ e_cal_backend_google_finalize (GObject *object)
 static void
 e_cal_backend_google_init (ECalBackendGoogle *cbgo, ECalBackendGoogleClass *class)
 {
-       ECalBackendGooglePrivate *priv;         
+       ECalBackendGooglePrivate *priv;
 
        priv = g_new0 (ECalBackendGooglePrivate, 1);
 
@@ -909,8 +909,8 @@ e_cal_backend_google_init (ECalBackendGoogle *cbgo, ECalBackendGoogleClass *clas
        e_cal_backend_sync_set_lock (E_CAL_BACKEND_SYNC (cbgo), TRUE);
 }
 
-icaltimezone * 
-e_cal_backend_google_get_default_zone (ECalBackendGoogle *cbgo) 
+icaltimezone *
+e_cal_backend_google_get_default_zone (ECalBackendGoogle *cbgo)
 {
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
        return cbgo->priv->default_zone;
@@ -931,7 +931,7 @@ e_cal_backend_google_class_init (ECalBackendGoogleClass *class)
        parent_class = g_type_class_peek_parent (class);
 
        object_class->dispose = e_cal_backend_google_dispose;
-       object_class->finalize = e_cal_backend_google_finalize; 
+       object_class->finalize = e_cal_backend_google_finalize;
 
        sync_class->is_read_only_sync = e_cal_backend_google_is_read_only;
        sync_class->get_cal_address_sync = e_cal_backend_google_get_cal_address;
@@ -939,10 +939,10 @@ e_cal_backend_google_class_init (ECalBackendGoogleClass *class)
        sync_class->get_ldap_attribute_sync = e_cal_backend_google_get_ldap_attribute;
        sync_class->get_static_capabilities_sync = e_cal_backend_google_get_static_capabilities;
        sync_class->open_sync = e_cal_backend_google_open;
-       sync_class->remove_sync = e_cal_backend_google_remove; 
-       sync_class->create_object_sync = e_cal_backend_google_create_object; 
+       sync_class->remove_sync = e_cal_backend_google_remove;
+       sync_class->create_object_sync = e_cal_backend_google_create_object;
        sync_class->modify_object_sync = e_cal_backend_google_modify_object;
-       sync_class->remove_object_sync = e_cal_backend_google_remove_object; 
+       sync_class->remove_object_sync = e_cal_backend_google_remove_object;
        sync_class->discard_alarm_sync = e_cal_backend_google_discard_alarm;
        sync_class->receive_objects_sync = e_cal_backend_google_receive_objects;
        sync_class->send_objects_sync = e_cal_backend_google_send_objects;
@@ -966,7 +966,7 @@ e_cal_backend_google_class_init (ECalBackendGoogleClass *class)
 /**
  * e_cal_backend_google_get_type:
  * @void:
- * Registers the #ECalBackendGoogle class if necessary and returns the type ID 
+ * Registers the #ECalBackendGoogle class if necessary and returns the type ID
  * associated with it
  * Return value: The type id of the #ECalBackendGoogle class.
  **/
@@ -986,27 +986,27 @@ e_cal_backend_google_get_type ()
                        0,
                        (GInstanceInitFunc) e_cal_backend_google_init
                };
-               e_cal_backend_google_type = g_type_register_static (E_TYPE_CAL_BACKEND_SYNC, 
+               e_cal_backend_google_type = g_type_register_static (E_TYPE_CAL_BACKEND_SYNC,
                                "ECalBackendGoogle", &info, 0);
        }
-       return e_cal_backend_google_type;       
+       return e_cal_backend_google_type;
 }
 
 
 /***************************************** Helper Functions ****************************************************/
 
 /**
- * e_cal_backend_google_set_cache: 
+ * e_cal_backend_google_set_cache:
  * @cbgo a #ECalBackendGoogle object
  * @cache a #ECalBackendCache
- * 
+ *
  **/
 
-void 
-e_cal_backend_google_set_cache (ECalBackendGoogle *cbgo, ECalBackendCache *cache) 
+void
+e_cal_backend_google_set_cache (ECalBackendGoogle *cbgo, ECalBackendCache *cache)
 {
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_if_fail (cbgo != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
 
@@ -1015,54 +1015,54 @@ e_cal_backend_google_set_cache (ECalBackendGoogle *cbgo, ECalBackendCache *cache
 }
 
 /**
- * e_cal_backend_google_set_item: 
+ * e_cal_backend_google_set_item:
  * @cbgo a #ECalBackendGoogle object
  * @cache a #EGoItem *item
- * 
+ *
  **/
 void
 e_cal_backend_google_set_item (ECalBackendGoogle *cbgo, EGoItem *item)
 {
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_if_fail (cbgo != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
-       
+
        priv = cbgo->priv;
        priv->item = item;
 }
 
 /**
- * e_cal_backend_google_set_item: 
+ * e_cal_backend_google_set_item:
  * @cbgo a #ECalBackendGoogle object
  * @cache a #EGoItem *item
  * Sets the #EGoItem item on object
- * 
- **/ 
+ *
+ **/
 void
 e_cal_backend_google_set_service (ECalBackendGoogle *cbgo, GDataGoogleService *service)
 {
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_if_fail (cbgo != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
-       
+
        priv = cbgo->priv;
        priv->service = service;
 }
 
 /**
- * e_cal_backend_google_set_uri: 
+ * e_cal_backend_google_set_uri:
  * @cbgo a #ECalBackendGoogle cbgo
  * @uri  Private uri , for accessing google calendar
  * Sets the uri on cbgo
- * 
- **/ 
-void 
+ *
+ **/
+void
 e_cal_backend_google_set_uri (ECalBackendGoogle *cbgo, gchar *uri)
 {
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_if_fail (cbgo != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
 
@@ -1071,108 +1071,108 @@ e_cal_backend_google_set_uri (ECalBackendGoogle *cbgo, gchar *uri)
 }
 
 /**
- * e_cal_backend_google_set_entry: 
+ * e_cal_backend_google_set_entry:
  * @cbgo a #ECalBackendGoogle object
  * @entry a #GDataEntry entry
  * Sets the entry on object
- * 
- **/ 
-void 
+ *
+ **/
+void
 e_cal_backend_google_set_entry (ECalBackendGoogle *cbgo, GDataEntry *entry)
 {
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_if_fail (cbgo != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
-       
+
        priv = cbgo->priv;
        priv->entry = entry;
 }
 
 /**
- * e_cal_backend_google_set_timeout_id: 
+ * e_cal_backend_google_set_timeout_id:
  * @cbgo a #ECalBackendGoogle object
  * @timeout_id a time out id
  * Sets the timeout id on object
- * 
- **/ 
+ *
+ **/
 void
 e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo,gint timeout_id )
 {
        ECalBackendGooglePrivate *priv;
        priv = cbgo->priv;
-       
-       g_return_if_fail (cbgo != NULL);        
+
+       g_return_if_fail (cbgo != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
-       
+
        priv->timeout_id = timeout_id;
 }
 
 /**
- * e_cal_backend_google_set_username: 
+ * e_cal_backend_google_set_username:
  * @cbgo a #ECalBackendGoogle object
- * @username username 
- * Sets the username on object . 
- * 
- **/ 
+ * @username username
+ * Sets the username on object .
+ *
+ **/
 void
 e_cal_backend_google_set_username (ECalBackendGoogle *cbgo,gchar *username)
 {
        ECalBackendGooglePrivate *priv;
        priv = cbgo->priv;
-       
-       g_return_if_fail (cbgo != NULL);        
+
+       g_return_if_fail (cbgo != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
-       
+
        priv->username = username;
 }
 
 /**
- * e_cal_backend_google_set_password: 
+ * e_cal_backend_google_set_password:
  * @cbgo a #ECalBackendGoogle object
  * @cache a #EGoItem *item
  * Sets the #EGoItem item on object
- * 
- **/ 
+ *
+ **/
 
 void
 e_cal_backend_google_set_password (ECalBackendGoogle *cbgo,gchar *password)
 {
        ECalBackendGooglePrivate *priv;
        priv = cbgo->priv;
-       
-       g_return_if_fail (cbgo != NULL);        
+
+       g_return_if_fail (cbgo != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
-       
+
        priv->password = password;
 }
 
 /**
- * e_cal_backend_google_get_cache: 
+ * e_cal_backend_google_get_cache:
  * @cbgo a #ECalBackendGoogle object
- * Gets the cache .  
- * 
- **/ 
+ * Gets the cache .
+ *
+ **/
 ECalBackendCache *
-e_cal_backend_google_get_cache (ECalBackendGoogle *cbgo) 
+e_cal_backend_google_get_cache (ECalBackendGoogle *cbgo)
 {
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_val_if_fail (cbgo != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
 
-       
+
        priv = cbgo->priv;
        return priv->cache;
 }
 
 /**
- * e_cal_backend_google_get_item: 
+ * e_cal_backend_google_get_item:
  * @cbgo a #ECalBackendGoogle object
- * Gets the #EGoItem . from cbgo 
- **/ 
+ * Gets the #EGoItem . from cbgo
+ **/
 EGoItem *
-e_cal_backend_google_get_item (ECalBackendGoogle *cbgo) 
+e_cal_backend_google_get_item (ECalBackendGoogle *cbgo)
 {
        ECalBackendGooglePrivate *priv;
 
@@ -1184,16 +1184,16 @@ e_cal_backend_google_get_item (ECalBackendGoogle *cbgo)
 }
 
 /**
- * e_cal_backend_google_get_service: 
+ * e_cal_backend_google_get_service:
  * @cbgo a #ECalBackendGoogle object
- * Gets the #GDataGoogleService service object . 
- * 
- **/ 
+ * Gets the #GDataGoogleService service object .
+ *
+ **/
 GDataGoogleService *
 e_cal_backend_google_get_service (ECalBackendGoogle *cbgo)
 {
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_val_if_fail (cbgo != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
 
@@ -1202,15 +1202,15 @@ e_cal_backend_google_get_service (ECalBackendGoogle *cbgo)
 }
 
 /**
- * e_cal_backend_google_set_item: 
+ * e_cal_backend_google_set_item:
  * @cbgo a #ECalBackendGoogle object
- * Gets the uri 
- **/ 
+ * Gets the uri
+ **/
 gchar *
 e_cal_backend_google_get_uri (ECalBackendGoogle *cbgo)
 {
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_val_if_fail (cbgo != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
 
@@ -1219,16 +1219,16 @@ e_cal_backend_google_get_uri (ECalBackendGoogle *cbgo)
 }
 
 /**
- * e_cal_backend_google_get_entry: 
+ * e_cal_backend_google_get_entry:
  * @cbgo a #ECalBackendGoogle object
- * Gets the #GDataEntry object. 
- * 
- **/ 
+ * Gets the #GDataEntry object.
+ *
+ **/
 GDataEntry *
-e_cal_backend_google_get_entry (ECalBackendGoogle *cbgo) 
-{      
+e_cal_backend_google_get_entry (ECalBackendGoogle *cbgo)
+{
        ECalBackendGooglePrivate *priv;
-       
+
        g_return_val_if_fail (cbgo != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
 
@@ -1237,11 +1237,11 @@ e_cal_backend_google_get_entry (ECalBackendGoogle *cbgo)
 }
 
 /**
- * e_cal_backend_google_get_timeout_id: 
+ * e_cal_backend_google_get_timeout_id:
  * @cbgo a #ECalBackendGoogle object
- * Gets the timeout id.  
- * 
- **/ 
+ * Gets the timeout id.
+ *
+ **/
 gint
 e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo)
 {
@@ -1249,17 +1249,17 @@ e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo)
 
        g_return_val_if_fail (cbgo != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
-       
+
        priv = cbgo->priv;
        return priv->timeout_id;
 }
 
 /**
- * e_cal_backend_google_get_username: 
+ * e_cal_backend_google_get_username:
  * @cbgo a #ECalBackendGoogle object
- * Gets the username  
- * 
- **/ 
+ * Gets the username
+ *
+ **/
 gchar *
 e_cal_backend_google_get_username (ECalBackendGoogle *cbgo)
 {
@@ -1267,16 +1267,16 @@ e_cal_backend_google_get_username (ECalBackendGoogle *cbgo)
 
        g_return_val_if_fail (cbgo != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
-       
+
        priv = cbgo->priv;
        return priv->username;
 }
 
 /**
- * e_cal_backend_google_get_password: 
+ * e_cal_backend_google_get_password:
  * @cbgo a #ECalBackendGoogle object
- * Gets the password 
- **/ 
+ * Gets the password
+ **/
 gchar *
 e_cal_backend_google_get_password (ECalBackendGoogle *cbgo)
 {
@@ -1285,7 +1285,7 @@ e_cal_backend_google_get_password (ECalBackendGoogle *cbgo)
        g_return_val_if_fail (cbgo != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
 
-       /* FIXME Encrypt ? */   
+       /* FIXME Encrypt ? */
        priv = cbgo->priv;
        return priv->password;
 }
index 7bd4b05..33968b0 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
- *  Ebby Wiselyn <ebbywiselyn@gmail.com> 
+/*
+ * Authors :
+ *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -16,7 +16,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -47,7 +47,7 @@ typedef struct _ECalBackendGooglePrivate ECalBackendGooglePrivate;
 
 struct _ECalBackendGoogle {
        ECalBackendSync Backend;
-       
+
        /* private data */
        ECalBackendGooglePrivate *priv;
 };
index fc1d04c..b09f633 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *  Harish Krishnaswamy <kharish@novell.com>
  *  Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -46,7 +46,7 @@
 #include "e-cal-backend-groupwise-utils.h"
 #include "libedataserver/e-source-list.h"
 
-static gboolean 
+static gboolean
 get_recur_instance (ECalComponent *comp, time_t instance_start, time_t instance_end, gpointer data)
 {
        GSList **recur_dates = (GSList **) data;
@@ -69,8 +69,8 @@ resolve_tzid_cb (const char *tzid, gpointer data)
 const char *
 e_cal_component_get_gw_id (ECalComponent *comp)
 {
-       icalproperty *prop;     
-       
+       icalproperty *prop;
+
        prop = icalcomponent_get_first_property (e_cal_component_get_icalcomponent (comp),
                                                 ICAL_X_PROPERTY);
        while (prop) {
@@ -88,7 +88,7 @@ e_cal_component_get_gw_id (ECalComponent *comp)
        return NULL;
 }
 
-static void 
+static void
 set_categories_for_gw_item (EGwItem *item, GSList *category_names, ECalBackendGroupwise *cbgw)
 {
        GHashTable *categories_by_name, *categories_by_id;
@@ -103,9 +103,9 @@ set_categories_for_gw_item (EGwItem *item, GSList *category_names, ECalBackendGr
        categories_by_name = e_cal_backend_groupwise_get_categories_by_name (cbgw);
        categories_by_id = e_cal_backend_groupwise_get_categories_by_id (cbgw);
        cnc = e_cal_backend_groupwise_get_connection (cbgw);
-       
+
        g_return_if_fail (categories_by_id != NULL || categories_by_name != NULL || cnc != NULL);
-       
+
        for (; category_names != NULL; category_names = g_slist_next (category_names)) {
                      if (!category_names->data || strlen(category_names->data) == 0 )
                              continue;
@@ -121,7 +121,7 @@ set_categories_for_gw_item (EGwItem *item, GSList *category_names, ECalBackendGr
                              if (status == E_GW_CONNECTION_STATUS_OK && id != NULL) {
                                      char **components = g_strsplit (id, "@", -1);
                                      char *temp_id = components[0];
-    
+
                                      g_hash_table_insert (categories_by_name, g_strdup (category_names->data), g_strdup(temp_id));
                                      g_hash_table_insert (categories_by_id, g_strdup(temp_id), g_strdup (category_names->data));
                                      category_ids = g_list_append (category_ids, g_strdup(temp_id));
@@ -152,7 +152,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
        while (icalprop) {
 
                x_name = icalproperty_get_x_name (icalprop);
-               
+
                if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-PRIORITY")) {
                        sendoptions_set = TRUE;
                        x_val = icalproperty_get_x (icalprop);
@@ -177,13 +177,13 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
                                icaltime_set_timezone (&temp, default_zone);
                                temp = icaltime_convert_to_zone (temp, utc);
                                value = icaltime_as_ical_string (temp);
-                               e_gw_item_set_reply_within (item, (char *) value);      
+                               e_gw_item_set_reply_within (item, (char *) value);
                        }
                } else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-EXPIRE")) {
                        const char *expire = NULL;
                        x_val = icalproperty_get_x (icalprop);
                        temp = icaltime_current_time_with_zone (default_zone ? default_zone : utc);
-                       icaltime_adjust (&temp, atoi (x_val), 0, 0, 0); 
+                       icaltime_adjust (&temp, atoi (x_val), 0, 0, 0);
                        icaltime_set_timezone (&temp, default_zone);
                        temp = icaltime_convert_to_zone (temp, utc);
                        expire = icaltime_as_ical_string (temp);
@@ -197,7 +197,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
                        temp = icaltime_convert_to_zone (temp, utc);
                        delay = icaltime_as_ical_string (temp);
                        e_gw_item_set_delay_until (item, (char *) delay);
-                                       
+
                } else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-TRACKINFO")) {
                        sendoptions_set = TRUE;
                        x_val = icalproperty_get_x (icalprop);
@@ -220,7 +220,7 @@ add_send_options_data_to_item (EGwItem *item, ECalComponent *comp, icaltimezone
                                        break;
                                case 1: e_gw_item_set_notify_opened (item, E_GW_ITEM_NOTIFY_MAIL);
                        }
-                       
+
                } else if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-ACCEPTED")) {
                        int i = 0;
                        x_val = icalproperty_get_x (icalprop);
@@ -267,9 +267,9 @@ e_cal_backend_groupwise_set_attachments_from_comp (ECalComponent *comp,
        GSList *l;
 
        e_cal_component_get_attachment_list (comp, &attach_file_list);
-       
+
        for (l = attach_file_list; l ; l = l->next) {
-               
+
                EGwItemAttachment *attach_item;
                char *file_contents, *encoded_data;
                gsize file_len;
@@ -285,10 +285,10 @@ e_cal_backend_groupwise_set_attachments_from_comp (ECalComponent *comp,
 
                /* Extract the simple file name from the
                 * attach_filename_full which is of the form
-                * file://<path>/compuid-<simple filename> 
+                * file://<path>/compuid-<simple filename>
                 */
                e_cal_component_get_uid (comp, &uid);
-               filename = g_strrstr (attach_filename_full, uid);               
+               filename = g_strrstr (attach_filename_full, uid);
                if (filename == NULL) {
                        g_message ("DEBUG: This is an invalid attachment file\n");
                        g_free (attach_filename_full);
@@ -307,7 +307,7 @@ e_cal_backend_groupwise_set_attachments_from_comp (ECalComponent *comp,
                 * message */
                encoded_data = g_base64_encode (file_contents, file_len);
                attach_item->data = encoded_data;
-               attach_item->size = strlen (encoded_data); 
+               attach_item->size = strlen (encoded_data);
 
                g_free (file_contents);
                attach_list = g_slist_append (attach_list, attach_item);
@@ -320,7 +320,7 @@ e_cal_backend_groupwise_set_attachments_from_comp (ECalComponent *comp,
 static icalproperty *
 get_attendee_prop (icalcomponent *icalcomp, const char *attendee)
 {
-       icalproperty *prop;     
+       icalproperty *prop;
 
        for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
                        prop;
@@ -348,7 +348,7 @@ set_attendees_to_item (EGwItem *item, ECalComponent *comp, icaltimezone *default
                        const char *attendees = NULL;
                        char **emails, **iter;
 
-                       for (icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY); icalprop; 
+                       for (icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY); icalprop;
                                        icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) {
                                if (g_str_equal (icalproperty_get_x_name (icalprop), "X-EVOLUTION-RECIPIENTS")) {
                                        break;
@@ -382,28 +382,28 @@ set_attendees_to_item (EGwItem *item, ECalComponent *comp, icaltimezone *default
        } else if (e_cal_component_has_attendees (comp)) {
                GSList *attendee_list, *recipient_list = NULL, *al;
 
-               e_cal_component_get_attendee_list (comp, &attendee_list);       
+               e_cal_component_get_attendee_list (comp, &attendee_list);
                for (al = attendee_list; al != NULL; al = al->next) {
                        ECalComponentAttendee *attendee = (ECalComponentAttendee *) al->data;
                        EGwItemRecipient *recipient;
-                               
+
                        if (delegate && (g_str_equal (attendee->value + 7, user_email) || !(attendee->delfrom && *attendee->delfrom)))
-                               continue;               
-                       
+                               continue;
+
                        if (delegate) {
-                               icalproperty *prop = get_attendee_prop (e_cal_component_get_icalcomponent (comp), 
+                               icalproperty *prop = get_attendee_prop (e_cal_component_get_icalcomponent (comp),
                                                attendee->value);
-                               if (prop) 
+                               if (prop)
                                        icalproperty_remove_parameter_by_kind (prop, ICAL_DELEGATEDFROM_PARAMETER);
                        }
-       
+
                        recipient = g_new0 (EGwItemRecipient, 1);
 
                        /* len (MAILTO:) + 1 = 7 */
                        recipient->email = g_strdup (attendee->value + 7);
                        if (attendee->cn != NULL)
                                recipient->display_name = g_strdup (attendee->cn);
-                       if (attendee->role == ICAL_ROLE_REQPARTICIPANT) 
+                       if (attendee->role == ICAL_ROLE_REQPARTICIPANT)
                                recipient->type = E_GW_ITEM_RECIPIENT_TO;
                        else if (attendee->role == ICAL_ROLE_OPTPARTICIPANT)
                                recipient->type = E_GW_ITEM_RECIPIENT_CC;
@@ -413,23 +413,23 @@ set_attendees_to_item (EGwItem *item, ECalComponent *comp, icaltimezone *default
                                recipient->status = E_GW_ITEM_STAT_ACCEPTED;
                        else if (attendee->status == ICAL_PARTSTAT_DECLINED)
                                recipient->status = E_GW_ITEM_STAT_DECLINED;
-                       else 
+                       else
                                recipient->status = E_GW_ITEM_STAT_NONE;
 
                        recipient_list = g_slist_append (recipient_list, recipient);
                }
 
                e_cal_component_free_attendee_list(attendee_list);
-       
+
                /* recipient_list shouldn't be freed. Look into the function below. */
                e_gw_item_set_recipient_list (item, recipient_list);
        }
-       
+
        if (e_cal_component_has_organizer (comp)) {
                /* Send Options */
                add_send_options_data_to_item (item, comp, default_zone);
        }
-               
+
        if (!delegate && e_cal_component_has_organizer (comp)) {
                ECalComponentOrganizer cal_organizer;
                EGwItemOrganizer *organizer = NULL;
@@ -457,7 +457,7 @@ set_rrule_from_comp (ECalComponent *comp, EGwItem *item, ECalBackendGroupwise *c
        if (rrule_list) {
                /* assumes only one rrule is present  */
                ical_recur = (struct icalrecurrencetype *) rrule_list->data;
-               
+
                g_message ("DEBUG: Processing rule\n%s\n", icalrecurrencetype_as_string (ical_recur));
                /*set the data */
                switch (ical_recur->freq) {
@@ -479,7 +479,7 @@ set_rrule_from_comp (ECalComponent *comp, EGwItem *item, ECalBackendGroupwise *c
                if (ical_recur->count != 0)
                        item_rrule->count = ical_recur->count;
                else
-                       item_rrule->until =  g_strdup (icaltime_as_ical_string (ical_recur->until)); 
+                       item_rrule->until =  g_strdup (icaltime_as_ical_string (ical_recur->until));
 
                item_rrule->interval = ical_recur->interval;
 
@@ -500,24 +500,24 @@ set_rrule_from_comp (ECalComponent *comp, EGwItem *item, ECalBackendGroupwise *c
                        GSList *l, *item_exdate_list = NULL;
                        icaltimezone *default_zone, *utc;
                        struct icaltimetype itt_utc;
-                       
+
 
                        e_cal_component_get_exdate_list (comp, &exdate_list);
                        default_zone = e_cal_backend_groupwise_get_default_zone (cbgw);
                        utc = icaltimezone_get_utc_timezone ();
                        for (l = exdate_list; l ; l = l->next) {
-                               ECalComponentDateTime *dt = (ECalComponentDateTime *) l->data; 
+                               ECalComponentDateTime *dt = (ECalComponentDateTime *) l->data;
                                if (dt->value) {
                                        if (!icaltime_get_timezone (*(dt->value)))
                                                icaltime_set_timezone (dt->value, default_zone ? default_zone : utc);
                                        itt_utc = icaltime_convert_to_zone (*dt->value, utc);
                                        item_exdate_list = g_slist_append (item_exdate_list, g_strdup (icaltime_as_ical_string (itt_utc)));
                                }
-                       }                       
+                       }
                        e_gw_item_set_exdate_list (item, item_exdate_list);
                        e_cal_component_free_exdate_list (exdate_list);
                }
-       } 
+       }
 }
 
 static EGwItem *
@@ -533,7 +533,7 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
        GSList *slist, *sl;
        icaltimezone *default_zone, *utc;
        struct icaltimetype itt_utc;
-       
+
        default_zone = e_cal_backend_groupwise_get_default_zone (cbgw);
        utc = icaltimezone_get_utc_timezone ();
 
@@ -569,8 +569,8 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
                        duration = abs (icaldurationtype_as_int (trigger.u.rel_duration));
                        e_gw_item_set_trigger (item, duration);
                }
-               
-               
+
+
 
                /* end date */
                e_cal_component_get_dtend (comp, &dt);
@@ -594,7 +594,7 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
                        itt_utc = icaltime_convert_to_zone (*dt.value, utc);
                        e_gw_item_set_due_date (item, icaltime_as_ical_string (itt_utc));
                }
-               
+
                        /* priority */
                 priority = NULL;
                 e_cal_component_get_priority (comp, &priority);
@@ -610,7 +610,7 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
 
                         e_cal_component_free_priority (priority);
                 }
-         
+
                        /* completed */
                e_cal_component_get_completed (comp, &dt.value);
                if (dt.value) {
@@ -630,8 +630,8 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
        /* set common properties */
        /* GW server ID */
        e_gw_item_set_id (item, e_cal_component_get_gw_id (comp));
-       
-       
+
+
        /* UID */
        e_cal_component_get_uid (comp, &uid);
        e_gw_item_set_icalid (item, uid);
@@ -671,17 +671,17 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
                g_object_unref (item);
                return NULL;
        }
-       
+
        /* all day event */
        if (dt.value && dt.value->is_date && e_gw_item_get_item_type (item) == E_GW_ITEM_TYPE_APPOINTMENT)
                e_gw_item_set_is_allday_event (item, TRUE);
-       
+
        /* creation date */
        e_cal_component_get_created (comp, &dt.value);
        if (dt.value) {
                if (!icaltime_get_timezone (*dt.value))
                        icaltime_set_timezone (dt.value, default_zone);
-               itt_utc = icaltime_convert_to_zone (*dt.value, utc); 
+               itt_utc = icaltime_convert_to_zone (*dt.value, utc);
                e_gw_item_set_creation_date (item, icaltime_as_ical_string (itt_utc));
        } else {
                struct icaltimetype itt;
@@ -708,7 +708,7 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
 
 
        set_attendees_to_item (item, comp, default_zone, FALSE, NULL);
-       
+
        /* check if recurrences exist and update the item */
        if (e_cal_component_has_recurrences (comp)) {
                if (e_cal_component_has_rrules (comp))
@@ -716,23 +716,23 @@ set_properties_from_cal_component (EGwItem *item, ECalComponent *comp, ECalBacke
                else {
 
                        GSList *recur_dates = NULL;
-                       
+
                        if (dt.tzid)
-                               e_cal_recur_generate_instances (comp, -1, -1,get_recur_instance, &recur_dates, resolve_tzid_cb, NULL, (icaltimezone *) default_zone);           
-                       else 
-                               e_cal_recur_generate_instances (comp, -1, -1,get_recur_instance, &recur_dates, resolve_tzid_cb, NULL, utc);             
+                               e_cal_recur_generate_instances (comp, -1, -1,get_recur_instance, &recur_dates, resolve_tzid_cb, NULL, (icaltimezone *) default_zone);
+                       else
+                               e_cal_recur_generate_instances (comp, -1, -1,get_recur_instance, &recur_dates, resolve_tzid_cb, NULL, utc);
 
                        recur_dates = g_slist_delete_link (recur_dates, recur_dates);
-                       
+
                        e_gw_item_set_recurrence_dates (item, recur_dates);
                }
        }
-       
+
        /* attachments */
        if (e_cal_component_has_attachments (comp)) {
-               e_cal_backend_groupwise_set_attachments_from_comp (comp, item); 
+               e_cal_backend_groupwise_set_attachments_from_comp (comp, item);
        }
-       
+
        return item;
 }
 
@@ -755,7 +755,7 @@ e_gw_item_new_for_delegate_from_cal (ECalBackendGroupwise *cbgw, ECalComponent *
        EGwItem *item;
        icaltimezone *default_zone;
        const char *user_email;
-   
+
        g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), NULL);
        default_zone = e_cal_backend_groupwise_get_default_zone (cbgw);
        item = e_gw_item_new_empty ();
@@ -768,7 +768,7 @@ e_gw_item_new_for_delegate_from_cal (ECalBackendGroupwise *cbgw, ECalComponent *
        return item;
 }
 
-/* Fetch data from the server and unencode it to the actual data 
+/* Fetch data from the server and unencode it to the actual data
  * and populate the attach_data
  */
 static gboolean
@@ -782,7 +782,7 @@ get_attach_data_from_server (EGwItemAttachment *attach_item, ECalBackendGroupwis
        cnc = e_cal_backend_groupwise_get_connection (cbgw);
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
 
-       status = e_gw_connection_get_attachment (cnc, attach_item->id, 0, -1, (const char **) &data, &len); 
+       status = e_gw_connection_get_attachment (cnc, attach_item->id, 0, -1, (const char **) &data, &len);
 
        if (status != E_GW_CONNECTION_STATUS_OK ) {
                g_warning ("Failed to read the attachment from the server\n");
@@ -801,7 +801,7 @@ set_attachments_to_cal_component (EGwItem *item, ECalComponent *comp, ECalBacken
        GSList *comp_attachment_list = NULL;
        const char *uid;
        char *attach_file_url;
-       
+
        fetch_list = e_gw_item_get_attach_id_list (item);
        if (fetch_list == NULL)
                return; /* No attachments exist */
@@ -815,7 +815,7 @@ set_attachments_to_cal_component (EGwItem *item, ECalComponent *comp, ECalBacken
                char *filename;
 
                attach_item = (EGwItemAttachment *) l->data;
-               attach_file_url = g_strconcat (e_cal_backend_groupwise_get_local_attachments_store (cbgw), 
+               attach_file_url = g_strconcat (e_cal_backend_groupwise_get_local_attachments_store (cbgw),
                         "/", uid, "-", attach_item->name, NULL);
 
                filename = g_filename_from_uri (attach_file_url, NULL, NULL);
@@ -825,7 +825,7 @@ set_attachments_to_cal_component (EGwItem *item, ECalComponent *comp, ECalBacken
                                return; /* Could not get the attachment from the server */
                        }
                        fd = g_open (filename, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0600);
-                       if (fd == -1) { 
+                       if (fd == -1) {
                                /* skip gracefully */
                                g_warning ("DEBUG: could not serialize attachments\n");
                        } else if (write (fd, attach_item->data, attach_item->size) == -1) {
@@ -860,13 +860,13 @@ set_default_alarms (ECalComponent *comp)
                                DAYS,
                                HOURS,
                                MINUTES
-                       } duration;     
+                       } duration;
                        ECalComponentAlarmTrigger trigger;
 
                        interval = gconf_client_get_int (gconf, CALENDAR_CONFIG_DEFAULT_REMINDER_INTERVAL, NULL);
                        units = gconf_client_get_string (gconf, CALENDAR_CONFIG_DEFAULT_REMINDER_UNITS, NULL);
 
-                       if (units == NULL) 
+                       if (units == NULL)
                                duration = MINUTES;
                        else {
                                if (!strcmp (units, "days"))
@@ -890,10 +890,10 @@ set_default_alarms (ECalComponent *comp)
                        case MINUTES:
                                trigger.u.rel_duration.minutes = interval;
                                break;
-                       case HOURS:     
+                       case HOURS:
                                trigger.u.rel_duration.hours = interval;
                                break;
-                       case DAYS:      
+                       case DAYS:
                                trigger.u.rel_duration.days = interval;
                                break;
                        default:
@@ -964,9 +964,9 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                icalcomponent_add_property (e_cal_component_get_icalcomponent (comp), icalprop);
        }
 
-       
+
        if (e_gw_item_get_reply_request (item)) {
-               char *reply_within; 
+               char *reply_within;
                const char *mess = e_gw_item_get_message (item);
                char *value;
 
@@ -1014,7 +1014,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                if (!icaltime_get_timezone (itt_utc))
                        icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
                if (default_zone) {
-                       itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+                       itt = icaltime_convert_to_zone (itt_utc, default_zone);
                        icaltime_set_timezone (&itt, default_zone);
                        e_cal_component_set_created (comp, &itt);
                        e_cal_component_set_dtstamp (comp, &itt);
@@ -1025,7 +1025,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                }
        }
        g_free (t);
-       
+
        /* categories */
        category_ids = e_gw_item_get_categories (item);
        categories = NULL;
@@ -1042,19 +1042,19 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
        }
 
        /* all day event */
-       is_allday = e_gw_item_get_is_allday_event (item);       
+       is_allday = e_gw_item_get_is_allday_event (item);
 
        /* start date */
        /* should i duplicate here ? */
        t = e_gw_item_get_start_date (item);
        if (t) {
                itt_utc = icaltime_from_string (t);
-               
+
                if (!is_allday && (item_type != E_GW_ITEM_TYPE_NOTE)) {
                        if (!icaltime_get_timezone (itt_utc))
                                icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
                        if (default_zone) {
-                               itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+                               itt = icaltime_convert_to_zone (itt_utc, default_zone);
                                icaltime_set_timezone (&itt, default_zone);
                                dt.value = &itt;
                                dt.tzid = icaltimezone_get_tzid (default_zone);
@@ -1066,12 +1066,12 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                        dt.value = &itt_utc;
                        dt.tzid = NULL;
                        dt.value->is_date = 1;
-               }       
+               }
 
                e_cal_component_set_dtstart (comp, &dt);
-       } else 
+       } else
                return NULL;
-       
+
        /* UID */
        if (e_gw_item_get_recurrence_key (item) != 0) {
 
@@ -1096,7 +1096,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                        return NULL;
                }
        }
-               
+
        g_free (t);
 
        /* classification */
@@ -1126,9 +1126,9 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                                        attendee->role = ICAL_ROLE_REQPARTICIPANT;
                                else if (recipient->type == E_GW_ITEM_RECIPIENT_CC || recipient->type == E_GW_ITEM_RECIPIENT_BC)
                                        attendee->role = ICAL_ROLE_OPTPARTICIPANT;
-                               else 
+                               else
                                        attendee->role = ICAL_ROLE_NONE;
-                               /* FIXME  needs a server fix on the interface 
+                               /* FIXME  needs a server fix on the interface
                                 * for getting cutype and the status */
                                attendee->cutype = ICAL_CUTYPE_INDIVIDUAL;
 
@@ -1143,10 +1143,10 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                                else if (recipient->status == E_GW_ITEM_STAT_DECLINED)
                                        attendee->status = ICAL_PARTSTAT_DECLINED;
                                else
-                                       attendee->status = ICAL_PARTSTAT_NEEDSACTION;   
+                                       attendee->status = ICAL_PARTSTAT_NEEDSACTION;
 
 
-                               attendee_list = g_slist_append (attendee_list, attendee);                               
+                               attendee_list = g_slist_append (attendee_list, attendee);
                        }
 
                        e_cal_component_set_attendee_list (comp, attendee_list);
@@ -1157,7 +1157,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
        organizer = e_gw_item_get_organizer (item);
        if (organizer) {
                ECalComponentOrganizer *cal_organizer;
-               
+
                cal_organizer = g_new0 (ECalComponentOrganizer, 1);
                cal_organizer->cn = g_strdup (organizer->display_name);
                cal_organizer->value = g_strconcat("MAILTO:", organizer->email, NULL);
@@ -1191,7 +1191,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                                if (!icaltime_get_timezone (itt_utc))
                                        icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
                                if (default_zone) {
-                                       itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+                                       itt = icaltime_convert_to_zone (itt_utc, default_zone);
                                        icaltime_set_timezone (&itt, default_zone);
                                        dt.value = &itt;
                                        dt.tzid = icaltimezone_get_tzid (default_zone);
@@ -1215,7 +1215,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                if (alarm_duration != 0) {
                        ECalComponentAlarm *alarm;
                        ECalComponentAlarmTrigger trigger;
-                       
+
                        alarm = e_cal_component_alarm_new ();
                        e_cal_component_alarm_set_action (alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
                        trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START;
@@ -1223,7 +1223,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                        e_cal_component_alarm_set_trigger (alarm, trigger);
                        e_cal_component_add_alarm (comp, alarm);
 
-               } else 
+               } else
                        set_default_alarms (comp);
 
                break;
@@ -1235,7 +1235,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                        if (!icaltime_get_timezone (itt_utc))
                                icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
                        if (default_zone) {
-                               itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+                               itt = icaltime_convert_to_zone (itt_utc, default_zone);
                                icaltime_set_timezone (&itt, default_zone);
                                dt.value = &itt;
                                dt.tzid = icaltimezone_get_tzid (default_zone);
@@ -1262,17 +1262,17 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                /* EGwItem's completed is a boolean */
                if (e_gw_item_get_completed (item)) {
                        percent = 100;
-                       
+
                        t = e_gw_item_get_completed_date (item);
                        if (t) {
                                itt_utc = icaltime_from_string (t);
                                if (!icaltime_get_timezone (itt_utc))
                                        icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
                                if (default_zone) {
-                                       itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+                                       itt = icaltime_convert_to_zone (itt_utc, default_zone);
                                        icaltime_set_timezone (&itt, default_zone);
                                        e_cal_component_set_completed (comp, &itt);
-                               } else 
+                               } else
                                        e_cal_component_set_completed (comp, &itt_utc);
                        } else {
                                /* We are setting the completion date as the current time due to
@@ -1281,7 +1281,7 @@ e_gw_item_to_cal_component (EGwItem *item, ECalBackendGroupwise *cbgw)
                                itt = icaltime_today ();
                                e_cal_component_set_completed (comp,&itt);
                        }
-               } else 
+               } else
                        percent =0;
                e_cal_component_set_percent (comp, &percent);
 
@@ -1320,15 +1320,15 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
 
        switch  (type) {
 
-               case E_CAL_COMPONENT_EVENT: 
+               case E_CAL_COMPONENT_EVENT:
                case E_CAL_COMPONENT_TODO:
                case E_CAL_COMPONENT_JOURNAL:
                        if (!g_str_has_suffix (gw_id, container)) {
                                item_id = g_strconcat (e_cal_component_get_gw_id (comp), GW_EVENT_TYPE_ID, container, NULL);
                                need_to_get = TRUE;
-                               
+
                        }
-                       else 
+                       else
                                item_id = g_strdup (gw_id);
                        break;
                default:
@@ -1342,7 +1342,7 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
 
        if (need_to_get) {
                EGwItem *item = NULL;
-                
+
                status = e_gw_connection_get_item (cnc, container, item_id, "recipients message recipientStatus attachments default", &item);
                if (status == E_GW_CONNECTION_STATUS_OK)
                        *created_comp = e_gw_item_to_cal_component (item, cbgw);
@@ -1376,12 +1376,12 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
                        const char *email_id;
                        ECalComponentAttendee  *attendee = NULL, *tmp;
 
-                       
+
                        e_cal_component_get_attendee_list (comp, &attendee_list);
                        for (l = attendee_list; l ; l = g_slist_next (l)) {
                                tmp = (ECalComponentAttendee *) (l->data);
                                email_id = tmp->value;
-                               
+
                                if (!g_ascii_strncasecmp (email_id, "mailto:", 7))
                                        email_id += 7;
 
@@ -1399,7 +1399,7 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
                        }
                        if (attendee_list)
                                e_cal_component_free_attendee_list (attendee_list);
-                       
+
                }
                else {
                        status = E_GW_CONNECTION_STATUS_INVALID_OBJECT;
@@ -1408,8 +1408,8 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
                *pstatus = partstat;
                switch (partstat) {
                ECalComponentTransparency transp;
-                       
-               case ICAL_PARTSTAT_ACCEPTED: 
+
+               case ICAL_PARTSTAT_ACCEPTED:
                        e_cal_component_get_transparency (comp, &transp);
                        if (transp == E_CAL_COMPONENT_TRANSP_OPAQUE)  {
                                if (all_instances)
@@ -1429,7 +1429,7 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
                                status = e_gw_connection_decline_request (cnc, item_id, NULL, recurrence_key);
                        else
                                status = e_gw_connection_decline_request (cnc, item_id, NULL, NULL);
-                       
+
                        break;
                case ICAL_PARTSTAT_TENTATIVE:
                        if (all_instances)
@@ -1442,7 +1442,7 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
 
                default :
                        status = E_GW_CONNECTION_STATUS_INVALID_OBJECT;
-       
+
                }
 
                break;
@@ -1459,7 +1459,7 @@ e_gw_connection_send_appointment (ECalBackendGroupwise *cbgw, const char *contai
        default:
                return E_GW_CONNECTION_STATUS_INVALID_OBJECT;
        }
-       
+
        return status;
 }
 
@@ -1506,7 +1506,7 @@ e_gw_connection_create_appointment (EGwConnection *cnc, const char *container, E
 }
 
 static EGwConnectionStatus
-start_freebusy_session (EGwConnection *cnc, GList *users, 
+start_freebusy_session (EGwConnection *cnc, GList *users,
                time_t start, time_t end, const char **session)
 {
         SoupSoapMessage *msg;
@@ -1527,10 +1527,10 @@ start_freebusy_session (EGwConnection *cnc, GList *users,
                                            "startFreeBusySessionRequest");
         /* FIXME users is just a buch of user names - associate it with uid,
          * email id apart from the name*/
-        
-        soup_soap_message_start_element (msg, "users", NULL, NULL); 
+
+        soup_soap_message_start_element (msg, "users", NULL, NULL);
         for ( l = users; l != NULL; l = g_list_next (l)) {
-               soup_soap_message_start_element (msg, "user", NULL, NULL); 
+               soup_soap_message_start_element (msg, "user", NULL, NULL);
                 e_gw_message_write_string_parameter (msg, "email", NULL, l->data);
                soup_soap_message_end_element (msg);
         }
@@ -1541,13 +1541,13 @@ start_freebusy_session (EGwConnection *cnc, GList *users,
        utc = icaltimezone_get_utc_timezone ();
        icaltime = icaltime_from_timet_with_zone (start, FALSE, utc);
        start_date = icaltime_as_ical_string (icaltime);
-       
+
        icaltime = icaltime_from_timet_with_zone (end, FALSE, utc);
        end_date = icaltime_as_ical_string (icaltime);
-               
+
         e_gw_message_write_string_parameter (msg, "startDate", NULL, start_date);
         e_gw_message_write_string_parameter (msg, "endDate", NULL, end_date);
-        
+
        e_gw_message_write_footer (msg);
 
        /* send message to server */
@@ -1564,7 +1564,7 @@ start_freebusy_session (EGwConnection *cnc, GList *users,
                 g_object_unref (response);
                 return status;
         }
-        
+
                /* if status is OK - parse result, return the list */
         param = soup_soap_response_get_first_parameter_by_name (response, "freeBusySessionId");
         if (!param) {
@@ -1572,8 +1572,8 @@ start_freebusy_session (EGwConnection *cnc, GList *users,
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-       
-       *session = soup_soap_parameter_get_string_value (param); 
+
+       *session = soup_soap_parameter_get_string_value (param);
         /* free memory */
        g_object_unref (response);
        g_object_unref (msg);
@@ -1581,7 +1581,7 @@ start_freebusy_session (EGwConnection *cnc, GList *users,
        return status;
 }
 
-static EGwConnectionStatus 
+static EGwConnectionStatus
 close_freebusy_session (EGwConnection *cnc, const char *session)
 {
         SoupSoapMessage *msg;
@@ -1623,7 +1623,7 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
 
        /* Perform startFreeBusySession */
-        status = start_freebusy_session (cnc, users, start, end, &session); 
+        status = start_freebusy_session (cnc, users, start, end, &session);
         /*FIXME log error messages  */
         if (status != E_GW_CONNECTION_STATUS_OK)
                 return status;
@@ -1692,7 +1692,7 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
                ECalComponentAttendee attendee;
                GSList *attendee_list = NULL;
                icalcomponent *icalcomp = NULL;
-               
+
                tmp = soup_soap_parameter_get_first_child_by_name (subparam, "email");
                if (tmp)
                        email = soup_soap_parameter_get_string_value (tmp);
@@ -1704,16 +1704,16 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
                        name = soup_soap_parameter_get_string_value (tmp);
 
                comp = e_cal_component_new ();
-               e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_FREEBUSY); 
+               e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_FREEBUSY);
                e_cal_component_commit_sequence (comp);
                icalcomp = e_cal_component_get_icalcomponent (comp);
-               
+
                memset (&attendee, 0, sizeof (ECalComponentAttendee));
                if (name)
                        attendee.cn = name;
                if (email)
                        attendee.value = email;
-               
+
                attendee.cutype = ICAL_CUTYPE_INDIVIDUAL;
                attendee.role = ICAL_ROLE_REQPARTICIPANT;
                attendee.status = ICAL_PARTSTAT_NEEDSACTION;
@@ -1721,30 +1721,30 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
                /* XXX the uuid is not currently used. hence it is
                 * discarded */
 
-               attendee_list = g_slist_append (attendee_list, &attendee);      
+               attendee_list = g_slist_append (attendee_list, &attendee);
 
                e_cal_component_set_attendee_list (comp, attendee_list);
 
-               
+
                param_blocks = soup_soap_parameter_get_first_child_by_name (subparam, "blocks");
                if (!param_blocks) {
                        g_object_unref (response);
                        g_object_unref (msg);
                        return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
                }
-        
+
                for (subparam_block = soup_soap_parameter_get_first_child_by_name (param_blocks, "block");
                     subparam_block != NULL;
                     subparam_block = soup_soap_parameter_get_next_child_by_name (subparam_block, "block")) {
 
-                       /* process each block and create ECal free/busy components.*/ 
+                       /* process each block and create ECal free/busy components.*/
                        SoupSoapParameter *tmp;
                        struct icalperiodtype ipt;
                        icalproperty *icalprop;
                        icaltimetype itt;
                        time_t t;
                        const char *start, *end, *accept_level;
-                       
+
                        memset (&ipt, 0, sizeof (struct icalperiodtype));
                        tmp = soup_soap_parameter_get_first_child_by_name (subparam_block, "startDate");
                        if (tmp) {
@@ -1752,7 +1752,7 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
                                t = e_gw_connection_get_date_from_string (start);
                                itt = icaltime_from_timet_with_zone (t, 0, default_zone ? default_zone : NULL);
                                ipt.start = itt;
-                       }        
+                       }
 
                        tmp = soup_soap_parameter_get_first_child_by_name (subparam_block, "endDate");
                        if (tmp) {
@@ -1806,7 +1806,7 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
                e_gw_item_set_change (item, E_GW_ITEM_CHANGE_TYPE_ADD, #fieldname, (gpointer) fieldname );           \
        }G_STMT_END
 
-static void 
+static void
 set_categories_changes (EGwItem *new_item, EGwItem *old_item)
 {
        GList *old_category_list;
@@ -1819,7 +1819,7 @@ set_categories_changes (EGwItem *new_item, EGwItem *old_item)
        if (old_category_list && new_category_list) {
                old_categories_copy = g_list_copy (old_category_list);
                for ( ; new_category_list != NULL; new_category_list = g_list_next (new_category_list)) {
-                       
+
                        category1  = new_category_list->data;
                        temp = old_category_list;
                        categories_matched  = FALSE;
@@ -1830,12 +1830,12 @@ set_categories_changes (EGwItem *new_item, EGwItem *old_item)
                                        old_categories_copy = g_list_remove (old_categories_copy, category2);
                                        break;
                                }
-                               
+
                        }
                        if (!categories_matched)
                                added_categories = g_list_append (added_categories, category1);
                }
-               
+
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_ADD, "categories", added_categories);
                e_gw_item_set_change (new_item, E_GW_ITEM_CHANGE_TYPE_DELETE, "categories", old_categories_copy);
 
@@ -1868,7 +1868,7 @@ e_gw_item_set_changes (EGwItem *item, EGwItem *cache_item)
        SET_DELTA(message);
        SET_DELTA(classification);
 
-       
+
        SET_DELTA(start_date);
        set_categories_changes (item, cache_item);
        /*FIXME  recipient_list modifications need go here after server starts
@@ -1880,13 +1880,13 @@ e_gw_item_set_changes (EGwItem *item, EGwItem *cache_item)
                SET_DELTA(place);
                trigger = e_gw_item_get_trigger (item);
                cache_trigger = e_gw_item_get_trigger (cache_item);
-               if (cache_trigger) {                                                                            
-                       if (!trigger)                                                                               
+               if (cache_trigger) {
+                       if (!trigger)
                                e_gw_item_set_change (item, E_GW_ITEM_CHANGE_TYPE_DELETE, "alarm", &cache_trigger);
                        else if (trigger != cache_trigger)
                                e_gw_item_set_change (item, E_GW_ITEM_CHANGE_TYPE_UPDATE, "alarm", &trigger);
-               }                                                                                                 
-               else if (trigger)                                                                               
+               }
+               else if (trigger)
                        e_gw_item_set_change (item, E_GW_ITEM_CHANGE_TYPE_ADD, "alarm", &trigger);
                is_allday = e_gw_item_get_is_allday_event (item);
                cache_is_allday = e_gw_item_get_is_allday_event (cache_item);
@@ -1901,19 +1901,19 @@ e_gw_item_set_changes (EGwItem *item, EGwItem *cache_item)
 }
 
 
-static void 
+static void
 add_return_value (EGwSendOptionsReturnNotify track, ESource *source, char *notify)
 {
        char *value;
-       
+
        switch (track) {
                case E_GW_RETURN_NOTIFY_MAIL:
                        value =  g_strdup ("mail");
                        break;
                default:
-                       value = g_strdup ("none");              
+                       value = g_strdup ("none");
        }
-       
+
        e_source_set_property (source, notify, value);
        g_free (value), value = NULL;
 }
@@ -1936,7 +1936,7 @@ e_cal_backend_groupwise_store_settings (GwSettings *hold)
        cbgw = hold->cbgw;
        opts = hold->opts;
        source = e_cal_backend_get_source (E_CAL_BACKEND (cbgw));
-       kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgw)); 
+       kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgw));
 
        /* TODO implement send options for Notes */
        if (kind == ICAL_VJOURNAL_COMPONENT)
@@ -1949,8 +1949,8 @@ e_cal_backend_groupwise_store_settings (GwSettings *hold)
        } else {
                source_list = e_source_list_new_for_gconf (gconf, "/apps/evolution/tasks/sources");
                sopts = e_gw_sendoptions_get_status_tracking_options (opts, "task");
-       } 
-       
+       }
+
        uid = e_source_peek_uid (source);
        source = e_source_list_peek_source_by_uid (source_list, uid);
        if (gopts) {
@@ -1975,7 +1975,7 @@ e_cal_backend_groupwise_store_settings (GwSettings *hold)
                if (gopts->reply_enabled) {
                        if (gopts->reply_convenient)
                                value = g_strdup ("convinient");
-                       else 
+                       else
                                value = g_strdup_printf ("%d",gopts->reply_within);
                } else
                        value = g_strdup ("none");
@@ -2020,11 +2020,11 @@ e_cal_backend_groupwise_store_settings (GwSettings *hold)
                e_source_set_property (source, "status-tracking", value);
                g_free (value), value = NULL;
 
-               add_return_value (sopts->opened, source, "return-open"); 
-               add_return_value (sopts->accepted, source, "return-accept"); 
-               add_return_value (sopts->declined, source, "return-decline"); 
-               add_return_value (sopts->completed, source, "return-complete"); 
-       }       
+               add_return_value (sopts->opened, source, "return-open");
+               add_return_value (sopts->accepted, source, "return-accept");
+               add_return_value (sopts->declined, source, "return-decline");
+               add_return_value (sopts->completed, source, "return-complete");
+       }
 
        e_source_list_sync (source_list, NULL);
 
@@ -2040,9 +2040,9 @@ e_cal_backend_groupwise_store_settings (GwSettings *hold)
 gboolean
 e_cal_backend_groupwise_utils_check_delegate (ECalComponent *comp, const char *email)
 {
-       icalproperty *prop;     
+       icalproperty *prop;
        icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
-       
+
        /*TODO remove the argument email */
        prop = icalcomponent_get_first_property (icalcomp,
                                                 ICAL_X_PROPERTY);
@@ -2059,7 +2059,7 @@ e_cal_backend_groupwise_utils_check_delegate (ECalComponent *comp, const char *e
                prop = icalcomponent_get_next_property (e_cal_component_get_icalcomponent (comp),
                                                        ICAL_X_PROPERTY);
        }
+
        return FALSE;
 
 }
index 746ee6e..5989dea 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -61,7 +61,7 @@ gboolean e_cal_backend_groupwise_utils_check_delegate (ECalComponent *comp, cons
 /*
  * Component related utility functions
  */
-  
+
 const char *e_cal_component_get_gw_id (ECalComponent *comp);
 G_END_DECLS
 
index 21bbc0e..84d89de 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *  Harish Krishnaswamy <kharish@novell.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -82,7 +82,7 @@ struct _ECalBackendGroupwisePrivate {
 
        /* timeout handler for syncing sendoptions */
        guint sendoptions_sync_timeout;
-       
+
        /* fields for storing info while offline */
        char *user_email;
        char *local_attachments_store;
@@ -115,9 +115,9 @@ e_cal_backend_groupwise_get_connection (ECalBackendGroupwise *cbgw) {
 
 GHashTable *
 e_cal_backend_groupwise_get_categories_by_id (ECalBackendGroupwise *cbgw) {
-       
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_GROUPWISE (cbgw), NULL);
-       
+
        return cbgw->priv->categories_by_id;
 }
 
@@ -139,10 +139,10 @@ e_cal_backend_groupwise_get_default_zone (ECalBackendGroupwise *cbgw) {
 
 static GMutex *mutex = NULL;
 
-static const char * 
-get_element_type (icalcomponent_kind kind) 
+static const char *
+get_element_type (icalcomponent_kind kind)
 {
-       
+
        const char *type;
 
        if (kind == ICAL_VEVENT_COMPONENT)
@@ -168,11 +168,11 @@ populate_cache (ECalBackendGroupwise *cbgw)
        int cursor = 0;
        guint32 total, num = 0;
        int percent = 0, i;
-       const char *position = E_GW_CURSOR_POSITION_END; 
+       const char *position = E_GW_CURSOR_POSITION_END;
        icalcomponent_kind kind;
        const char *type;
        EGwFilter* filter[3];
-       char l_str[26]; 
+       char l_str[26];
        char h_str[26];
        icaltimetype temp;
        struct tm tm;
@@ -188,8 +188,8 @@ populate_cache (ECalBackendGroupwise *cbgw)
 
        g_mutex_lock (mutex);
 
-       type = get_element_type (kind); 
-       
+       type = get_element_type (kind);
+
        /* Fetch the data with a bias to present, near past/future */
        temp = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
        i = g_ascii_strtod (g_getenv ("PRELOAD_WINDOW_DAYS")? g_getenv ("PRELOAD_WINDOW_DAYS"):"15", NULL);
@@ -220,7 +220,7 @@ populate_cache (ECalBackendGroupwise *cbgw)
 
        for (i = 0; i < 3; i++) {
                status = e_gw_connection_create_cursor (priv->cnc,
-                               priv->container_id, 
+                               priv->container_id,
                                "recipients message recipientStatus attachments default peek", filter[i], &cursor);
                if (status != E_GW_CONNECTION_STATUS_OK) {
                        e_cal_backend_groupwise_notify_error_code (cbgw, status);
@@ -236,9 +236,9 @@ populate_cache (ECalBackendGroupwise *cbgw)
                        position = E_GW_CURSOR_POSITION_END;
                        forward = FALSE;
                }
-                       
+
                while (!done) {
-                       
+
                        status = e_gw_connection_read_cursor (priv->cnc, priv->container_id, cursor, forward, CURSOR_ITEM_LIMIT, position, &list);
                        if (status != E_GW_CONNECTION_STATUS_OK) {
                                e_cal_backend_groupwise_notify_error_code (cbgw, status);
@@ -248,29 +248,29 @@ populate_cache (ECalBackendGroupwise *cbgw)
                        for (l = list; l != NULL; l = g_list_next(l)) {
                                EGwItem *item;
                                char *progress_string = NULL;
-                               
+
                                item = E_GW_ITEM (l->data);
                                comp = e_gw_item_to_cal_component (item, cbgw);
                                g_object_unref (item);
-                               
+
                                /* Show the progress information */
                                num++;
                                percent = ((float) num/total) * 100;
-                       
-                               /* FIXME The total obtained from the server is wrong. Sometimes the num can 
+
+                               /* FIXME The total obtained from the server is wrong. Sometimes the num can
                                be greater than the total. The following makes sure that the percentage is not >= 100 */
-        
+
                                if (percent > 100)
-                                       percent = 99; 
+                                       percent = 99;
 
                                progress_string = g_strdup_printf (_("Loading %s items"), type);
                                e_cal_backend_notify_view_progress (E_CAL_BACKEND (cbgw), progress_string, percent);
-                               
+
                                if (E_IS_CAL_COMPONENT (comp)) {
                                        char *comp_str;
-                                       
+
                                        e_cal_component_commit_sequence (comp);
-                                       comp_str = e_cal_component_get_as_string (comp);        
+                                       comp_str = e_cal_component_get_as_string (comp);
                                        e_cal_backend_notify_object_created (E_CAL_BACKEND (cbgw), (const char *) comp_str);
                                        g_free (comp_str);
                                        e_cal_backend_cache_put_component (priv->cache, comp);
@@ -278,7 +278,7 @@ populate_cache (ECalBackendGroupwise *cbgw)
                                }
                                g_free (progress_string);
                        }
-                       
+
                        if (!list  || g_list_length (list) == 0)
                                done = TRUE;
                        g_list_free (list);
@@ -305,22 +305,22 @@ get_deltas (gpointer handle)
 {
        ECalBackendGroupwise *cbgw;
        ECalBackendGroupwisePrivate *priv;
-       EGwConnection *cnc; 
-       ECalBackendCache *cache; 
-       EGwConnectionStatus status; 
+       EGwConnection *cnc;
+       ECalBackendCache *cache;
+       EGwConnectionStatus status;
        icalcomponent_kind kind;
        GList *item_list, *total_list = NULL, *l;
        GSList *cache_keys = NULL, *ls;
        GPtrArray *uid_array = NULL;
        char *time_string = NULL;
-       char t_str [26]; 
+       char t_str [26];
        const char *serv_time;
        static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
        const char *time_interval_string;
        const char *key = "attempts";
        const char *attempts;
        const char *position ;
-       
+
 
        EGwFilter *filter;
        int time_interval;
@@ -336,8 +336,8 @@ get_deltas (gpointer handle)
        cbgw = (ECalBackendGroupwise *) handle;
        priv= cbgw->priv;
        kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgw));
-       cnc = priv->cnc; 
-       cache = priv->cache; 
+       cnc = priv->cnc;
+       cache = priv->cache;
        item_list = NULL;
 
        if (priv->mode == CAL_MODE_LOCAL)
@@ -393,7 +393,7 @@ get_deltas (gpointer handle)
                        e_cal_backend_cache_put_key_value (cache, key, GINT_TO_POINTER (failures));
                }
 
-               if (status == E_GW_CONNECTION_STATUS_NO_RESPONSE) { 
+               if (status == E_GW_CONNECTION_STATUS_NO_RESPONSE) {
                        g_static_mutex_unlock (&connecting);
                        return TRUE;
                }
@@ -421,8 +421,8 @@ get_deltas (gpointer handle)
                }
                if ((r_key = e_gw_item_get_recurrence_key (item)) != 0)
                        rid = e_cal_component_get_recurid_as_string (modified_comp);
-               
-               e_cal_component_get_uid (modified_comp, &uid);          
+
+               e_cal_component_get_uid (modified_comp, &uid);
                cache_comp = e_cal_backend_cache_get_component (cache, uid, rid);
                e_cal_component_commit_sequence (modified_comp);
                e_cal_component_commit_sequence (cache_comp);
@@ -446,7 +446,7 @@ get_deltas (gpointer handle)
        time_interval_string = g_getenv ("GETQM_TIME_INTERVAL");
        if (time_interval_string) {
                time_interval = g_ascii_strtod (time_interval_string, NULL);
-       } 
+       }
        if (attempts) {
                tm.tm_min += (time_interval * g_ascii_strtod (attempts, NULL));
                e_cal_backend_cache_put_key_value (cache, key, NULL);
@@ -465,7 +465,7 @@ get_deltas (gpointer handle)
                g_list_free (item_list);
                item_list = NULL;
        }
-       
+
        /* handle deleted items here by going over the entire cache and
         * checking for deleted items.*/
        position = E_GW_CURSOR_POSITION_END;
@@ -488,7 +488,7 @@ get_deltas (gpointer handle)
        }
 
        cache_keys = e_cal_backend_cache_get_keys (cache);
-       
+
        done = FALSE;
        while (!done) {
                status = e_gw_connection_read_cal_ids (cnc, cbgw->priv->container_id, cursor, FALSE, CURSOR_ICALID_LIMIT, position, &item_list);
@@ -501,7 +501,7 @@ get_deltas (gpointer handle)
                        g_static_mutex_unlock (&connecting);
                        return TRUE;
                }
-               
+
                if (!item_list  || g_list_length (item_list) == 0)
                        done = TRUE;
                else {
@@ -518,7 +518,7 @@ get_deltas (gpointer handle)
        }
        e_gw_connection_destroy_cursor (cnc, cbgw->priv->container_id, cursor);
        e_file_cache_freeze_changes (E_FILE_CACHE (cache));
-       
+
        uid_array = g_ptr_array_new ();
        for (l = total_list; l != NULL; l = l->next) {
                EGwItemCalId *calid = (EGwItemCalId *)  l->data;
@@ -531,14 +531,14 @@ get_deltas (gpointer handle)
                        const char *rid = NULL;
                        icaltimetype tt = icaltime_from_string (calid->ical_id);
                        if (!tt.is_date) {
-                               tt = icaltime_convert_to_zone (tt, priv->default_zone); 
+                               tt = icaltime_convert_to_zone (tt, priv->default_zone);
                                icaltime_set_timezone (&tt, priv->default_zone);
                                rid = icaltime_as_ical_string (tt);
                        } else
                                rid = calid->ical_id;
                        real_key = g_strconcat (calid->recur_key, "@", rid, NULL);
                }
-               
+
                if (!calid->recur_key || real_key) {
                        recur_key = real_key;
                        func = (GCompareFunc) strcmp;
@@ -554,16 +554,16 @@ get_deltas (gpointer handle)
                } else  {
                        cache_keys = g_slist_remove_link (cache_keys, remove);
                }
-       
+
                g_free (real_key);
        }
 
        for (ls = cache_keys; ls ; ls = g_slist_next (ls)) {
                ECalComponent *comp = NULL;
                icalcomponent *icalcomp = NULL;
-               
 
-               comp = e_cal_backend_cache_get_component (cache, (const char *) ls->data, NULL);        
+
+               comp = e_cal_backend_cache_get_component (cache, (const char *) ls->data, NULL);
 
                if (!comp)
                        continue;
@@ -571,9 +571,9 @@ get_deltas (gpointer handle)
                if (kind == icalcomponent_isa (icalcomp)) {
                        char *comp_str = NULL;
                        ECalComponentId *id = e_cal_component_get_id (comp);
-                       
+
                        comp_str = e_cal_component_get_as_string (comp);
-                       e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), 
+                       e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw),
                                        id, comp_str, NULL);
                        e_cal_backend_cache_remove_component (cache, (const char *) id->uid, id->rid);
 
@@ -585,7 +585,7 @@ get_deltas (gpointer handle)
 
        if (needs_to_get) {
                e_gw_connection_get_items_from_ids (priv->cnc,
-                               priv->container_id, 
+                               priv->container_id,
                                "attachments recipients message recipientStatus default peek",
                                uid_array, &item_list);
 
@@ -595,7 +595,7 @@ get_deltas (gpointer handle)
                        char *tmp = NULL;
 
                        item = (EGwItem *) l->data;
-                       comp = e_gw_item_to_cal_component (item, cbgw); 
+                       comp = e_gw_item_to_cal_component (item, cbgw);
                        if (comp) {
                                e_cal_component_commit_sequence (comp);
                                sanitize_component (E_CAL_BACKEND_SYNC (cbgw), comp, (char *) e_gw_item_get_id (item));
@@ -612,12 +612,12 @@ get_deltas (gpointer handle)
 
                        g_object_unref (item);
                }
-       } 
+       }
 
        e_file_cache_thaw_changes (E_FILE_CACHE (cache));
 
        g_ptr_array_free (uid_array, TRUE);
-       
+
        if (item_list) {
                g_list_free (item_list);
                item_list = NULL;
@@ -627,14 +627,14 @@ get_deltas (gpointer handle)
                g_list_foreach (total_list, (GFunc) e_gw_item_free_cal_id, NULL);
                g_list_free (total_list);
        }
-       
+
        if (cache_keys) {
                /*FIXME this is a memory leak, but free'ing it causes crash in gslice */
 //             g_slist_free (cache_keys);
        }
-       
+
        g_static_mutex_unlock (&connecting);
-       return TRUE;        
+       return TRUE;
 }
 
 static gboolean
@@ -656,14 +656,14 @@ get_deltas_timeout (gpointer cbgw)
 }
 
 
-static char* 
+static char*
 form_uri (ESource *source)
 {
        char *uri;
        const char *port;
        char *formed_uri;
        const char *use_ssl;
-       
+
                EUri *parsed_uri;
 
        uri = e_source_get_uri (source);
@@ -681,15 +681,15 @@ form_uri (ESource *source)
 
        if (use_ssl && !g_str_equal (use_ssl, "never"))
                formed_uri = g_strconcat ("https://", parsed_uri->host,":", port, "/soap", NULL );
-       else 
+       else
                formed_uri = g_strconcat ("http://", parsed_uri->host,":", port, "/soap", NULL );
-       
+
        g_free (uri);
        e_uri_free (parsed_uri);
        return formed_uri;
 
 }
-                               
+
 static ECalBackendSyncStatus
 cache_init (ECalBackendGroupwise *cbgw)
 {
@@ -705,22 +705,22 @@ cache_init (ECalBackendGroupwise *cbgw)
        time_interval_string = g_getenv ("GETQM_TIME_INTERVAL");
        if (time_interval_string) {
                time_interval = g_ascii_strtod (time_interval_string, NULL);
-               time_interval *= (60*1000); 
-               
+               time_interval *= (60*1000);
+
        }
-       cnc_status = e_gw_connection_get_settings (priv->cnc, &opts);   
+       cnc_status = e_gw_connection_get_settings (priv->cnc, &opts);
        if (cnc_status == E_GW_CONNECTION_STATUS_OK) {
                GwSettings *hold = g_new0 (GwSettings, 1);
 
                hold->cbgw = cbgw;
                hold->opts = opts;
-               
+
                /* We now sync the sendoptions into e-source using the GLIB main loop. Doing this operation
                    in a thread causes crashes. */
                priv->sendoptions_sync_timeout = g_idle_add ((GSourceFunc ) e_cal_backend_groupwise_store_settings, hold);
-       } else 
+       } else
                g_warning (G_STRLOC ": Could not get the settings from the server");
-       
+
        /* get the list of category ids and corresponding names from the server */
        cnc_status = e_gw_connection_get_categories (priv->cnc, &priv->categories_by_id, &priv->categories_by_name);
        if (cnc_status != E_GW_CONNECTION_STATUS_OK) {
@@ -740,7 +740,7 @@ cache_init (ECalBackendGroupwise *cbgw)
                        return GNOME_Evolution_Calendar_PermissionDenied;
                } else {
                        char *utc_str;
-                       
+
                        utc_str = (char *) e_gw_connection_get_server_time (priv->cnc);
                        e_cal_backend_cache_set_marker (priv->cache);
                        e_cal_backend_cache_put_server_utc_time (priv->cache, utc_str);
@@ -761,13 +761,13 @@ cache_init (ECalBackendGroupwise *cbgw)
                } else {
                        g_warning (G_STRLOC ": Could not populate the cache");
                        /*FIXME  why dont we do a notify here */
-                       return GNOME_Evolution_Calendar_PermissionDenied;       
+                       return GNOME_Evolution_Calendar_PermissionDenied;
                }
        }
 }
 
 static ECalBackendSyncStatus
-set_container_id_with_count (ECalBackendGroupwise *cbgw) 
+set_container_id_with_count (ECalBackendGroupwise *cbgw)
 {
        ECalBackendGroupwisePrivate *priv;
        GList *container_list = NULL, *l;
@@ -778,7 +778,7 @@ set_container_id_with_count (ECalBackendGroupwise *cbgw)
        priv = cbgw->priv;
 
        kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgw));
-       
+
        switch (kind) {
        case ICAL_VEVENT_COMPONENT:
        case ICAL_VTODO_COMPONENT:
@@ -789,20 +789,20 @@ set_container_id_with_count (ECalBackendGroupwise *cbgw)
                priv->container_id = NULL;
                return GNOME_Evolution_Calendar_UnsupportedMethod;
        }
-       
+
        status = e_gw_connection_get_container_list (priv->cnc, "folders", &container_list);
-       
+
        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                status = e_gw_connection_get_container_list (priv->cnc, "folders", &container_list);
-       
+
        if (status != E_GW_CONNECTION_STATUS_OK)
                return GNOME_Evolution_Calendar_OtherError;
 
        res =  GNOME_Evolution_Calendar_ObjectNotFound;
        for (l = container_list; l != NULL; l = l->next) {
                EGwContainer *container = E_GW_CONTAINER (l->data);
-               
-               if (e_gw_container_get_is_system_folder (container) && 
+
+               if (e_gw_container_get_is_system_folder (container) &&
                                e_gw_container_get_container_type (container) == E_GW_CONTAINER_TYPE_CALENDAR) {
 
                        priv->container_id = g_strdup (e_gw_container_get_id (container));
@@ -816,7 +816,7 @@ set_container_id_with_count (ECalBackendGroupwise *cbgw)
 
        return res;
 }
-       
+
 static ECalBackendSyncStatus
 connect_to_server (ECalBackendGroupwise *cbgw)
 {
@@ -831,7 +831,7 @@ connect_to_server (ECalBackendGroupwise *cbgw)
        GError *error = NULL;
        char *parent_user = NULL;
        icalcomponent_kind kind;
-       
+
        priv = cbgw->priv;
 
        source = e_cal_backend_get_source (E_CAL_BACKEND (cbgw));
@@ -843,7 +843,7 @@ connect_to_server (ECalBackendGroupwise *cbgw)
        if (!real_uri) {
                e_cal_backend_notify_error (E_CAL_BACKEND (cbgw), _("Invalid server URI"));
                return GNOME_Evolution_Calendar_NoSuchCal;
-       } 
+       }
 
        kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbgw));
 
@@ -863,11 +863,11 @@ connect_to_server (ECalBackendGroupwise *cbgw)
                        e_cal_backend_notify_error (E_CAL_BACKEND (cbgw), _("Authentication failed"));
                        return GNOME_Evolution_Calendar_AuthenticationFailed;
                }
-                       
+
                priv->cnc = e_gw_connection_get_proxy_connection (cnc, parent_user, priv->password, priv->username, &permissions);
 
                g_object_unref(cnc);
-       
+
                if (!priv->cnc) {
                        e_cal_backend_notify_error (E_CAL_BACKEND (cbgw), _("Authentication failed"));
                        return GNOME_Evolution_Calendar_AuthenticationFailed;
@@ -875,7 +875,7 @@ connect_to_server (ECalBackendGroupwise *cbgw)
 
 
                cbgw->priv->read_only = TRUE;
-       
+
                if (kind == ICAL_VEVENT_COMPONENT && (permissions & E_GW_PROXY_APPOINTMENT_WRITE) )
                        cbgw->priv->read_only = FALSE;
                else if (kind == ICAL_VTODO_COMPONENT && (permissions & E_GW_PROXY_TASK_WRITE))
@@ -898,7 +898,7 @@ connect_to_server (ECalBackendGroupwise *cbgw)
                cbgw->priv->read_only = FALSE;
        }
        g_free (real_uri);
-               
+
        if (priv->cnc && priv->cache && priv->container_id) {
                char *utc_str;
                priv->mode = CAL_MODE_REMOTE;
@@ -943,11 +943,11 @@ connect_to_server (ECalBackendGroupwise *cbgw)
                /* get the ID for the container */
                if (priv->container_id)
                        g_free (priv->container_id);
-               
+
                if ((status = set_container_id_with_count (cbgw)) != GNOME_Evolution_Calendar_Success) {
                        return status;
                }
-       
+
                priv->cache = e_cal_backend_cache_new (e_cal_backend_get_uri (E_CAL_BACKEND (cbgw)), source_type);
                if (!priv->cache) {
                        g_mutex_unlock (priv->mutex);
@@ -965,7 +965,7 @@ connect_to_server (ECalBackendGroupwise *cbgw)
 
                        e_cal_backend_notify_error (E_CAL_BACKEND (cbgw), _("Could not create thread for populating cache"));
                        return GNOME_Evolution_Calendar_OtherError;
-               } 
+               }
 
 
        } else {
@@ -973,7 +973,7 @@ connect_to_server (ECalBackendGroupwise *cbgw)
                return GNOME_Evolution_Calendar_AuthenticationFailed;
        }
 
-       if (!e_gw_connection_get_version (priv->cnc)) 
+       if (!e_gw_connection_get_version (priv->cnc))
                return GNOME_Evolution_Calendar_InvalidServerVersion;
 
        return GNOME_Evolution_Calendar_Success;
@@ -1076,10 +1076,10 @@ static ECalBackendSyncStatus
 e_cal_backend_groupwise_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboolean *read_only)
 {
        ECalBackendGroupwise *cbgw;
-       
+
        cbgw = E_CAL_BACKEND_GROUPWISE(backend);
        *read_only = cbgw->priv->read_only;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -1089,7 +1089,7 @@ e_cal_backend_groupwise_get_cal_address (ECalBackendSync *backend, EDataCal *cal
 {
        ECalBackendGroupwise *cbgw;
        ECalBackendGroupwisePrivate *priv;
-       
+
        cbgw = E_CAL_BACKEND_GROUPWISE(backend);
        priv = cbgw->priv;
 
@@ -1101,7 +1101,7 @@ e_cal_backend_groupwise_get_cal_address (ECalBackendSync *backend, EDataCal *cal
        }
 
        *address = g_strdup (priv->user_email);
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -1110,9 +1110,9 @@ e_cal_backend_groupwise_get_ldap_attribute (ECalBackendSync *backend, EDataCal *
 {
        /* ldap attribute is specific to Sun ONE connector to get free busy information*/
        /* retun NULL here as group wise backend know how to get free busy information */
-       
+
        *attribute = NULL;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -1120,9 +1120,9 @@ static ECalBackendSyncStatus
 e_cal_backend_groupwise_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
 {
        /*group wise does not support email based alarms */
-       
+
        *address = NULL;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -1157,11 +1157,11 @@ in_offline (ECalBackendGroupwise *cbgw) {
        priv= cbgw->priv;
        priv->read_only = TRUE;
 
-       if (priv->timeout_id) { 
+       if (priv->timeout_id) {
                g_source_remove (priv->timeout_id);
                priv->timeout_id =0;
-       }       
-       
+       }
+
        if (priv->cnc) {
                g_object_unref (priv->cnc);
                priv->cnc = NULL;
@@ -1183,7 +1183,7 @@ e_cal_backend_groupwise_open (ECalBackendSync *backend, EDataCal *cal, gboolean
        char *filename;
        char *mangled_uri;
        int i;
-       
+
        cbgw = E_CAL_BACKEND_GROUPWISE (backend);
        priv = cbgw->priv;
 
@@ -1211,13 +1211,13 @@ e_cal_backend_groupwise_open (ECalBackendSync *backend, EDataCal *cal, gboolean
        if (priv->mode == CAL_MODE_LOCAL) {
                ESource *esource;
                const char *display_contents = NULL;
-                       
-               cbgw->priv->read_only = TRUE;                           
+
+               cbgw->priv->read_only = TRUE;
                esource = e_cal_backend_get_source (E_CAL_BACKEND (cbgw));
                display_contents = e_source_get_property (esource, "offline_sync");
-               
+
                if (!display_contents || !g_str_equal (display_contents, "1")) {
-                       g_mutex_unlock (priv->mutex);   
+                       g_mutex_unlock (priv->mutex);
                        return GNOME_Evolution_Calendar_RepositoryOffline;
                }
 
@@ -1226,14 +1226,14 @@ e_cal_backend_groupwise_open (ECalBackendSync *backend, EDataCal *cal, gboolean
                        if (!priv->cache) {
                                g_mutex_unlock (priv->mutex);
                                e_cal_backend_notify_error (E_CAL_BACKEND (cbgw), _("Could not create cache file"));
-                               
+
                                return GNOME_Evolution_Calendar_OtherError;
                        }
                }
-               
+
                e_cal_backend_cache_put_default_timezone (priv->cache, priv->default_zone);
 
-               g_mutex_unlock (priv->mutex);   
+               g_mutex_unlock (priv->mutex);
                return GNOME_Evolution_Calendar_Success;
        }
 
@@ -1256,7 +1256,7 @@ e_cal_backend_groupwise_open (ECalBackendSync *backend, EDataCal *cal, gboolean
                                     mangled_uri,
                                     NULL);
        g_free (mangled_uri);
-       priv->local_attachments_store = 
+       priv->local_attachments_store =
                g_filename_to_uri (filename, NULL, NULL);
        g_free (filename);
 
@@ -1272,7 +1272,7 @@ e_cal_backend_groupwise_remove (ECalBackendSync *backend, EDataCal *cal)
 {
        ECalBackendGroupwise *cbgw;
        ECalBackendGroupwisePrivate *priv;
-       
+
        cbgw = E_CAL_BACKEND_GROUPWISE (backend);
        priv = cbgw->priv;
 
@@ -1330,7 +1330,7 @@ e_cal_backend_groupwise_set_mode (ECalBackend *backend, CalMode mode)
        }
 
        g_mutex_lock (priv->mutex);
-       
+
        priv->mode_changed = TRUE;
        switch (mode) {
        case CAL_MODE_REMOTE :/* go online */
@@ -1340,7 +1340,7 @@ e_cal_backend_groupwise_set_mode (ECalBackend *backend, CalMode mode)
                                                    GNOME_Evolution_Calendar_MODE_REMOTE);
                e_cal_backend_notify_readonly (backend, priv->read_only);
                if(e_cal_backend_groupwise_is_loaded (backend))
-                             e_cal_backend_notify_auth_required(backend);      
+                             e_cal_backend_notify_auth_required(backend);
                break;
 
        case CAL_MODE_LOCAL : /* go offline */
@@ -1363,9 +1363,9 @@ e_cal_backend_groupwise_set_mode (ECalBackend *backend, CalMode mode)
 static ECalBackendSyncStatus
 e_cal_backend_groupwise_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
 {
-       
+
        ECalComponent *comp;
-       
+
         comp = e_cal_component_new ();
 
        switch (e_cal_backend_get_kind (E_CAL_BACKEND (backend))) {
@@ -1446,7 +1446,7 @@ e_cal_backend_groupwise_get_timezone (ECalBackendSync *backend, EDataCal *cal, c
         icalcomp = icaltimezone_get_component (zone);
         if (!icalcomp)
                 return GNOME_Evolution_Calendar_InvalidObject;
-                                                      
+
         *object = g_strdup (icalcomponent_as_ical_string (icalcomp));
 
         return GNOME_Evolution_Calendar_Success;
@@ -1533,7 +1533,7 @@ e_cal_backend_groupwise_get_object_list (ECalBackendSync *backend, EDataCal *cal
         GList *components, *l;
        ECalBackendSExp *cbsexp;
        gboolean search_needed = TRUE;
-        
+
        cbgw = E_CAL_BACKEND_GROUPWISE (backend);
        priv = cbgw->priv;
 
@@ -1630,7 +1630,7 @@ e_cal_backend_groupwise_get_free_busy (ECalBackendSync *backend, EDataCal *cal,
 
        if (status != E_GW_CONNECTION_STATUS_OK)
                return GNOME_Evolution_Calendar_OtherError;
-       return GNOME_Evolution_Calendar_Success; 
+       return GNOME_Evolution_Calendar_Success;
 }
 
 typedef struct {
@@ -1644,7 +1644,7 @@ static void
 e_cal_backend_groupwise_compute_changes_foreach_key (const char *key, const char *value, gpointer data)
 {
        ECalBackendGroupwiseComputeChangesData *be_data = data;
-                
+
        if (!e_cal_backend_cache_get_component (be_data->backend->priv->cache, key, NULL)) {
                ECalComponent *comp;
 
@@ -1686,7 +1686,7 @@ e_cal_backend_groupwise_compute_changes (ECalBackendGroupwise *cbgw, const char
         status = e_cal_backend_groupwise_get_object_list (E_CAL_BACKEND_SYNC (cbgw), NULL, NULL, &list);
         if (status != GNOME_Evolution_Calendar_Success)
                 return status;
-        
+
         /* Calculate adds and modifies */
        for (i = list; i != NULL; i = g_list_next (i)) {
                const char *uid;
@@ -1725,7 +1725,7 @@ e_cal_backend_groupwise_compute_changes (ECalBackendGroupwise *cbgw, const char
 
        e_xmlhash_write (ehash);
        e_xmlhash_destroy (ehash);
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -1753,9 +1753,9 @@ e_cal_backend_groupwise_discard_alarm (ECalBackendSync *backend, EDataCal *cal,
 
 static icaltimezone *
 e_cal_backend_groupwise_internal_get_default_timezone (ECalBackend *backend)
-{      
+{
        ECalBackendGroupwise *cbgw = E_CAL_BACKEND_GROUPWISE (backend);
-       
+
        return cbgw->priv->default_zone;
 }
 
@@ -1767,7 +1767,7 @@ e_cal_backend_groupwise_internal_get_timezone (ECalBackend *backend, const char
        zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
        if (!zone)
                return icaltimezone_get_utc_timezone();
-               
+
        return zone;
 }
 
@@ -1777,8 +1777,8 @@ sanitize_component (ECalBackendSync *backend, ECalComponent *comp, char *server_
        ECalBackendGroupwise *cbgw;
        icalproperty *icalprop;
        int i;
-       GString *str = g_string_new ("");;      
-       
+       GString *str = g_string_new ("");;
+
        cbgw = E_CAL_BACKEND_GROUPWISE (backend);
        if (server_uid) {
 
@@ -1791,7 +1791,7 @@ sanitize_component (ECalBackendSync *backend, ECalComponent *comp, char *server_
                                break;
                        }
                }
-               
+
                /* add the extra property to the component */
                icalprop = icalproperty_new_x (str->str);
                icalproperty_set_x_name (icalprop, "X-GWRECORDID");
@@ -1843,7 +1843,7 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal,
        case CAL_MODE_REMOTE :
                /* when online, send the item to the server */
                status = e_gw_connection_create_appointment (priv->cnc, priv->container_id, cbgw, comp, &uid_list);
-               
+
                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                        status = e_gw_connection_create_appointment (priv->cnc, priv->container_id, cbgw, comp, &uid_list);
 
@@ -1855,32 +1855,32 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal,
                        else
                                return GNOME_Evolution_Calendar_OtherError;
                }
-       
+
                /* If delay deliver has been set, server will not send the uid */
                if (!uid_list || ((e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_JOURNAL) && e_cal_component_has_organizer (comp))) {
                        *calobj = NULL;
                        g_object_unref (comp);
                        return GNOME_Evolution_Calendar_Success;
                }
-               
+
                if (g_slist_length (uid_list) == 1) {
                        server_uid = (char *) uid_list->data;
-                       sanitize_component (backend, comp, server_uid); 
+                       sanitize_component (backend, comp, server_uid);
                        g_free (server_uid);
                        /* if successful, update the cache */
                        e_cal_backend_cache_put_component (priv->cache, comp);
                        *calobj = e_cal_component_get_as_string (comp);
                } else {
-                       EGwConnectionStatus stat;       
+                       EGwConnectionStatus stat;
                        GList *list = NULL, *tmp;
                        GPtrArray *uid_array = g_ptr_array_new ();
                        for (l = uid_list; l; l = g_slist_next (l)) {
                                g_ptr_array_add (uid_array, l->data);
                        }
-                       
+
                        /* convert uid_list to GPtrArray and get the items in a list */
                        stat = e_gw_connection_get_items_from_ids (priv->cnc,
-                                       priv->container_id, 
+                                       priv->container_id,
                                        "attachments recipients message recipientStatus default peek",
                                        uid_array, &list);
 
@@ -1888,7 +1888,7 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal,
                                g_ptr_array_free (uid_array, TRUE);
                                return GNOME_Evolution_Calendar_OtherError;
                        }
-                       
+
                        comp = g_object_ref ( (ECalComponent *) list->data );
                        /* convert items into components and add them to the cache */
                        for (i=0, tmp = list; tmp ; tmp = g_list_next (tmp), i++) {
@@ -1896,13 +1896,13 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal,
                                EGwItem *item;
 
                                item = (EGwItem *) tmp->data;
-                               e_cal_comp = e_gw_item_to_cal_component (item, cbgw); 
+                               e_cal_comp = e_gw_item_to_cal_component (item, cbgw);
                                e_cal_component_commit_sequence (e_cal_comp);
                                sanitize_component (backend, e_cal_comp, g_ptr_array_index (uid_array, i));
                                e_cal_backend_cache_put_component (priv->cache, e_cal_comp);
-                               
+
                                if (i == 0) {
-                                       *calobj = e_cal_component_get_as_string (e_cal_comp);   
+                                       *calobj = e_cal_component_get_as_string (e_cal_comp);
                                }
 
                                if (i != 0) {
@@ -1926,7 +1926,7 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal,
        return GNOME_Evolution_Calendar_Success;
 }
 
-static void 
+static void
 get_retract_data (ECalComponent *comp, const char **retract_comment, gboolean *all_instances)
 {
        icalcomponent *icalcomp = NULL;
@@ -1965,7 +1965,7 @@ get_retract_data (ECalComponent *comp, const char **retract_comment, gboolean *a
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj, 
+e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj,
                                       CalObjModType mod, char **old_object, char **new_object)
 {
        ECalBackendGroupwise *cbgw;
@@ -1987,7 +1987,7 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
                in_offline (cbgw);
                return GNOME_Evolution_Calendar_RepositoryOffline;
        }
-       
+
        /* check the component for validity */
        icalcomp = icalparser_parse_string (calobj);
        if (!icalcomp)
@@ -2008,7 +2008,7 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
                        return GNOME_Evolution_Calendar_ObjectNotFound;
                }
 
-               if (e_cal_component_has_attendees (comp) && 
+               if (e_cal_component_has_attendees (comp) &&
                                e_cal_backend_groupwise_utils_check_delegate (comp, e_gw_connection_get_user_email (priv->cnc))) {
                        const char *id = NULL, *recur_key = NULL;
 
@@ -2016,10 +2016,10 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
 
                        if (mod == CALOBJ_MOD_ALL && e_cal_component_is_instance (comp)) {
                                recur_key = uid;
-                       } 
+                       }
                        id = e_gw_item_get_id (item);
 
-                       status = e_gw_connection_delegate_request (priv->cnc, item, id, NULL, NULL, recur_key); 
+                       status = e_gw_connection_delegate_request (priv->cnc, item, id, NULL, NULL, recur_key);
 
                        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                                status = e_gw_connection_delegate_request (priv->cnc, item, id, NULL, NULL, recur_key);
@@ -2032,22 +2032,22 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
                        e_cal_backend_cache_put_component (priv->cache, comp);
                        *new_object = e_cal_component_get_as_string (comp);
                        break;
-               } 
+               }
 
                item = e_gw_item_new_from_cal_component (priv->container_id, cbgw, comp);
                cache_item =  e_gw_item_new_from_cal_component (priv->container_id, cbgw, cache_comp);
                if ( e_gw_item_get_item_type (item) == E_GW_ITEM_TYPE_TASK) {
                        gboolean completed, cache_completed;
-                       
+
                        completed = e_gw_item_get_completed (item);
                        cache_completed = e_gw_item_get_completed (cache_item);
                        if (completed && !cache_completed) {
                                /*FIXME  return values. */
                                status = e_gw_connection_complete_request (priv->cnc, e_gw_item_get_id (item));
-                       
+
                                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                                        status = e_gw_connection_complete_request (priv->cnc, e_gw_item_get_id (item));
-                               
+
                                if (status != E_GW_CONNECTION_STATUS_OK) {
                                        g_object_unref (comp);
                                        g_object_unref (cache_comp);
@@ -2057,12 +2057,12 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
                                break;
                        }
                }
-               
-               e_gw_item_set_changes (item, cache_item); 
+
+               e_gw_item_set_changes (item, cache_item);
 
                /* the second argument is redundant */
                status = e_gw_connection_modify_item (priv->cnc, e_gw_item_get_id (item), item);
-               
+
                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                        status = e_gw_connection_modify_item (priv->cnc, e_gw_item_get_id (item), item);
 
@@ -2089,9 +2089,9 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend, EDataCal *cal,
 }
 
 static const char *
-get_gw_item_id (icalcomponent *icalcomp) 
+get_gw_item_id (icalcomponent *icalcomp)
 {
-       icalproperty *icalprop; 
+       icalproperty *icalprop;
 
        /* search the component for the X-GWRECORDID property */
        icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
@@ -2130,7 +2130,7 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
                ECalBackendSyncStatus status;
                const char *id_to_remove = NULL;
                icalcomponent *icalcomp;
-       
+
                status = e_cal_backend_groupwise_get_object (backend, cal, uid, rid, &calobj);
                if (status != GNOME_Evolution_Calendar_Success)
                        return status;
@@ -2143,7 +2143,7 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
                }
 
                if (mod == CALOBJ_MOD_THIS) {
-                       id_to_remove = get_gw_item_id (icalcomp); 
+                       id_to_remove = get_gw_item_id (icalcomp);
                        if (!id_to_remove) {
                                /* use the iCalId to remove the object */
                                id_to_remove = uid;
@@ -2176,22 +2176,22 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
                        if (e_cal_component_has_attendees (E_CAL_COMPONENT (comp_list->data))) {
                                /* get recurrence key and send it to
                                 * e_gw_connection_remove_recurrence_item */
-                               
-                               id_to_remove = get_gw_item_id (e_cal_component_get_icalcomponent (comp_list->data)); 
+
+                               id_to_remove = get_gw_item_id (e_cal_component_get_icalcomponent (comp_list->data));
                                status = e_gw_connection_decline_request (priv->cnc, id_to_remove, NULL, uid);
                                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                                        status = e_gw_connection_decline_request (priv->cnc, id_to_remove, NULL, uid);
                        } else {
-                               GList *item_ids = NULL; 
-                               
+                               GList *item_ids = NULL;
+
                                for (l = comp_list; l; l = l->next) {
                                        ECalComponent *comp = E_CAL_COMPONENT (l->data);
 
-                                       id_to_remove = get_gw_item_id (e_cal_component_get_icalcomponent (comp)); 
+                                       id_to_remove = get_gw_item_id (e_cal_component_get_icalcomponent (comp));
                                        item_ids = g_list_append (item_ids, (char *) id_to_remove);
                                }
                                status = e_gw_connection_remove_items (priv->cnc, priv->container_id, item_ids);
-                               
+
                                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                                        status = e_gw_connection_remove_items (priv->cnc, priv->container_id, item_ids);
                        }
@@ -2202,14 +2202,14 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
                                        ECalComponent *comp = E_CAL_COMPONENT (l->data);
                                        ECalComponentId *id = e_cal_component_get_id (comp);
 
-                                       e_cal_backend_cache_remove_component (priv->cache, id->uid, 
+                                       e_cal_backend_cache_remove_component (priv->cache, id->uid,
                                                        id->rid);
                                        if (!id->rid || !g_str_equal (id->rid, rid))
                                                e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), id, e_cal_component_get_as_string (comp), NULL);
                                        e_cal_component_free_id (id);
-                                       
+
                                        g_object_unref (comp);
-                               
+
                                }
                                /* Setting NULL would trigger another signal.
                                 * We do not set the *object to NULL  */
@@ -2229,7 +2229,7 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend, EDataCal *cal,
                return GNOME_Evolution_Calendar_RepositoryOffline;
        } else
                return GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED;
-       
+
 }
 
 /* This function is largely duplicated in
@@ -2249,7 +2249,7 @@ fetch_attachments (ECalBackendGroupwise *cbgw, ECalComponent *comp)
        e_cal_component_get_uid (comp, &uid);
        /*FIXME  get the uri rather than computing the path */
        attach_store = g_strdup (e_cal_backend_groupwise_get_local_attachments_store (cbgw));
-       
+
        for (l = attach_list; l ; l = l->next) {
                char *sfname = (char *)l->data;
                char *filename, *new_filename;
@@ -2290,10 +2290,10 @@ fetch_attachments (ECalBackendGroupwise *cbgw, ECalComponent *comp)
        e_cal_component_set_attachment_list (comp, new_attach_list);
 }
 
-static void 
+static void
 change_status (ECalComponent *comp, icalparameter_partstat status, const char *email)
-{      
-       icalproperty *prop;     
+{
+       icalproperty *prop;
        icalparameter *param;
        gboolean found = FALSE;
        icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp);
@@ -2352,7 +2352,7 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
        priv = cbgw->priv;
 
        /* When the icalcomponent is obtained through the itip message rather
-        * than from the SOAP protocol, the container id has to be explicitly 
+        * than from the SOAP protocol, the container id has to be explicitly
         * added to the xgwrecordid inorder to obtain the item id. */
        icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
        while (icalprop) {
@@ -2373,7 +2373,7 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
        comp = e_cal_component_new ();
        e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
        method = icalcomponent_get_method (icalcomp);
-       
+
        /* handle attachments */
        if (e_cal_component_has_attachments (comp))
                fetch_attachments (cbgw, comp);
@@ -2393,7 +2393,7 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
 
                if (all_instances) {
                        const char *uid;
-                       
+
                        e_cal_component_get_uid (modif_comp, (const char **) &uid);
                        comps = e_cal_backend_cache_get_components_by_uid (priv->cache, uid);
 
@@ -2413,10 +2413,10 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
                                comps = g_slist_append (comps, component);
                                found = TRUE;
                        }
+
                        e_cal_component_free_id (id);
                }
+
                for (l = comps; l != NULL; l = l->next) {
                        ECalComponent *component = E_CAL_COMPONENT (l->data);
 
@@ -2434,9 +2434,9 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
                                char *comp_str = NULL;
 
                                change_status (component, pstatus, e_gw_connection_get_user_email (priv->cnc));
-                               e_cal_backend_cache_put_component (priv->cache, component);     
+                               e_cal_backend_cache_put_component (priv->cache, component);
                                comp_str = e_cal_component_get_as_string (component);
-                               
+
                                if (found)
                                        e_cal_backend_notify_object_modified (E_CAL_BACKEND (cbgw), comp_str, comp_str);
                                else
@@ -2445,10 +2445,10 @@ receive_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalco
                                g_free (comp_str);
                        }
                }
-               
+
                g_slist_foreach (comps, (GFunc) g_object_unref, NULL);
                g_slist_free (comps);
-               g_object_unref (comp);  
+               g_object_unref (comp);
                g_object_unref (modif_comp);
                return GNOME_Evolution_Calendar_Success;
 
@@ -2526,13 +2526,13 @@ send_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp,
                g_object_unref (comp);
                return GNOME_Evolution_Calendar_ObjectNotFound;
        }
-               
+
 
        switch (priv->mode) {
        case CAL_MODE_ANY :
        case CAL_MODE_REMOTE :
                if (method == ICAL_METHOD_CANCEL) {
-                       const char *retract_comment = NULL;     
+                       const char *retract_comment = NULL;
                        gboolean all_instances = FALSE;
                        const char *id = NULL;
 
@@ -2553,10 +2553,10 @@ send_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp,
                                                ECalComponentId *cid = e_cal_component_get_id (component);
                                                char *object = e_cal_component_get_as_string (component);
 
-                                               if (e_cal_backend_cache_remove_component (priv->cache, cid->uid, 
+                                               if (e_cal_backend_cache_remove_component (priv->cache, cid->uid,
                                                                cid->rid))
                                                e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), cid, object, NULL);
-                                               
+
                                                e_cal_component_free_id (cid);
                                                g_free (object);
                                                g_object_unref (component);
@@ -2571,10 +2571,10 @@ send_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp,
                                        cid = e_cal_component_get_id (comp);
                                        icalcomp = e_cal_component_get_icalcomponent (comp);
                                        object = e_cal_component_get_as_string (comp);
-                               
-                                       if (e_cal_backend_cache_remove_component (priv->cache, cid->uid, 
+
+                                       if (e_cal_backend_cache_remove_component (priv->cache, cid->uid,
                                                                cid->rid)) {
-                                               e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), cid, 
+                                               e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbgw), cid,
                                                        object, NULL);
                                        }
 
@@ -2589,7 +2589,7 @@ send_object (ECalBackendGroupwise *cbgw, EDataCal *cal, icalcomponent *icalcomp,
                status = GNOME_Evolution_Calendar_RepositoryOffline;
                break;
        default:
-               break;  
+               break;
        }
 
        g_object_unref (comp);
@@ -2641,24 +2641,24 @@ e_cal_backend_groupwise_send_objects (ECalBackendSync *backend, EDataCal *cal, c
                status = send_object (cbgw, cal, icalcomp, method);
        } else
                status = GNOME_Evolution_Calendar_InvalidObject;
-       
+
        if (status == GNOME_Evolution_Calendar_Success) {
                ECalComponent *comp;
 
                comp = e_cal_component_new ();
-               
+
                if (e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp))) {
                        GSList *attendee_list = NULL, *tmp;
                        e_cal_component_get_attendee_list (comp, &attendee_list);
                        /* convert this into GList */
                        for (tmp = attendee_list; tmp; tmp = g_slist_next (tmp)) {
                                const char *attendee = tmp->data;
-       
+
                                if (attendee)
                                        *users = g_list_append (*users, g_strdup (attendee));
                        }
-                       
-                       g_object_unref (comp);  
+
+                       g_object_unref (comp);
                }
                *modified_calobj = g_strdup (calobj);
        }
@@ -2739,11 +2739,11 @@ e_cal_backend_groupwise_class_init (ECalBackendGroupwiseClass *class)
 
 /**
  * e_cal_backend_groupwise_get_type:
- * @void: 
- * 
+ * @void:
+ *
  * Registers the #ECalBackendGroupwise class if necessary, and returns the type ID
  * associated to it.
- * 
+ *
  * Return value: The type ID of the #ECalBackendGroupwise class.
  **/
 GType
index e940312..095819b 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 0fd5905..67d157e 100644 (file)
@@ -133,7 +133,7 @@ e_cal_backend_http_finalize (GObject *object)
                icaltimezone_free (priv->default_zone, 1);
                priv->default_zone = NULL;
        }
-       
+
 
        if (priv->soup_session) {
                soup_session_abort (priv->soup_session);
@@ -162,7 +162,7 @@ static ECalBackendSyncStatus
 e_cal_backend_http_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboolean *read_only)
 {
        *read_only = TRUE;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -182,7 +182,7 @@ static ECalBackendSyncStatus
 e_cal_backend_http_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
 {
        *attribute = NULL;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -193,7 +193,7 @@ e_cal_backend_http_get_alarm_email_address (ECalBackendSync *backend, EDataCal *
         * with it (although that would be a useful feature some day).
         */
        *address = NULL;
-       
+
        return GNOME_Evolution_Calendar_Success;
 }
 
@@ -384,46 +384,46 @@ retrieval_done (SoupMessage *msg, ECalBackendHttp *cbhttp)
 /* Authentication helpers for libsoup */
 
 static void
-soup_authenticate (SoupSession  *session, 
+soup_authenticate (SoupSession  *session,
                   SoupMessage  *msg,
-                  const char   *auth_type, 
+                  const char   *auth_type,
                   const char   *auth_realm,
-                  char        **username, 
-                  char        **password, 
+                  char        **username,
+                  char        **password,
                   gpointer      data)
 {
        ECalBackendHttpPrivate *priv;
        ECalBackendHttp        *cbhttp;
-       
-       cbhttp = E_CAL_BACKEND_HTTP (data);     
+
+       cbhttp = E_CAL_BACKEND_HTTP (data);
        priv =  cbhttp->priv;
 
        *username = priv->username;
        *password = priv->password;
-       
+
        priv->username = NULL;
        priv->password = NULL;
 
 }
 
 static void
-soup_reauthenticate (SoupSession  *session, 
+soup_reauthenticate (SoupSession  *session,
                     SoupMessage  *msg,
-                    const char   *auth_type, 
+                    const char   *auth_type,
                     const char   *auth_realm,
-                    char        **username, 
-                    char        **password, 
+                    char        **username,
+                    char        **password,
                     gpointer      data)
 {
        ECalBackendHttpPrivate *priv;
        ECalBackendHttp        *cbhttp;
-       
-       cbhttp = E_CAL_BACKEND_HTTP (data);     
+
+       cbhttp = E_CAL_BACKEND_HTTP (data);
        priv = cbhttp->priv;
 
        *username = priv->username;
        *password = priv->password;
-       
+
        priv->username = NULL;
        priv->password = NULL;
 }
@@ -461,7 +461,7 @@ begin_retrieval_cb (ECalBackendHttp *cbhttp)
                                  G_CALLBACK (soup_authenticate), cbhttp);
                g_signal_connect (priv->soup_session, "reauthenticate",
                                  G_CALLBACK (soup_reauthenticate), cbhttp);
-       
+
                /* set the HTTP proxy, if configuration is set to do so */
                conf_client = gconf_client_get_default ();
                if (gconf_client_get_bool (conf_client, "/system/http_proxy/use_http_proxy", NULL)) {
@@ -505,7 +505,7 @@ begin_retrieval_cb (ECalBackendHttp *cbhttp)
        if (priv->uri == NULL) {
                ESource *source = e_cal_backend_get_source (E_CAL_BACKEND (cbhttp));
                const char *secure_prop = e_source_get_property (source, "use_ssl");
-               
+
                priv->uri = webcal_to_http_method (e_cal_backend_get_uri (E_CAL_BACKEND (cbhttp)),
                                                   (secure_prop && g_str_equal(secure_prop, "1")));
        }
@@ -575,11 +575,11 @@ e_cal_backend_http_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
        ECalBackendHttp *cbhttp;
        ECalBackendHttpPrivate *priv;
        ESource *source;
-       
+
        cbhttp = E_CAL_BACKEND_HTTP (backend);
        priv = cbhttp->priv;
        source = e_cal_backend_get_source (E_CAL_BACKEND (backend));
-       
+
        if (e_source_get_property (source, "auth") != NULL) {
                if ((username == NULL || password == NULL)) {
                        return GNOME_Evolution_Calendar_AuthenticationRequired;
@@ -595,16 +595,16 @@ e_cal_backend_http_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_
 
                if (!priv->cache) {
                        e_cal_backend_notify_error (E_CAL_BACKEND(cbhttp), _("Could not create cache file"));
-                       return GNOME_Evolution_Calendar_OtherError;     
+                       return GNOME_Evolution_Calendar_OtherError;
                }
-               
+
                if (priv->default_zone) {
                        e_cal_backend_cache_put_default_timezone (priv->cache, priv->default_zone);
                }
 
-               if (priv->mode == CAL_MODE_LOCAL) 
+               if (priv->mode == CAL_MODE_LOCAL)
                        return GNOME_Evolution_Calendar_Success;
-               
+
 
                g_idle_add ((GSourceFunc) begin_retrieval_cb, cbhttp);
        }
@@ -617,7 +617,7 @@ e_cal_backend_http_remove (ECalBackendSync *backend, EDataCal *cal)
 {
        ECalBackendHttp *cbhttp;
        ECalBackendHttpPrivate *priv;
-       
+
        cbhttp = E_CAL_BACKEND_HTTP (backend);
        priv = cbhttp->priv;
 
@@ -669,7 +669,7 @@ e_cal_backend_http_set_mode (ECalBackend *backend, CalMode mode)
        priv = cbhttp->priv;
 
        loaded = e_cal_backend_http_is_loaded (backend);
-                               
+
        switch (mode) {
                case CAL_MODE_LOCAL:
                        priv->mode = mode;
@@ -680,13 +680,13 @@ e_cal_backend_http_set_mode (ECalBackend *backend, CalMode mode)
                        }
                        break;
                case CAL_MODE_REMOTE:
-               case CAL_MODE_ANY:      
+               case CAL_MODE_ANY:
                        priv->mode = mode;
                        set_mode = cal_mode_to_corba (mode);
-                       if (loaded) 
+                       if (loaded)
                                g_idle_add ((GSourceFunc) begin_retrieval_cb, backend);
                        break;
-               
+
                        priv->mode = CAL_MODE_REMOTE;
                        set_mode = GNOME_Evolution_Calendar_MODE_REMOTE;
                        break;
@@ -696,7 +696,7 @@ e_cal_backend_http_set_mode (ECalBackend *backend, CalMode mode)
        }
 
        if (loaded) {
-               
+
                if (set_mode == GNOME_Evolution_Calendar_MODE_ANY)
                        e_cal_backend_notify_mode (backend,
                                                   GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED,
@@ -978,7 +978,7 @@ create_user_free_busy (ECalBackendHttp *cbhttp, const char *address, const char
         ECalBackendHttpPrivate *priv;
         ECalBackendCache *cache;
         char *query, *iso_start, *iso_end;
-       
+
         priv = cbhttp->priv;
         cache = priv->cache;
 
@@ -1066,7 +1066,7 @@ e_cal_backend_http_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
        gchar *address, *name;
        icalcomponent *vfb;
        char *calobj;
-       
+
 
        cbhttp = E_CAL_BACKEND_HTTP (backend);
        priv = cbhttp->priv;
@@ -1082,7 +1082,7 @@ e_cal_backend_http_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList
                         vfb = create_user_free_busy (cbhttp, address, name, start, end);
                         calobj = icalcomponent_as_ical_string (vfb);
                         *freebusy = g_list_append (*freebusy, g_strdup (calobj));
-                        icalcomponent_free (vfb);      
+                        icalcomponent_free (vfb);
                         g_free (address);
                         g_free (name);
                }
@@ -1139,7 +1139,7 @@ e_cal_backend_http_create_object (ECalBackendSync *backend, EDataCal *cal, char
 {
        ECalBackendHttp *cbhttp;
        ECalBackendHttpPrivate *priv;
-       
+
        cbhttp = E_CAL_BACKEND_HTTP (backend);
        priv = cbhttp->priv;
 
@@ -1147,7 +1147,7 @@ e_cal_backend_http_create_object (ECalBackendSync *backend, EDataCal *cal, char
 }
 
 static ECalBackendSyncStatus
-e_cal_backend_http_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj, 
+e_cal_backend_http_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj,
                                CalObjModType mod, char **old_object, char **new_object)
 {
        ECalBackendHttp *cbhttp;
@@ -1313,11 +1313,11 @@ e_cal_backend_http_class_init (ECalBackendHttpClass *class)
 
 /**
  * e_cal_backend_http_get_type:
- * @void: 
- * 
+ * @void:
+ *
  * Registers the #ECalBackendHttp class if necessary, and returns the type ID
  * associated to it.
- * 
+ *
  * Return value: The type ID of the #ECalBackendHttp class.
  **/
 GType
index f6d9b7c..881bc14 100644 (file)
@@ -34,7 +34,7 @@ static gboolean begin_retrieval_cb (ECalBackendWeather *cbw);
 static ECalComponent* create_weather (ECalBackendWeather *cbw, WeatherForecast *report);
 static ECalBackendSyncStatus
 e_cal_backend_weather_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj);
-       
+
 /* Private part of the ECalBackendWeather structure */
 struct _ECalBackendWeatherPrivate {
        /* URI to get remote weather data from */
@@ -190,7 +190,7 @@ begin_retrieval_cb (ECalBackendWeather *cbw)
 
        source = g_main_current_source ();
 
-       if (priv->begin_retrival_id == g_source_get_id (source)) 
+       if (priv->begin_retrival_id == g_source_get_id (source))
                priv->begin_retrival_id = 0;
 
        if (priv->is_loading)
@@ -452,7 +452,7 @@ e_cal_backend_weather_open (ECalBackendSync *backend, EDataCal *cal, gboolean on
        if (priv->city)
                g_free (priv->city);
        priv->city = g_strdup (strrchr (uri, '/') + 1);
-       
+
        if (!priv->cache) {
                priv->cache = e_cal_backend_cache_new (uri, E_CAL_SOURCE_TYPE_EVENT);
 
@@ -927,7 +927,7 @@ e_cal_backend_weather_class_init (ECalBackendWeatherClass *class)
 
 /**
  * e_cal_backend_weather_get_type:
- * @void: 
+ * @void:
  *
  * Registers the #ECalBackendWeather class if necessary, and returns
  * the type ID associated to it.
index edb79b0..92bd4b3 100644 (file)
@@ -82,7 +82,7 @@ struct period {
 
 struct recur_id {
        struct datetime recur_time;
-       
+
        icalparameter *range_param;
 };
 
@@ -97,7 +97,7 @@ struct _ECalComponentPrivate {
 
        icalproperty *status;
        GSList *attendee_list;
-       
+
        icalproperty *categories;
 
        icalproperty *classification;
@@ -130,14 +130,14 @@ struct _ECalComponentPrivate {
        GSList *exrule_list; /* list of icalproperty objects */
 
        struct organizer organizer;
-       
+
        icalproperty *geo;
        icalproperty *last_modified;
        icalproperty *percent;
        icalproperty *priority;
 
        struct recur_id recur_id;
-       
+
        GSList *rdate_list; /* list of struct period */
 
        GSList *rrule_list; /* list of icalproperty objects */
@@ -288,7 +288,7 @@ free_icalcomponent (ECalComponent *comp, gboolean free)
 {
        ECalComponentPrivate *priv;
        GSList *l;
-       
+
        priv = comp->priv;
 
        if (!priv->icalcomp)
@@ -300,7 +300,7 @@ free_icalcomponent (ECalComponent *comp, gboolean free)
                icalcomponent_free (priv->icalcomp);
                priv->icalcomp = NULL;
        }
-       
+
        /* Free the mappings */
 
        priv->uid = NULL;
@@ -316,7 +316,7 @@ free_icalcomponent (ECalComponent *comp, gboolean free)
                g_free (l->data);
        g_slist_free (priv->attendee_list);
        priv->attendee_list = NULL;
-       
+
        priv->categories = NULL;
 
        priv->classification = NULL;
@@ -524,10 +524,10 @@ e_cal_component_clone (ECalComponent *comp)
 
 /* Scans an attachment property */
 static void
-scan_attachment (GSList **attachment_list, icalproperty *prop) 
+scan_attachment (GSList **attachment_list, icalproperty *prop)
 {
        struct attachment *attachment;
-       
+
        attachment = g_new (struct attachment, 1);
        attachment->prop = prop;
 
@@ -538,10 +538,10 @@ scan_attachment (GSList **attachment_list, icalproperty *prop)
 
 /* Scans an attendee property */
 static void
-scan_attendee (GSList **attendee_list, icalproperty *prop) 
+scan_attendee (GSList **attendee_list, icalproperty *prop)
 {
        struct attendee *attendee;
-       
+
        attendee = g_new (struct attendee, 1);
        attendee->prop = prop;
 
@@ -555,7 +555,7 @@ scan_attendee (GSList **attendee_list, icalproperty *prop)
        attendee->sentby_param = icalproperty_get_first_parameter (prop, ICAL_SENTBY_PARAMETER);
        attendee->cn_param = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER);
        attendee->language_param = icalproperty_get_first_parameter (prop, ICAL_LANGUAGE_PARAMETER);
-       
+
        *attendee_list = g_slist_append (*attendee_list, attendee);
 }
 
@@ -589,7 +589,7 @@ scan_exdate (ECalComponent *comp, icalproperty *prop)
 
 /* Scans and attendee property */
 static void
-scan_organizer (ECalComponent *comp, struct organizer *organizer, icalproperty *prop) 
+scan_organizer (ECalComponent *comp, struct organizer *organizer, icalproperty *prop)
 {
        organizer->prop = prop;
 
@@ -1177,7 +1177,7 @@ void
 e_cal_component_strip_errors (ECalComponent *comp)
 {
        ECalComponentPrivate *priv;
-       
+
        g_return_if_fail (comp != NULL);
        g_return_if_fail (E_IS_CAL_COMPONENT (comp));
 
@@ -1437,13 +1437,13 @@ e_cal_component_get_id (ECalComponent *comp)
 
        priv = comp->priv;
        g_return_val_if_fail (priv->icalcomp != NULL, NULL);
-       
+
        id = g_new0 (ECalComponentId, 1);
        id->uid = g_strdup (icalproperty_get_uid (priv->uid));
        id->rid = g_strdup (e_cal_component_get_recurid_as_string (comp));
 
        return id;
-} 
+}
 
 /**
  * e_cal_component_get_uid:
@@ -1518,12 +1518,12 @@ get_attachment_list (GSList *attachment_list, GSList **al)
                if (icalattach_get_is_url (attachment->attach)) {
                        /* FIXME : this ref count is screwed up
                         * These structures are being leaked.
-                        */   
+                        */
                        icalattach_ref (attachment->attach);
                        data = icalattach_get_url (attachment->attach);
                        buf_size = strlen (data);
                        buf = g_malloc0 (buf_size+1);
-                       icalvalue_decode_ical_string (data, buf, buf_size);     
+                       icalvalue_decode_ical_string (data, buf, buf_size);
                }
                else
                        data = NULL;
@@ -1570,7 +1570,7 @@ set_attachment_list (icalcomponent *icalcomp,
                buf_size = 2 * strlen ((char *)l->data);
                buf = g_malloc0 (buf_size);
                icalvalue_encode_ical_string (l->data, buf, buf_size);
-               attachment->attach = icalattach_new_from_url ((char *) buf);    
+               attachment->attach = icalattach_new_from_url ((char *) buf);
                attachment->prop = icalproperty_new_attach (attachment->attach);
                icalcomponent_add_property (icalcomp, attachment->prop);
                g_free (buf);
@@ -1582,10 +1582,10 @@ set_attachment_list (icalcomponent *icalcomp,
 
 
 /**
- * e_cal_component_get_attachment_list: 
- * @comp: A calendar component object. 
+ * e_cal_component_get_attachment_list:
+ * @comp: A calendar component object.
  * @attachment_list: Return list of URLS to attachments.
- * 
+ *
  * Queries the attachment properties of the calendar component object. When done,
  * the @attachment_list should be freed by calling #g_slist_free.
  **/
@@ -1593,7 +1593,7 @@ void
 e_cal_component_get_attachment_list (ECalComponent *comp, GSList **attachment_list)
 {
        ECalComponentPrivate *priv;
-       
+
        g_return_if_fail (comp != NULL);
        g_return_if_fail (E_IS_CAL_COMPONENT (comp));
        g_return_if_fail (attachment_list != NULL);
@@ -1606,7 +1606,7 @@ e_cal_component_get_attachment_list (ECalComponent *comp, GSList **attachment_li
 
 /**
  * e_cal_component_set_attachment_list:
- * @comp: A calendar component object. 
+ * @comp: A calendar component object.
  * @attachment_list: list of urls to attachment pointers.
  *
  * This currently handles only attachments that are urls
@@ -1648,7 +1648,7 @@ e_cal_component_has_attachments (ECalComponent *comp)
 
        if (g_slist_length (priv->attachment_list) > 0)
                return TRUE;
-       
+
        return FALSE;
 }
 
@@ -1660,7 +1660,7 @@ e_cal_component_has_attachments (ECalComponent *comp)
  *
  * Return value: the number of attachments.
  */
-int 
+int
 e_cal_component_get_num_attachments (ECalComponent *comp)
 {
        ECalComponentPrivate *priv;
@@ -1671,7 +1671,7 @@ e_cal_component_get_num_attachments (ECalComponent *comp)
        priv = comp->priv;
 
        return g_slist_length (priv->attachment_list) > 0;
-       
+
 }
 
 /**
@@ -2471,7 +2471,7 @@ e_cal_component_get_dtend (ECalComponent *comp, ECalComponentDateTime *dt)
 
        dt->tzid = NULL;
        dt->value = NULL;
-       
+
        g_return_if_fail (comp != NULL);
        g_return_if_fail (E_IS_CAL_COMPONENT (comp));
 
@@ -2591,7 +2591,7 @@ e_cal_component_get_dtstart (ECalComponent *comp, ECalComponentDateTime *dt)
 
        dt->tzid = NULL;
        dt->value = NULL;
-       
+
        g_return_if_fail (comp != NULL);
        g_return_if_fail (E_IS_CAL_COMPONENT (comp));
 
@@ -2644,7 +2644,7 @@ e_cal_component_get_due (ECalComponent *comp, ECalComponentDateTime *dt)
 
        dt->tzid = NULL;
        dt->value = NULL;
-       
+
        g_return_if_fail (comp != NULL);
        g_return_if_fail (E_IS_CAL_COMPONENT (comp));
 
@@ -3252,7 +3252,7 @@ e_cal_component_set_last_modified (ECalComponent *comp, struct icaltimetype *t)
  * e_cal_component_get_organizer:
  * @comp:  A calendar component object
  * @organizer: A value for the organizer
- * 
+ *
  * Queries the organizer property of a calendar component object
  **/
 void
@@ -3293,7 +3293,7 @@ e_cal_component_get_organizer (ECalComponent *comp, ECalComponentOrganizer *orga
  * e_cal_component_set_organizer:
  * @comp:  A calendar component object.
  * @organizer: Value for the organizer property
- * 
+ *
  * Sets the organizer of a calendar component object
  **/
 void
@@ -3388,9 +3388,9 @@ e_cal_component_set_organizer (ECalComponent *comp, ECalComponentOrganizer *orga
 /**
  * e_cal_component_has_organizer:
  * @comp: A calendar component object.
- * 
+ *
  * Check whether a calendar component object has an organizer or not.
- * 
+ *
  * Return value: TRUE if there is an organizer, FALSE otherwise.
  **/
 gboolean
@@ -3405,7 +3405,7 @@ e_cal_component_has_organizer (ECalComponent *comp)
 
        return priv->organizer.prop != NULL;
 }
-               
+
 /**
  * e_cal_component_get_percent:
  * @comp: A calendar component object.
@@ -3540,10 +3540,10 @@ e_cal_component_set_priority (ECalComponent *comp, int *priority)
  * e_cal_component_get_recurid:
  * @comp: A calendar component object.
  * @recur_id: Return value for the recurrence id property
- * 
+ *
  * Queries the recurrence id property of a calendar component object.
  **/
-void 
+void
 e_cal_component_get_recurid (ECalComponent *comp, ECalComponentRange *recur_id)
 {
        ECalComponentPrivate *priv;
@@ -3555,8 +3555,8 @@ e_cal_component_get_recurid (ECalComponent *comp, ECalComponentRange *recur_id)
        priv = comp->priv;
        g_return_if_fail (priv->icalcomp != NULL);
 
-       get_datetime (&priv->recur_id.recur_time, 
-                     icalproperty_get_recurrenceid, 
+       get_datetime (&priv->recur_id.recur_time,
+                     icalproperty_get_recurrenceid,
                      &recur_id->datetime);
 }
 
@@ -3582,7 +3582,7 @@ e_cal_component_get_recurid_as_string (ECalComponent *comp)
                 return "0";
         tt = *range.datetime.value;
         e_cal_component_free_range (&range);
-                                                                                   
+
         return icaltime_is_valid_time (tt) && !icaltime_is_null_time (tt) ?
                 icaltime_as_ical_string (tt) : "0";
 }
@@ -3591,7 +3591,7 @@ e_cal_component_get_recurid_as_string (ECalComponent *comp)
  * e_cal_component_set_recurid:
  * @comp: A calendar component object.
  * @recur_id: Value for the recurrence id property.
- * 
+ *
  * Sets the recurrence id property of a calendar component object.
  **/
 void
@@ -3604,7 +3604,7 @@ e_cal_component_set_recurid (ECalComponent *comp, ECalComponentRange *recur_id)
 
        priv = comp->priv;
        g_return_if_fail (priv->icalcomp != NULL);
-       
+
        set_datetime (comp, &priv->recur_id.recur_time,
                      icalproperty_new_recurrenceid,
                      icalproperty_set_recurrenceid,
@@ -3825,7 +3825,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
 
        if (!e_cal_component_has_recurrences (comp))
                return TRUE;
-       
+
        e_cal_component_get_rrule_list (comp, &rrule_list);
        len = g_slist_length (rrule_list);
        if (len > 1
@@ -3858,7 +3858,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
        if (n_by_second != 0
            || n_by_minute != 0
            || n_by_hour != 0)
-               goto cleanup;   
+               goto cleanup;
 
        switch (r->freq) {
        case ICAL_DAILY_RECURRENCE:
@@ -3888,7 +3888,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
                        if (pos != 0)
                                goto cleanup;
                }
-               
+
                simple = TRUE;
                break;
 
@@ -3908,9 +3908,9 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
                        nth = r->by_month_day[0];
                        if (nth < 1 && nth != -1)
                                goto cleanup;
-                       
+
                        simple = TRUE;
-                       
+
                } else if (n_by_day == 1) {
                        enum icalrecurrencetype_weekday weekday;
                        int pos;
@@ -3946,7 +3946,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
                } else {
                        goto cleanup;
                }
-               
+
                simple = TRUE;
                break;
 
@@ -3958,7 +3958,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
                    || n_by_month != 0
                    || n_by_set_pos != 0)
                        goto cleanup;
-               
+
                simple = TRUE;
                break;
 
@@ -3981,7 +3981,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
  *
  * Return value: TRUE if it is an instance, FALSE if not.
  */
-gboolean 
+gboolean
 e_cal_component_is_instance (ECalComponent *comp)
 {
        ECalComponentPrivate *priv;
@@ -4265,7 +4265,7 @@ e_cal_component_set_summary (ECalComponent *comp, ECalComponentText *summary)
                }
        } else if (priv->summary.altrep_param) {
                icalproperty_remove_parameter (priv->summary.prop, ICAL_ALTREP_PARAMETER);
-               priv->summary.altrep_param = NULL; 
+               priv->summary.altrep_param = NULL;
        }
 
        /* look for alarms that need a description */
@@ -4454,7 +4454,7 @@ get_attendee_list (GSList *attendee_list, GSList **al)
                a->value = icalproperty_get_attendee (attendee->prop);
 
                if (attendee->member_param)
-                       a->member = icalparameter_get_member (attendee->member_param);          
+                       a->member = icalparameter_get_member (attendee->member_param);
                if (attendee->cutype_param)
                        a->cutype = icalparameter_get_cutype (attendee->cutype_param);
                else
@@ -4546,7 +4546,7 @@ set_attendee_list (icalcomponent *icalcomp,
                else
                        attendee->rsvp_param = icalparameter_new_rsvp (ICAL_RSVP_FALSE);
                icalproperty_add_parameter (attendee->prop, attendee->rsvp_param);
-       
+
                if (a->delfrom) {
                        attendee->delfrom_param = icalparameter_new_delegatedfrom (a->delfrom);
                        icalproperty_add_parameter (attendee->prop, attendee->delfrom_param);
@@ -4575,19 +4575,19 @@ set_attendee_list (icalcomponent *icalcomp,
 }
 
 /**
- * e_cal_component_get_attendee_list: 
- * @comp: A calendar component object. 
+ * e_cal_component_get_attendee_list:
+ * @comp: A calendar component object.
  * @attendee_list: Return value for the attendee property.
  * This should be freed using the e_cal_component_free_attendee_list ()
  * function.
- * 
+ *
  * Queries the attendee properties of the calendar component object
  **/
 void
 e_cal_component_get_attendee_list (ECalComponent *comp, GSList **attendee_list)
 {
        ECalComponentPrivate *priv;
-       
+
        g_return_if_fail (comp != NULL);
        g_return_if_fail (E_IS_CAL_COMPONENT (comp));
        g_return_if_fail (attendee_list != NULL);
@@ -4600,9 +4600,9 @@ e_cal_component_get_attendee_list (ECalComponent *comp, GSList **attendee_list)
 
 /**
  * e_cal_component_set_attendee_list:
- * @comp: A calendar component object. 
+ * @comp: A calendar component object.
  * @attendee_list: Values for attendee properties
- * 
+ *
  * Sets the attendees of a calendar component object
  **/
 void
@@ -4639,7 +4639,7 @@ e_cal_component_has_attendees (ECalComponent *comp)
 
        if (g_slist_length (priv->attendee_list) > 0)
                return TRUE;
-       
+
        return FALSE;
 }
 
@@ -4647,7 +4647,7 @@ e_cal_component_has_attendees (ECalComponent *comp)
  * e_cal_component_get_location:
  * @comp: A calendar component object
  * @location: Return value for the location.
- * 
+ *
  * Queries the location property of a calendar component object.
  **/
 void
@@ -4672,7 +4672,7 @@ e_cal_component_get_location (ECalComponent *comp, const char **location)
  * e_cal_component_set_location:
  * @comp: A calendar component object.
  * @location: Location value.
- * 
+ *
  * Sets the location property of a calendar component object.
  **/
 void
@@ -4744,7 +4744,7 @@ e_cal_component_free_datetime (ECalComponentDateTime *dt)
  *
  * Frees an #ECalComponentRange structure.
  */
-void 
+void
 e_cal_component_free_range (ECalComponentRange *range)
 {
        g_return_if_fail (range != NULL);
@@ -4915,7 +4915,7 @@ e_cal_component_free_id (ECalComponentId *id)
                g_free (id->uid);
                id->uid = NULL;
        }
-       
+
        if (id->rid) {
                g_free (id->rid);
                id->rid = NULL;
@@ -4953,9 +4953,9 @@ e_cal_component_free_text_list (GSList *text_list)
 /**
  * e_cal_component_free_attendee_list:
  * @attendee_list:  List of attendees.
- * 
+ *
  * Frees a list of #ECalComponentAttendee structures.
- * 
+ *
  **/
 void
 e_cal_component_free_attendee_list (GSList *attendee_list)
@@ -5003,7 +5003,7 @@ e_cal_component_has_alarms (ECalComponent *comp)
  * e_cal_component_add_alarm:
  * @comp: A calendar component.
  * @alarm: An alarm.
- * 
+ *
  * Adds an alarm subcomponent to a calendar component.  You should have created
  * the @alarm by using e_cal_component_alarm_new(); it is invalid to use a
  * #ECalComponentAlarm structure that came from e_cal_component_get_alarm().  After
@@ -5030,7 +5030,7 @@ e_cal_component_add_alarm (ECalComponent *comp, ECalComponentAlarm *alarm)
  * e_cal_component_remove_alarm:
  * @comp: A calendar component.
  * @auid: UID of the alarm to remove.
- * 
+ *
  * Removes an alarm subcomponent from a calendar component.  If the alarm that
  * corresponds to the specified @auid had been fetched with
  * e_cal_component_get_alarm(), then those alarm structures will be invalid; you
@@ -5065,19 +5065,19 @@ for_each_remove_all_alarms (gpointer key, gpointer value, gpointer data)
        ECalComponent *comp = E_CAL_COMPONENT (data);
        ECalComponentPrivate *priv;
        icalcomponent *alarm = value;
-       
+
        priv = comp->priv;
-       
+
        icalcomponent_remove_component (priv->icalcomp, alarm);
        icalcomponent_free (alarm);
 
-       return TRUE;    
+       return TRUE;
 }
 
 /**
  * e_cal_component_remove_all_alarms:
  * @comp: A calendar component
- * 
+ *
  * Remove all alarms from the calendar component
  **/
 void
@@ -5137,7 +5137,7 @@ scan_alarm_property (ECalComponentAlarm *alarm, icalproperty *prop)
        case ICAL_ATTENDEE_PROPERTY:
                scan_attendee (&alarm->attendee_list, prop);
                break;
-               
+
        case ICAL_X_PROPERTY:
                xname = icalproperty_get_x_name (prop);
                g_assert (xname != NULL);
@@ -5172,7 +5172,7 @@ make_alarm (icalcomponent *subcomp)
        alarm->repeat = NULL;
        alarm->trigger = NULL;
        alarm->attendee_list = NULL;
-       
+
        for (prop = icalcomponent_get_first_property (subcomp, ICAL_ANY_PROPERTY);
             prop;
             prop = icalcomponent_get_next_property (subcomp, ICAL_ANY_PROPERTY))
@@ -5212,19 +5212,19 @@ e_cal_component_get_alarm_uids (ECalComponent *comp)
             icalcompiter_next (&iter)) {
                icalcomponent *subcomp;
                icalproperty *prop;
-               
+
                subcomp = icalcompiter_deref (&iter);
                for (prop = icalcomponent_get_first_property (subcomp, ICAL_X_PROPERTY);
                     prop;
                     prop = icalcomponent_get_next_property (subcomp, ICAL_X_PROPERTY)) {
                        const char *xname;
-                       
+
                        xname = icalproperty_get_x_name (prop);
                        g_assert (xname != NULL);
-                       
+
                        if (strcmp (xname, EVOLUTION_ALARM_UID_PROPERTY) == 0) {
                                const char *auid;
-                               
+
                                auid = alarm_uid_from_prop (prop);
                                l = g_list_append (l, g_strdup (auid));
                        }
@@ -5326,16 +5326,16 @@ e_cal_component_alarm_new (void)
        alarm->repeat = NULL;
        alarm->trigger = NULL;
        alarm->attendee_list = NULL;
-       
+
        return alarm;
 }
 
 /**
  * e_cal_component_alarm_clone:
  * @alarm: An alarm subcomponent.
- * 
+ *
  * Creates a new alarm subcomponent by copying the information from another one.
- * 
+ *
  * Return value: A newly-created alarm subcomponent with the same values as the
  * original one.  Should be freed with e_cal_component_alarm_free().
  **/
@@ -5360,7 +5360,7 @@ void
 e_cal_component_alarm_free (ECalComponentAlarm *alarm)
 {
        GSList *l;
-       
+
        g_return_if_fail (alarm != NULL);
 
        g_assert (alarm->icalcomp != NULL);
@@ -5382,7 +5382,7 @@ e_cal_component_alarm_free (ECalComponentAlarm *alarm)
                g_free (l->data);
        g_slist_free (alarm->attendee_list);
        alarm->attendee_list = NULL;
-       
+
        g_free (alarm);
 }
 
@@ -5504,7 +5504,7 @@ e_cal_component_alarm_set_action (ECalComponentAlarm *alarm, ECalComponentAlarmA
  * e_cal_component_alarm_get_attach:
  * @alarm: An alarm.
  * @attach: Return value for the attachment; should be freed using icalattach_unref().
- * 
+ *
  * Queries the attachment property of an alarm.
  **/
 void
@@ -5526,7 +5526,7 @@ e_cal_component_alarm_get_attach (ECalComponentAlarm *alarm, icalattach **attach
  * e_cal_component_alarm_set_attach:
  * @alarm: An alarm.
  * @attach: Attachment property or NULL to remove an existing property.
- * 
+ *
  * Sets the attachment property of an alarm.
  **/
 void
@@ -5552,7 +5552,7 @@ e_cal_component_alarm_set_attach (ECalComponentAlarm *alarm, icalattach *attach)
  * e_cal_component_alarm_get_description:
  * @alarm: An alarm.
  * @description: Return value for the description property and its parameters.
- * 
+ *
  * Queries the description property of an alarm.
  **/
 void
@@ -5578,7 +5578,7 @@ e_cal_component_alarm_get_description (ECalComponentAlarm *alarm, ECalComponentT
  * e_cal_component_alarm_set_description:
  * @alarm: An alarm.
  * @description: Description property and its parameters, or NULL for no description.
- * 
+ *
  * Sets the description property of an alarm.
  **/
 void
@@ -5616,7 +5616,7 @@ e_cal_component_alarm_set_description (ECalComponentAlarm *alarm, ECalComponentT
  * e_cal_component_alarm_get_repeat:
  * @alarm: An alarm.
  * @repeat: Return value for the repeat/duration properties.
- * 
+ *
  * Queries the repeat/duration properties of an alarm.
  **/
 void
@@ -5642,7 +5642,7 @@ e_cal_component_alarm_get_repeat (ECalComponentAlarm *alarm, ECalComponentAlarmR
  * @alarm: An alarm.
  * @repeat: Repeat/duration values.  To remove any repetitions from the alarm,
  * set the @repeat.repetitions to 0.
- * 
+ *
  * Sets the repeat/duration values for an alarm.
  **/
 void
@@ -5854,11 +5854,11 @@ e_cal_component_alarm_set_trigger (ECalComponentAlarm *alarm, ECalComponentAlarm
  *
  * Gets the list of attendees associated with an alarm.
  */
-void 
+void
 e_cal_component_alarm_get_attendee_list (ECalComponentAlarm *alarm, GSList **attendee_list)
 {
        g_return_if_fail (alarm != NULL);
-       
+
        get_attendee_list (alarm->attendee_list, attendee_list);
 }
 
@@ -5869,7 +5869,7 @@ e_cal_component_alarm_get_attendee_list (ECalComponentAlarm *alarm, GSList **att
  *
  * Sets the list of attendees for an alarm.
  */
-void 
+void
 e_cal_component_alarm_set_attendee_list (ECalComponentAlarm *alarm, GSList *attendee_list)
 {
        g_return_if_fail (alarm != NULL);
@@ -5885,7 +5885,7 @@ e_cal_component_alarm_set_attendee_list (ECalComponentAlarm *alarm, GSList *atte
  *
  * Return value: TRUE if there are attendees in the alarm, FALSE if not.
  */
-gboolean 
+gboolean
 e_cal_component_alarm_has_attendees (ECalComponentAlarm *alarm)
 {
 
@@ -5893,8 +5893,8 @@ e_cal_component_alarm_has_attendees (ECalComponentAlarm *alarm)
 
        if (g_slist_length (alarm->attendee_list) > 0)
                return TRUE;
-       
-       return FALSE;   
+
+       return FALSE;
 }
 
 
index 4b1c1c8..4995eeb 100644 (file)
@@ -134,7 +134,7 @@ typedef enum {
 
 typedef struct {
        ECalComponentRangeType type;
-       
+
        ECalComponentDateTime datetime;
 } ECalComponentRange;
 
@@ -155,23 +155,23 @@ typedef enum {
        E_CAL_COMPONENT_TRANSP_UNKNOWN
 } ECalComponentTransparency;
 
-/* Organizer & Attendee */     
+/* Organizer & Attendee */
 typedef struct {
        const char *value;
-       
+
        const char *member;
        icalparameter_cutype cutype;
        icalparameter_role role;
        icalparameter_partstat status;
        gboolean rsvp;
-       
+
        const char *delto;
        const char *delfrom;
        const char *sentby;
        const char *cn;
        const char *language;
 } ECalComponentAttendee;
-       
+
 typedef struct {
        const char *value;
        const char *sentby;
index de6234f..9559c53 100644 (file)
@@ -97,7 +97,7 @@ convert_status (const GNOME_Evolution_Calendar_CallStatus status)
                return E_CALENDAR_STATUS_INVALID_SERVER_VERSION;
        case GNOME_Evolution_Calendar_NoSuchCal:
              return E_CALENDAR_STATUS_NO_SUCH_CALENDAR;
-       
+
        case GNOME_Evolution_Calendar_OtherError:
        default:
                return E_CALENDAR_STATUS_OTHER_ERROR;
@@ -305,7 +305,7 @@ impl_notifyObjectsReceived (PortableServer_Servant servant,
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
@@ -342,15 +342,15 @@ impl_notifyObjectsSent (PortableServer_Servant servant,
        g_list_free (users);
 }
 
-static void 
+static void
 impl_notifyDefaultObjectRequested (PortableServer_Servant servant,
                                   const GNOME_Evolution_Calendar_CallStatus status,
                                   const CORBA_char *object,
-                                  CORBA_Environment *ev) 
+                                  CORBA_Environment *ev)
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
@@ -360,15 +360,15 @@ impl_notifyDefaultObjectRequested (PortableServer_Servant servant,
        g_signal_emit (G_OBJECT (listener), signals[DEFAULT_OBJECT], 0, convert_status (status), object);
 }
 
-static void 
+static void
 impl_notifyObjectRequested (PortableServer_Servant servant,
                            const GNOME_Evolution_Calendar_CallStatus status,
                            const CORBA_char *object,
-                           CORBA_Environment *ev) 
+                           CORBA_Environment *ev)
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
@@ -387,27 +387,27 @@ build_object_list (const GNOME_Evolution_Calendar_stringlist *seq)
        list = NULL;
        for (i = 0; i < seq->_length; i++) {
                icalcomponent *comp;
-               
+
                comp = icalcomponent_new_from_string (seq->_buffer[i]);
                if (!comp)
                        continue;
-               
+
                list = g_list_prepend (list, comp);
        }
 
        return list;
 }
 
-static void 
+static void
 impl_notifyObjectListRequested (PortableServer_Servant servant,
                                const GNOME_Evolution_Calendar_CallStatus status,
                                const GNOME_Evolution_Calendar_stringlist *objects,
-                               CORBA_Environment *ev) 
+                               CORBA_Environment *ev)
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
        GList *object_list, *l;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
@@ -415,7 +415,7 @@ impl_notifyObjectListRequested (PortableServer_Servant servant,
                return;
 
        object_list = build_object_list (objects);
-       
+
        g_signal_emit (G_OBJECT (listener), signals[OBJECT_LIST], 0, convert_status (status), object_list);
 
        for (l = object_list; l; l = l->next)
@@ -423,17 +423,17 @@ impl_notifyObjectListRequested (PortableServer_Servant servant,
        g_list_free (object_list);
 }
 
-static void 
+static void
 impl_notifyAttachmentListRequested (PortableServer_Servant servant,
                                const GNOME_Evolution_Calendar_CallStatus status,
                                const GNOME_Evolution_Calendar_stringlist *attachments,
-                               CORBA_Environment *ev) 
+                               CORBA_Environment *ev)
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
        GSList *a_list = NULL;
        int i;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
@@ -458,13 +458,13 @@ impl_notifyTimezoneRequested (PortableServer_Servant servant,
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
        if (!priv->notify)
                return;
-       
+
        g_signal_emit (G_OBJECT (listener), signals[GET_TIMEZONE], 0, convert_status (status), object);
 }
 
@@ -476,13 +476,13 @@ impl_notifyTimezoneAdded (PortableServer_Servant servant,
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
        if (!priv->notify)
                return;
-       
+
        g_signal_emit (G_OBJECT (listener), signals[ADD_TIMEZONE], 0, convert_status (status), tzid);
 }
 
@@ -493,13 +493,13 @@ impl_notifyDefaultTimezoneSet (PortableServer_Servant servant,
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
        if (!priv->notify)
                return;
-       
+
        g_signal_emit (G_OBJECT (listener), signals[SET_DEFAULT_TIMEZONE], 0, convert_status (status));
 }
 
@@ -547,15 +547,15 @@ impl_notifyChanges (PortableServer_Servant servant,
        ECalListener *listener;
        ECalListenerPrivate *priv;
        GList *changes, *l;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
        if (!priv->notify)
                return;
-       
+
        changes = build_change_list (seq);
-       
+
        g_signal_emit (G_OBJECT (listener), signals[GET_CHANGES], 0, convert_status (status), changes);
 
        for (l = changes; l; l = l->next)
@@ -587,7 +587,7 @@ build_free_busy_list (const GNOME_Evolution_Calendar_CalObjSeq *seq)
                                g_object_unref (G_OBJECT (comp));
                                continue;
                        }
-                       
+
                        list = g_list_append (list, comp);
                } else {
                        icalcomponent_free (icalcomp);
@@ -606,15 +606,15 @@ impl_notifyFreeBusy (PortableServer_Servant servant,
        ECalListener *listener;
        ECalListenerPrivate *priv;
        GList *freebusy, *l;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
        if (!priv->notify)
                return;
-       
+
        freebusy = build_free_busy_list (seq);
-       
+
        g_signal_emit (G_OBJECT (listener), signals[GET_FREE_BUSY], 0, convert_status (status), freebusy);
 
        for (l = freebusy; l; l = l->next)
@@ -622,21 +622,21 @@ impl_notifyFreeBusy (PortableServer_Servant servant,
        g_list_free (freebusy);
 }
 
-static void 
+static void
 impl_notifyQuery (PortableServer_Servant servant,
                  const GNOME_Evolution_Calendar_CallStatus status,
                  const GNOME_Evolution_Calendar_CalView query,
-                 CORBA_Environment *ev) 
+                 CORBA_Environment *ev)
 {
        ECalListener *listener;
        ECalListenerPrivate *priv;
-       
+
        listener = E_CAL_LISTENER (bonobo_object_from_servant (servant));
        priv = listener->priv;
 
        if (!priv->notify)
                return;
-       
+
        g_signal_emit (G_OBJECT (listener), signals[QUERY], 0, convert_status (status), query);
 }
 
@@ -672,7 +672,7 @@ impl_notifyAuthRequired (PortableServer_Servant servant,
 
        if (!priv->notify)
                return;
-       
+
        g_signal_emit (G_OBJECT (listener), signals[AUTH_REQUIRED], 0);
 }
 
@@ -801,7 +801,7 @@ e_cal_listener_class_init (ECalListenerClass *klass)
                              G_STRUCT_OFFSET (ECalListenerClass, ldap_attribute),
                              NULL, NULL,
                              e_cal_marshal_VOID__INT_STRING,
-                             G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING);       
+                             G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING);
        signals[STATIC_CAPABILITIES] =
                g_signal_new ("static_capabilities",
                              G_TYPE_FROM_CLASS (klass),
@@ -817,7 +817,7 @@ e_cal_listener_class_init (ECalListenerClass *klass)
                              G_STRUCT_OFFSET (ECalListenerClass, open),
                              NULL, NULL,
                              g_cclosure_marshal_VOID__INT,
-                             G_TYPE_NONE, 1, G_TYPE_INT);      
+                             G_TYPE_NONE, 1, G_TYPE_INT);
        signals[REMOVE] =
                g_signal_new ("remove",
                              G_TYPE_FROM_CLASS (klass),
@@ -841,7 +841,7 @@ e_cal_listener_class_init (ECalListenerClass *klass)
                              G_STRUCT_OFFSET (ECalListenerClass, modify_object),
                              NULL, NULL,
                              g_cclosure_marshal_VOID__INT,
-                             G_TYPE_NONE, 1, G_TYPE_INT);      
+                             G_TYPE_NONE, 1, G_TYPE_INT);
        signals[REMOVE_OBJECT] =
                g_signal_new ("remove_object",
                              G_TYPE_FROM_CLASS (klass),
@@ -1016,7 +1016,7 @@ e_cal_listener_construct (ECalListener *listener,
  * calendar changed modes.
  * @fn_data: Closure data pointer that will be passed to the notification
  * functions.
- * 
+ *
  * Creates a new #ECalListener object.
  *
  * Return value: A newly-created #ECalListener object.
@@ -1029,7 +1029,7 @@ e_cal_listener_new (ECalListenerCalSetModeFn cal_set_mode_fn,
 
        g_return_val_if_fail (cal_set_mode_fn != NULL, NULL);
 
-       listener = g_object_new (E_TYPE_CAL_LISTENER, 
+       listener = g_object_new (E_TYPE_CAL_LISTENER,
                                 "poa", bonobo_poa_get_threaded (ORBIT_THREAD_HINT_PER_REQUEST, NULL),
                                 NULL);
 
@@ -1041,7 +1041,7 @@ e_cal_listener_new (ECalListenerCalSetModeFn cal_set_mode_fn,
 /**
  * e_cal_listener_stop_notification:
  * @listener: A calendar listener.
- * 
+ *
  * Informs a calendar listener that no further notification is desired.  The
  * callbacks specified when the listener was created will no longer be invoked
  * after this function is called.
index d584fa1..63793b9 100644 (file)
@@ -75,14 +75,14 @@ typedef struct {
        void (*object_list) (ECalListener *listener, ECalendarStatus status, GList **objects);
 
        void (*attachment_list) (ECalListener *listener, ECalendarStatus status, GSList **objects);
-       
+
        void (*get_timezone) (ECalListener *listener, ECalendarStatus status, const char *object);
        void (*add_timezone) (ECalListener *listener, ECalendarStatus status, const char *tzid);
        void (*set_default_timezone) (ECalListener *listener, ECalendarStatus status, const char *tzid);
 
        void (*get_changes) (ECalListener *listener, ECalendarStatus status, GList *changes);
        void (*get_free_busy) (ECalListener *listener, ECalendarStatus status, GList *freebusy);
-       
+
        void (*query) (ECalListener *listener, ECalendarStatus status, GNOME_Evolution_Calendar_CalView query);
 
        void (*auth_required)      (ECalListener *listener);
index 770e8b1..35a6c48 100644 (file)
@@ -784,7 +784,7 @@ e_cal_recur_generate_instances_of_rule (ECalComponent        *comp,
                if (e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_JOURNAL) {
                        icaltimetype start_t = icaltime_from_timet_with_zone (start, FALSE, default_timezone);
                        icaltimetype end_t = icaltime_from_timet_with_zone (end, FALSE, default_timezone);
-               
+
                        if ((icaltime_compare_date_only (*dtstart.value, start_t) >= 0) && ((icaltime_compare_date_only (*dtstart.value, end_t) < 0)))
                                (* cb) (comp, dtstart_time, dtend_time, cb_data);
                } else if  ((end == -1 || dtstart_time < end) && dtend_time > start) {
@@ -827,7 +827,7 @@ e_cal_recur_generate_instances_of_rule (ECalComponent        *comp,
 
        cal_object_time_from_time (&event_start, dtstart_time, start_zone);
        cal_object_time_from_time (&event_end, dtend_time, start_zone);
-       
+
        /* Calculate the duration of the event, which we use for all
           occurrences. We can't just subtract start from end since that may
           be affected by daylight-saving time. So we want a value of days
@@ -926,10 +926,10 @@ array_to_list (short *array, int max_elements)
  * @convert_end_date: TRUE if the saved end date needs to be converted to the
  * given @zone timezone. This is needed if the DTSTART is a DATE or floating
  * time.
- * 
+ *
  * Converts an #icalproperty to a #ECalRecurrence.  This should be
  * freed using the e_cal_recur_free() function.
- * 
+ *
  * Return value: #ECalRecurrence structure.
  **/
 static ECalRecurrence *
@@ -1082,7 +1082,7 @@ e_cal_recur_ical_weekday_to_weekday       (enum icalrecurrencetype_weekday day)
 /**
  * e_cal_recur_free:
  * @r: A #ECalRecurrence structure.
- * 
+ *
  * Frees a #ECalRecurrence structure.
  **/
 static void
@@ -1171,7 +1171,7 @@ generate_instances_for_chunk (ECalComponent       *comp,
                else if (cal_obj_time_compare_func (event_start, chunk_start) >= 0)
                        g_array_append_vals (occs, event_start, 1);
        }
-       
+
        /* Expand each of the recurrence rules. */
        for (elem = rrules; elem; elem = elem->next) {
                icalproperty *prop;
@@ -1411,12 +1411,12 @@ cal_object_get_rdate_end        (CalObjTime     *occ,
 
        while (lower < upper) {
                middle = (lower + upper) >> 1;
-         
+
                rdate = &g_array_index (rdate_periods, CalObjRecurrenceDate,
                                        middle);
 
                cmp = cal_obj_time_compare_func (occ, &rdate->start);
-         
+
                if (cmp == 0)
                        break;
                else if (cmp < 0)
@@ -2915,7 +2915,7 @@ cal_obj_bymonthday_expand (RecurData  *recur_data,
                                cotime.day = time_days_in_month (occ->year, occ->month);
                                g_array_append_val (new_occs, cotime);
                        }
-                               
+
                        elem = elem->next;
                }
        }
@@ -3923,7 +3923,7 @@ e_cal_recur_ensure_rule_end_date (ECalComponent                   *comp,
        /* Store the end date in the "X-EVOLUTION-ENDDATE" parameter of the
           rule. */
        e_cal_recur_set_rule_end_date (prop, cb_data.end_date);
-               
+
        return TRUE;
 }
 
@@ -3974,7 +3974,7 @@ e_cal_recur_get_rule_end_date     (icalproperty   *prop,
                                icaltime = icalvalue_get_datetime (value);
                                icalvalue_free (value);
 
-                               zone = default_timezone ? default_timezone : 
+                               zone = default_timezone ? default_timezone :
                                        icaltimezone_get_utc_timezone ();
                                return icaltime_as_timet_with_zone (icaltime,
                                                                    zone);
index 3909f39..6394774 100644 (file)
@@ -420,7 +420,7 @@ time_day_end_with_zone (time_t time, icaltimezone *zone)
  * @time: A time value.
  * @zone: Desired timezone for destination @date, or NULL if the UTC timezone
  * is desired.
- * 
+ *
  * Converts a time_t value to a #GDate structure using the specified timezone.
  * This is analogous to g_date_set_time() but takes the timezone into account.
  **/
@@ -570,9 +570,9 @@ time_leap_years_up_to (int year)
 /**
  * isodate_from_time_t:
  * @t: A time value.
- * 
+ *
  * Creates an ISO 8601 UTC representation from a time value.
- * 
+ *
  * Return value: String with the ISO 8601 representation of the UTC time.
  **/
 char *
@@ -583,7 +583,7 @@ isodate_from_time_t (time_t t)
        const char *fmt;
 
        gmtime_r (&t, &stm);
-       ret = g_malloc (ISODATE_LENGTH); 
+       ret = g_malloc (ISODATE_LENGTH);
        fmt = "%04d%02d%02dT%02d%02d%02dZ";
        g_snprintf (ret, ISODATE_LENGTH, fmt, (stm.tm_year+1900), (stm.tm_mon+1), stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec);
 
@@ -593,9 +593,9 @@ isodate_from_time_t (time_t t)
 /**
  * time_from_isodate:
  * @str: Date/time value in ISO 8601 format.
- * 
+ *
  * Converts an ISO 8601 UTC time string into a time_t value.
- * 
+ *
  * Return value: Time_t corresponding to the specified ISO string.
  * Note that we only allow UTC times at present.
  **/
@@ -661,7 +661,7 @@ struct tm
 icaltimetype_to_tm (struct icaltimetype *itt)
 {
        struct tm tm;
-       
+
        memset (&tm, 0, sizeof (struct tm));
 
        if (!itt->is_date) {
@@ -675,7 +675,7 @@ icaltimetype_to_tm (struct icaltimetype *itt)
        tm.tm_year = itt->year - 1900;
        tm.tm_wday = time_day_of_week (itt->day, itt->month - 1, itt->year);
        tm.tm_isdst = -1;
-       
+
        return tm;
 }
 
@@ -684,10 +684,10 @@ icaltimetype_to_tm (struct icaltimetype *itt)
  * @itt: A time value.
  * @from_zone: Source timezone.
  * @to_zone: Destination timezone.
- * 
+ *
  * Converts a time value from one timezone to another, and returns a struct tm
  * representation of the time.
- * 
+ *
  * Return value: The converted time as a struct tm. All fields will be
  * set properly except for tm.tm_yday.
  **/
@@ -737,10 +737,10 @@ tm_to_icaltimetype (struct tm *tm, gboolean is_date)
        itt.day = tm->tm_mday;
        itt.month = tm->tm_mon + 1;
        itt.year = tm->tm_year+ 1900;
-    
+
        itt.is_utc = 0;
-       itt.is_date = is_date; 
-       
+       itt.is_date = is_date;
+
        return itt;
 }
 
index 519e3a9..526e457 100644 (file)
@@ -111,7 +111,7 @@ time_t      time_day_end_with_zone (time_t time, icaltimezone *zone);
 void time_to_gdate_with_zone (GDate *date, time_t time, icaltimezone *zone);
 
 /**************************************************************************
- * struct tm manipulation 
+ * struct tm manipulation
  **************************************************************************/
 
 struct tm icaltimetype_to_tm (struct icaltimetype *itt);
index 0897b99..7e96c7d 100644 (file)
@@ -39,7 +39,7 @@ typedef enum {
        E_CAL_CHANGE_DELETED = 1 << 2
 } ECalChangeType;
 
-typedef struct 
+typedef struct
 {
        ECalComponent *comp;
        ECalChangeType type;
index 8dc4e4e..cc688d8 100644 (file)
@@ -193,7 +193,7 @@ e_cal_util_parse_ics_string (const char *string)
                                                        icalcomponent_merge_component (icalcomp, tmp);
                                                else
                                                        icalcomp = tmp;
-                                       } else 
+                                       } else
                                                g_warning ("Could not merge the components, the component is either invalid or not a toplevel component \n");
 
                                        g_string_free (comp_str, TRUE);
@@ -323,7 +323,7 @@ struct alarm_occurrence_data {
        time_t start;
        time_t end;
        ECalComponentAlarmAction *omit;
-       
+
        /* This is what we compute */
        GSList *triggers;
        int n_triggers;
@@ -366,7 +366,7 @@ add_alarm_occurrences_cb (ECalComponent *comp, time_t start, time_t end, gpointe
                time_t dur_time;
                time_t occur_time, trigger_time;
                int i;
-               
+
                auid = l->data;
                alarm = e_cal_component_get_alarm (comp, auid);
                g_assert (alarm != NULL);
@@ -382,7 +382,7 @@ add_alarm_occurrences_cb (ECalComponent *comp, time_t start, time_t end, gpointe
                }
                if (aod->omit[i] != -1)
                        continue;
-               
+
                if (trigger.type != E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START
                    && trigger.type != E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END)
                        continue;
@@ -453,7 +453,7 @@ generate_absolute_triggers (ECalComponent *comp, struct alarm_occurrence_data *a
                time_t occur_start, occur_end;
                icaltimezone *zone;
                int i;
-               
+
                auid = l->data;
                alarm = e_cal_component_get_alarm (comp, auid);
                g_assert (alarm != NULL);
@@ -840,7 +840,7 @@ e_cal_util_component_has_organizer (icalcomponent *icalcomp)
  * @icalcomp: An #icalcomponent.
  *
  * Checks if an #icalcomponent has any attendees.
- * 
+ *
  * Return value: TRUE if there are attendees, FALSE if not.
  */
 gboolean
@@ -948,7 +948,7 @@ e_cal_util_event_dates_match (icalcomponent *icalcomp1, icalcomponent *icalcomp2
                        return FALSE;
        }
 
-       
+
 
        /* now match the timezones */
        if (!(!c1_dtstart.zone && !c2_dtstart.zone) ||
index c186cbf..cdf1cae 100644 (file)
@@ -85,11 +85,11 @@ build_object_list (const GNOME_Evolution_Calendar_stringlist *seq)
        list = NULL;
        for (i = 0; i < seq->_length; i++) {
                icalcomponent *comp;
-               
+
                comp = icalcomponent_new_from_string (seq->_buffer[i]);
                if (!comp)
                        continue;
-               
+
                list = g_list_prepend (list, comp);
        }
 
@@ -109,7 +109,7 @@ build_id_list (const GNOME_Evolution_Calendar_CalObjIDSeq *seq)
 
                corba_id = &seq->_buffer[i];
                id = g_new (ECalComponentId, 1);
-               
+
                id->uid = g_strdup (corba_id->uid);
                id->rid = g_strdup (corba_id->rid);
 
@@ -127,12 +127,12 @@ impl_notifyObjectsAdded (PortableServer_Servant servant,
        ECalViewListener *ql;
        ECalViewListenerPrivate *priv;
        GList *object_list, *l;
-       
+
        ql = E_CAL_VIEW_LISTENER (bonobo_object_from_servant (servant));
        priv = ql->priv;
 
        object_list = build_object_list (objects);
-       
+
        g_signal_emit (G_OBJECT (ql), signals[OBJECTS_ADDED], 0, object_list);
 
        for (l = object_list; l; l = l->next)
@@ -148,12 +148,12 @@ impl_notifyObjectsModified (PortableServer_Servant servant,
        ECalViewListener *ql;
        ECalViewListenerPrivate *priv;
        GList *object_list, *l;
-       
+
        ql = E_CAL_VIEW_LISTENER (bonobo_object_from_servant (servant));
        priv = ql->priv;
 
        object_list = build_object_list (objects);
-       
+
        g_signal_emit (G_OBJECT (ql), signals[OBJECTS_MODIFIED], 0, object_list);
 
        for (l = object_list; l; l = l->next)
@@ -169,12 +169,12 @@ impl_notifyObjectsRemoved (PortableServer_Servant servant,
        ECalViewListener *ql;
        ECalViewListenerPrivate *priv;
        GList *id_list, *l;
-       
+
        ql = E_CAL_VIEW_LISTENER (bonobo_object_from_servant (servant));
        priv = ql->priv;
 
        id_list = build_id_list (ids);
-       
+
        g_signal_emit (G_OBJECT (ql), signals[OBJECTS_REMOVED], 0, id_list);
 
        for (l = id_list; l; l = l->next)
@@ -193,7 +193,7 @@ impl_notifyQueryProgress (PortableServer_Servant servant,
 
        ql = E_CAL_VIEW_LISTENER (bonobo_object_from_servant (servant));
        priv = ql->priv;
-       
+
        g_signal_emit (G_OBJECT (ql), signals[VIEW_PROGRESS], 0, message, percent);
 }
 
@@ -207,7 +207,7 @@ impl_notifyQueryDone (PortableServer_Servant servant,
 
        ql = E_CAL_VIEW_LISTENER (bonobo_object_from_servant (servant));
        priv = ql->priv;
-       
+
        g_signal_emit (G_OBJECT (ql), signals[VIEW_DONE], 0, convert_status (status));
 }
 
index 77c5799..35b45e9 100644 (file)
@@ -142,10 +142,10 @@ e_cal_view_set_property (GObject *object, guint property_id, const GValue *value
 {
        ECalView *view;
        ECalViewPrivate *priv;
-       
+
        view = E_CAL_VIEW (object);
        priv = view->priv;
-       
+
        switch (property_id) {
        case PROP_VIEW:
                if (priv->view != CORBA_OBJECT_NIL)
@@ -161,17 +161,17 @@ e_cal_view_set_property (GObject *object, guint property_id, const GValue *value
 
                priv->listener = bonobo_object_ref (g_value_get_pointer (value));
 
-               g_signal_connect (G_OBJECT (priv->listener), "objects_added", 
+               g_signal_connect (G_OBJECT (priv->listener), "objects_added",
                                  G_CALLBACK (objects_added_cb), view);
-               g_signal_connect (G_OBJECT (priv->listener), "objects_modified", 
+               g_signal_connect (G_OBJECT (priv->listener), "objects_modified",
                                  G_CALLBACK (objects_modified_cb), view);
-               g_signal_connect (G_OBJECT (priv->listener), "objects_removed", 
+               g_signal_connect (G_OBJECT (priv->listener), "objects_removed",
                                  G_CALLBACK (objects_removed_cb), view);
-               g_signal_connect (G_OBJECT (priv->listener), "view_progress", 
+               g_signal_connect (G_OBJECT (priv->listener), "view_progress",
                                  G_CALLBACK (view_progress_cb), view);
-               g_signal_connect (G_OBJECT (priv->listener), "view_done", 
+               g_signal_connect (G_OBJECT (priv->listener), "view_done",
                                  G_CALLBACK (view_done_cb), view);
-               break;          
+               break;
        case PROP_CLIENT:
                priv->client = E_CAL (g_value_dup_object (value));
                break;
@@ -186,7 +186,7 @@ e_cal_view_get_property (GObject *object, guint property_id, GValue *value, GPar
 {
        ECalView *view;
        ECalViewPrivate *priv;
-       
+
        view = E_CAL_VIEW (object);
        priv = view->priv;
 
@@ -238,7 +238,7 @@ e_cal_view_class_init (ECalViewClass *klass)
 {
        GObjectClass *object_class;
        GParamSpec *param;
-       
+
        object_class = (GObjectClass *) klass;
 
        parent_class = g_type_class_peek_parent (klass);
@@ -257,7 +257,7 @@ e_cal_view_class_init (ECalViewClass *klass)
        param =  g_param_spec_object ("client", "The e-cal for the view", NULL, E_TYPE_CAL,
                                      G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
        g_object_class_install_property (object_class, PROP_CLIENT, param);
-       
+
        signals[OBJECTS_ADDED] =
                g_signal_new ("objects_added",
                              G_TYPE_FROM_CLASS (klass),
@@ -302,10 +302,10 @@ e_cal_view_class_init (ECalViewClass *klass)
 
 /**
  * e_cal_view_get_type:
- * 
+ *
  * Registers the #ECalView class if necessary, and returns the type ID assigned
  * to it.
- * 
+ *
  * Return value: The type ID of the #ECalView class.
  **/
 GType
@@ -335,10 +335,10 @@ e_cal_view_get_type (void)
  * @corba_view: The CORBA object for the view.
  * @listener: An #ECalViewListener.
  * @client: An #ECal object.
- * 
+ *
  * Creates a new view object by issuing the view creation request to the
  * calendar server.
- * 
+ *
  * Return value: A newly-created view object, or NULL if the request failed.
  **/
 ECalView *
@@ -346,7 +346,7 @@ e_cal_view_new (GNOME_Evolution_Calendar_CalView corba_view, ECalViewListener *l
 {
        ECalView *view;
 
-       view = g_object_new (E_TYPE_CAL_VIEW, "view", corba_view, "listener", 
+       view = g_object_new (E_TYPE_CAL_VIEW, "view", corba_view, "listener",
                              listener, "client", client, NULL);
 
        return view;
@@ -382,13 +382,13 @@ e_cal_view_start (ECalView *view)
 
        g_return_if_fail (view != NULL);
        g_return_if_fail (E_IS_CAL_VIEW (view));
-       
+
        priv = view->priv;
-       
+
        CORBA_exception_init (&ev);
 
        GNOME_Evolution_Calendar_CalView_start (priv->view, &ev);
-       if (BONOBO_EX (&ev)) 
+       if (BONOBO_EX (&ev))
                g_warning (G_STRLOC ": Unable to start view");
 
        CORBA_exception_free (&ev);
index e2a3041..a6de924 100644 (file)
@@ -75,11 +75,11 @@ struct _ECalPrivate {
        ESource *source;
        char *uri;
        ECalSourceType type;
-       
+
        ECalendarOp *current_op;
 
        GMutex *mutex;
-       
+
        /* Email address associated with this calendar, or NULL */
        char *cal_address;
        char *alarm_email_address;
@@ -87,11 +87,11 @@ struct _ECalPrivate {
 
        /* Scheduling info */
        char *capabilities;
-       
+
        int mode;
-       
+
        gboolean read_only;
-       
+
        /* The calendar factories we are contacting */
        GList *factories;
 
@@ -281,7 +281,7 @@ cal_mode_enum_get_type (void)
 
 
 static GNOME_Evolution_Calendar_CalObjType
-convert_type (ECalSourceType type) 
+convert_type (ECalSourceType type)
 {
        switch (type){
        case E_CAL_SOURCE_TYPE_EVENT:
@@ -293,7 +293,7 @@ convert_type (ECalSourceType type)
        default:
                return GNOME_Evolution_Calendar_TYPE_ANY;
        }
-       
+
        return GNOME_Evolution_Calendar_TYPE_ANY;
 }
 
@@ -318,7 +318,7 @@ e_calendar_get_op (ECal *ecal)
                g_warning (G_STRLOC ": Unexpected response");
                return NULL;
        }
-               
+
        return ecal->priv->current_op;
 }
 
@@ -402,7 +402,7 @@ destroy_cal (ECal *ecal)
        if (result)
                return;
 
-       bonobo_object_release_unref (priv->cal, NULL);  
+       bonobo_object_release_unref (priv->cal, NULL);
        priv->cal = CORBA_OBJECT_NIL;
 
 }
@@ -440,7 +440,7 @@ cal_read_only_cb (ECalListener *listener, ECalendarStatus status, gboolean read_
        op = e_calendar_get_op (ecal);
 
        if (op == NULL || !op->bool) {
-               ecal->priv->read_only = read_only; 
+               ecal->priv->read_only = read_only;
                return;
        }
 
@@ -583,7 +583,7 @@ cal_object_created_cb (ECalListener *listener, ECalendarStatus status, const cha
 
        op->status = status;
        op->uid = g_strdup (uid);
-       
+
        e_flag_set (op->done);
 }
 
@@ -698,7 +698,7 @@ cal_default_object_requested_cb (ECalListener *listener, ECalendarStatus status,
 
        op->status = status;
        op->string = g_strdup (object);
-       
+
        e_flag_set (op->done);
 }
 
@@ -717,7 +717,7 @@ cal_object_requested_cb (ECalListener *listener, ECalendarStatus status, const c
 
        op->status = status;
        op->string = g_strdup (object);
-       
+
        e_flag_set (op->done);
 }
 
@@ -727,7 +727,7 @@ cal_object_list_cb (ECalListener *listener, ECalendarStatus status, GList *objec
        ECal *ecal = data;
        ECalendarOp *op;
        GList *l;
-       
+
        op = e_calendar_get_op (ecal);
 
        if (op == NULL) {
@@ -737,10 +737,10 @@ cal_object_list_cb (ECalListener *listener, ECalendarStatus status, GList *objec
 
        op->status = status;
        op->list = g_list_copy (objects);
-       
+
        for (l = op->list; l; l = l->next)
                l->data = icalcomponent_new_clone (l->data);
-       
+
        e_flag_set (op->done);
 }
 
@@ -749,7 +749,7 @@ cal_attachment_list_cb (ECalListener *listener, ECalendarStatus status, GSList *
 {
        ECal *ecal = data;
        ECalendarOp *op;
-       
+
        op = e_calendar_get_op (ecal);
 
        if (op == NULL) {
@@ -759,7 +759,7 @@ cal_attachment_list_cb (ECalListener *listener, ECalendarStatus status, GSList *
 
        op->status = status;
        op->slist = g_slist_copy (attachments);
-       
+
        e_flag_set (op->done);
 }
 
@@ -825,7 +825,7 @@ cal_get_changes_cb (ECalListener *listener, ECalendarStatus status, GList *chang
        ECal *ecal = data;
        ECalendarOp *op;
        GList *l;
-       
+
        op = e_calendar_get_op (ecal);
 
        if (op == NULL) {
@@ -842,10 +842,10 @@ cal_get_changes_cb (ECalListener *listener, ECalendarStatus status, GList *chang
                new_ccc = g_new (ECalChange, 1);
                new_ccc->comp = e_cal_component_clone (ccc->comp);
                new_ccc->type = ccc->type;
-               
+
                l->data = new_ccc;
        }
-       
+
        e_flag_set (op->done);
 }
 
@@ -855,7 +855,7 @@ cal_get_free_busy_cb (ECalListener *listener, ECalendarStatus status, GList *fre
        ECal *ecal = data;
        ECalendarOp *op;
        GList *l;
-       
+
        op = e_calendar_get_op (ecal);
 
        if (op == NULL) {
@@ -877,7 +877,7 @@ cal_query_cb (ECalListener *listener, ECalendarStatus status, GNOME_Evolution_Ca
 {
        ECal *ecal = data;
        ECalendarOp *op;
-       
+
        op = e_calendar_get_op (ecal);
 
        if (op == NULL) {
@@ -887,15 +887,15 @@ cal_query_cb (ECalListener *listener, ECalendarStatus status, GNOME_Evolution_Ca
 
        op->status = status;
        op->query = e_cal_view_new (query, op->listener, ecal);
-       
+
        e_flag_set (op->done);
 }
 
-static gboolean  
+static gboolean
 reopen_with_auth (gpointer data)
 {
        ECalendarStatus status;
-       
+
        open_calendar (E_CAL (data), TRUE, NULL, &status, TRUE);
        return FALSE;
 }
@@ -903,7 +903,7 @@ reopen_with_auth (gpointer data)
 static void
 auth_required_cb (ECalListener *listener, gpointer data)
 {
-       g_idle_add (reopen_with_auth, data);    
+       g_idle_add (reopen_with_auth, data);
 
 }
 
@@ -926,13 +926,13 @@ cal_set_mode_cb (ECalListener *listener,
        switch (status) {
        case GNOME_Evolution_Calendar_CalListener_MODE_SET:
                ecal_status = E_CAL_SET_MODE_SUCCESS;
-               break;          
+               break;
        case GNOME_Evolution_Calendar_CalListener_MODE_NOT_SET:
                ecal_status = E_CAL_SET_MODE_ERROR;
                break;
        case GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED:
                ecal_status = E_CAL_SET_MODE_NOT_SUPPORTED;
-               break;          
+               break;
        default:
                g_assert_not_reached ();
        }
@@ -961,13 +961,13 @@ static gboolean
 backend_error_idle_cb (gpointer data)
 {
        ECalErrorData *error_data = data;
-       
+
        g_signal_emit (G_OBJECT (error_data->ecal), e_cal_signals[BACKEND_ERROR], 0, error_data->message);
 
        g_object_unref (error_data->ecal);
        g_free (error_data->message);
        g_free (error_data);
-       
+
        return FALSE;
 }
 
@@ -976,7 +976,7 @@ static void
 backend_error_cb (ECalListener *listener, const char *message, gpointer data)
 {
        ECalErrorData *error_data;
-       
+
        error_data = g_new0 (ECalErrorData, 1);
 
        error_data->ecal = g_object_ref (data);
@@ -987,7 +987,7 @@ backend_error_cb (ECalListener *listener, const char *message, gpointer data)
 
 \f
 
-static gboolean 
+static gboolean
 get_factories (const char *str_uri, GList **factories)
 {
        GNOME_Evolution_Calendar_CalFactory factory;
@@ -1001,23 +1001,23 @@ get_factories (const char *str_uri, GList **factories)
        uri = e_uri_new (str_uri);
        if (!uri) {
                g_warning (G_STRLOC ": Invalid uri string");
-               
+
                return FALSE;
        }
 
        query = "repo_ids.has ('IDL:GNOME/Evolution/DataServer/CalFactory:" API_VERSION "')";
 
-       
+
        servers = bonobo_activation_query (query, NULL, NULL);
 
        e_uri_free (uri);
 
        if (!servers) {
                g_warning (G_STRLOC ": Unable to query for calendar factories");
-               
+
                return FALSE;
-       }       
-       
+       }
+
        /* Try to activate the servers for the protocol */
        for (i = 0; i < servers->_length; i++) {
                const Bonobo_ServerInfo *info;
@@ -1028,7 +1028,7 @@ get_factories (const char *str_uri, GList **factories)
                g_message (G_STRLOC ": Activating calendar factory (%s)", info->iid);
 #endif
                factory = bonobo_activation_activate_from_id (info->iid, 0, NULL, NULL);
-               
+
                if (factory == CORBA_OBJECT_NIL)
                        g_warning (G_STRLOC ": Could not activate calendar factory (%s)", info->iid);
                else
@@ -1143,7 +1143,7 @@ e_cal_finalize (GObject *object)
                g_mutex_free (priv->mutex);
                priv->mutex = NULL;
        }
-       
+
        if (priv->cal_address) {
                g_free (priv->cal_address);
                priv->cal_address = NULL;
@@ -1264,7 +1264,7 @@ fetch_corba_cal (ECal *ecal, ESource *source, ECalSourceType type)
        gchar *source_xml;
        gchar *str_uri;
        gboolean result = FALSE;
-       
+
        priv = ecal->priv;
        g_return_val_if_fail (priv->load_state == E_CAL_LOAD_NOT_LOADED, FALSE);
        g_assert (priv->uri == NULL);
@@ -1296,7 +1296,7 @@ fetch_corba_cal (ECal *ecal, ESource *source, ECalSourceType type)
                                                                  BONOBO_OBJREF (priv->listener), &ev);
                if (BONOBO_EX (&ev))
                        continue;
-               
+
                priv->cal = cal;
 
                result = TRUE;
@@ -1314,11 +1314,11 @@ e_cal_activate ()
 {
        static GStaticMutex e_cal_lock = G_STATIC_MUTEX_INIT;
        static gboolean activated = FALSE;
-       
+
        g_static_mutex_lock (&e_cal_lock);
        if (!activated) {
                activated = TRUE;
-               
+
                if (!bonobo_is_initialized ())
                        bonobo_init (NULL, NULL);
        }
@@ -1358,7 +1358,7 @@ set_local_attachment_store (ECal *ecal)
                                                    ".evolution/cache/calendar",
                                                    mangled_uri,
                                                    NULL);
-               priv->local_attachment_store = 
+               priv->local_attachment_store =
                        g_filename_to_uri (filename, NULL, NULL);
                g_free (filename);
        } else if (g_str_has_prefix (priv->uri, "exchange://")) {
@@ -1383,7 +1383,7 @@ set_local_attachment_store (ECal *ecal)
                                                    ".evolution/cache/calendar",
                                                    mangled_uri,
                                                    NULL);
-               priv->local_attachment_store = 
+               priv->local_attachment_store =
                        g_filename_to_uri (filename, NULL, NULL);
                g_free (filename);
        }
@@ -1405,9 +1405,9 @@ ECal *
 e_cal_new (ESource *source, ECalSourceType type)
 {
        ECal *ecal;
-       
+
        e_cal_activate ();
-       
+
        ecal = g_object_new (E_TYPE_CAL, NULL);
 
        if (!fetch_corba_cal (ecal, source, type)) {
@@ -1476,7 +1476,7 @@ e_cal_new_system_calendar (void)
        g_free (filename);
        ecal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_EVENT);
        g_free (uri);
-       
+
        return ecal;
 }
 
@@ -1504,7 +1504,7 @@ e_cal_new_system_tasks (void)
        g_free (filename);
        ecal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_TODO);
        g_free (uri);
-       
+
        return ecal;
 }
 
@@ -1532,7 +1532,7 @@ e_cal_new_system_memos (void)
        g_free (filename);
        ecal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_JOURNAL);
        g_free (uri);
-       
+
        return ecal;
 }
 
@@ -1615,19 +1615,19 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta
        ECalendarOp *our_op;
        char *username = NULL, *auth_type = NULL, *password = NULL;
        gboolean read_only = FALSE;
-       
+
        e_return_error_if_fail (ecal != NULL, E_CALENDAR_STATUS_INVALID_ARG);
        e_return_error_if_fail (E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
        priv = ecal->priv;
-       
+
        g_mutex_lock (ecal->priv->mutex);
 
        if (!needs_auth && priv->load_state == E_CAL_LOAD_LOADED) {
                g_mutex_unlock (ecal->priv->mutex);
                return TRUE;
        }
-       
+
        if (ecal->priv->current_op != NULL) {
                g_mutex_unlock (ecal->priv->mutex);
                *status = E_CALENDAR_STATUS_BUSY;
@@ -1666,19 +1666,19 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta
                                e_source_peek_name (priv->source), username);
 
                auth_type = e_source_get_duped_property (priv->source, "auth-type");
-               if (auth_type) 
+               if (auth_type)
                        key = build_pass_key (ecal);
                else {
                        parent_user = e_source_get_duped_property (priv->source, "parent_id_name");
                        if (parent_user) {
                                key = build_proxy_pass_key (ecal, parent_user);
-                               /* 
-                                  This password prompt will be prompted rarely. Since the key that is passed to 
+                               /*
+                                  This password prompt will be prompted rarely. Since the key that is passed to
                                   the auth_func corresponds to the parent user.
                                 */
                                prompt = g_strdup_printf (_("Enter password for %s to enable proxy for user %s"), e_source_peek_name (priv->source), parent_user);
                                g_free (parent_user);
-                       } else 
+                       } else
                                key = g_strdup (e_cal_get_uri (ecal));
                }
                g_free (auth_type);
@@ -1697,9 +1697,9 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta
                        e_calendar_remove_op (ecal, our_op);
                        e_calendar_free_op (our_op);
                        priv->load_state = E_CAL_LOAD_NOT_LOADED;
-                       *status = E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED; 
+                       *status = E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED;
                        E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED, error);
-               } 
+               }
 
                g_free (prompt);
                g_free (key);
@@ -1720,7 +1720,7 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta
        if (BONOBO_EX (&ev)) {
                e_calendar_remove_op (ecal, our_op);
                e_calendar_free_op (our_op);
-               
+
                CORBA_exception_free (&ev);
 
                g_warning (G_STRLOC ": Unable to contact backend");
@@ -1735,7 +1735,7 @@ open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarSta
        e_flag_wait (our_op->done);
 
        *status = our_op->status;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
        if (*status == E_CALENDAR_STATUS_OK) {
@@ -1795,18 +1795,18 @@ async_signal_idle_cb (gpointer data)
        /* free memory */
        g_object_unref (ccad->ecal);
        g_free (ccad);
-       
+
        return FALSE;
 }
 
 static gpointer
-open_async (gpointer data) 
+open_async (gpointer data)
 {
        ECalAsyncData *ccad = data;
 
        ccad->result = open_calendar (ccad->ecal, ccad->exists, NULL, &ccad->status, FALSE);
        g_idle_add ((GSourceFunc) async_signal_idle_cb, ccad);
-       
+
        return GINT_TO_POINTER (ccad->result);
 }
 
@@ -1816,10 +1816,10 @@ open_async (gpointer data)
  * @only_if_exists: If TRUE, then only open the calendar if it already
  * exists.  If FALSE, then create a new calendar if it doesn't already
  * exist.
- * 
+ *
  * Open the calendar asynchronously.  The calendar will emit the
  * "cal_opened" signal when the operation has completed.
- * 
+ *
  * Because this operation runs in another thread, any authentication
  * callback set on the calendar will be called from this other thread.
  * See #e_cal_set_auth_func() for details.
@@ -1870,19 +1870,19 @@ e_cal_open_async (ECal *ecal, gboolean only_if_exists)
  *
  * Return value: TRUE if the calendar was removed, FALSE if there was an error.
  */
-gboolean 
+gboolean
 e_cal_remove (ECal *ecal, GError **error)
 {
        ECalPrivate *priv;
        CORBA_Environment ev;
        ECalendarStatus status;
        ECalendarOp *our_op;
-       
+
        g_return_val_if_fail (ecal != NULL, FALSE);
        g_return_val_if_fail (E_IS_CAL (ecal), FALSE);
 
        priv = ecal->priv;
-       
+
        g_mutex_lock (ecal->priv->mutex);
 
        if (ecal->priv->current_op != NULL) {
@@ -1914,7 +1914,7 @@ e_cal_remove (ECal *ecal, GError **error)
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -1951,7 +1951,7 @@ e_cal_uri_list (ECal *ecal, CalMode mode)
 #if 0
        ECalPrivate *priv;
        GNOME_Evolution_Calendar_StringSeq *uri_seq;
-       GList *uris = NULL;     
+       GList *uris = NULL;
        CORBA_Environment ev;
        GList *f;
 
@@ -1977,11 +1977,11 @@ e_cal_uri_list (ECal *ecal, CalMode mode)
                        uris = g_list_concat (uris, build_uri_list (uri_seq));
                        CORBA_free (uri_seq);
                }
-       
+
                CORBA_exception_free (&ev);
        }
-       
-       return uris;    
+
+       return uris;
 #endif
 
        return NULL;
@@ -2012,9 +2012,9 @@ e_cal_get_source_type (ECal *ecal)
 /**
  * e_cal_get_load_state:
  * @ecal: A calendar client.
- * 
+ *
  * Queries the state of loading of a calendar client.
- * 
+ *
  * Return value: A #ECalLoadState value indicating whether the client has
  * not been loaded with #e_cal_open yet, whether it is being
  * loaded, or whether it is already loaded.
@@ -2034,9 +2034,9 @@ e_cal_get_load_state (ECal *ecal)
 /**
  * e_cal_get_source:
  * @ecal: A calendar client.
- * 
+ *
  * Queries the source that is open in a calendar client.
- * 
+ *
  * Return value: The source of the calendar that is already loaded or is being
  * loaded, or NULL if the ecal has not started a load request yet.
  **/
@@ -2055,9 +2055,9 @@ e_cal_get_source (ECal *ecal)
 /**
  * e_cal_get_uri:
  * @ecal: A calendar client.
- * 
+ *
  * Queries the URI that is open in a calendar client.
- * 
+ *
  * Return value: The URI of the calendar that is already loaded or is being
  * loaded, or NULL if the client has not started a load request yet.
  **/
@@ -2076,7 +2076,7 @@ e_cal_get_uri (ECal *ecal)
 /**
  * e_cal_get_local_attachment_store
  * @ecal: A calendar client.
- * 
+ *
  * Queries the URL where the calendar attachments are
  * serialized in the local filesystem. This enable clients
  * to operate with the reference to attachments rather than the data itself
@@ -2114,13 +2114,13 @@ gboolean
 e_cal_is_read_only (ECal *ecal, gboolean *read_only, GError **error)
 {
        ECalPrivate *priv;
-       
+
        if (!(ecal && E_IS_CAL (ecal)))
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_INVALID_ARG, error);
-       
+
        priv = ecal->priv;
        *read_only = priv->read_only;
-       
+
        return TRUE;
 }
 
@@ -2131,7 +2131,7 @@ get_read_only (ECal *ecal, gboolean *read_only, GError **error)
        CORBA_Environment ev;
        ECalendarStatus status;
        ECalendarOp *our_op;
-       
+
        priv = ecal->priv;
        g_mutex_lock (ecal->priv->mutex);
 
@@ -2150,7 +2150,7 @@ get_read_only (ECal *ecal, gboolean *read_only, GError **error)
        /* set it to true so that op does not emit cond signals for all notifications
           from the backend */
        our_op->bool = TRUE;
-       
+
        g_mutex_unlock (ecal->priv->mutex);
 
 
@@ -2173,7 +2173,7 @@ get_read_only (ECal *ecal, gboolean *read_only, GError **error)
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-       
+
        if (status == E_CALENDAR_STATUS_OK)
                *read_only = our_op->bool;
 
@@ -2189,7 +2189,7 @@ get_read_only (ECal *ecal, gboolean *read_only, GError **error)
  * @error: Placeholder for error information.
  *
  * Queries the calendar address associated with a calendar client.
- * 
+ *
  * Return value: TRUE if the operation was successful, FALSE if there
  * was an error.
  **/
@@ -2205,7 +2205,7 @@ e_cal_get_cal_address (ECal *ecal, char **cal_address, GError **error)
        if (!(ecal && E_IS_CAL (ecal)))
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_INVALID_ARG, error);
        priv = ecal->priv;
-       if (priv->cal_address == NULL) { 
+       if (priv->cal_address == NULL) {
                g_mutex_lock (ecal->priv->mutex);
 
                if (ecal->priv->load_state != E_CAL_LOAD_LOADED) {
@@ -2247,11 +2247,11 @@ e_cal_get_cal_address (ECal *ecal, char **cal_address, GError **error)
                e_calendar_free_op (our_op);
 
                E_CALENDAR_CHECK_STATUS (status, error);
-       } else {        
+       } else {
                *cal_address = g_strdup (priv->cal_address);
 
                return TRUE;
-       }               
+       }
 }
 
 /**
@@ -2273,7 +2273,7 @@ e_cal_get_alarm_email_address (ECal *ecal, char **alarm_address, GError **error)
        ECalendarStatus status;
        ECalendarOp *our_op;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
        priv = ecal->priv;
 
@@ -2314,7 +2314,7 @@ e_cal_get_alarm_email_address (ECal *ecal, char **alarm_address, GError **error)
 
        status = our_op->status;
        *alarm_address = our_op->string;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -2340,7 +2340,7 @@ e_cal_get_ldap_attribute (ECal *ecal, char **ldap_attribute, GError **error)
        ECalendarStatus status;
        ECalendarOp *our_op;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
        priv = ecal->priv;
 
@@ -2381,7 +2381,7 @@ e_cal_get_ldap_attribute (ECal *ecal, char **ldap_attribute, GError **error)
 
        status = our_op->status;
        *ldap_attribute = our_op->string;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -2389,13 +2389,13 @@ e_cal_get_ldap_attribute (ECal *ecal, char **ldap_attribute, GError **error)
 }
 
 static gboolean
-load_static_capabilities (ECal *ecal, GError **error) 
+load_static_capabilities (ECal *ecal, GError **error)
 {
        ECalPrivate *priv;
        CORBA_Environment ev;
        ECalendarStatus status;
        ECalendarOp *our_op;
-       
+
        priv = ecal->priv;
 
        if (priv->capabilities)
@@ -2438,7 +2438,7 @@ load_static_capabilities (ECal *ecal, GError **error)
 
        status = our_op->status;
        priv->capabilities = our_op->string;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -2446,7 +2446,7 @@ load_static_capabilities (ECal *ecal, GError **error)
 }
 
 static gboolean
-check_capability (ECal *ecal, const char *cap) 
+check_capability (ECal *ecal, const char *cap)
 {
        ECalPrivate *priv;
 
@@ -2456,7 +2456,7 @@ check_capability (ECal *ecal, const char *cap)
        load_static_capabilities (ecal, NULL);
        if (priv->capabilities && strstr (priv->capabilities, cap))
                return TRUE;
-       
+
        return FALSE;
 }
 
@@ -2486,7 +2486,7 @@ e_cal_get_one_alarm_only (ECal *ecal)
  * Return value: TRUE if the calendar forces organizers to attend meetings,
  * FALSE otherwise.
  */
-gboolean 
+gboolean
 e_cal_get_organizer_must_attend (ECal *ecal)
 {
        g_return_val_if_fail (ecal != NULL, FALSE);
@@ -2504,7 +2504,7 @@ e_cal_get_organizer_must_attend (ECal *ecal)
  * Return value: TRUE if the calendar has a master object for recurrences,
  * FALSE otherwise.
  */
-gboolean 
+gboolean
 e_cal_get_recurrences_no_master (ECal *ecal)
 {
        g_return_val_if_fail (ecal != NULL, FALSE);
@@ -2539,7 +2539,7 @@ e_cal_get_static_capability (ECal *ecal, const char *cap)
  *
  * Return value: TRUE if it saves schedules, FALSE otherwise.
  */
-gboolean 
+gboolean
 e_cal_get_save_schedules (ECal *ecal)
 {
        g_return_val_if_fail (ecal != NULL, FALSE);
@@ -2558,7 +2558,7 @@ e_cal_get_save_schedules (ECal *ecal)
  * Return value: TRUE if the calendar requires organizers to accept, FALSE
  * otherwise.
  */
-gboolean 
+gboolean
 e_cal_get_organizer_must_accept (ECal *ecal)
 {
        g_return_val_if_fail (ecal != NULL, FALSE);
@@ -2580,7 +2580,7 @@ gboolean
 e_cal_set_mode (ECal *ecal, CalMode mode)
 {
        ECalPrivate *priv;
-       gboolean retval = TRUE; 
+       gboolean retval = TRUE;
        CORBA_Environment ev;
 
        g_return_val_if_fail (ecal != NULL, -1);
@@ -2594,7 +2594,7 @@ e_cal_set_mode (ECal *ecal, CalMode mode)
 
        if (BONOBO_EX (&ev))
                retval = FALSE;
-               
+
        CORBA_exception_free (&ev);
 
        return retval;
@@ -2630,7 +2630,7 @@ e_cal_get_default_object (ECal *ecal, icalcomponent **icalcomp, GError **error)
        ECalendarStatus status;
        ECalendarOp *our_op;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
        priv = ecal->priv;
 
@@ -2705,7 +2705,7 @@ e_cal_get_attachments_for_comp (ECal *ecal, const char *uid, const char *rid, GS
        ECalendarStatus status;
        ECalendarOp *our_op;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
        priv = ecal->priv;
 
@@ -2743,7 +2743,7 @@ e_cal_get_attachments_for_comp (ECal *ecal, const char *uid, const char *rid, GS
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-        if (status != E_CALENDAR_STATUS_OK){ 
+        if (status != E_CALENDAR_STATUS_OK){
                 *list = NULL;
         } else {
                *list = our_op->slist;
@@ -2776,7 +2776,7 @@ e_cal_get_object (ECal *ecal, const char *uid, const char *rid, icalcomponent **
        ECalendarStatus status;
        ECalendarOp *our_op;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
        priv = ecal->priv;
 
@@ -2815,7 +2815,7 @@ e_cal_get_object (ECal *ecal, const char *uid, const char *rid, icalcomponent **
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-        if (status != E_CALENDAR_STATUS_OK){ 
+        if (status != E_CALENDAR_STATUS_OK){
                 *icalcomp = NULL;
         } else {
                icalcomponent *tmp_icalcomp;
@@ -2926,7 +2926,7 @@ e_cal_get_objects_for_uid (ECal *ecal, const char *uid, GList **objects, GError
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-        if (status != E_CALENDAR_STATUS_OK){ 
+        if (status != E_CALENDAR_STATUS_OK){
                 *objects = NULL;
         } else {
                icalcomponent *icalcomp;
@@ -3004,7 +3004,7 @@ e_cal_resolve_tzid_cb (const char *tzid, gpointer data)
 
        g_return_val_if_fail (data != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL (data), NULL);
-       
+
        ecal = E_CAL (data);
 
        /* FIXME: Handle errors. */
@@ -3033,7 +3033,7 @@ e_cal_get_changes (ECal *ecal, const char *change_id, GList **changes, GError **
        ECalendarOp *our_op;
        ECalendarStatus status;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
        e_return_error_if_fail (change_id, E_CALENDAR_STATUS_INVALID_ARG);
 
        g_mutex_lock (ecal->priv->mutex);
@@ -3066,7 +3066,7 @@ e_cal_get_changes (ECal *ecal, const char *change_id, GList **changes, GError **
 
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_CORBA_EXCEPTION, error);
        }
-       
+
        CORBA_exception_free (&ev);
 
        e_flag_wait (our_op->done);
@@ -3111,12 +3111,12 @@ e_cal_free_change_list (GList *list)
  * @query: Query string.
  * @objects: Return value for list of objects.
  * @error: Placeholder for error information.
- * 
+ *
  * Gets a list of objects from the calendar that match the query specified
  * by the @query argument. The objects will be returned in the @objects
  * argument, which is a list of #icalcomponent. When done, this list
  * should be freed by using the #e_cal_free_object_list function.
- * 
+ *
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  **/
 gboolean
@@ -3127,7 +3127,7 @@ e_cal_get_object_list (ECal *ecal, const char *query, GList **objects, GError **
        ECalendarStatus status;
 
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
        e_return_error_if_fail (query, E_CALENDAR_STATUS_INVALID_ARG);
 
        g_mutex_lock (ecal->priv->mutex);
@@ -3160,7 +3160,7 @@ e_cal_get_object_list (ECal *ecal, const char *query, GList **objects, GError **
 
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_CORBA_EXCEPTION, error);
        }
-       
+
        CORBA_exception_free (&ev);
 
        e_flag_wait (our_op->done);
@@ -3180,11 +3180,11 @@ e_cal_get_object_list (ECal *ecal, const char *query, GList **objects, GError **
  * @query: Query string.
  * @objects: Return value for list of objects.
  * @error: Placeholder for error information.
- * 
+ *
  * Gets a list of objects from the calendar that match the query specified
  * by the @query argument. The objects will be returned in the @objects
  * argument, which is a list of #ECalComponent.
- * 
+ *
  * Return value: TRUE if the operation was successful, FALSE otherwise.
  */
 gboolean
@@ -3193,22 +3193,22 @@ e_cal_get_object_list_as_comp (ECal *ecal, const char *query, GList **objects, G
        GList *ical_objects = NULL;
        GList *l;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
-       e_return_error_if_fail (query, E_CALENDAR_STATUS_INVALID_ARG);  
-       e_return_error_if_fail (objects, E_CALENDAR_STATUS_INVALID_ARG);        
-       
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
+       e_return_error_if_fail (query, E_CALENDAR_STATUS_INVALID_ARG);
+       e_return_error_if_fail (objects, E_CALENDAR_STATUS_INVALID_ARG);
+
        if (!e_cal_get_object_list (ecal, query, &ical_objects, error))
                return FALSE;
-               
+
        *objects = NULL;
        for (l = ical_objects; l; l = l->next) {
                ECalComponent *comp;
-                       
+
                comp = e_cal_component_new ();
                e_cal_component_set_icalcomponent (comp, l->data);
                *objects = g_list_prepend (*objects, comp);
        }
-                       
+
        g_list_free (ical_objects);
 
        return TRUE;
@@ -3220,11 +3220,11 @@ e_cal_get_object_list_as_comp (ECal *ecal, const char *query, GList **objects, G
  *
  * Frees a list of objects as returned by #e_cal_get_object_list.
  */
-void 
+void
 e_cal_free_object_list (GList *objects)
 {
        GList *l;
-       
+
        for (l = objects; l; l = l->next)
                icalcomponent_free (l->data);
 
@@ -3287,7 +3287,7 @@ e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end,
        GNOME_Evolution_Calendar_Cal_getFreeBusy (ecal->priv->cal, &corba_users, start, end, &ev);
 
        CORBA_free (corba_users._buffer);
-       
+
        if (BONOBO_EX (&ev)) {
                e_calendar_remove_op (ecal, our_op);
                e_calendar_free_op (our_op);
@@ -3298,7 +3298,7 @@ e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end,
 
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_CORBA_EXCEPTION, error);
        }
-       
+
        CORBA_exception_free (&ev);
 
        e_flag_wait (our_op->done);
@@ -3341,7 +3341,7 @@ add_instance (ECalComponent *comp, time_t start, time_t end, gpointer data)
 
        icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
        e_cal_component_get_dtstart (comp, &datetime);
-               
+
        /* add the instance to the list */
        ci->comp = e_cal_component_new ();
        e_cal_component_set_icalcomponent (ci->comp, icalcomp);
@@ -3351,7 +3351,7 @@ add_instance (ECalComponent *comp, time_t start, time_t end, gpointer data)
                if (!(icalcomponent_get_first_property (icalcomp, ICAL_RECURRENCEID_PROPERTY))) {
                        ECalComponentRange *range;
 
-                       if (instances_hold->start_zone) 
+                       if (instances_hold->start_zone)
                                itt = icaltime_from_timet_with_zone (start, datetime.value->is_date, instances_hold->start_zone);
                        else {
                                itt = icaltime_from_timet (start, datetime.value->is_date);
@@ -3557,10 +3557,10 @@ generate_instances (ECal *ecal, time_t start, time_t end, const char *uid,
                        e_cal_component_get_dtstart (comp, &dtstart);
                        e_cal_component_get_dtend (comp, &dtend);
 
-                       /* For DATE-TIME values with a TZID, we use 
-                       e_cal_resolve_tzid_cb to resolve the TZID. 
+                       /* For DATE-TIME values with a TZID, we use
+                       e_cal_resolve_tzid_cb to resolve the TZID.
                        For DATE values and DATE-TIME values without a
-                       TZID (i.e. floating times) we use the default 
+                       TZID (i.e. floating times) we use the default
                        timezone. */
                        if (dtstart.tzid && !dtstart.value->is_date) {
                                start_zone = e_cal_resolve_tzid_cb (dtstart.tzid, ecal);
@@ -3584,18 +3584,18 @@ generate_instances (ECal *ecal, time_t start, time_t end, const char *uid,
                                ci->end = icaltime_as_timet_with_zone (*dtend.value, end_zone);
                        else if (icaltime_is_date (*dtstart.value))
                                ci->end = time_day_end (ci->start);
-                       else 
+                       else
                                ci->end = ci->start;
 
                        e_cal_component_free_datetime (&dtstart);
                        e_cal_component_free_datetime (&dtend);
+
                        detached_instances = g_list_prepend (detached_instances, ci);
                } else {
                        ECalComponentDateTime datetime;
                        icaltimezone *start_zone;
                        struct instances_info *instances_hold;
-                       
+
                        /* Get the start timezone */
                        e_cal_component_get_dtstart (comp, &datetime);
                        e_cal_get_timezone (ecal, datetime.tzid, &start_zone, NULL);
@@ -3608,7 +3608,7 @@ generate_instances (ECal *ecal, time_t start, time_t end, const char *uid,
                        e_cal_recur_generate_instances (comp, start, end, add_instance, instances_hold,
                                                        e_cal_resolve_tzid_cb, ecal,
                                                        default_zone);
-                       
+
                        g_free (instances_hold);
                        g_object_unref (comp);
                }
@@ -3624,9 +3624,9 @@ generate_instances (ECal *ecal, time_t start, time_t end, const char *uid,
        for (l = instances; l; l = l->next) {
                struct comp_instance *ci;
                gboolean result;
-               
+
                ci = l->data;
-               
+
                result = (* cb) (ci->comp, ci->start, ci->end, cb_data);
 
                if (!result)
@@ -3664,9 +3664,9 @@ generate_instances (ECal *ecal, time_t start, time_t end, const char *uid,
  * @end: End time for query.
  * @cb: Callback for each generated instance.
  * @cb_data: Closure data for the callback.
- * 
+ *
  * Does a combination of #e_cal_get_object_list () and
- * #e_cal_recur_generate_instances().  
+ * #e_cal_recur_generate_instances().
  *
  * The callback function should do a g_object_ref() of the calendar component
  * it gets passed if it intends to keep it around, since it will be unref'ed
@@ -3677,7 +3677,7 @@ e_cal_generate_instances (ECal *ecal, time_t start, time_t end,
                          ECalRecurInstanceFn cb, gpointer cb_data)
 {
        ECalPrivate *priv;
-       
+
        g_return_if_fail (ecal != NULL);
        g_return_if_fail (E_IS_CAL (ecal));
 
@@ -3733,7 +3733,7 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
        comp = e_cal_component_new ();
        e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
 
-       /*If the backend stores it as individual instances and does not 
+       /*If the backend stores it as individual instances and does not
         * have a master object - do not expand*/
        if (e_cal_get_static_capability (ecal, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER)) {
 
@@ -3743,7 +3743,7 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
                g_object_unref (comp);
                return;
        }
-               
+
        e_cal_component_get_uid (comp, &uid);
        /* string might be freed at any time, keep a copy */
        rid = g_strdup (e_cal_component_get_recurid_as_string (comp));
@@ -3756,7 +3756,7 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
        instances_hold = g_new0 (struct instances_info, 1);
        instances_hold->instances = &instances;
        instances_hold->start_zone = start_zone;
-       
+
        /* generate all instances in the given time range */
        generate_instances (ecal, start, end, uid, add_instance, instances_hold);
 
@@ -3885,7 +3885,7 @@ e_cal_get_alarms_in_range (ECal *ecal, time_t start, time_t end)
 /**
  * e_cal_free_alarms:
  * @comp_alarms: A list of #ECalComponentAlarms structures.
- * 
+ *
  * Frees a list of #ECalComponentAlarms structures as returned by
  * e_cal_get_alarms_in_range().
  **/
@@ -3984,7 +3984,7 @@ e_cal_discard_alarm (ECal *ecal, ECalComponent *comp, const char *auid, GError *
        ECalendarStatus status;
        ECalendarOp *our_op;
        const char *uid;
-       
+
        g_return_val_if_fail (ecal != NULL, FALSE);
        g_return_val_if_fail (E_IS_CAL (ecal), FALSE);
 
@@ -4027,7 +4027,7 @@ e_cal_discard_alarm (ECal *ecal, ECalComponent *comp, const char *auid, GError *
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -4270,7 +4270,7 @@ e_cal_create_object (ECal *ecal, icalcomponent *icalcomp, char **uid, GError **e
                *uid = our_op->uid;
                icalcomponent_set_uid (icalcomp, *uid);
        }
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -4342,7 +4342,7 @@ e_cal_modify_object (ECal *ecal, icalcomponent *icalcomp, CalObjModType mod, GEr
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -4418,7 +4418,7 @@ e_cal_remove_object_with_mod (ECal *ecal, const char *uid,
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -4430,11 +4430,11 @@ e_cal_remove_object_with_mod (ECal *ecal, const char *uid,
  * @ecal:  A calendar client.
  * @uid: Unique identifier of the calendar component to remove.
  * @error: Placeholder for error information.
- * 
+ *
  * Asks a calendar to remove a component.  If the server is able to remove the
  * component, all clients will be notified and they will emit the "obj_removed"
  * signal.
- * 
+ *
  * Return value: %TRUE if successful, %FALSE otherwise.
  **/
 gboolean
@@ -4505,7 +4505,7 @@ e_cal_receive_objects (ECal *ecal, icalcomponent *icalcomp, GError **error)
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -4586,10 +4586,10 @@ e_cal_send_objects (ECal *ecal, icalcomponent *icalcomp, GList **users, icalcomp
                        g_list_foreach (*users, (GFunc) g_free, NULL);
                        g_list_free (*users);
                        *users = NULL;
-               }               
+               }
        }
        g_free (our_op->string);
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -4639,15 +4639,15 @@ e_cal_get_timezone (ECal *ecal, const char *tzid, icaltimezone **zone, GError **
 
        /* Check for well known zones and in the cache */
        *zone = NULL;
-       
+
        /* If tzid is NULL or "" we return NULL, since it is a 'local time'. */
        if (!tzid || !tzid[0]) {
                e_calendar_remove_op (ecal, our_op);
                e_calendar_free_op (our_op);
 
                *zone = NULL;
-               
-               E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_OK, error);          
+
+               E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_OK, error);
        }
 
        /* If it is UTC, we return the special UTC timezone. */
@@ -4657,14 +4657,14 @@ e_cal_get_timezone (ECal *ecal, const char *tzid, icaltimezone **zone, GError **
                /* See if we already have it in the cache. */
                *zone = g_hash_table_lookup (priv->timezones, tzid);
        }
-       
+
        if (*zone) {
                e_calendar_remove_op (ecal, our_op);
                e_calendar_free_op (our_op);
 
-               E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_OK, error);  
+               E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_OK, error);
        }
-       
+
        /* call the backend */
        CORBA_exception_init (&ev);
 
@@ -4685,7 +4685,7 @@ e_cal_get_timezone (ECal *ecal, const char *tzid, icaltimezone **zone, GError **
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-        if (status != E_CALENDAR_STATUS_OK){ 
+        if (status != E_CALENDAR_STATUS_OK){
                 icalcomp = NULL;
         } else {
                 icalcomp = icalparser_parse_string (our_op->string);
@@ -4693,15 +4693,15 @@ e_cal_get_timezone (ECal *ecal, const char *tzid, icaltimezone **zone, GError **
                        status = E_CALENDAR_STATUS_INVALID_OBJECT;
        }
        g_free (our_op->string);
-       
+
        if (!icalcomp) {
                e_calendar_remove_op (ecal, our_op);
                e_calendar_free_op (our_op);
 
                E_CALENDAR_CHECK_STATUS (status, error);
        }
-       
-       *zone = icaltimezone_new ();    
+
+       *zone = icaltimezone_new ();
        if (!icaltimezone_set_component (*zone, icalcomp)) {
                icaltimezone_free (*zone, 1);
 
@@ -4742,7 +4742,7 @@ e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error)
 
        e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
        e_return_error_if_fail (izone, E_CALENDAR_STATUS_INVALID_ARG);
-       
+
        priv = ecal->priv;
 
        g_mutex_lock (priv->mutex);
@@ -4766,10 +4766,10 @@ e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error)
        if (izone == icaltimezone_get_utc_timezone ()) {
                e_calendar_remove_op (ecal, our_op);
                e_calendar_free_op (our_op);
-               
+
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_OK, error);
        }
-       
+
        icalcomp = icaltimezone_get_component (izone);
        if (!icalcomp) {
                e_calendar_remove_op (ecal, our_op);
@@ -4778,7 +4778,7 @@ e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error)
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_INVALID_ARG, error);
        }
 
-       /* convert icaltimezone into a string */        
+       /* convert icaltimezone into a string */
        tzobj = icalcomponent_as_ical_string (icalcomp);
 
        /* call the backend */
@@ -4801,7 +4801,7 @@ e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error)
        e_flag_wait (our_op->done);
 
        status = our_op->status;
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -4814,9 +4814,9 @@ e_cal_add_timezone (ECal *ecal, icaltimezone *izone, GError **error)
  * @sexp: S-expression representing the query.
  * @query: Return value for the new query.
  * @error: Placeholder for error information.
- * 
+ *
  * Creates a live query object from a loaded calendar.
- * 
+ *
  * Return value: A query object that will emit notification signals as calendar
  * components are added and removed from the query in the server.
  **/
@@ -4861,7 +4861,7 @@ e_cal_get_query (ECal *ecal, const char *sexp, ECalView **query, GError **error)
 
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_CORBA_EXCEPTION, error);
        }
-       
+
        CORBA_exception_free (&ev);
 
        e_flag_wait (our_op->done);
@@ -4870,7 +4870,7 @@ e_cal_get_query (ECal *ecal, const char *sexp, ECalView **query, GError **error)
        *query = our_op->query;
 
        bonobo_object_unref (BONOBO_OBJECT (our_op->listener));
-       
+
        e_calendar_remove_op (ecal, our_op);
        e_calendar_free_op (our_op);
 
@@ -4898,15 +4898,15 @@ e_cal_set_default_timezone (ECal *ecal, icaltimezone *zone, GError **error)
        icalcomponent *icalcomp = NULL;
        char *tzobj;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
-       e_return_error_if_fail (zone, E_CALENDAR_STATUS_INVALID_ARG);   
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
+       e_return_error_if_fail (zone, E_CALENDAR_STATUS_INVALID_ARG);
 
        priv = ecal->priv;
 
        /* Don't set the same timezone multiple times */
        if (priv->default_zone == zone)
                return FALSE;
-       
+
        g_mutex_lock (priv->mutex);
 
        if (ecal->priv->current_op != NULL) {
@@ -4927,7 +4927,7 @@ e_cal_set_default_timezone (ECal *ecal, icaltimezone *zone, GError **error)
                E_CALENDAR_CHECK_STATUS (E_CALENDAR_STATUS_INVALID_ARG, error);
        }
 
-       /* convert icaltimezone into a string */        
+       /* convert icaltimezone into a string */
        tzobj = icalcomponent_as_ical_string (icalcomp);
 
        /* call the backend */
@@ -5048,7 +5048,7 @@ get_default (ECal **ecal, ESourceList *sources, ECalSourceType type, ECalAuthFun
 
        if (default_source) {
                *ecal = e_cal_new (default_source, type);
-               if (!*ecal) {                   
+               if (!*ecal) {
                        g_propagate_error (error, err);
                        rv = FALSE;
                        goto done;
@@ -5058,7 +5058,7 @@ get_default (ECal **ecal, ESourceList *sources, ECalSourceType type, ECalAuthFun
                if (!e_cal_open (*ecal, TRUE, &err)) {
                        g_propagate_error (error, err);
                        rv = FALSE;
-                       goto done;              
+                       goto done;
                }
        } else {
                switch (type) {
@@ -5074,8 +5074,8 @@ get_default (ECal **ecal, ESourceList *sources, ECalSourceType type, ECalAuthFun
                default:
                        break;
                }
-               
-               if (!*ecal) {                   
+
+               if (!*ecal) {
                        g_propagate_error (error, err);
                        rv = FALSE;
                        goto done;
@@ -5085,7 +5085,7 @@ get_default (ECal **ecal, ESourceList *sources, ECalSourceType type, ECalAuthFun
                if (!e_cal_open (*ecal, TRUE, &err)) {
                        g_propagate_error (error, err);
                        rv = FALSE;
-                       goto done;              
+                       goto done;
                }
        }
 
@@ -5139,7 +5139,7 @@ e_cal_set_default (ECal *ecal, GError **error)
 {
        ESource *source;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);        
+       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 
        source = e_cal_get_source (ecal);
        if (!source) {
@@ -5239,7 +5239,7 @@ e_cal_get_sources (ESourceList **sources, ECalSourceType type, GError **error)
 {
        switch (type) {
        case E_CAL_SOURCE_TYPE_EVENT:
-               return get_sources (sources, "/apps/evolution/calendar/sources", error);                
+               return get_sources (sources, "/apps/evolution/calendar/sources", error);
                break;
        case E_CAL_SOURCE_TYPE_TODO:
                return get_sources (sources, "/apps/evolution/tasks/sources", error);
@@ -5251,7 +5251,7 @@ e_cal_get_sources (ESourceList **sources, ECalSourceType type, GError **error)
                /* FIXME Fill in error */
                return FALSE;
        }
-       
+
        /* FIXME Fill in error */
-       return FALSE;   
+       return FALSE;
 }
index 2fbc4d5..99b7d65 100644 (file)
@@ -83,7 +83,7 @@ struct _ECalClass {
        /* Notification signals */
 
        void (* cal_opened) (ECal *ecal, ECalendarStatus status);
-       void (* cal_set_mode) (ECal *ecal, ECalSetModeStatus status, CalMode mode);     
+       void (* cal_set_mode) (ECal *ecal, ECalSetModeStatus status, CalMode mode);
 
        void (* backend_error) (ECal *ecal, const char *message);
        void (* backend_died) (ECal *ecal);
@@ -154,7 +154,7 @@ gboolean e_cal_get_object_list (ECal *ecal, const char *query, GList **objects,
 gboolean e_cal_get_object_list_as_comp (ECal *ecal, const char *query, GList **objects, GError **error);
 void e_cal_free_object_list (GList *objects);
 
-gboolean e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end, 
+gboolean e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end,
                              GList **freebusy, GError **error);
 
 void e_cal_generate_instances (ECal *ecal, time_t start, time_t end,
index 3a3978b..726afb4 100644 (file)
@@ -62,7 +62,7 @@ get_filename_from_uri (const char *uri, ECalSourceType source_type)
                case E_CAL_SOURCE_TYPE_LAST :
                default :
                        break;
-       }       
+       }
 
        /* mangle the URI to not contain invalid characters */
        mangled_uri = g_strdup (uri);
@@ -130,7 +130,7 @@ e_cal_backend_cache_get_property (GObject *object, guint property_id, GValue *va
 
        switch (property_id) {
        case PROP_SOURCE_TYPE:
-               g_value_set_enum (value, priv->source_type);    
+               g_value_set_enum (value, priv->source_type);
        case PROP_URI :
                g_value_set_string (value, priv->uri);
                break;
@@ -182,7 +182,7 @@ e_cal_backend_cache_constructor (GType type,
                                         n_construct_properties,
                                         construct_properties);
 
-       if (!g_ascii_strcasecmp ( g_param_spec_get_name (construct_properties->pspec), "source_type")) 
+       if (!g_ascii_strcasecmp ( g_param_spec_get_name (construct_properties->pspec), "source_type"))
                source_type = g_value_get_enum (construct_properties->value);
        /* extract uid */
        if (!g_ascii_strcasecmp ( g_param_spec_get_name (construct_properties->pspec), "uri")) {
@@ -211,9 +211,9 @@ e_cal_backend_cache_class_init (ECalBackendCacheClass *klass)
 
         object_class->constructor = e_cal_backend_cache_constructor;
        g_object_class_install_property (object_class, PROP_SOURCE_TYPE,
-                                        g_param_spec_enum ("source_type", NULL, NULL, 
+                                        g_param_spec_enum ("source_type", NULL, NULL,
                                         e_cal_source_type_enum_get_type (),
-                                        E_CAL_SOURCE_TYPE_EVENT, 
+                                        E_CAL_SOURCE_TYPE_EVENT,
                                         G_PARAM_READABLE | G_PARAM_WRITABLE
                                                              | G_PARAM_CONSTRUCT_ONLY));
 
@@ -257,7 +257,7 @@ GType
 e_cal_backend_cache_get_type (void)
 {
        static GType type = 0;
-       static GStaticMutex registering = G_STATIC_MUTEX_INIT;  
+       static GStaticMutex registering = G_STATIC_MUTEX_INIT;
 
        g_static_mutex_lock (&registering);
        if (!type) {
@@ -293,7 +293,7 @@ ECalBackendCache *
 e_cal_backend_cache_new (const char *uri, ECalSourceType source_type)
 {
        ECalBackendCache *cache;
-        
+
                cache = g_object_new (E_TYPE_CAL_BACKEND_CACHE, "source_type", source_type, "uri", uri,  NULL);
 
         return cache;
@@ -460,7 +460,7 @@ e_cal_backend_cache_get_components (ECalBackendCache *cache)
        GList *list = NULL;
        icalcomponent *icalcomp;
        ECalComponent *comp = NULL;
-        
+
         /* return null if cache is not a valid Backend Cache.  */
        g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
         l = e_file_cache_get_objects (E_FILE_CACHE (cache));
@@ -486,7 +486,7 @@ e_cal_backend_cache_get_components (ECalBackendCache *cache)
                                        icalcomponent_free (icalcomp);
                         }
                 }
-                
+
         }
 
         return list;
@@ -509,7 +509,7 @@ e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const char *
        GSList *list = NULL;
        icalcomponent *icalcomp;
        ECalComponent *comp = NULL;
-        
+
         /* return null if cache is not a valid Backend Cache.  */
        g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
         l = e_file_cache_get_objects (E_FILE_CACHE (cache));
@@ -526,7 +526,7 @@ e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const char *
                                if (kind == ICAL_VEVENT_COMPONENT || kind == ICAL_VTODO_COMPONENT) {
                                        comp = e_cal_component_new ();
                                        if ((e_cal_component_set_icalcomponent (comp, icalcomp)) &&
-                                               !strcmp (icalcomponent_get_uid (icalcomp), uid)) 
+                                               !strcmp (icalcomponent_get_uid (icalcomp), uid))
                                                        list = g_slist_prepend (list, comp);
                                        else {
                                                g_object_unref (comp);
@@ -535,7 +535,7 @@ e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const char *
                                        icalcomponent_free (icalcomp);
                         }
                 }
-                
+
         }
 
         return list;
@@ -801,7 +801,7 @@ gboolean
 e_cal_backend_cache_put_server_utc_time (ECalBackendCache *cache, const char *utc_str)
 {
        gboolean ret_val = FALSE;
-       
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), FALSE);
 
        if (!(ret_val = e_file_cache_add_object (E_FILE_CACHE (cache), "server_utc_time", utc_str)))
@@ -821,7 +821,7 @@ e_cal_backend_cache_get_server_utc_time (ECalBackendCache *cache)
 {
 
        g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
-       
+
                return  e_file_cache_get_object (E_FILE_CACHE (cache), "server_utc_time");
 }
 
@@ -837,14 +837,14 @@ gboolean
 e_cal_backend_cache_put_key_value (ECalBackendCache *cache, const char *key, const char *value)
 {
        gboolean ret_val = FALSE;
-       
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), FALSE);
 
        if (value) {
                e_file_cache_remove_object (E_FILE_CACHE (cache), key);
                return TRUE;
        }
-       
+
        if (!(ret_val = e_file_cache_add_object (E_FILE_CACHE (cache), key, value)))
                ret_val = e_file_cache_replace_object (E_FILE_CACHE (cache), key, value);
 
@@ -862,6 +862,6 @@ e_cal_backend_cache_get_key_value (ECalBackendCache *cache, const char *key)
 {
 
        g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
-       
+
                return  e_file_cache_get_object (E_FILE_CACHE (cache), key);
 }
index 07598e7..1afbc3e 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * cal-backend-card-sexp.c
  * Copyright 1999, 2000, 2001, Ximian, Inc.
  *
@@ -177,7 +177,7 @@ e_cal_backend_sexp_func_time_add_day (ESExp *esexp, int argc, ESExpResult **argv
                return NULL;
        }
        n = argv[1]->value.number;
-       
+
        result = e_sexp_result_new (esexp, ESEXP_RES_TIME);
        result->value.time = time_add_day (t, n);
 
@@ -297,7 +297,7 @@ func_uid (ESExp *esexp, int argc, ESExpResult **argv, void *data)
                return NULL;
        }
 
-       arg_uid = argv[0]->value.string;        
+       arg_uid = argv[0]->value.string;
        e_cal_component_get_uid (ctx->comp, &uid);
 
        if (!arg_uid && !uid)
@@ -308,7 +308,7 @@ func_uid (ESExp *esexp, int argc, ESExpResult **argv, void *data)
                equal = TRUE;
        else
                equal = FALSE;
-       
+
        result = e_sexp_result_new (esexp, ESEXP_RES_BOOL);
        result->value.bool = equal;
 
@@ -330,12 +330,12 @@ static icaltimezone *
 resolve_tzid (const char *tzid, gpointer user_data)
 {
        SearchContext *ctx = user_data;
-                                                                                
+
         if (!tzid || !tzid[0])
                 return NULL;
         else if (!strcmp (tzid, "UTC"))
                 return icaltimezone_get_utc_timezone ();
-                                                                                
+
         return e_cal_backend_internal_get_timezone (ctx->backend, tzid);
 }
 
@@ -441,18 +441,18 @@ func_due_in_time_range (ESExp *esexp, int argc, ESExpResult **argv, void *data)
                        due_t = icaltime_as_timet_with_zone(*dt.value,zone);
                else
                        due_t = icaltime_as_timet(*dt.value);
-       }       
+       }
 
        if(dt.value != NULL && (due_t <= end && due_t >= start))
                retval = TRUE;
-       else 
-               retval = FALSE; 
+       else
+               retval = FALSE;
 
        result = e_sexp_result_new (esexp, ESEXP_RES_BOOL);
        result->value.bool = retval;
 
        e_cal_component_free_datetime (&dt);
-       
+
        return result;
 }
 
@@ -542,7 +542,7 @@ matches_organizer (ECalComponent *comp, const char *str)
        if (str && !*str)
                return TRUE;
 
-       if ((org.value && e_util_strstrcase (org.value, str)) || 
+       if ((org.value && e_util_strstrcase (org.value, str)) ||
                        (org.cn && e_util_strstrcase (org.cn, str)))
                return TRUE;
 
@@ -557,14 +557,14 @@ matches_classification (ECalComponent *comp, const char *str)
 
        if (!*str)
                return FALSE;
-       
+
        if(g_str_equal (str, "Public"))
                classification1 = E_CAL_COMPONENT_CLASS_PUBLIC;
        else if(g_str_equal (str, "Private"))
                classification1 = E_CAL_COMPONENT_CLASS_PRIVATE;
        else if(g_str_equal (str, "Confidential"))
                classification1 = E_CAL_COMPONENT_CLASS_CONFIDENTIAL;
-       else    
+       else
                classification1 = E_CAL_COMPONENT_CLASS_UNKNOWN;
 
        e_cal_component_get_classification(comp, &classification);
@@ -630,7 +630,7 @@ matches_priority (ECalComponent *comp ,const char *pr)
        if (!priority || !*priority)
                return FALSE;
 
-       if (g_str_equal (pr, "HIGH") && *priority <= 4) 
+       if (g_str_equal (pr, "HIGH") && *priority <= 4)
                return TRUE;
        else if (g_str_equal (pr, "NORMAL") && *priority == 5)
                return TRUE;
@@ -654,9 +654,9 @@ matches_status (ECalComponent *comp ,const char *str)
 
        if (g_str_equal (str, "NOT STARTED") && status == ICAL_STATUS_NONE)
                        return TRUE;
-       else if (g_str_equal (str, "COMPLETED") && status == ICAL_STATUS_COMPLETED) 
+       else if (g_str_equal (str, "COMPLETED") && status == ICAL_STATUS_COMPLETED)
                        return TRUE;
-       else if(g_str_equal (str, "CANCELLED") && status == ICAL_STATUS_CANCELLED)  
+       else if(g_str_equal (str, "CANCELLED") && status == ICAL_STATUS_CANCELLED)
                        return TRUE;
        else if(g_str_equal (str, "IN PROGRESS")  && status == ICAL_STATUS_INPROCESS)
                        return TRUE;
@@ -697,11 +697,11 @@ func_percent_complete (ESExp *esexp, int argc, ESExpResult **argv, void *data)
 
        e_cal_component_get_percent (ctx->comp, &percent);
 
-       if (percent && *percent) {      
+       if (percent && *percent) {
                result = e_sexp_result_new (esexp, ESEXP_RES_INT);
                result->value.number = *percent;
 
-       }  
+       }
 
        return result;
 }
@@ -1192,12 +1192,12 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
                        if (any_field
                            || !strcmp (prop_info_table[i].query_prop, propname)) {
                                info = &prop_info_table[i];
-                               
+
                                if (info->prop_type == PROP_TYPE_NORMAL) {
                                        char *prop = NULL;
                                        /* searches where the query's property
                                           maps directly to an ecard property */
-                                       
+
                                        prop = e_card_simple_get (ctx->card, info->field_id);
 
                                        if (prop && compare(prop, argv[1]->value.string)) {
@@ -1214,7 +1214,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
                                        const char *prop = NULL;
                                        /* searches where the query's property
                                           maps directly to an ecard property */
-                                       
+
                                        prop = e_card_get_id (ctx->card->card);
 
                                        if (prop && compare(prop, argv[1]->value.string)) {
@@ -1233,7 +1233,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
                                        break;
                        }
                }
-               
+
        }
        r = e_sexp_result_new(f, ESEXP_RES_BOOL);
        r->value.bool = truth;
@@ -1334,7 +1334,7 @@ e_cal_backend_sexp_match_object (ECalBackendSExp *sexp, const char *object, ECal
 
        comp = e_cal_component_new ();
        e_cal_component_set_icalcomponent (comp, icalcomp);
-       
+
        retval = e_cal_backend_sexp_match_comp (sexp, comp, backend);
 
        g_object_unref (comp);
@@ -1395,7 +1395,7 @@ const char *
 e_cal_backend_sexp_text (ECalBackendSExp *sexp)
 {
        ECalBackendSExpPrivate *priv;
-       
+
        g_return_val_if_fail (sexp != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND_SEXP (sexp), NULL);
 
index 83c863a..55abce6 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * cal-backend-card-sexp.h
  * Copyright 2000, 2001, Ximian, Inc.
  *
index cba6b89..f99eff6 100644 (file)
@@ -180,7 +180,7 @@ e_cal_backend_sync_open  (ECalBackendSync *backend, EDataCal *cal, gboolean only
                          const char *username, const char *password)
 {
        ECalBackendSyncStatus status;
-       
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
 
        LOCK_WRAPPER (open_sync, (backend, cal, only_if_exists, username, password));
@@ -201,11 +201,11 @@ ECalBackendSyncStatus
 e_cal_backend_sync_remove  (ECalBackendSync *backend, EDataCal *cal)
 {
        ECalBackendSyncStatus status;
-  
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
-  
+
        LOCK_WRAPPER (remove_sync, (backend, cal));
-       
+
        return status;
 }
 
@@ -224,13 +224,13 @@ ECalBackendSyncStatus
 e_cal_backend_sync_create_object (ECalBackendSync *backend, EDataCal *cal, char **calobj, char **uid)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (E_CAL_BACKEND_SYNC_GET_CLASS (backend)->create_object_sync != NULL,
                              GNOME_Evolution_Calendar_UnsupportedMethod);
-  
+
        LOCK_WRAPPER (create_object_sync, (backend, cal, calobj, uid));
+
        return status;
 }
 
@@ -250,17 +250,17 @@ e_cal_backend_sync_create_object (ECalBackendSync *backend, EDataCal *cal, char
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj, 
+e_cal_backend_sync_modify_object (ECalBackendSync *backend, EDataCal *cal, const char *calobj,
                                  CalObjModType mod, char **old_object, char **new_object)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (E_CAL_BACKEND_SYNC_GET_CLASS (backend)->modify_object_sync != NULL,
                              GNOME_Evolution_Calendar_UnsupportedMethod);
-  
+
        LOCK_WRAPPER (modify_object_sync, (backend, cal, calobj, mod, old_object, new_object));
+
        return status;
 }
 
@@ -287,13 +287,13 @@ e_cal_backend_sync_remove_object (ECalBackendSync *backend, EDataCal *cal, const
                                  CalObjModType mod, char **old_object, char **object)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (E_CAL_BACKEND_SYNC_GET_CLASS (backend)->remove_object_sync != NULL,
                              GNOME_Evolution_Calendar_UnsupportedMethod);
-  
+
        LOCK_WRAPPER (remove_object_sync, (backend, cal, uid, rid, mod, old_object, object));
+
        return status;
 }
 
@@ -312,13 +312,13 @@ ECalBackendSyncStatus
 e_cal_backend_sync_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (E_CAL_BACKEND_SYNC_GET_CLASS (backend)->discard_alarm_sync != NULL,
                              GNOME_Evolution_Calendar_UnsupportedMethod);
-  
+
        LOCK_WRAPPER (discard_alarm_sync, (backend, cal, uid, auid));
+
        return status;
 }
 
@@ -336,13 +336,13 @@ ECalBackendSyncStatus
 e_cal_backend_sync_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (E_CAL_BACKEND_SYNC_GET_CLASS (backend)->receive_objects_sync != NULL,
                              GNOME_Evolution_Calendar_UnsupportedMethod);
-  
+
        LOCK_WRAPPER (receive_objects_sync, (backend, cal, calobj));
+
        return status;
 }
 
@@ -363,13 +363,13 @@ e_cal_backend_sync_send_objects (ECalBackendSync *backend, EDataCal *cal, const
                                 char **modified_calobj)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (E_CAL_BACKEND_SYNC_GET_CLASS (backend)->send_objects_sync != NULL,
                              GNOME_Evolution_Calendar_UnsupportedMethod);
+
        LOCK_WRAPPER (send_objects_sync, (backend, cal, calobj, users, modified_calobj));
+
        return status;
 }
 
@@ -387,12 +387,12 @@ ECalBackendSyncStatus
 e_cal_backend_sync_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (object, GNOME_Evolution_Calendar_OtherError);
-  
+
        LOCK_WRAPPER (get_default_object_sync, (backend, cal, object));
-  
+
        return status;
 }
 
@@ -413,12 +413,12 @@ ECalBackendSyncStatus
 e_cal_backend_sync_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (object, GNOME_Evolution_Calendar_OtherError);
-  
+
        LOCK_WRAPPER (get_object_sync, (backend, cal, uid, rid, object));
-  
+
        return status;
 }
 
@@ -437,12 +437,12 @@ ECalBackendSyncStatus
 e_cal_backend_sync_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp, GList **objects)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (objects, GNOME_Evolution_Calendar_OtherError);
-  
+
        LOCK_WRAPPER (get_object_list_sync, (backend, cal, sexp, objects));
-  
+
        return status;
 }
 
@@ -462,12 +462,12 @@ ECalBackendSyncStatus
 e_cal_backend_sync_get_attachment_list (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, GSList **attachments)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (backend && E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
        g_return_val_if_fail (attachments, GNOME_Evolution_Calendar_OtherError);
-  
+
        LOCK_WRAPPER (get_attachment_list_sync, (backend, cal, uid, rid, attachments));
-  
+
        return status;
 }
 
@@ -486,11 +486,11 @@ ECalBackendSyncStatus
 e_cal_backend_sync_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
-  
+
        LOCK_WRAPPER (get_timezone_sync, (backend, cal, tzid, object));
-  
+
        return status;
 }
 
@@ -508,11 +508,11 @@ ECalBackendSyncStatus
 e_cal_backend_sync_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
-  
+
        LOCK_WRAPPER (add_timezone_sync, (backend, cal, tzobj));
-  
+
        return status;
 }
 
@@ -530,9 +530,9 @@ ECalBackendSyncStatus
 e_cal_backend_sync_set_default_zone (ECalBackendSync *backend, EDataCal *cal, const char *tz)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
-       
+
        /* Old backends might be using the set_default_timezone */
        if (!E_CAL_BACKEND_SYNC_GET_CLASS (backend)->set_default_zone_sync) {
                icalcomponent *icalcomp = icalparser_parse_string (tz);
@@ -552,7 +552,7 @@ e_cal_backend_sync_set_default_zone (ECalBackendSync *backend, EDataCal *cal, co
        }
 
        LOCK_WRAPPER (set_default_zone_sync, (backend, cal, tz));
-  
+
        return status;
 }
 
@@ -574,11 +574,11 @@ ECalBackendSyncStatus
 e_cal_backend_sync_set_default_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid)
 {
        ECalBackendSyncStatus status;
+
        g_return_val_if_fail (E_IS_CAL_BACKEND_SYNC (backend), GNOME_Evolution_Calendar_OtherError);
-  
+
        LOCK_WRAPPER (set_default_timezone_sync, (backend, cal, tzid));
-  
+
        return status;
 }
 
@@ -622,7 +622,7 @@ e_cal_backend_sync_get_changes (ECalBackendSync *backend, EDataCal *cal, const c
  * Return value: Status code.
  */
 ECalBackendSyncStatus
-e_cal_backend_sync_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList *users, 
+e_cal_backend_sync_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList *users,
                                  time_t start, time_t end, GList **freebusy)
 {
        ECalBackendSyncStatus status;
@@ -723,7 +723,7 @@ _e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const char *c
 {
        ECalBackendSyncStatus status;
        char *uid = NULL, *modified_calobj = (char *) calobj;
-       
+
        status = e_cal_backend_sync_create_object (E_CAL_BACKEND_SYNC (backend), cal, &modified_calobj, &uid);
 
        e_data_cal_notify_object_created (cal, status, uid, modified_calobj);
@@ -742,8 +742,8 @@ _e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const char *c
        ECalBackendSyncStatus status;
        char *old_object = NULL;
        char *new_object = NULL;
-       
-       status = e_cal_backend_sync_modify_object (E_CAL_BACKEND_SYNC (backend), cal, 
+
+       status = e_cal_backend_sync_modify_object (E_CAL_BACKEND_SYNC (backend), cal,
                                                   calobj, mod, &old_object, &new_object);
 
        if (new_object)
@@ -760,7 +760,7 @@ _e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const char *u
 {
        ECalBackendSyncStatus status;
        char *object = NULL, *old_object = NULL;
-       
+
        status = e_cal_backend_sync_remove_object (E_CAL_BACKEND_SYNC (backend), cal, uid, rid, mod, &old_object, &object);
 
        if (status == GNOME_Evolution_Calendar_Success) {
@@ -773,7 +773,7 @@ _e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const char *u
 
                if (!object)
                        e_data_cal_notify_object_removed (cal, status, id, old_object, object);
-               else 
+               else
                        e_data_cal_notify_object_modified (cal, status, old_object, object);
 
                e_cal_component_free_id (id);
@@ -788,7 +788,7 @@ static void
 _e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const char *uid, const char *auid)
 {
        ECalBackendSyncStatus status;
-       
+
        status = e_cal_backend_sync_discard_alarm (E_CAL_BACKEND_SYNC (backend), cal, uid, auid);
 
        e_data_cal_notify_alarm_discarded (cal, status);
@@ -798,7 +798,7 @@ static void
 _e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const char *calobj)
 {
        ECalBackendSyncStatus status;
-       
+
        status = e_cal_backend_sync_receive_objects (E_CAL_BACKEND_SYNC (backend), cal, calobj);
 
        e_data_cal_notify_objects_received (cal, status);
@@ -841,7 +841,7 @@ _e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const char *uid,
        status = e_cal_backend_sync_get_object (E_CAL_BACKEND_SYNC (backend), cal, uid, rid, &object);
 
        e_data_cal_notify_object (cal, status, object);
-       
+
        g_free (object);
 }
 
@@ -854,7 +854,7 @@ _e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const c
        status = e_cal_backend_sync_get_attachment_list (E_CAL_BACKEND_SYNC (backend), cal, uid, rid, &list);
 
        e_data_cal_notify_attachment_list (cal, status, list);
-       
+
        g_slist_foreach (list, (GFunc) g_free, NULL);
        g_free (list);
 }
@@ -879,7 +879,7 @@ _e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const char *tz
 {
        ECalBackendSyncStatus status;
        char *object = NULL;
-       
+
        status = e_cal_backend_sync_get_timezone (E_CAL_BACKEND_SYNC (backend), cal, tzid, &object);
 
        e_data_cal_notify_timezone_requested (cal, status, object);
@@ -922,8 +922,8 @@ _e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const char *cha
 {
        ECalBackendSyncStatus status;
        GList *adds = NULL, *modifies = NULL, *deletes = NULL, *l;
-       
-       status = e_cal_backend_sync_get_changes (E_CAL_BACKEND_SYNC (backend), cal, change_id, 
+
+       status = e_cal_backend_sync_get_changes (E_CAL_BACKEND_SYNC (backend), cal, change_id,
                                               &adds, &modifies, &deletes);
 
        e_data_cal_notify_changes (cal, status, adds, modifies, deletes);
@@ -946,7 +946,7 @@ _e_cal_backend_get_free_busy (ECalBackend *backend, EDataCal *cal, GList *users,
 {
        ECalBackendSyncStatus status;
        GList *freebusy = NULL, *l;
-       
+
        status = e_cal_backend_sync_get_free_busy (E_CAL_BACKEND_SYNC (backend), cal, users, start, end, &freebusy);
 
        e_data_cal_notify_free_busy (cal, status, freebusy);
index f154d41..a82db4f 100644 (file)
@@ -119,10 +119,10 @@ ECalBackendSyncStatus e_cal_backend_sync_remove_object           (ECalBackendSyn
                                                               CalObjModType    mod,
                                                               char **old_object,
                                                               char **object);
-ECalBackendSyncStatus  e_cal_backend_sync_get_attachment_list (ECalBackendSync *backend, 
-                                                               EDataCal *cal, 
-                                                               const char *uid, 
-                                                               const char *rid, 
+ECalBackendSyncStatus  e_cal_backend_sync_get_attachment_list (ECalBackendSync *backend,
+                                                               EDataCal *cal,
+                                                               const char *uid,
+                                                               const char *rid,
                                                                GSList **attachments);
 
 ECalBackendSyncStatus e_cal_backend_sync_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid);
index 1c54bc5..2af3027 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2000 Ximian, Inc.
  * Copyright (C) 2001 Ximian, Inc.
  *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>    
+ * Authors: Rodrigo Moya <rodrigo@ximian.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
index 4f3d387..f3cdb1a 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2000 Ximian, Inc.
  * Copyright (C) 2001 Ximian, Inc.
  *
- * Authors: Rodrigo Moya <rodrigo@ximian.com>    
+ * Authors: Rodrigo Moya <rodrigo@ximian.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
index c44b5c2..debe316 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Authors: Federico Mena-Quintero <federico@ximian.com>
  *          JP Rosevear <jpr@ximian.com>
- *          Rodrigo Moya <rodrigo@ximian.com>    
+ *          Rodrigo Moya <rodrigo@ximian.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
@@ -41,7 +41,7 @@ struct _ECalBackendPrivate {
 
        /* The kind of components for this backend */
        icalcomponent_kind kind;
-       
+
        /* List of Cal objects */
        GMutex *clients_mutex;
        GList *clients;
@@ -115,10 +115,10 @@ e_cal_backend_set_property (GObject *object, guint property_id, const GValue *va
 {
        ECalBackend *backend;
        ECalBackendPrivate *priv;
-       
+
        backend = E_CAL_BACKEND (object);
        priv = backend->priv;
-       
+
        switch (property_id) {
        case PROP_SOURCE:
                {
@@ -160,7 +160,7 @@ e_cal_backend_get_property (GObject *object, guint property_id, GValue *value, G
 {
        ECalBackend *backend;
        ECalBackendPrivate *priv;
-       
+
        backend = E_CAL_BACKEND (object);
        priv = backend->priv;
 
@@ -194,22 +194,22 @@ e_cal_backend_class_init (ECalBackendClass *class)
        object_class->get_property = e_cal_backend_get_property;
        object_class->finalize = e_cal_backend_finalize;
 
-       g_object_class_install_property (object_class, PROP_SOURCE, 
+       g_object_class_install_property (object_class, PROP_SOURCE,
                                         g_param_spec_object ("source", NULL, NULL, E_TYPE_SOURCE,
                                                              G_PARAM_READABLE | G_PARAM_WRITABLE
                                                              | G_PARAM_CONSTRUCT_ONLY));
 
-       g_object_class_install_property (object_class, PROP_URI, 
+       g_object_class_install_property (object_class, PROP_URI,
                                         g_param_spec_string ("uri", NULL, NULL, "",
                                                              G_PARAM_READABLE | G_PARAM_WRITABLE
                                                              | G_PARAM_CONSTRUCT_ONLY));
 
-       g_object_class_install_property (object_class, PROP_KIND, 
-                                        g_param_spec_ulong ("kind", NULL, NULL, 
-                                                            ICAL_NO_COMPONENT, ICAL_XLICMIMEPART_COMPONENT, 
+       g_object_class_install_property (object_class, PROP_KIND,
+                                        g_param_spec_ulong ("kind", NULL, NULL,
+                                                            ICAL_NO_COMPONENT, ICAL_XLICMIMEPART_COMPONENT,
                                                             ICAL_NO_COMPONENT,
                                                             G_PARAM_READABLE | G_PARAM_WRITABLE
-                                                            | G_PARAM_CONSTRUCT_ONLY));        
+                                                            | G_PARAM_CONSTRUCT_ONLY));
        e_cal_backend_signals[LAST_CLIENT_GONE] =
                g_signal_new ("last_client_gone",
                              G_TYPE_FROM_CLASS (class),
@@ -249,7 +249,7 @@ e_cal_backend_class_init (ECalBackendClass *class)
        class->is_read_only = NULL;
        class->start_query = NULL;
        class->get_mode = NULL;
-       class->set_mode = NULL; 
+       class->set_mode = NULL;
        class->get_object = NULL;
        class->get_default_object = NULL;
        class->get_object_list = NULL;
@@ -297,7 +297,7 @@ e_cal_backend_finalize (GObject *object)
 
        g_mutex_free (priv->clients_mutex);
        g_mutex_free (priv->queries_mutex);
-       
+
        g_free (priv->uri);
        g_object_unref (priv->source);
        g_free (priv);
@@ -319,12 +319,12 @@ ESource *
 e_cal_backend_get_source (ECalBackend *backend)
 {
        ECalBackendPrivate *priv;
-       
+
        g_return_val_if_fail (backend != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND (backend), NULL);
 
        priv = backend->priv;
-       
+
        return priv->source;
 }
 
@@ -341,12 +341,12 @@ const char *
 e_cal_backend_get_uri (ECalBackend *backend)
 {
        ECalBackendPrivate *priv;
-       
+
        g_return_val_if_fail (backend != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND (backend), NULL);
 
        priv = backend->priv;
-       
+
        return priv->uri;
 }
 
@@ -362,12 +362,12 @@ icalcomponent_kind
 e_cal_backend_get_kind (ECalBackend *backend)
 {
        ECalBackendPrivate *priv;
-       
+
        g_return_val_if_fail (backend != NULL, ICAL_NO_COMPONENT);
        g_return_val_if_fail (E_IS_CAL_BACKEND (backend), ICAL_NO_COMPONENT);
 
        priv = backend->priv;
-       
+
        return priv->kind;
 }
 
@@ -405,14 +405,14 @@ void
 e_cal_backend_add_client (ECalBackend *backend, EDataCal *cal)
 {
        ECalBackendPrivate *priv;
-       
+
        g_return_if_fail (backend != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
        g_return_if_fail (cal != NULL);
        g_return_if_fail (E_IS_DATA_CAL (cal));
 
        priv = backend->priv;
-       
+
        bonobo_object_set_immortal (BONOBO_OBJECT (cal), TRUE);
 
        g_object_weak_ref (G_OBJECT (cal), cal_destroy_cb, backend);
@@ -435,7 +435,7 @@ void
 e_cal_backend_remove_client (ECalBackend *backend, EDataCal *cal)
 {
        ECalBackendPrivate *priv;
-       
+
        /* XXX this needs a bit more thinking wrt the mutex - we
           should be holding it when we check to see if clients is
           NULL */
@@ -476,7 +476,7 @@ e_cal_backend_add_query (ECalBackend *backend, EDataCalView *query)
        g_mutex_lock (backend->priv->queries_mutex);
 
        e_list_append (backend->priv->queries, query);
-       
+
        g_mutex_unlock (backend->priv->queries_mutex);
 }
 
@@ -638,9 +638,9 @@ e_cal_backend_remove (ECalBackend *backend, EDataCal *cal)
 /**
  * e_cal_backend_is_loaded:
  * @backend: A calendar backend.
- * 
+ *
  * Queries whether a calendar backend has been loaded yet.
- * 
+ *
  * Return value: TRUE if the backend has been loaded with data, FALSE
  * otherwise.
  */
@@ -683,7 +683,7 @@ e_cal_backend_is_read_only (ECalBackend *backend, EDataCal *cal)
  *
  * Starts a new live query on the given backend.
  */
-void 
+void
 e_cal_backend_start_query (ECalBackend *backend, EDataCalView *query)
 {
        g_return_if_fail (backend != NULL);
@@ -695,10 +695,10 @@ e_cal_backend_start_query (ECalBackend *backend, EDataCalView *query)
 
 /**
  * e_cal_backend_get_mode:
- * @backend: A calendar backend. 
- * 
+ * @backend: A calendar backend.
+ *
  * Queries whether a calendar backend is connected remotely.
- * 
+ *
  * Return value: The current mode the calendar is in
  **/
 CalMode
@@ -720,8 +720,8 @@ e_cal_backend_get_mode (ECalBackend *backend)
  * e_cal_backend_set_mode:
  * @backend: A calendar backend
  * @mode: Mode to change to
- * 
- * Sets the mode of the calendar 
+ *
+ * Sets the mode of the calendar
  */
 void
 e_cal_backend_set_mode (ECalBackend *backend, CalMode mode)
@@ -776,7 +776,7 @@ e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const char *uid,
  * @backend: A calendar backend.
  * @cal: An #EDataCal object.
  * @sexp: Expression to search for.
- * 
+ *
  * Calls the get_object_list method on the given backend.
  */
 void
@@ -796,7 +796,7 @@ e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const char *
  * @uid: Unique identifier for a calendar object.
  * @rid: ID for the object's recurrence to get.
  *
- * Queries a calendar backend for attachments present in a calendar object based 
+ * Queries a calendar backend for attachments present in a calendar object based
  * on its unique identifier and its recurrence ID (if a recurrent appointment).
  */
 void
@@ -817,7 +817,7 @@ e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const ch
  * @users: List of users to get free/busy information for.
  * @start: Start time for query.
  * @end: End time for query.
- * 
+ *
  * Gets a free/busy object for the given time interval
  */
 void
@@ -837,12 +837,12 @@ e_cal_backend_get_free_busy (ECalBackend *backend, EDataCal *cal, GList *users,
  * @backend: A calendar backend.
  * @cal: An #EDataCal object.
  * @change_id: A unique uid for the callers change list
- * 
+ *
  * Builds a sequence of objects and the type of change that occurred on them since
  * the last time the give change_id was seen
  */
 void
-e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const char *change_id) 
+e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const char *change_id)
 {
        g_return_if_fail (backend != NULL);
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
@@ -924,7 +924,7 @@ e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const char *ca
  * @uid: Unique identifier of the object to remove.
  * @rid: A recurrence ID.
  * @mod: Type of removal.
- * 
+ *
  * Removes an object in a calendar backend.  The backend will notify all of its
  * clients about the change.
  */
@@ -983,7 +983,7 @@ e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const char *cal
  * @cal: An #EDataCal object.
  * @tzid: Unique identifier of a VTIMEZONE object. Note that this must not be
  * NULL.
- * 
+ *
  * Returns the icaltimezone* corresponding to the TZID, or NULL if the TZID
  * can't be found.
  */
@@ -1003,9 +1003,9 @@ e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const char *tzi
  * @backend: A calendar backend.
  * @cal: An #EDataCal object.
  * @tzobj: The timezone object, in a string.
- * 
+ *
  * Sets the default timezone for the calendar, which is used to resolve
- * DATE and floating DATE-TIME values. 
+ * DATE and floating DATE-TIME values.
  */
 void
 e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const char *tzobj)
@@ -1026,10 +1026,10 @@ e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const char
  * @backend: A calendar backend.
  * @cal: An #EDataCal object.
  * @tzid: The TZID identifying the timezone.
- * 
+ *
  * Sets the default timezone for the calendar, which is used to resolve
- * DATE and floating DATE-TIME values. 
- * 
+ * DATE and floating DATE-TIME values.
+ *
  */
 void
 e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const char *tzid)
@@ -1143,7 +1143,7 @@ e_cal_backend_notify_object_created (ECalBackend *backend, const char *calobj)
                query = QUERY (e_iterator_get (iter));
 
                bonobo_object_ref (query);
-               if (e_data_cal_view_object_matches (query, calobj))             
+               if (e_data_cal_view_object_matches (query, calobj))
                        e_data_cal_view_notify_objects_added_1 (query, calobj);
                bonobo_object_unref (query);
 
@@ -1167,13 +1167,13 @@ match_query_and_notify (EDataCalView *query, const char *old_object, const char
                e_data_cal_view_notify_objects_added_1 (query, object);
        else if (old_match) {
                ECalComponent *comp = NULL;
-       
+
                comp = e_cal_component_new_from_string (old_object);
                if (comp) {
                        ECalComponentId *id = e_cal_component_get_id (comp);
 
                        e_data_cal_view_notify_objects_removed_1 (query, id);
-                       
+
                        e_cal_component_free_id (id);
                        g_object_unref (comp);
                }
@@ -1272,7 +1272,7 @@ e_cal_backend_notify_view_done (ECalBackend *backend, GNOME_Evolution_Calendar_C
  * modified by non-EDS clients.
  **/
 void
-e_cal_backend_notify_object_modified (ECalBackend *backend, 
+e_cal_backend_notify_object_modified (ECalBackend *backend,
                                      const char *old_object, const char *object)
 {
        ECalBackendPrivate *priv;
@@ -1367,7 +1367,7 @@ e_cal_backend_notify_object_removed (ECalBackend *backend, const ECalComponentId
  **/
 void
 e_cal_backend_notify_mode (ECalBackend *backend,
-                          GNOME_Evolution_Calendar_CalListener_SetModeStatus status, 
+                          GNOME_Evolution_Calendar_CalListener_SetModeStatus status,
                           GNOME_Evolution_Calendar_CalMode mode)
 {
        ECalBackendPrivate *priv = backend->priv;
@@ -1394,7 +1394,7 @@ e_cal_backend_notify_auth_required (ECalBackend *backend)
 {
         ECalBackendPrivate *priv = backend->priv;
         GList *l;
-                                                                                                                             
+
         for (l = priv->clients; l; l = l->next)
                 e_data_cal_notify_auth_required (l->data);
 }
index 093f1bc..50560e6 100644 (file)
@@ -72,7 +72,7 @@ struct _ECalBackendClass {
        void (* get_alarm_email_address) (ECalBackend *backend, EDataCal *cal);
        void (* get_ldap_attribute) (ECalBackend *backend, EDataCal *cal);
        void (* get_static_capabilities) (ECalBackend *backend, EDataCal *cal);
-       
+
        void (* open) (ECalBackend *backend, EDataCal *cal, gboolean only_if_exists, const char *username, const char *password);
        void (* remove) (ECalBackend *backend, EDataCal *cal);
 
@@ -87,11 +87,11 @@ struct _ECalBackendClass {
        void (* send_objects) (ECalBackend *backend, EDataCal *cal, const char *calobj);
 
        void (* get_default_object) (ECalBackend *backend, EDataCal *cal);
-       void (* get_object) (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid);    
+       void (* get_object) (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid);
        void (* get_object_list) (ECalBackend *backend, EDataCal *cal, const char *sexp);
 
-       void (* get_attachment_list) (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid);   
-       
+       void (* get_attachment_list) (ECalBackend *backend, EDataCal *cal, const char *uid, const char *rid);
+
        /* Timezone related virtual methods */
        void (* get_timezone) (ECalBackend *backend, EDataCal *cal, const char *tzid);
        void (* add_timezone) (ECalBackend *backend, EDataCal *cal, const char *object);
@@ -174,7 +174,7 @@ void e_cal_backend_notify_object_modified (ECalBackend *backend, const char *old
 void e_cal_backend_notify_object_removed  (ECalBackend *backend, const ECalComponentId *id, const char *old_object, const char *object);
 
 void e_cal_backend_notify_mode      (ECalBackend *backend,
-                                    GNOME_Evolution_Calendar_CalListener_SetModeStatus status, 
+                                    GNOME_Evolution_Calendar_CalListener_SetModeStatus status,
                                     GNOME_Evolution_Calendar_CalMode mode);
 void e_cal_backend_notify_auth_required (ECalBackend *backend);
 void e_cal_backend_notify_error     (ECalBackend *backend, const char *message);
index d221eb9..2188e12 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2000-2003 Ximian, Inc.
  *
- * Authors: 
+ * Authors:
  *   Federico Mena-Quintero <federico@ximian.com>
  *   JP Rosevear <jpr@ximian.com>
  *
@@ -48,9 +48,9 @@ struct _EDataCalFactoryPrivate {
 
        /* Whether we have been registered with OAF yet */
        guint registered : 1;
-        
+
         int mode;
-        
+
 };
 
 /* Signal IDs */
@@ -74,7 +74,7 @@ calobjtype_to_icalkind (const GNOME_Evolution_Calendar_CalObjType type)
        case GNOME_Evolution_Calendar_TYPE_JOURNAL:
                return ICAL_VJOURNAL_COMPONENT;
        }
-       
+
        return ICAL_NO_COMPONENT;
 }
 
@@ -83,7 +83,7 @@ get_backend_factory (GHashTable *methods, const char *method, icalcomponent_kind
 {
        GHashTable *kinds;
        ECalBackendFactory *factory;
-       
+
        kinds = g_hash_table_lookup (methods, method);
        if (!kinds)
                return NULL;
@@ -150,7 +150,7 @@ impl_CalFactory_getCal (PortableServer_Servant servant,
        char *str_uri;
        EUri *uri;
        char *uri_type_string;
-       
+
        factory = E_DATA_CAL_FACTORY (bonobo_object_from_servant (servant));
        priv = factory->priv;
 
@@ -188,7 +188,7 @@ impl_CalFactory_getCal (PortableServer_Servant servant,
                bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CalFactory_UnsupportedMethod);
                goto cleanup;
        }
-               
+
        /* Duplicate the listener object */
        CORBA_exception_init (&ev2);
        listener_copy = CORBA_Object_duplicate (listener, &ev2);
@@ -220,7 +220,7 @@ impl_CalFactory_getCal (PortableServer_Servant servant,
                                  G_CALLBACK (backend_last_client_gone_cb),
                                  factory);
        }
-       
+
        /* Create the corba calendar */
        cal = e_data_cal_new (backend, listener);
        printf ("cal = %p\n", cal);
@@ -233,7 +233,7 @@ impl_CalFactory_getCal (PortableServer_Servant servant,
        /* Let the backend know about its clients corba clients */
        e_cal_backend_add_client (backend, cal);
        e_cal_backend_set_mode (backend, priv->mode);
-       
+
        ret_cal = CORBA_Object_duplicate (BONOBO_OBJREF (cal), ev);
  cleanup:
        e_uri_free (uri);
@@ -259,8 +259,8 @@ e_data_cal_factory_new (void)
 {
        EDataCalFactory *factory;
 
-       factory = g_object_new (E_TYPE_DATA_CAL_FACTORY, 
-                               "poa", bonobo_poa_get_threaded (ORBIT_THREAD_HINT_PER_REQUEST, NULL), 
+       factory = g_object_new (E_TYPE_DATA_CAL_FACTORY,
+                               "poa", bonobo_poa_get_threaded (ORBIT_THREAD_HINT_PER_REQUEST, NULL),
                                NULL);
 
        return factory;
@@ -324,7 +324,7 @@ e_data_cal_factory_class_init (EDataCalFactoryClass *klass)
        epv->getCal = impl_CalFactory_getCal;
 }
 
-static void 
+static void
 set_backend_online_status (gpointer key, gpointer value, gpointer data)
 {
        ECalBackend *backend = E_CAL_BACKEND (value);
@@ -339,12 +339,12 @@ set_backend_online_status (gpointer key, gpointer value, gpointer data)
  *
  * Sets the online mode for all backends created by the given factory.
  */
-void 
+void
 e_data_cal_factory_set_backend_mode (EDataCalFactory *factory, int mode)
 {
        EDataCalFactoryPrivate *priv = factory->priv;
-       
-       
+
+
        priv->mode = mode;
        g_hash_table_foreach (priv->backends, set_backend_online_status, GINT_TO_POINTER (priv->mode));
 }
@@ -359,9 +359,9 @@ e_data_cal_factory_init (EDataCalFactory *factory, EDataCalFactoryClass *klass)
        priv = g_new0 (EDataCalFactoryPrivate, 1);
        factory->priv = priv;
 
-       priv->methods = g_hash_table_new_full (g_str_hash, g_str_equal, 
+       priv->methods = g_hash_table_new_full (g_str_hash, g_str_equal,
                                               (GDestroyNotify) g_free, (GDestroyNotify) g_hash_table_destroy);
-       priv->backends = g_hash_table_new_full (g_str_hash, g_str_equal, 
+       priv->backends = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref);
        priv->registered = FALSE;
 }
@@ -375,10 +375,10 @@ BONOBO_TYPE_FUNC_FULL (EDataCalFactory,
  * e_data_cal_factory_register_storage:
  * @factory: A calendar factory.
  * @iid: OAFIID for the factory to be registered.
- * 
+ *
  * Registers a calendar factory with the OAF object activation daemon.  This
  * function must be called before any clients can activate the factory.
- * 
+ *
  * Return value: TRUE on success, FALSE otherwise.
  **/
 gboolean
@@ -432,7 +432,7 @@ e_data_cal_factory_register_storage (EDataCalFactory *factory, const char *iid)
  * e_data_cal_factory_register_backend:
  * @factory: A calendar factory.
  * @backend_factory: The object responsible for creating backends.
- * 
+ *
  * Registers an #ECalBackend subclass that will be used to handle URIs
  * with a particular method.  When the factory is asked to open a
  * particular URI, it will look in its list of registered methods and
@@ -473,7 +473,7 @@ e_data_cal_factory_register_backend (EDataCalFactory *factory, ECalBackendFactor
                kinds = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
                g_hash_table_insert (priv->methods, method_str, kinds);
        }
-       
+
        g_hash_table_insert (kinds, GINT_TO_POINTER (kind), backend_factory);
 }
 
index 6b3a580..fa2559c 100644 (file)
@@ -50,7 +50,7 @@ struct _EDataCalFactory {
 
 struct _EDataCalFactoryClass {
        BonoboObjectClass parent_class;
-       
+
        POA_GNOME_Evolution_Calendar_CalFactory__epv epv;
 
        /* Notification signals */
index d64dc81..2e85116 100644 (file)
@@ -133,7 +133,7 @@ uncache_with_id_cb (gpointer key, gpointer value, gpointer user_data)
                e_cal_component_get_uid (comp, &this_uid);
                if (this_uid && !strcmp (id->uid, this_uid)) {
                        if (id->rid && *id->rid) {
-                               const char *rid = e_cal_component_get_recurid_as_string (comp); 
+                               const char *rid = e_cal_component_get_recurid_as_string (comp);
 
                                if (rid && !strcmp (id->rid, rid))
                                        remove = TRUE;
@@ -172,7 +172,7 @@ listener_died_cb (EComponentListener *cl, gpointer data)
                if (ld->component_listener == cl) {
                        g_object_unref (ld->component_listener);
                        ld->component_listener = NULL;
-       
+
                        bonobo_object_release_unref (ld->listener, NULL);
                        ld->listener = NULL;
 
@@ -269,7 +269,7 @@ e_data_cal_view_set_property (GObject *object, guint property_id, const GValue *
 
        query = QUERY (object);
        priv = query->priv;
-       
+
        switch (property_id) {
        case PROP_BACKEND:
                priv->backend = E_CAL_BACKEND (g_value_get_object (value));
@@ -291,7 +291,7 @@ e_data_cal_view_get_property (GObject *object, guint property_id, GValue *value,
 {
        EDataCalView *query;
        EDataCalViewPrivate *priv;
-       
+
        query = QUERY (object);
        priv = query->priv;
 
@@ -323,7 +323,7 @@ e_data_cal_view_class_init (EDataCalViewClass *klass)
        GObjectClass *object_class;
        POA_GNOME_Evolution_Calendar_CalView__epv *epv = &klass->epv;
        GParamSpec *param;
-       
+
        object_class = (GObjectClass *) klass;
 
        parent_class = g_type_class_peek_parent (klass);
@@ -407,9 +407,9 @@ e_data_cal_view_finalize (GObject *object)
  * @backend: Calendar backend that the query object will monitor.
  * @ql: Listener for query results.
  * @sexp: Sexp that defines the query.
- * 
+ *
  * Creates a new query engine object that monitors a calendar backend.
- * 
+ *
  * Return value: A newly-created query object, or NULL on failure.
  **/
 EDataCalView *
@@ -505,13 +505,13 @@ gboolean
 e_data_cal_view_object_matches (EDataCalView *query, const char *object)
 {
        EDataCalViewPrivate *priv;
-       
+
        g_return_val_if_fail (query != NULL, FALSE);
        g_return_val_if_fail (IS_QUERY (query), FALSE);
        g_return_val_if_fail (object != NULL, FALSE);
 
        priv = query->priv;
-       
+
        return e_cal_backend_sexp_match_object (priv->sexp, object, priv->backend);
 }
 
@@ -628,7 +628,7 @@ e_data_cal_view_notify_objects_added (EDataCalView *query, const GList *objects)
        CORBA_Environment ev;
        const GList *l;
        int num_objs, i;
-       
+
        g_return_if_fail (query != NULL);
        g_return_if_fail (IS_QUERY (query));
 
@@ -677,7 +677,7 @@ e_data_cal_view_notify_objects_added_1 (EDataCalView *query, const char *object)
 {
        EDataCalViewPrivate *priv;
        GList objects;
-       
+
        g_return_if_fail (query != NULL);
        g_return_if_fail (IS_QUERY (query));
        g_return_if_fail (object != NULL);
@@ -706,7 +706,7 @@ e_data_cal_view_notify_objects_modified (EDataCalView *query, const GList *objec
        CORBA_Environment ev;
        const GList *l;
        int num_objs, i;
-       
+
        g_return_if_fail (query != NULL);
        g_return_if_fail (IS_QUERY (query));
 
@@ -755,7 +755,7 @@ e_data_cal_view_notify_objects_modified_1 (EDataCalView *query, const char *obje
 {
        EDataCalViewPrivate *priv;
        GList objects;
-       
+
        g_return_if_fail (query != NULL);
        g_return_if_fail (IS_QUERY (query));
        g_return_if_fail (object != NULL);
@@ -765,7 +765,7 @@ e_data_cal_view_notify_objects_modified_1 (EDataCalView *query, const char *obje
 
        objects.next = objects.prev = NULL;
        objects.data = (gpointer)object;
-       
+
        e_data_cal_view_notify_objects_modified (query, &objects);
 }
 
@@ -784,7 +784,7 @@ e_data_cal_view_notify_objects_removed (EDataCalView *query, const GList *ids)
        CORBA_Environment ev;
        const GList *l;
        int num_ids, i;
-       
+
        g_return_if_fail (query != NULL);
        g_return_if_fail (IS_QUERY (query));
 
@@ -794,27 +794,27 @@ e_data_cal_view_notify_objects_removed (EDataCalView *query, const GList *ids)
        num_ids = g_list_length ((GList*)ids);
        if (num_ids <= 0)
                return;
-       
+
        id_list._buffer = GNOME_Evolution_Calendar_CalObjIDSeq_allocbuf (num_ids);
        id_list._maximum = num_ids;
        id_list._length = num_ids;
-       
+
        i = 0;
        for (l = ids; l; l = l->next, i++) {
                ECalComponentId *id = l->data;
                GNOME_Evolution_Calendar_CalObjID *c_id = &id_list._buffer[i];
 
                c_id->uid = CORBA_string_dup (id->uid);
-               
+
                if (id->rid)
                        c_id->rid = CORBA_string_dup (id->rid);
                else
-                       c_id->rid = CORBA_string_dup ("");      
+                       c_id->rid = CORBA_string_dup ("");
 
                /* update our cache */
                remove_object_from_cache (query, l->data);
        }
+
        for (l = priv->listeners; l != NULL; l = l->next) {
                ListenerData *ld = l->data;
 
@@ -842,7 +842,7 @@ e_data_cal_view_notify_objects_removed_1 (EDataCalView *query, const ECalCompone
 {
        EDataCalViewPrivate *priv;
        GList ids;
-       
+
        g_return_if_fail (query != NULL);
        g_return_if_fail (IS_QUERY (query));
        g_return_if_fail (id != NULL);
@@ -852,7 +852,7 @@ e_data_cal_view_notify_objects_removed_1 (EDataCalView *query, const ECalCompone
 
        ids.next = ids.prev = NULL;
        ids.data = (gpointer)id;
-       
+
        e_data_cal_view_notify_objects_removed (query, &ids);
 }
 
@@ -867,7 +867,7 @@ e_data_cal_view_notify_objects_removed_1 (EDataCalView *query, const ECalCompone
 void
 e_data_cal_view_notify_progress (EDataCalView *query, const char *message, int percent)
 {
-       EDataCalViewPrivate *priv;      
+       EDataCalViewPrivate *priv;
        CORBA_Environment ev;
        GList *l;
 
@@ -901,7 +901,7 @@ e_data_cal_view_notify_progress (EDataCalView *query, const char *message, int p
 void
 e_data_cal_view_notify_done (EDataCalView *query, GNOME_Evolution_Calendar_CallStatus status)
 {
-       EDataCalViewPrivate *priv;      
+       EDataCalViewPrivate *priv;
        CORBA_Environment ev;
        GList *l;
 
index 6ab7ecc..550cce9 100644 (file)
@@ -74,7 +74,7 @@ impl_Cal_open (PortableServer_Servant servant,
 {
        EDataCal *cal;
        EDataCalPrivate *priv;
-       
+
        cal = E_DATA_CAL (bonobo_object_from_servant (servant));
        priv = cal->priv;
 
@@ -87,7 +87,7 @@ impl_Cal_remove (PortableServer_Servant servant,
 {
        EDataCal *cal;
        EDataCalPrivate *priv;
-       
+
        cal = E_DATA_CAL (bonobo_object_from_servant (servant));
        priv = cal->priv;
 
@@ -107,7 +107,7 @@ impl_Cal_isReadOnly (PortableServer_Servant servant,
 
        e_cal_backend_is_read_only (priv->backend, cal);
 }
-                      
+
 /* Cal::getEmailAddress method */
 static void
 impl_Cal_getCalAddress (PortableServer_Servant servant,
@@ -121,7 +121,7 @@ impl_Cal_getCalAddress (PortableServer_Servant servant,
 
        e_cal_backend_get_cal_address (priv->backend, cal);
 }
-                      
+
 /* Cal::get_alarm_email_address method */
 static void
 impl_Cal_getAlarmEmailAddress (PortableServer_Servant servant,
@@ -135,7 +135,7 @@ impl_Cal_getAlarmEmailAddress (PortableServer_Servant servant,
 
        e_cal_backend_get_alarm_email_address (priv->backend, cal);
 }
-                      
+
 /* Cal::get_ldap_attribute method */
 static void
 impl_Cal_getLdapAttribute (PortableServer_Servant servant,
@@ -172,7 +172,7 @@ impl_Cal_setMode (PortableServer_Servant servant,
 {
        EDataCal *cal;
        EDataCalPrivate *priv;
-       
+
        cal = E_DATA_CAL (bonobo_object_from_servant (servant));
        priv = cal->priv;
 
@@ -185,10 +185,10 @@ impl_Cal_getDefaultObject (PortableServer_Servant servant,
 {
        EDataCal *cal;
        EDataCalPrivate *priv;
+
        cal = E_DATA_CAL (bonobo_object_from_servant (servant));
        priv = cal->priv;
+
        e_cal_backend_get_default_object (priv->backend, cal);
 }
 
@@ -217,7 +217,7 @@ impl_Cal_getObjectList (PortableServer_Servant servant,
        EDataCal *cal;
        EDataCalPrivate *priv;
        EDataCalView *query;
-       
+
        cal = E_DATA_CAL (bonobo_object_from_servant (servant));
        priv = cal->priv;
 
@@ -396,7 +396,7 @@ impl_Cal_getQuery (PortableServer_Servant servant,
        EDataCalPrivate *priv;
        EDataCalView *query;
        ECalBackendSExp *obj_sexp;
-       
+
        cal = E_DATA_CAL (bonobo_object_from_servant (servant));
        priv = cal->priv;
 
@@ -518,7 +518,7 @@ e_data_cal_construct (EDataCal *cal,
        CORBA_exception_free (&ev);
 
        priv->backend = backend;
-       
+
        return cal;
 }
 
@@ -542,7 +542,7 @@ e_data_cal_new (ECalBackend *backend, GNOME_Evolution_Calendar_CalListener liste
        g_return_val_if_fail (backend != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND (backend), NULL);
 
-       cal = E_DATA_CAL (g_object_new (E_TYPE_DATA_CAL, 
+       cal = E_DATA_CAL (g_object_new (E_TYPE_DATA_CAL,
                                 "poa", bonobo_poa_get_threaded (ORBIT_THREAD_HINT_PER_REQUEST, NULL),
                                 NULL));
 
@@ -605,7 +605,7 @@ e_data_cal_finalize (GObject *object)
        priv = cal->priv;
 
        priv->backend = NULL;
-       
+
        CORBA_exception_init (&ev);
        bonobo_object_release_unref (priv->listener, &ev);
        if (BONOBO_EX (&ev))
@@ -691,7 +691,7 @@ BONOBO_TYPE_FUNC_FULL (EDataCal, GNOME_Evolution_Calendar_Cal, PARENT_TYPE, e_da
  *
  * Notifies listeners of the completion of the is_read_only method call.
  */
-void 
+void
 e_data_cal_notify_read_only (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, gboolean read_only)
 {
        EDataCalPrivate *priv;
@@ -709,7 +709,7 @@ e_data_cal_notify_read_only (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus
        if (BONOBO_EX (&ev))
                g_message (G_STRLOC ": could not notify the listener of read only");
 
-       CORBA_exception_free (&ev);     
+       CORBA_exception_free (&ev);
 }
 
 /**
@@ -720,7 +720,7 @@ e_data_cal_notify_read_only (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus
  *
  * Notifies listeners of the completion of the get_cal_address method call.
  */
-void 
+void
 e_data_cal_notify_cal_address (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, const char *address)
 {
        EDataCalPrivate *priv;
@@ -738,7 +738,7 @@ e_data_cal_notify_cal_address (EDataCal *cal, GNOME_Evolution_Calendar_CallStatu
        if (BONOBO_EX (&ev))
                g_message (G_STRLOC ": could not notify the listener of cal address");
 
-       CORBA_exception_free (&ev);     
+       CORBA_exception_free (&ev);
 }
 
 /**
@@ -836,7 +836,7 @@ e_data_cal_notify_static_capabilities (EDataCal *cal, GNOME_Evolution_Calendar_C
  *
  * Notifies listeners of the completion of the open method call.
  */
-void 
+void
 e_data_cal_notify_open (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status)
 {
        EDataCalPrivate *priv;
@@ -931,7 +931,7 @@ e_data_cal_notify_object_created (EDataCal *cal, GNOME_Evolution_Calendar_CallSt
  * Notifies listeners of the completion of the modify_object method call.
  */
 void
-e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, 
+e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
                                   const char *old_object, const char *object)
 {
        EDataCalPrivate *priv;
@@ -967,7 +967,7 @@ e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallS
  * Notifies listeners of the completion of the remove_object method call.
  */
 void
-e_data_cal_notify_object_removed (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, 
+e_data_cal_notify_object_removed (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
                                  const ECalComponentId *id, const char *old_object, const char *object)
 {
        EDataCalPrivate *priv;
@@ -1044,7 +1044,7 @@ e_data_cal_notify_alarm_discarded (EDataCal *cal, GNOME_Evolution_Calendar_CallS
        if (BONOBO_EX (&ev))
                g_message (G_STRLOC ": could not notify the listener of alarm discarded");
 
-       CORBA_exception_free (&ev);     
+       CORBA_exception_free (&ev);
 }
 
 /**
@@ -1104,7 +1104,7 @@ e_data_cal_notify_default_object (EDataCal *cal, GNOME_Evolution_Calendar_CallSt
 {
        EDataCalPrivate *priv;
        CORBA_Environment ev;
-       
+
        g_return_if_fail (cal != NULL);
        g_return_if_fail (E_IS_DATA_CAL (cal));
 
@@ -1113,7 +1113,7 @@ e_data_cal_notify_default_object (EDataCal *cal, GNOME_Evolution_Calendar_CallSt
 
        CORBA_exception_init (&ev);
 
-       GNOME_Evolution_Calendar_CalListener_notifyDefaultObjectRequested (priv->listener, status, 
+       GNOME_Evolution_Calendar_CalListener_notifyDefaultObjectRequested (priv->listener, status,
                                                                           object ? object : "", &ev);
 
        if (BONOBO_EX (&ev))
@@ -1135,7 +1135,7 @@ e_data_cal_notify_object (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus sta
 {
        EDataCalPrivate *priv;
        CORBA_Environment ev;
-       
+
        g_return_if_fail (cal != NULL);
        g_return_if_fail (E_IS_DATA_CAL (cal));
 
@@ -1169,7 +1169,7 @@ e_data_cal_notify_object_list (EDataCal *cal, GNOME_Evolution_Calendar_CallStatu
        GNOME_Evolution_Calendar_stringlist seq;
        GList *l;
        int i;
-       
+
        g_return_if_fail (cal != NULL);
        g_return_if_fail (E_IS_DATA_CAL (cal));
 
@@ -1213,7 +1213,7 @@ e_data_cal_notify_attachment_list (EDataCal *cal, GNOME_Evolution_Calendar_CallS
        GNOME_Evolution_Calendar_stringlist seq;
        GSList *l;
        int i;
-       
+
        g_return_if_fail (cal != NULL);
        g_return_if_fail (E_IS_DATA_CAL (cal));
 
@@ -1267,7 +1267,7 @@ e_data_cal_notify_query (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus stat
        if (BONOBO_EX (&ev))
                g_message (G_STRLOC ": could not notify the listener of query");
 
-       CORBA_exception_free (&ev);     
+       CORBA_exception_free (&ev);
 }
 
 /**
@@ -1364,13 +1364,13 @@ e_data_cal_notify_default_timezone_set (EDataCal *cal, GNOME_Evolution_Calendar_
  * Notifies listeners of the completion of the get_changes method call.
  */
 void
-e_data_cal_notify_changes (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, 
+e_data_cal_notify_changes (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
                           GList *adds, GList *modifies, GList *deletes)
 {
        EDataCalPrivate *priv;
        CORBA_Environment ev;
        GNOME_Evolution_Calendar_CalObjChangeSeq seq;
-       GList *l;       
+       GList *l;
        int n, i;
 
        g_return_if_fail (E_IS_DATA_CAL (cal));
@@ -1386,7 +1386,7 @@ e_data_cal_notify_changes (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus st
        i = 0;
        for (l = adds; l; i++, l = l->next) {
                GNOME_Evolution_Calendar_CalObjChange *change = &seq._buffer[i];
-               
+
                change->calobj = CORBA_string_dup (l->data);
                change->type = GNOME_Evolution_Calendar_ADDED;
        }
@@ -1404,7 +1404,7 @@ e_data_cal_notify_changes (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus st
                change->calobj = CORBA_string_dup (l->data);
                change->type = GNOME_Evolution_Calendar_DELETED;
        }
-       
+
        CORBA_exception_init (&ev);
        GNOME_Evolution_Calendar_CalListener_notifyChanges (priv->listener, status, &seq, &ev);
 
@@ -1432,7 +1432,7 @@ e_data_cal_notify_free_busy (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus
        GNOME_Evolution_Calendar_CalObjSeq seq;
        GList *l;
        int n, i;
-       
+
        g_return_if_fail (E_IS_DATA_CAL (cal));
 
        priv = cal->priv;
@@ -1445,7 +1445,7 @@ e_data_cal_notify_free_busy (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus
 
        for (i = 0, l = freebusy; l; i++, l = l->next)
                seq._buffer[i] = CORBA_string_dup (l->data);
-       
+
        CORBA_exception_init (&ev);
        GNOME_Evolution_Calendar_CalListener_notifyFreeBusy (priv->listener, status, &seq, &ev);
 
@@ -1462,7 +1462,7 @@ e_data_cal_notify_free_busy (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus
  * @cal: A calendar client interface.
  * @status: Status of the mode set.
  * @mode: The current mode.
- * 
+ *
  * Notifies the listener of the results of a set_mode call.
  **/
 void
@@ -1486,7 +1486,7 @@ e_data_cal_notify_mode (EDataCal *cal,
                g_message ("e_data_cal_notify_mode(): could not notify the listener "
                           "about a mode change");
 
-       CORBA_exception_free (&ev);     
+       CORBA_exception_free (&ev);
 }
 
 /**
@@ -1495,18 +1495,18 @@ e_data_cal_notify_mode (EDataCal *cal,
  *
  * Notifies listeners that authorization is required to open the calendar.
  */
-void 
+void
 e_data_cal_notify_auth_required (EDataCal *cal)
 {
        EDataCalPrivate *priv;
        CORBA_Environment ev;
-       
+
        g_return_if_fail (cal != NULL);
        g_return_if_fail (E_IS_DATA_CAL (cal));
-       
+
        priv = cal->priv;
        g_return_if_fail (priv->listener != CORBA_OBJECT_NIL);
-       
+
        CORBA_exception_init (&ev);
        GNOME_Evolution_Calendar_CalListener_notifyAuthRequired (priv->listener,  &ev);
        if (BONOBO_EX (&ev))
index ec54f19..46db23b 100644 (file)
@@ -80,9 +80,9 @@ void e_data_cal_notify_remove (EDataCal *cal, GNOME_Evolution_Calendar_CallStatu
 
 void e_data_cal_notify_object_created  (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
                                        const char *uid, const char *object);
-void e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, 
+void e_data_cal_notify_object_modified (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
                                        const char *old_object, const char *object);
-void e_data_cal_notify_object_removed  (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status, 
+void e_data_cal_notify_object_removed  (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
                                        const ECalComponentId *id, const char *old_object, const char *object);
 void e_data_cal_notify_alarm_discarded (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status);
 
@@ -111,8 +111,8 @@ void e_data_cal_notify_changes   (EDataCal *cal, GNOME_Evolution_Calendar_CallSt
 void e_data_cal_notify_free_busy (EDataCal *cal, GNOME_Evolution_Calendar_CallStatus status,
                                  GList *freebusy);
 
-void e_data_cal_notify_mode  (EDataCal *cal, 
-                             GNOME_Evolution_Calendar_CalListener_SetModeStatus status, 
+void e_data_cal_notify_mode  (EDataCal *cal,
+                             GNOME_Evolution_Calendar_CalListener_SetModeStatus status,
                              GNOME_Evolution_Calendar_CalMode mode);
 
 void e_data_cal_notify_auth_required (EDataCal *cal);
index 89829f1..923bb2a 100644 (file)
@@ -62,7 +62,7 @@ static void
 objects_added_cb (GObject *object, GList *objects, gpointer data)
 {
        GList *l;
-       
+
        for (l = objects; l; l = l->next)
                cl_printf (data, "Object added %s\n", icalcomponent_get_uid (l->data));
 }
@@ -71,7 +71,7 @@ static void
 objects_modified_cb (GObject *object, GList *objects, gpointer data)
 {
        GList *l;
-       
+
        for (l = objects; l; l = l->next)
                cl_printf (data, "Object modified %s\n", icalcomponent_get_uid (l->data));
 }
@@ -80,7 +80,7 @@ static void
 objects_removed_cb (GObject *object, GList *objects, gpointer data)
 {
        GList *l;
-       
+
        for (l = objects; l; l = l->next)
                cl_printf (data, "Object removed %s\n", icalcomponent_get_uid (l->data));
 }
@@ -96,10 +96,10 @@ list_uids (ECal *client)
 {
        GList *objects = NULL;
        GList *l;
-       
+
        if (!e_cal_get_object_list (client, "(contains? \"any\" \"test\")", &objects, NULL))
                return FALSE;
-       
+
        cl_printf (client, "UIDS: ");
 
        cl_printf (client, "\nGot %d objects\n", g_list_length (objects));
@@ -142,7 +142,7 @@ client_destroy_cb (gpointer data, GObject *object)
                g_main_loop_quit (loop);
 }
 
-static char * 
+static char *
 test_object_creation (ECal *client,  char **uid)
 {
        ECalComponent *comp, *comp_retrieved;
@@ -153,7 +153,7 @@ test_object_creation (ECal *client,  char **uid)
        ECalComponentTransparency transp;
        gboolean compare;
        GError *error = NULL;
-       
+
        comp = e_cal_component_new ();
        /* set fields */
        e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
@@ -169,10 +169,10 @@ test_object_creation (ECal *client,  char **uid)
        dt.tzid ="UTC";
        e_cal_component_set_dtend (comp, &dt);
        e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
-       
+
 
        e_cal_component_commit_sequence (comp);
-       icalcomp = e_cal_component_get_icalcomponent (comp); 
+       icalcomp = e_cal_component_get_icalcomponent (comp);
        if (!e_cal_create_object (client, icalcomp, uid, &error)) {
                cl_printf (client, "Object creation:  %s\n", error->message);
                g_free (comp);
@@ -198,26 +198,26 @@ test_object_creation (ECal *client,  char **uid)
                g_free (icalcomp_retrieved);
                return "Test Object Creation failed";
 
-       }       
+       }
        /* Dumping icalcomp into a string is not useful as the retrieved object
-        * has some generated information like timestamps. We compare 
+        * has some generated information like timestamps. We compare
         * member values we set during creation*/
        compare = e_cal_component_event_dates_match (comp, comp_retrieved);
-       
+
        if (compare) {
                e_cal_component_get_transparency (comp_retrieved, &transp);
-               compare = (transp == E_CAL_COMPONENT_TRANSP_OPAQUE); 
+               compare = (transp == E_CAL_COMPONENT_TRANSP_OPAQUE);
        }
-       
+
        g_free (comp_retrieved);
        g_free (comp);
        g_free (icalcomp);
        g_free (icalcomp_retrieved);
-       
+
        mu_assert ("Test Object creation : Created object does not match retrieved data\n", compare);
        return NULL;
 }
-       
+
 static char *
 test_object_modification (ECal *client, char *uid)
 {
@@ -225,7 +225,7 @@ test_object_modification (ECal *client, char *uid)
        icalcomponent *icalcomp, *icalcomp_modified;
        gboolean compare;
        GError *error = NULL;
-       
+
        if (!e_cal_get_object (client, uid, NULL, &icalcomp, &error)) {
                cl_printf (client, "Test Modify object : Could not get the object: %s\n", error->message);
                g_free (uid);
@@ -263,39 +263,39 @@ test_object_modification (ECal *client, char *uid)
 static char *
 test_object_removal (ECal *client)
 {
-       
+
        char *uid;
        ECalComponent *comp;
        icalcomponent *icalcomp;
        gboolean compare = 1;
        GError *error = NULL;
-       
+
        comp = e_cal_component_new ();
        e_cal_component_commit_sequence (comp);
-       icalcomp = e_cal_component_get_icalcomponent (comp); 
+       icalcomp = e_cal_component_get_icalcomponent (comp);
        if (!e_cal_create_object (client, icalcomp, &uid, &error)) {
                cl_printf (client, "Test object removal - Object creation:  %s\n", error->message);
                g_object_unref (comp);
                g_object_unref(icalcomp);
                return "Test Object Removal failed\n";
        }
-       
+
        if (!e_cal_remove_object (client, uid, &error)) {
                cl_printf (client, "Test object removal - Could not remove the object\n");
                g_free (uid);
                g_object_unref (comp);
                g_object_unref (icalcomp);
                return "Test Object Removal failed\n";
-               
-       }       
+
+       }
 
        compare =  e_cal_get_object (client, uid, NULL, &icalcomp, &error);
 
        g_free (uid);
        g_object_unref (comp);
        g_object_unref (icalcomp);
-       
-       mu_assert ("Test object removal - Failed\n", compare);  
+
+       mu_assert ("Test object removal - Failed\n", compare);
        return NULL;
 }
 #endif
@@ -307,22 +307,22 @@ test_get_alarms_in_range (ECal *client)
        icaltimezone *utc;
        time_t start = time (NULL), end;
        gboolean compare;
-       
+
        utc = icaltimezone_get_utc_timezone ();
        start = time_from_isodate ("20040212T000000Z");
        end = time_add_day_with_zone (start, 2, utc);
 
        alarms = e_cal_get_alarms_in_range (client, start, end);
-       compare = (g_slist_length (alarms) == 3); 
-       
+       compare = (g_slist_length (alarms) == 3);
+
        e_cal_free_alarms (alarms);
        mu_assert ("Test getting alarms in range\n", compare);
-       
+
        return NULL;
 }
 
 static char *
-test_set_uri (ECal *client, const gchar *uri) 
+test_set_uri (ECal *client, const gchar *uri)
 {
        /* The uri is set as part of create_client call. This method merely
         * verifies it was done correctly.
@@ -331,10 +331,10 @@ test_set_uri (ECal *client, const gchar *uri)
        gboolean compare = 0;
        cal_uri = g_strconcat ("file://", uri, NULL);
        compare = !strcmp (e_cal_get_uri (client), cal_uri);
-       
+
        g_free (cal_uri);
-       mu_assert ("Test set_uri : uri was not set correctly\n", compare);  
-       
+       mu_assert ("Test set_uri : uri was not set correctly\n", compare);
+
        return NULL;
 }
 
@@ -343,7 +343,7 @@ test_cal_loaded (ECal *client)
 {
        /* Test one loaded calendar and another that is not loaded. */
        mu_assert ("Test get_cal_load_state : Failed \n",
-                       (E_CAL_LOAD_LOADED == e_cal_get_load_state (client)) && 
+                       (E_CAL_LOAD_LOADED == e_cal_get_load_state (client)) &&
                        (E_CAL_LOAD_NOT_LOADED == e_cal_get_load_state (NULL)));
 
        return NULL;
@@ -356,7 +356,7 @@ test_get_source (ECal *client, const gchar *expected)
        char *uri;
        char *cal_uri;
        gboolean compare = 0;
-       
+
        source = e_cal_get_source (client);
        uri = e_source_get_uri (source);
        cal_uri = g_strconcat ("file://", expected, NULL);
@@ -364,7 +364,7 @@ test_get_source (ECal *client, const gchar *expected)
 
        g_free (cal_uri);
        mu_assert ("Test get_source : Failed\n", compare);
-                       
+
        return NULL;
 }
 
@@ -373,7 +373,7 @@ test_query (ECal *client, const char *query, int expected)
 {
        /* This uses pre-loaded data. Hence its results are valid only
         * when called before any write operation is performed.
-        */ 
+        */
        int i = 0;
        GList *objects = NULL;
 
@@ -381,7 +381,7 @@ test_query (ECal *client, const char *query, int expected)
                return "Could not get the list of objects";
        i = g_list_length (objects);
        e_cal_free_object_list (objects);
-       
+
        mu_assert ("Test get_object_list : Expected number of objects not found", i == expected);
 
        return NULL;
@@ -394,7 +394,7 @@ test_e_cal_new (ECal **cal, const char *uri)
        GError *error = NULL;
        char *cal_uri, *cal_file;
        gboolean created = 0;
-       
+
        cal_uri = g_strconcat ("file://", uri, NULL);
        *cal = e_cal_new_from_uri (cal_uri, E_CAL_SOURCE_TYPE_EVENT);
        if (!*cal) {
@@ -419,7 +419,7 @@ test_e_cal_new (ECal **cal, const char *uri)
        g_free (cal_file);
 
        mu_assert ("Test creation of new calendar : Failed", created);
-       
+
        return NULL;
 }
 
@@ -429,19 +429,19 @@ test_e_cal_remove (ECal *ecal, const char *uri)
        char *cal_uri;
        GError *error = NULL;
        gboolean removed = 0;
-       
+
        cal_uri = g_strconcat (uri, "/calendar.ics", NULL);
        if (!e_cal_remove (ecal, &error)) {
                cl_printf (ecal, "Test Calendar removal : Could not remove the Calendar : %s\n", error->message);
        }
-       
+
        removed = !g_file_test (uri, G_FILE_TEST_EXISTS);
        g_free (cal_uri);
-       
+
        mu_assert ("Test Remove calendar : Failed ", removed);
-       
+
        return NULL;
-} 
+}
 #endif
 
 static char *
@@ -450,14 +450,14 @@ test_new_system_calendar(void)
        ECal *cal;
        char *uri;
        gboolean created;
-       
+
        cal = e_cal_new_system_calendar ();
        uri = g_build_filename (g_get_home_dir (), ".evolution", "calendar", "local", "system", "calendar.ics", NULL);
        created = g_file_test (uri, G_FILE_TEST_EXISTS);
        g_free (uri);
-       
+
        mu_assert ("Test creation of default system calendar : Failed", created);
-       
+
        return NULL;
 }
 
@@ -467,14 +467,14 @@ test_new_system_tasks(void)
        ECal *cal;
        char *uri;
        gboolean created;
-       
+
        cal = e_cal_new_system_tasks ();
        uri = g_build_filename (g_get_home_dir (), ".evolution", "tasks", "local", "system", "tasks.ics", NULL);
        created = g_file_test (uri, G_FILE_TEST_EXISTS);
        g_free (uri);
-       
+
        mu_assert ("Test creation of default system tasks : Failed", created);
-       
+
        return NULL;
 }
 
@@ -484,14 +484,14 @@ test_new_system_memos(void)
        ECal *cal;
        char *uri;
        gboolean created;
-       
+
        cal = e_cal_new_system_memos ();
        uri = g_build_filename (g_get_home_dir (), ".evolution", "memos", "local", "system", "journal.ics", NULL);
        created = g_file_test (uri, G_FILE_TEST_EXISTS);
        g_free (uri);
-       
+
        mu_assert ("Test creation of default system memos : Failed", created);
-       
+
        return NULL;
 }
 
@@ -503,7 +503,7 @@ test_get_free_busy (ECal *client)
        GError *error = NULL;
        icaltimezone *utc;
        time_t start = time (NULL), end;
-       
+
        utc = icaltimezone_get_utc_timezone ();
        start = time_from_isodate ("20040212T000000Z");
        end = time_add_day_with_zone (start, 2, utc);
@@ -517,17 +517,17 @@ test_get_free_busy (ECal *client)
                for (l = freebusy; l; l = l->next) {
                        char *comp_string;
                        ECalComponent *comp = E_CAL_COMPONENT (l->data);
-                       
+
                        comp_string = e_cal_component_get_as_string (comp);
                        cl_printf (client, "%s\n\n", comp_string);
                        g_object_unref (comp);
                        g_free (comp_string);
-               }       
-       }       
+               }
+       }
        else {
                cl_printf (client, "free_busy was returned but NULL");
-       }       
-       return NULL;    
+       }
+       return NULL;
 }
 
 
@@ -543,16 +543,16 @@ test_get_default_object (ECal *client)
                g_free (ical_string);
                tests_passed++;
                return NULL;
-               
-       } else 
-               cl_printf (client, "Test Get default object : Could not get the default object: %s\n", error->message); 
+
+       } else
+               cl_printf (client, "Test Get default object : Could not get the default object: %s\n", error->message);
        return error->message;
 }
 
 
 /* XXX The string pasted below is *really* ugly. Alternatively, it could be
  * read from a file at run-time. Not sure if it is an elegant solution when
- * multiple clients try to load the same file during stress testing. 
+ * multiple clients try to load the same file during stress testing.
  * how can this be done better ?
  */
 #define EXPECTED \
@@ -582,14 +582,14 @@ LAST-MODIFIED:20040213T055647Z\
 END:VEVENT"
 
 static char *
-test_get_object (ECal *client) 
+test_get_object (ECal *client)
 {
        const char *uid = "20040213T055519Z-15802-500-1-3@testcal";
        char *actual;
        icalcomponent *icalcomp;
        gboolean compare;
        GError *error = NULL;
-       
+
        if (!e_cal_get_object (client, uid, NULL, &icalcomp, &error)) {
                cl_printf (client, "Test Get object : Could not get the object: %s\n", error->message);
                return error->message;
@@ -597,12 +597,12 @@ test_get_object (ECal *client)
 
        actual = icalcomponent_as_ical_string (icalcomp);
        compare = !strcmp (actual, EXPECTED);
-       
+
        g_free (actual);
 
        mu_assert ("Test : get_object does not match the expected output", compare);
        return NULL;
-}      
+}
 
 static char *
 test_timezones (ECal *client)
@@ -616,30 +616,30 @@ test_timezones (ECal *client)
 
        printf ("\n\nTime Zones : \n%s *** %s", icaltimezone_get_display_name (zone), icaltimezone_get_tzid (zone));
        printf ("\n\nTime Zones : \n%s", icaltimezone_get_location (zone));
-       
-       
+
+
        return NULL;
 }
 
 static char *
-all_tests(ECal *client, const gchar *uri) 
+all_tests(ECal *client, const gchar *uri)
 {
        char *uid;
-               
+
        mu_run_test (test_new_system_calendar ());
        mu_run_test (test_new_system_tasks ());
        mu_run_test (test_new_system_memos ());
        mu_run_test (test_set_uri (client, uri));
        mu_run_test (test_get_source (client, uri));
        mu_run_test (test_cal_loaded (client));
-       
+
        /* test_query acts on pre-loaded data. Hence it must executed before
         * any writes are made */
        mu_run_test (test_query (client, "(contains? \"any\" \"test\")", 2));
        mu_run_test (test_query (client, "(contains? \"summary\" \"Kansas\")", 1));
        mu_run_test (test_query (client, "(contains? \"any\" \"gibberish\")", 0));
 
-       
+
        mu_run_test (test_get_default_object (client));
        mu_run_test (test_get_object (client));
        mu_run_test (test_get_free_busy (client));
@@ -652,9 +652,9 @@ all_tests(ECal *client, const gchar *uri)
 //     mu_run_test (test_e_cal_new (&ecal, tmp));
 //     mu_run_test (test_e_cal_remove (ecal, tmp));
 //     g_free (tmp);
-       
+
        test_timezones (client);
-       
+
        return NULL;
 }
 
@@ -666,7 +666,7 @@ create_client (ECal **client, const gchar *uri, ECalSourceType type, gboolean on
        ECalView *query;
        char *cal_uri;
        GError *error = NULL;
-       
+
        cal_uri = g_strconcat ("file://", uri, NULL);
        *client = e_cal_new_from_uri (cal_uri, type);
        if (!*client) {
@@ -683,30 +683,30 @@ create_client (ECal **client, const gchar *uri, ECalSourceType type, gboolean on
                exit (1);
        }
        g_clear_error (&error);
-       
+
        if (!e_cal_get_query (*client, "(contains? \"any\" \"Event\")", &query, NULL)) {
                cl_printf (*client, G_STRLOC ": Unable to obtain query");
-               exit (1);               
+               exit (1);
        }
 
-       g_signal_connect (G_OBJECT (query), "objects_added", 
+       g_signal_connect (G_OBJECT (query), "objects_added",
                          G_CALLBACK (objects_added_cb), client);
-       g_signal_connect (G_OBJECT (query), "objects_modified", 
+       g_signal_connect (G_OBJECT (query), "objects_modified",
                          G_CALLBACK (objects_modified_cb), client);
-       g_signal_connect (G_OBJECT (query), "objects_removed", 
+       g_signal_connect (G_OBJECT (query), "objects_removed",
                          G_CALLBACK (objects_removed_cb), client);
        g_signal_connect (G_OBJECT (query), "view_done",
                          G_CALLBACK (view_done_cb), client);
-       
+
        e_cal_view_start (query);
-       
+
        results = all_tests (*client, uri);
-       cl_printf (*client, "\n\n\n*************Tests run: %d****************\n\n", tests_run); 
+       cl_printf (*client, "\n\n\n*************Tests run: %d****************\n\n", tests_run);
        cl_printf (*client, "*************Tests passed: %d*************\n\n\n", tests_passed);
-       if (results != 0) 
+       if (results != 0)
                cl_printf (*client, "***Failures********%s\n", results);
 
-       
+
        cl_printf (*client, "dump of the test calendar data");
        list_uids (*client);
        g_free (cal_uri);
@@ -726,8 +726,8 @@ main (int argc, char **argv)
        /* arg1- file name; arg2- client suffix */
        uri = g_strconcat (argv[1], argv[2], NULL);
        create_client (&client1, uri, E_CAL_SOURCE_TYPE_EVENT, FALSE);
-       
-       g_free (uri);   
+
+       g_free (uri);
        g_main_loop_run (loop);
        return 0;
 }
index ce627da..caab5c8 100644 (file)
@@ -32,7 +32,7 @@ main (int argc, char **argv)
        for (l = objects; l; l = l->next) {
                ECalComponent *comp = E_CAL_COMPONENT (l->data);
                char *str;
-               
+
                str = e_cal_component_get_as_string (comp);
                printf ("%s\n", str);
 
index 803ac4a..bf5ac00 100644 (file)
@@ -121,40 +121,40 @@ datetok (const char *date)
        struct _date_token *tokens = NULL, *token, *tail = (struct _date_token *) &tokens;
        const unsigned char *start, *end;
        unsigned int mask;
-       
+
        start = date;
        while (*start) {
                /* kill leading whitespace */
                while (*start && isspace ((int) *start))
                        start++;
-               
+
                if (*start == '\0')
                        break;
-               
+
                mask = datetok_table[*start];
-               
+
                /* find the end of this token */
                end = start + 1;
                while (*end && !strchr ("-/,\t\r\n ", *end))
                        mask |= datetok_table[*end++];
-               
+
                if (end != start) {
                        token = g_malloc (sizeof (struct _date_token));
                        token->next = NULL;
                        token->start = start;
                        token->len = end - start;
                        token->mask = mask;
-                       
+
                        tail->next = token;
                        tail = token;
                }
-               
+
                if (*end)
                        start = end + 1;
                else
                        break;
        }
-       
+
        return tokens;
 }
 
@@ -164,25 +164,25 @@ decode_int (const unsigned char *in, unsigned int inlen)
        register const unsigned char *inptr;
        const unsigned char *inend;
        int sign = 1, val = 0;
-       
+
        inptr = in;
        inend = in + inlen;
-       
+
        if (*inptr == '-') {
                sign = -1;
                inptr++;
        } else if (*inptr == '+')
                inptr++;
-       
+
        for ( ; inptr < inend; inptr++) {
                if (!isdigit ((int) *inptr))
                        return  -1;
                else
                        val = (val * 10) + (*inptr - '0');
        }
-       
+
        val *= sign;
-       
+
        return val;
 }
 
@@ -190,14 +190,14 @@ static int
 get_wday (const unsigned char *in, unsigned int inlen)
 {
        int wday;
-       
+
        if (inlen < 3)
                return -1;
-       
+
        for (wday = 0; wday < 7; wday++)
                if (!g_ascii_strncasecmp (in, tm_days[wday], 3))
                        return wday;
-       
+
        return -1;  /* unknown week day */
 }
 
@@ -205,12 +205,12 @@ static int
 get_mday (const unsigned char *in, unsigned int inlen)
 {
        int mday;
-       
+
        mday = decode_int (in, inlen);
-       
+
        if (mday < 0 || mday > 31)
                mday = -1;
-       
+
        return mday;
 }
 
@@ -218,14 +218,14 @@ static int
 get_month (const unsigned char *in, unsigned int inlen)
 {
        int i;
-       
+
        if (inlen < 3)
                return -1;
-       
+
        for (i = 0; i < 12; i++)
                if (!g_ascii_strncasecmp (in, tm_months[i], 3))
                        return i;
-       
+
        return -1;  /* unknown month */
 }
 
@@ -233,17 +233,17 @@ static int
 get_year (const unsigned char *in, unsigned int inlen)
 {
        int year;
-       
+
        year = decode_int (in, inlen);
        if (year == -1)
                return -1;
-       
+
        if (year < 100)
                year += (year < 70) ? 2000 : 1900;
-       
+
        if (year < 1969)
                return -1;
-       
+
        return year;
 }
 
@@ -253,9 +253,9 @@ get_time (const unsigned char *in, unsigned int inlen, int *hour, int *min, int
        register const unsigned char *inptr;
        const unsigned char *inend;
        int *val, colons = 0;
-       
+
        *hour = *min = *sec = 0;
-       
+
        inend = in + inlen;
        val = hour;
        for (inptr = in; inptr < inend; inptr++) {
@@ -276,7 +276,7 @@ get_time (const unsigned char *in, unsigned int inlen, int *hour, int *min, int
                else
                        *val = (*val * 10) + (*inptr - '0');
        }
-       
+
        return TRUE;
 }
 
@@ -286,17 +286,17 @@ get_tzone (struct _date_token **token)
        const unsigned char *inptr, *inend;
        unsigned int inlen;
        int i, t;
-       
+
        for (i = 0; *token && i < 2; *token = (*token)->next, i++) {
                inptr = (*token)->start;
                inlen = (*token)->len;
                inend = inptr + inlen;
-               
+
                if (*inptr == '+' || *inptr == '-') {
                        t = decode_int (inptr, inlen);
                        if (t < -1200 || t > 1400)
                                return -1;
-                       
+
                        return t;
                } else {
                        if (*inptr == '(') {
@@ -306,19 +306,19 @@ get_tzone (struct _date_token **token)
                                else
                                        inlen--;
                        }
-                       
+
                        for (t = 0; t < 15; t++) {
                                unsigned int len = strlen (tz_offsets[t].name);
-                               
+
                                if (len != inlen)
                                        continue;
-                               
+
                                if (!strncmp (inptr, tz_offsets[t].name, len))
                                        return tz_offsets[t].offset;
                        }
                }
        }
-       
+
        return -1;
 }
 
@@ -341,11 +341,11 @@ decode_broken_date (struct _date_token *tokens, int *tzone)
        struct _date_token *token;
        struct tm tm;
        time_t time;
-       
+
        memset ((void *) &tm, 0, sizeof (struct tm));
        got_wday = got_month = got_tzone = FALSE;
        offset = 0;
-       
+
        token = tokens;
        while (token) {
                if (is_weekday (token) && !got_wday) {
@@ -356,7 +356,7 @@ decode_broken_date (struct _date_token *tokens, int *tzone)
                                goto next_token;
                        }
                }
-               
+
                if (is_month (token) && !got_month) {
                        if ((n = get_month (token->start, token->len)) != -1) {
                                d(printf ("month; "));
@@ -365,7 +365,7 @@ decode_broken_date (struct _date_token *tokens, int *tzone)
                                goto next_token;
                        }
                }
-               
+
                if (is_time (token) && !tm.tm_hour && !tm.tm_min && !tm.tm_sec) {
                        if (get_time (token->start, token->len, &hour, &min, &sec)) {
                                d(printf ("time; "));
@@ -375,10 +375,10 @@ decode_broken_date (struct _date_token *tokens, int *tzone)
                                goto next_token;
                        }
                }
-               
+
                if (is_tzone (token) && !got_tzone) {
                        struct _date_token *t = token;
-                       
+
                        if ((n = get_tzone (&t)) != -1) {
                                d(printf ("tzone; "));
                                got_tzone = TRUE;
@@ -386,7 +386,7 @@ decode_broken_date (struct _date_token *tokens, int *tzone)
                                goto next_token;
                        }
                }
-               
+
                if (is_numeric (token)) {
                        if (token->len == 4 && !tm.tm_year) {
                                if ((n = get_year (token->start, token->len)) != -1) {
@@ -413,26 +413,26 @@ decode_broken_date (struct _date_token *tokens, int *tzone)
                                }
                        }
                }
-               
+
                d(printf ("???; "));
-               
+
        next_token:
-               
+
                token = token->next;
        }
-       
+
        d(printf ("\n"));
-       
+
        time = e_mktime_utc (&tm);
-       
+
        /* time is now GMT of the time we want, but not offset by the timezone ... */
-       
+
        /* this should convert the time to the GMT equiv time */
        time -= ((offset / 100) * 60 * 60) + (offset % 100) * 60;
-       
+
        if (tzone)
                *tzone = offset;
-       
+
        return time;
 }
 
@@ -454,18 +454,18 @@ parse_broken_date (const char *datestr, int *saveoffset)
 {
        struct _date_token *token, *tokens;
        time_t date;
-       
+
        tokens = datetok (datestr);
-       
+
        date = decode_broken_date (tokens, saveoffset);
-       
+
        /* cleanup */
        while (tokens) {
                token = tokens;
                tokens = tokens->next;
                g_free (token);
        }
-       
+
        return date;
 }
 
@@ -479,35 +479,35 @@ static void
 table_init ()
 {
        int i;
-       
+
        memset (datetok_table, 0, sizeof (datetok_table));
-       
+
        for (i = 0; i < 256; i++) {
                if (!strchr (NUMERIC_CHARS, i))
                        datetok_table[i] |= DATE_TOKEN_NON_NUMERIC;
-               
+
                if (!strchr (WEEKDAY_CHARS, i))
                        datetok_table[i] |= DATE_TOKEN_NON_WEEKDAY;
-               
+
                if (!strchr (MONTH_CHARS, i))
                        datetok_table[i] |= DATE_TOKEN_NON_MONTH;
-               
+
                if (!strchr (TIME_CHARS, i))
                        datetok_table[i] |= DATE_TOKEN_NON_TIME;
-               
+
                if (!strchr (TIMEZONE_ALPHA_CHARS, i))
                        datetok_table[i] |= DATE_TOKEN_NON_TIMEZONE_ALPHA;
-               
+
                if (!strchr (TIMEZONE_NUMERIC_CHARS, i))
                        datetok_table[i] |= DATE_TOKEN_NON_TIMEZONE_NUMERIC;
-               
+
                if (((char) i) == ':')
                        datetok_table[i] |= DATE_TOKEN_HAS_COLON;
-               
+
                if (strchr ("+-", i))
                        datetok_table[i] |= DATE_TOKEN_HAS_SIGN;
        }
-       
+
        printf ("static const unsigned int datetok_table[256] = {");
        for (i = 0; i < 256; i++) {
                if (i % 16 == 0)
@@ -522,12 +522,12 @@ int main (int argc, char **argv)
 {
        time_t date;
        int offset;
-       
+
        /*table_init ();*/
-       
+
        date = parse_broken_date (argv[1], &offset);
        printf ("%d; %d\n", date, offset);
-       
+
        return 0;
 }
 
index d8d6bc2..39b8cef 100644 (file)
@@ -50,7 +50,7 @@ CamelType
 camel_address_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_object_get_type (), "CamelAddress",
                                            sizeof (CamelAddress),
@@ -60,7 +60,7 @@ camel_address_get_type (void)
                                            (CamelObjectInitFunc) camel_address_init,
                                            (CamelObjectFinalizeFunc) camel_address_finalize);
        }
-       
+
        return type;
 }
 
@@ -68,7 +68,7 @@ camel_address_get_type (void)
  * camel_address_new:
  *
  * Create a new #CamelAddress object.
- * 
+ *
  * Returns a new #CamelAddress object
  **/
 CamelAddress *
@@ -82,9 +82,9 @@ camel_address_new (void)
 /**
  * camel_address_new_clone:
  * @addr: a #CamelAddress object
- * 
+ *
  * Clone an existing address type.
- * 
+ *
  * Returns the cloned address
  **/
 CamelAddress *
@@ -100,9 +100,9 @@ camel_address_new_clone (const CamelAddress *addr)
 /**
  * camel_address_length:
  * @addr: a #CamelAddress object
- * 
+ *
  * Get the number of addresses stored in the address @addr.
- * 
+ *
  * Returns the number of addresses contained in @addr
  **/
 int
@@ -133,9 +133,9 @@ camel_address_decode (CamelAddress *addr, const char *raw)
 /**
  * camel_address_encode:
  * @addr: a #CamelAddress object
- * 
+ *
  * Encode an address in a format suitable for a raw header.
- * 
+ *
  * Returns the encoded address
  **/
 char *
@@ -151,10 +151,10 @@ camel_address_encode (CamelAddress *addr)
  * camel_address_unformat:
  * @addr: a #CamelAddress object
  * @raw: raw address description
- * 
+ *
  * Attempt to convert a previously formatted and/or edited
  * address back into internal form.
- * 
+ *
  * Returns the number of addresses parsed or %-1 on fail
  **/
 int
@@ -169,9 +169,9 @@ camel_address_unformat(CamelAddress *addr, const char *raw)
 /**
  * camel_address_format:
  * @addr: a #CamelAddress object
- * 
+ *
  * Format an address in a format suitable for display.
- * 
+ *
  * Returns a newly allocated string containing the formatted addresses
  **/
 char *
@@ -187,10 +187,10 @@ camel_address_format (CamelAddress *addr)
  * camel_address_cat:
  * @dest: destination #CamelAddress object
  * @source: source #CamelAddress object
- * 
+ *
  * Concatenate one address onto another. The addresses must
  * be of the same type.
- * 
+ *
  * Returns the number of addresses concatenated
  **/
 int
@@ -207,9 +207,9 @@ camel_address_cat (CamelAddress *dest, const CamelAddress *source)
  * camel_address_copy:
  * @dest: destination #CamelAddress object
  * @source: source #CamelAddress object
- * 
+ *
  * Copy the contents of one address into another.
- * 
+ *
  * Returns the number of addresses copied
  **/
 int
@@ -227,7 +227,7 @@ camel_address_copy (CamelAddress *dest, const CamelAddress *source)
  * camel_address_remove:
  * @addr: a #CamelAddress object
  * @index: The address to remove, use %-1 to remove all address.
- * 
+ *
  * Remove an address by index, or all addresses.
  **/
 void
index 8f3ddfb..1c22b19 100644 (file)
@@ -51,11 +51,11 @@ struct _CamelBlockFilePrivate {
        struct _CamelBlockFilePrivate *prev;
 
        struct _CamelBlockFile *base;
-       
+
        pthread_mutex_t root_lock; /* for modifying the root block */
        pthread_mutex_t cache_lock; /* for refcounting, flag manip, cache manip */
        pthread_mutex_t io_lock; /* for all io ops */
-       
+
        unsigned int deleted:1;
 };
 
@@ -87,11 +87,11 @@ block_file_validate_root(CamelBlockFile *bs)
        CamelBlockRoot *br;
        struct stat st;
        int retval;
-       
+
        br = bs->root;
-       
+
        retval = fstat (bs->fd, &st);
-       
+
        d(printf("Validate root: '%s'\n", bs->path));
        d(printf("version: %.8s (%.8s)\n", bs->root->version, bs->version));
        d(printf("block size: %d (%d)%s\n", br->block_size, bs->block_size,
@@ -173,11 +173,11 @@ camel_block_file_init(CamelBlockFile *bs)
 
        p = bs->priv = g_malloc0(sizeof(*bs->priv));
        p->base = bs;
-       
+
        pthread_mutex_init(&p->root_lock, NULL);
        pthread_mutex_init(&p->cache_lock, NULL);
        pthread_mutex_init(&p->io_lock, NULL);
-       
+
        /* link into lru list */
        LOCK(block_file_lock);
        e_dlist_addhead(&block_file_list, (EDListNode *)p);
@@ -224,19 +224,19 @@ camel_block_file_finalise(CamelBlockFile *bs)
                bl = bn;
                bn = bn->next;
        }
-       
+
        g_hash_table_destroy (bs->blocks);
-       
+
        if (bs->root_block)
                camel_block_file_unref_block(bs, bs->root_block);
        g_free(bs->path);
        if (bs->fd != -1)
                close(bs->fd);
-       
+
        pthread_mutex_destroy(&p->io_lock);
        pthread_mutex_destroy(&p->cache_lock);
        pthread_mutex_destroy(&p->root_lock);
-       
+
        g_free(p);
 }
 
@@ -244,7 +244,7 @@ CamelType
 camel_block_file_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_object_get_type(), "CamelBlockFile",
                                           sizeof (CamelBlockFile),
@@ -254,7 +254,7 @@ camel_block_file_get_type(void)
                                           (CamelObjectInitFunc) camel_block_file_init,
                                           (CamelObjectFinalizeFunc) camel_block_file_finalise);
        }
-       
+
        return type;
 }
 
@@ -351,14 +351,14 @@ camel_cache_remove(c, key);
 
 /**
  * camel_block_file_new:
- * @path: 
- * @: 
- * @block_size: 
- * 
+ * @path:
+ * @:
+ * @block_size:
+ *
  * Allocate a new block file, stored at @path.  @version contains an 8 character
  * version string which must match the head of the file, or the file will be
  * intitialised.
- * 
+ *
  * @block_size is currently ignored and is set to CAMEL_BLOCK_SIZE.
  *
  * Return value: The new block file, or NULL if it could not be created.
@@ -457,16 +457,16 @@ camel_block_file_delete(CamelBlockFile *bs)
        CAMEL_BLOCK_FILE_UNLOCK(bs, io_lock);
 
        return ret;
-       
+
 }
 
 /**
  * camel_block_file_new_block:
- * @bs: 
- * 
+ * @bs:
+ *
  * Allocate a new block, return a pointer to it.  Old blocks
  * may be flushed to disk during this call.
- * 
+ *
  * Return value: The block, or NULL if an error occured.
  **/
 CamelBlock *camel_block_file_new_block(CamelBlockFile *bs)
@@ -499,10 +499,10 @@ fail:
 
 /**
  * camel_block_file_free_block:
- * @bs: 
- * @id: 
- * 
- * 
+ * @bs:
+ * @id:
+ *
+ *
  **/
 int camel_block_file_free_block(CamelBlockFile *bs, camel_block_t id)
 {
@@ -527,11 +527,11 @@ int camel_block_file_free_block(CamelBlockFile *bs, camel_block_t id)
 
 /**
  * camel_block_file_get_block:
- * @bs: 
- * @id: 
- * 
+ * @bs:
+ * @id:
+ *
  * Retreive a block @id.
- * 
+ *
  * Return value: The block, or NULL if blockid is invalid or a file error
  * occured.
  **/
@@ -607,9 +607,9 @@ CamelBlock *camel_block_file_get_block(CamelBlockFile *bs, camel_block_t id)
 
 /**
  * camel_block_file_detach_block:
- * @bs: 
- * @bl: 
- * 
+ * @bs:
+ * @bl:
+ *
  * Detatch a block from the block file's cache.  The block should
  * be unref'd or attached when finished with.  The block file will
  * perform no writes of this block or flushing of it if the cache
@@ -628,9 +628,9 @@ void camel_block_file_detach_block(CamelBlockFile *bs, CamelBlock *bl)
 
 /**
  * camel_block_file_attach_block:
- * @bs: 
- * @bl: 
- * 
+ * @bs:
+ * @bl:
+ *
  * Reattach a block that has been detached.
  **/
 void camel_block_file_attach_block(CamelBlockFile *bs, CamelBlock *bl)
@@ -646,9 +646,9 @@ void camel_block_file_attach_block(CamelBlockFile *bs, CamelBlock *bl)
 
 /**
  * camel_block_file_touch_block:
- * @bs: 
- * @bl: 
- * 
+ * @bs:
+ * @bl:
+ *
  * Mark a block as dirty.  The block will be written to disk if
  * it ever expires from the cache.
  **/
@@ -672,9 +672,9 @@ void camel_block_file_touch_block(CamelBlockFile *bs, CamelBlock *bl)
 
 /**
  * camel_block_file_unref_block:
- * @bs: 
- * @bl: 
- * 
+ * @bs:
+ * @bl:
+ *
  * Mark a block as unused.  If a block is used it will not be
  * written to disk, or flushed from memory.
  *
@@ -742,12 +742,12 @@ sync_nolock(CamelBlockFile *bs)
 
 /**
  * camel_block_file_sync_block:
- * @bs: 
- * @bl: 
- * 
+ * @bs:
+ * @bl:
+ *
  * Flush a block to disk immediately.  The block will only
  * be flushed to disk if it is marked as dirty (touched).
- * 
+ *
  * Return value: -1 on io error.
  **/
 int camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl)
@@ -767,10 +767,10 @@ int camel_block_file_sync_block(CamelBlockFile *bs, CamelBlock *bl)
 
 /**
  * camel_block_file_sync:
- * @bs: 
- * 
+ * @bs:
+ *
  * Sync all dirty blocks to disk, including the root block.
- * 
+ *
  * Return value: -1 on io error.
  **/
 int camel_block_file_sync(CamelBlockFile *bs)
@@ -829,9 +829,9 @@ camel_key_file_init(CamelKeyFile *bs)
 
        p = bs->priv = g_malloc0(sizeof(*bs->priv));
        p->base = bs;
-       
+
        pthread_mutex_init(&p->lock, NULL);
-       
+
        LOCK(key_file_lock);
        e_dlist_addhead(&key_file_list, (EDListNode *)p);
        UNLOCK(key_file_lock);
@@ -853,9 +853,9 @@ camel_key_file_finalise(CamelKeyFile *bs)
        UNLOCK(key_file_lock);
 
        g_free(bs->path);
-       
+
        pthread_mutex_destroy(&p->lock);
-       
+
        g_free(p);
 }
 
@@ -863,7 +863,7 @@ CamelType
 camel_key_file_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_object_get_type(), "CamelKeyFile",
                                           sizeof (CamelKeyFile),
@@ -873,7 +873,7 @@ camel_key_file_get_type(void)
                                           (CamelObjectInitFunc) camel_key_file_init,
                                           (CamelObjectFinalizeFunc) camel_key_file_finalise);
        }
-       
+
        return type;
 }
 
@@ -967,13 +967,13 @@ key_file_unuse(CamelKeyFile *bs)
 
 /**
  * camel_key_file_new:
- * @path: 
+ * @path:
  * @flags: open flags
  * @version: Version string (header) of file.  Currently
  * written but not checked.
- * 
+ *
  * Create a new key file.  A linked list of record blocks.
- * 
+ *
  * Return value: A new key file, or NULL if the file could not
  * be opened/created/initialised.
  **/
@@ -1071,18 +1071,18 @@ camel_key_file_delete(CamelKeyFile *kf)
        CAMEL_KEY_FILE_UNLOCK(kf, lock);
 
        return ret;
-       
+
 }
 
 /**
  * camel_key_file_write:
- * @kf: 
- * @parent: 
- * @len: 
- * @records: 
- * 
+ * @kf:
+ * @parent:
+ * @len:
+ * @records:
+ *
  * Write a new list of records to the key file.
- * 
+ *
  * Return value: -1 on io error.  The key file will remain unchanged.
  **/
 int
@@ -1130,14 +1130,14 @@ camel_key_file_write(CamelKeyFile *kf, camel_block_t *parent, size_t len, camel_
 
 /**
  * camel_key_file_read:
- * @kf: 
+ * @kf:
  * @start: The record pointer.  This will be set to the next record pointer on success.
  * @len: Number of records read, if != NULL.
  * @records: Records, allocated, must be freed with g_free, if != NULL.
- * 
+ *
  * Read the next block of data from the key file.  Returns the number of
  * records.
- * 
+ *
  * Return value: -1 on io error.
  **/
 int
index ec90ed0..2092263 100644 (file)
@@ -69,7 +69,7 @@ CamelType
 camel_certdb_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_object_get_type (),
                                            "CamelCertDB",
@@ -80,7 +80,7 @@ camel_certdb_get_type (void)
                                            (CamelObjectInitFunc) camel_certdb_init,
                                            (CamelObjectFinalizeFunc) camel_certdb_finalize);
        }
-       
+
        return type;
 }
 
@@ -89,10 +89,10 @@ static void
 camel_certdb_class_init (CamelCertDBClass *klass)
 {
        parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
-       
+
        klass->header_load = certdb_header_load;
        klass->header_save = certdb_header_save;
-       
+
        klass->cert_new  = certdb_cert_new;
        klass->cert_load = certdb_cert_load;
        klass->cert_save = certdb_cert_save;
@@ -105,18 +105,18 @@ static void
 camel_certdb_init (CamelCertDB *certdb)
 {
        certdb->priv = g_malloc (sizeof (struct _CamelCertDBPrivate));
-       
+
        certdb->filename = NULL;
        certdb->version = CAMEL_CERTDB_VERSION;
        certdb->saved_certs = 0;
-       
+
        certdb->cert_size = sizeof (CamelCert);
-       
+
        certdb->cert_chunks = NULL;
-       
+
        certdb->certs = g_ptr_array_new ();
        certdb->cert_hash = g_hash_table_new (g_str_hash, g_str_equal);
-       
+
        certdb->priv->db_lock = g_mutex_new ();
        certdb->priv->io_lock = g_mutex_new ();
        certdb->priv->alloc_lock = g_mutex_new ();
@@ -128,26 +128,26 @@ camel_certdb_finalize (CamelObject *obj)
 {
        CamelCertDB *certdb = (CamelCertDB *) obj;
        struct _CamelCertDBPrivate *p;
-       
+
        p = certdb->priv;
-       
+
        if (certdb->flags & CAMEL_CERTDB_DIRTY)
                camel_certdb_save (certdb);
-       
+
        camel_certdb_clear (certdb);
        g_ptr_array_free (certdb->certs, TRUE);
        g_hash_table_destroy (certdb->cert_hash);
-       
+
        g_free (certdb->filename);
-       
+
        if (certdb->cert_chunks)
                e_memchunk_destroy (certdb->cert_chunks);
-       
+
        g_mutex_free (p->db_lock);
        g_mutex_free (p->io_lock);
        g_mutex_free (p->alloc_lock);
        g_mutex_free (p->ref_lock);
-       
+
        g_free (p);
 }
 
@@ -167,15 +167,15 @@ void
 camel_certdb_set_default (CamelCertDB *certdb)
 {
        pthread_mutex_lock (&default_certdb_lock);
-       
+
        if (default_certdb)
                camel_object_unref (default_certdb);
-       
+
        if (certdb)
                camel_object_ref (certdb);
-       
+
        default_certdb = certdb;
-       
+
        pthread_mutex_unlock (&default_certdb_lock);
 }
 
@@ -184,16 +184,16 @@ CamelCertDB *
 camel_certdb_get_default (void)
 {
        CamelCertDB *certdb;
-       
+
        pthread_mutex_lock (&default_certdb_lock);
-       
+
        if (default_certdb)
                camel_object_ref (default_certdb);
-       
+
        certdb = default_certdb;
-       
+
        pthread_mutex_unlock (&default_certdb_lock);
-       
+
        return certdb;
 }
 
@@ -203,12 +203,12 @@ camel_certdb_set_filename (CamelCertDB *certdb, const char *filename)
 {
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
        g_return_if_fail (filename != NULL);
-       
+
        CAMEL_CERTDB_LOCK (certdb, db_lock);
-       
+
        g_free (certdb->filename);
        certdb->filename = g_strdup (filename);
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, db_lock);
 }
 
@@ -220,7 +220,7 @@ certdb_header_load (CamelCertDB *certdb, FILE *istream)
                return -1;
        if (camel_file_util_decode_uint32 (istream, &certdb->saved_certs) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -228,7 +228,7 @@ static CamelCert *
 certdb_cert_load (CamelCertDB *certdb, FILE *istream)
 {
        CamelCert *cert;
-       
+
        cert = camel_certdb_cert_new (certdb);
 
        if (camel_file_util_decode_string (istream, &cert->issuer) == -1)
@@ -241,13 +241,13 @@ certdb_cert_load (CamelCertDB *certdb, FILE *istream)
                goto error;
        if (camel_file_util_decode_uint32 (istream, &cert->trust) == -1)
                goto error;
-       
+
        return cert;
-       
+
  error:
-       
+
        camel_certdb_cert_unref (certdb, cert);
-       
+
        return NULL;
 }
 
@@ -257,44 +257,44 @@ camel_certdb_load (CamelCertDB *certdb)
        CamelCert *cert;
        FILE *in;
        int i;
-       
+
        g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), -1);
        g_return_val_if_fail (certdb->filename, -1);
 
        in = g_fopen (certdb->filename, "rb");
        if (in == NULL)
                return -1;
-       
+
        CAMEL_CERTDB_LOCK (certdb, io_lock);
        if (CAMEL_CERTDB_GET_CLASS (certdb)->header_load (certdb, in) == -1)
                goto error;
-       
+
        for (i = 0; i < certdb->saved_certs; i++) {
                cert = CAMEL_CERTDB_GET_CLASS (certdb)->cert_load (certdb, in);
-               
+
                if (cert == NULL)
                        goto error;
-               
+
                camel_certdb_add (certdb, cert);
        }
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, io_lock);
-       
+
        if (fclose (in) != 0)
                return -1;
-       
+
        certdb->flags &= ~CAMEL_CERTDB_DIRTY;
-       
+
        return 0;
-       
+
  error:
-       
+
        g_warning ("Cannot load certificate database: %s", strerror (ferror (in)));
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, io_lock);
-       
+
        fclose (in);
-       
+
        return -1;
 }
 
@@ -305,7 +305,7 @@ certdb_header_save (CamelCertDB *certdb, FILE *ostream)
                return -1;
        if (camel_file_util_encode_uint32 (ostream, certdb->saved_certs) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -322,7 +322,7 @@ certdb_cert_save (CamelCertDB *certdb, CamelCert *cert, FILE *ostream)
                return -1;
        if (camel_file_util_encode_uint32 (ostream, cert->trust) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -333,17 +333,17 @@ camel_certdb_save (CamelCertDB *certdb)
        char *filename;
        int fd, i;
        FILE *out;
-       
+
        g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), -1);
        g_return_val_if_fail (certdb->filename, -1);
-       
+
        filename = alloca (strlen (certdb->filename) + 4);
        sprintf (filename, "%s~", certdb->filename);
-       
+
        fd = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0600);
        if (fd == -1)
                return -1;
-       
+
        out = fdopen (fd, "wb");
        if (out == NULL) {
                i = errno;
@@ -352,22 +352,22 @@ camel_certdb_save (CamelCertDB *certdb)
                errno = i;
                return -1;
        }
-       
+
        CAMEL_CERTDB_LOCK (certdb, io_lock);
-       
+
        certdb->saved_certs = certdb->certs->len;
        if (CAMEL_CERTDB_GET_CLASS (certdb)->header_save (certdb, out) == -1)
                goto error;
-       
+
        for (i = 0; i < certdb->saved_certs; i++) {
                cert = (CamelCert *) certdb->certs->pdata[i];
-               
+
                if (CAMEL_CERTDB_GET_CLASS (certdb)->cert_save (certdb, cert, out) == -1)
                        goto error;
        }
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, io_lock);
-       
+
        if (fflush (out) != 0 || fsync (fileno (out)) == -1) {
                i = errno;
                fclose (out);
@@ -375,36 +375,36 @@ camel_certdb_save (CamelCertDB *certdb)
                errno = i;
                return -1;
        }
-       
+
        if (fclose (out) != 0) {
                i = errno;
                g_unlink (filename);
                errno = i;
                return -1;
        }
-       
+
        if (g_rename (filename, certdb->filename) == -1) {
                i = errno;
                g_unlink (filename);
                errno = i;
                return -1;
        }
-       
+
        certdb->flags &= ~CAMEL_CERTDB_DIRTY;
-       
+
        return 0;
-       
+
  error:
-       
+
        g_warning ("Cannot save certificate database: %s", strerror (ferror (out)));
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, io_lock);
-       
+
        i = errno;
        fclose (out);
        g_unlink (filename);
        errno = i;
-       
+
        return -1;
 }
 
@@ -412,7 +412,7 @@ void
 camel_certdb_touch (CamelCertDB *certdb)
 {
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
-       
+
        certdb->flags |= CAMEL_CERTDB_DIRTY;
 }
 
@@ -420,17 +420,17 @@ CamelCert *
 camel_certdb_get_cert (CamelCertDB *certdb, const char *fingerprint)
 {
        CamelCert *cert;
-       
+
        g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), NULL);
-       
+
        CAMEL_CERTDB_LOCK (certdb, db_lock);
-       
+
        cert = g_hash_table_lookup (certdb->cert_hash, fingerprint);
        if (cert)
                camel_certdb_cert_ref (certdb, cert);
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, db_lock);
-       
+
        return cert;
 }
 
@@ -438,20 +438,20 @@ void
 camel_certdb_add (CamelCertDB *certdb, CamelCert *cert)
 {
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
-       
+
        CAMEL_CERTDB_LOCK (certdb, db_lock);
-       
+
        if (g_hash_table_lookup (certdb->cert_hash, cert->fingerprint)) {
                CAMEL_CERTDB_UNLOCK (certdb, db_lock);
                return;
        }
-       
+
        camel_certdb_cert_ref (certdb, cert);
        g_ptr_array_add (certdb->certs, cert);
        g_hash_table_insert (certdb->cert_hash, cert->fingerprint, cert);
-       
+
        certdb->flags |= CAMEL_CERTDB_DIRTY;
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, db_lock);
 }
 
@@ -459,17 +459,17 @@ void
 camel_certdb_remove (CamelCertDB *certdb, CamelCert *cert)
 {
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
-       
+
        CAMEL_CERTDB_LOCK (certdb, db_lock);
-       
+
        if (g_hash_table_lookup (certdb->cert_hash, cert->fingerprint)) {
                g_hash_table_remove (certdb->cert_hash, cert->fingerprint);
                g_ptr_array_remove (certdb->certs, cert);
                camel_certdb_cert_unref (certdb, cert);
-               
+
                certdb->flags |= CAMEL_CERTDB_DIRTY;
        }
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, db_lock);
 }
 
@@ -477,14 +477,14 @@ static CamelCert *
 certdb_cert_new (CamelCertDB *certdb)
 {
        CamelCert *cert;
-       
+
        if (certdb->cert_chunks)
                cert = e_memchunk_alloc0 (certdb->cert_chunks);
        else
                cert = g_malloc0 (certdb->cert_size);
-       
+
        cert->refcount = 1;
-       
+
        return cert;
 }
 
@@ -492,15 +492,15 @@ CamelCert *
 camel_certdb_cert_new (CamelCertDB *certdb)
 {
        CamelCert *cert;
-       
+
        g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), NULL);
-       
+
        CAMEL_CERTDB_LOCK (certdb, alloc_lock);
-       
+
        cert = CAMEL_CERTDB_GET_CLASS (certdb)->cert_new (certdb);
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, alloc_lock);
-       
+
        return cert;
 }
 
@@ -509,7 +509,7 @@ camel_certdb_cert_ref (CamelCertDB *certdb, CamelCert *cert)
 {
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
        g_return_if_fail (cert != NULL);
-       
+
        CAMEL_CERTDB_LOCK (certdb, ref_lock);
        cert->refcount++;
        CAMEL_CERTDB_UNLOCK (certdb, ref_lock);
@@ -531,9 +531,9 @@ camel_certdb_cert_unref (CamelCertDB *certdb, CamelCert *cert)
 {
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
        g_return_if_fail (cert != NULL);
-       
+
        CAMEL_CERTDB_LOCK (certdb, ref_lock);
-       
+
        if (cert->refcount <= 1) {
                CAMEL_CERTDB_GET_CLASS (certdb)->cert_free (certdb, cert);
                if (certdb->cert_chunks)
@@ -543,7 +543,7 @@ camel_certdb_cert_unref (CamelCertDB *certdb, CamelCert *cert)
        } else {
                cert->refcount--;
        }
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, ref_lock);
 }
 
@@ -559,21 +559,21 @@ camel_certdb_clear (CamelCertDB *certdb)
 {
        CamelCert *cert;
        int i;
-       
+
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
-       
+
        CAMEL_CERTDB_LOCK (certdb, db_lock);
-       
+
        g_hash_table_foreach_remove (certdb->cert_hash, cert_remove, NULL);
        for (i = 0; i < certdb->certs->len; i++) {
                cert = (CamelCert *) certdb->certs->pdata[i];
                camel_certdb_cert_unref (certdb, cert);
        }
-       
+
        certdb->saved_certs = 0;
        g_ptr_array_set_size (certdb->certs, 0);
        certdb->flags |= CAMEL_CERTDB_DIRTY;
-       
+
        CAMEL_CERTDB_UNLOCK (certdb, db_lock);
 }
 
@@ -601,9 +601,9 @@ camel_cert_get_string (CamelCertDB *certdb, CamelCert *cert, int string)
 {
        g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), NULL);
        g_return_val_if_fail (cert != NULL, NULL);
-       
+
        /* FIXME: do locking? */
-       
+
        return CAMEL_CERTDB_GET_CLASS (certdb)->cert_get_string (certdb, cert, string);
 }
 
@@ -638,9 +638,9 @@ camel_cert_set_string (CamelCertDB *certdb, CamelCert *cert, int string, const c
 {
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
        g_return_if_fail (cert != NULL);
-       
+
        /* FIXME: do locking? */
-       
+
        CAMEL_CERTDB_GET_CLASS (certdb)->cert_set_string (certdb, cert, string, value);
 }
 
@@ -650,7 +650,7 @@ camel_cert_get_trust (CamelCertDB *certdb, CamelCert *cert)
 {
        g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), CAMEL_CERT_TRUST_UNKNOWN);
        g_return_val_if_fail (cert != NULL, CAMEL_CERT_TRUST_UNKNOWN);
-       
+
        return cert->trust;
 }
 
@@ -660,6 +660,6 @@ camel_cert_set_trust (CamelCertDB *certdb, CamelCert *cert, CamelCertTrust trust
 {
        g_return_if_fail (CAMEL_IS_CERTDB (certdb));
        g_return_if_fail (cert != NULL);
-       
+
        cert->trust = trust;
 }
index ccc40b1..abfe0f9 100644 (file)
@@ -58,12 +58,12 @@ typedef enum {
 
 typedef struct {
        guint32 refcount;
-       
+
        char *issuer;
        char *subject;
        char *hostname;
        char *fingerprint;
-       
+
        CamelCertTrust trust;
        GByteArray *rawcert;
 } CamelCert;
@@ -71,32 +71,32 @@ typedef struct {
 struct _CamelCertDB {
        CamelObject parent_object;
        struct _CamelCertDBPrivate *priv;
-       
+
        char *filename;
        guint32 version;
        guint32 saved_certs;
        guint32 flags;
-       
+
        guint32 cert_size;
-       
+
        struct _EMemChunk *cert_chunks;
-       
+
        GPtrArray *certs;
        GHashTable *cert_hash;
 };
 
 struct _CamelCertDBClass {
        CamelObjectClass parent_class;
-       
+
        int (*header_load) (CamelCertDB *certdb, FILE *istream);
        int (*header_save) (CamelCertDB *certdb, FILE *ostream);
-       
+
        CamelCert * (*cert_load) (CamelCertDB *certdb, FILE *istream);
        int (*cert_save) (CamelCertDB *certdb, CamelCert *cert, FILE *ostream);
-       
+
        CamelCert *  (*cert_new) (CamelCertDB *certdb);
        void        (*cert_free) (CamelCertDB *certdb, CamelCert *cert);
-       
+
        const char * (*cert_get_string) (CamelCertDB *certdb, CamelCert *cert, int string);
        void (*cert_set_string) (CamelCertDB *certdb, CamelCert *cert, int string, const char *value);
 };
index 615a75d..162a9cf 100644 (file)
 /* This file is automatically generated: DO NOT EDIT */
 
 static const unsigned char m000[256] = {
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xbf, 0xbf, 0xbf, 0xbf, 
-       0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 
-       0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 
-       0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 
-       0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0x9f, 0x9f, 0x9f, 
-       0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 
-       0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 
-       0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 
-       0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 
-       0xff, 0x80, 0xc0, 0xe0, 0xc3, 0xc0, 0xe0, 0xf3, 
-       0xe3, 0xec, 0x80, 0xe0, 0xe0, 0xf3, 0xc0, 0xc2, 
-       0xef, 0xe0, 0xec, 0xe0, 0xc3, 0xc0, 0xc0, 0xec, 
-       0xc3, 0xc0, 0x80, 0xe0, 0xc0, 0xe0, 0xc0, 0x80, 
-       0x80, 0x83, 0x83, 0x82, 0x83, 0x82, 0x82, 0x81, 
-       0x80, 0x83, 0x80, 0x83, 0x80, 0x83, 0x83, 0x80, 
-       0x00, 0x80, 0x80, 0x81, 0x83, 0x82, 0x83, 0xc3, 
-       0x82, 0x80, 0x83, 0x82, 0x83, 0x01, 0x00, 0x83, 
-       0x80, 0x83, 0x83, 0x82, 0x83, 0x82, 0x82, 0x81, 
-       0x80, 0x83, 0x80, 0x83, 0x80, 0x83, 0x83, 0x80, 
-       0x00, 0x80, 0x80, 0x81, 0x83, 0x82, 0x83, 0xcf, 
-       0x82, 0x80, 0x83, 0x82, 0x83, 0x01, 0x00, 0x80, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xbf, 0xbf, 0xbf, 0xbf,
+       0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf,
+       0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf,
+       0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf,
+       0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0x9f, 0x9f, 0x9f,
+       0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3,
+       0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3,
+       0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3,
+       0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3,
+       0xff, 0x80, 0xc0, 0xe0, 0xc3, 0xc0, 0xe0, 0xf3,
+       0xe3, 0xec, 0x80, 0xe0, 0xe0, 0xf3, 0xc0, 0xc2,
+       0xef, 0xe0, 0xec, 0xe0, 0xc3, 0xc0, 0xc0, 0xec,
+       0xc3, 0xc0, 0x80, 0xe0, 0xc0, 0xe0, 0xc0, 0x80,
+       0x80, 0x83, 0x83, 0x82, 0x83, 0x82, 0x82, 0x81,
+       0x80, 0x83, 0x80, 0x83, 0x80, 0x83, 0x83, 0x80,
+       0x00, 0x80, 0x80, 0x81, 0x83, 0x82, 0x83, 0xc3,
+       0x82, 0x80, 0x83, 0x82, 0x83, 0x01, 0x00, 0x83,
+       0x80, 0x83, 0x83, 0x82, 0x83, 0x82, 0x82, 0x81,
+       0x80, 0x83, 0x80, 0x83, 0x80, 0x83, 0x83, 0x80,
+       0x00, 0x80, 0x80, 0x81, 0x83, 0x82, 0x83, 0xcf,
+       0x82, 0x80, 0x83, 0x82, 0x83, 0x01, 0x00, 0x80,
 };
 
 static const unsigned char m001[256] = {
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 
-       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 
-       0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
-       0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
-       0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
-       0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
-       0x07, 0x02, 0x03, 0x03, 0x05, 0x02, 0x05, 0x07, 
-       0x00, 0x07, 0x02, 0x07, 0x07, 0x07, 0x07, 0x02, 
-       0x07, 0x07, 0x03, 0x03, 0x00, 0x07, 0x07, 0x07, 
-       0x00, 0x03, 0x02, 0x07, 0x01, 0x01, 0x01, 0x02, 
-       0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 
-       0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
-       0x02, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 
-       0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x03, 
-       0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 
-       0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
-       0x02, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03, 
-       0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x02, 
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
+       0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03,
+       0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
+       0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
+       0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
+       0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
+       0x07, 0x02, 0x03, 0x03, 0x05, 0x02, 0x05, 0x07,
+       0x00, 0x07, 0x02, 0x07, 0x07, 0x07, 0x07, 0x02,
+       0x07, 0x07, 0x03, 0x03, 0x00, 0x07, 0x07, 0x07,
+       0x00, 0x03, 0x02, 0x07, 0x01, 0x01, 0x01, 0x02,
+       0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02,
+       0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+       0x02, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03,
+       0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x03,
+       0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02,
+       0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+       0x02, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x03,
+       0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x02,
 };
 
 static const unsigned char m010[256] = {
-       0x02, 0x02, 0x01, 0x01, 0x03, 0x03, 0x01, 0x01, 
-       0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x01, 0x01, 
-       0x03, 0x03, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02, 
-       0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x80, 0x80, 
-       0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 
-       0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02, 
-       0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 
-       0x02, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x00, 
-       0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 
-       0x01, 0x00, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 
-       0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 
-       0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x81, 0x81, 
-       0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 
-       0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 
-       0x01, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x02, 0x02, 0x01, 0x01, 0x03, 0x03, 0x01, 0x01,
+       0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x01, 0x01,
+       0x03, 0x03, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02,
+       0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x80, 0x80,
+       0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
+       0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x02, 0x02,
+       0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+       0x02, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x00,
+       0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01,
+       0x01, 0x00, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00,
+       0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02,
+       0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x81, 0x81,
+       0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02,
+       0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01,
+       0x01, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m011[256] = {
-       0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 
-       0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 
-       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 
-       0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 
-       0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 
-       0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 
-       0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 
-       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 
-       0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 
-       0x02, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
+       0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
+       0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+       0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+       0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+       0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01,
+       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+       0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+       0x02, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m020[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x01, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x01, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m030[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x00, 
-       0x20, 0x20, 0x20, 0x00, 0x20, 0x00, 0x20, 0x20, 
-       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-       0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 
-       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x00,
+       0x20, 0x20, 0x20, 0x00, 0x20, 0x00, 0x20, 0x20,
+       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+       0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20,
+       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+       0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m040[256] = {
-       0x00, 0x1c, 0x10, 0x10, 0x18, 0x10, 0x18, 0x18, 
-       0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 
-       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 
-       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 
-       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 
-       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 
-       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 
-       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 
-       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 
-       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 
-       0x00, 0x1c, 0x10, 0x10, 0x18, 0x10, 0x18, 0x18, 
-       0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x1c, 0x10, 0x10, 0x18, 0x10, 0x18, 0x18,
+       0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10,
+       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
+       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
+       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
+       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
+       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
+       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
+       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
+       0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
+       0x00, 0x1c, 0x10, 0x10, 0x18, 0x10, 0x18, 0x18,
+       0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m041[256] = {
-       0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
-       0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
+       0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m050[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 
-       0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 
-       0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 
-       0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
+       0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
+       0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
+       0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m200[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x40, 
-       0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x20, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x40,
+       0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x20,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m201[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 
-       0x04, 0x05, 0x04, 0x00, 0x05, 0x05, 0x05, 0x00, 
-       0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00,
+       0x04, 0x05, 0x04, 0x00, 0x05, 0x05, 0x05, 0x00,
+       0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m210[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m211[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m220[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m230[256] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const unsigned char m250[256] = {
-       0x0c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x04, 0x04, 0x0c, 
-       0x0c, 0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x0c, 0x0c, 
-       0x0c, 0x0c, 0x04, 0x0c, 0x04, 0x04, 0x0c, 0x0c, 
-       0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 
-       0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+       0x0c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x04, 0x04, 0x0c,
+       0x0c, 0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x0c, 0x0c,
+       0x0c, 0x0c, 0x04, 0x0c, 0x04, 0x04, 0x0c, 0x0c,
+       0x0c, 0x0c, 0x0c, 0x04, 0x0c, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+       0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
 static const struct {
        const unsigned char *bits0;
        const unsigned char *bits1;
 } camel_charmap[256] = {
-       { m000, m001, }, { m010, m011, }, { m020, NULL, }, { m030, NULL, }, { m040, m041, }, { m050, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { m200, m201, }, { m210, m211, }, { m220, NULL, }, { m230, NULL, }, { NULL, NULL, }, { m250, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
-       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, 
+       { m000, m001, }, { m010, m011, }, { m020, NULL, }, { m030, NULL, }, { m040, m041, }, { m050, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { m200, m201, }, { m210, m211, }, { m220, NULL, }, { m230, NULL, }, { NULL, NULL, }, { m250, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
+       { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, }, { NULL, NULL, },
 };
 
 static const struct {
index 8fd9ebf..c472973 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; -*- */
-/* 
+/*
  * Authors:
  *   Michael Zucchi <notzed@ximian.com>
  *   Jeffrey Stedfast <fejj@ximian.com>
@@ -7,8 +7,8 @@
  *
  * Copyright 2000-2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -35,7 +35,7 @@
 /*
   if you want to build the charset map, compile this with something like:
     gcc -DBUILD_MAP camel-charset-map.c `glib-config --cflags`
-  (plus any -I/-L/-l flags you need for iconv), then run it as 
+  (plus any -I/-L/-l flags you need for iconv), then run it as
     ./a.out > camel-charset-map-private.h
 
   Note that the big-endian variant isn't tested...
@@ -196,7 +196,7 @@ int main (void)
                        printf("\t\\\n");
        }
        printf("\n\n");
-       
+
        return 0;
 }
 
@@ -229,15 +229,15 @@ camel_charset_step (CamelCharset *cc, const char *in, int len)
        register unsigned int mask;
        register int level;
        register guint32 c;
-       
+
        mask = cc->mask;
        level = cc->level;
-       
+
        /* check what charset a given string will fit in */
        while ((c = camel_utf8_getc_limit(&inptr, inend)) != 0xffff) {
                if (c < 0xffff) {
                        mask &= charset_mask(c);
-                       
+
                        if (c>=128 && c<256)
                                level = MAX(level, 1);
                        else if (c>=256)
@@ -248,7 +248,7 @@ camel_charset_step (CamelCharset *cc, const char *in, int len)
                        break;
                }
        }
-       
+
        cc->mask = mask;
        cc->level = level;
 }
@@ -259,17 +259,17 @@ camel_charset_best_mask(unsigned int mask)
 {
        const char *locale_lang, *lang;
        int i;
-       
+
        locale_lang = e_iconv_locale_language ();
        for (i = 0; i < G_N_ELEMENTS (camel_charinfo); i++) {
                if (camel_charinfo[i].bit & mask) {
                        lang = e_iconv_charset_language (camel_charinfo[i].name);
-                       
+
                        if (!locale_lang || (lang && !strncmp (locale_lang, lang, 2)))
                                return camel_charinfo[i].name;
                }
        }
-       
+
        return "UTF-8";
 }
 
@@ -328,7 +328,7 @@ camel_charset_iso_to_windows (const char *isocharset)
         *    iso-8859-13 are Baltic that it also maps to
         *    windows-cp1257.
         */
-       
+
        if (!g_ascii_strcasecmp (isocharset, "iso-8859-1") || !g_ascii_strcasecmp (isocharset, "us-ascii"))
                return "windows-cp1252";
        else if (!g_ascii_strcasecmp (isocharset, "iso-8859-2"))
@@ -347,7 +347,7 @@ camel_charset_iso_to_windows (const char *isocharset)
                return "windows-cp1254";
        else if (!g_ascii_strcasecmp (isocharset, "iso-8859-13"))
                return "windows-cp1257";
-       
+
        return isocharset;
 }
 
index a11b2cd..2acf2ab 100644 (file)
@@ -66,14 +66,14 @@ CamelCipherContext *
 camel_cipher_context_new (CamelSession *session)
 {
        CamelCipherContext *context;
-       
+
        g_return_val_if_fail (session != NULL, NULL);
-       
+
        context = CAMEL_CIPHER_CONTEXT (camel_object_new (CAMEL_CIPHER_CONTEXT_TYPE));
-       
+
        camel_object_ref (session);
        context->session = session;
-       
+
        return context;
 }
 
@@ -89,7 +89,7 @@ camel_cipher_context_construct (CamelCipherContext *context, CamelSession *sessi
 {
        g_return_if_fail (CAMEL_IS_CIPHER_CONTEXT (context));
        g_return_if_fail (CAMEL_IS_SESSION (session));
-       
+
        camel_object_ref (session);
        context->session = session;
 }
@@ -122,15 +122,15 @@ camel_cipher_sign (CamelCipherContext *context, const char *userid, CamelCipherH
                   struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
 {
        int retval;
-       
+
        g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
 
        camel_operation_start(NULL, _("Signing message"));
 
        CIPHER_LOCK(context);
-       
+
        retval = CCC_CLASS (context)->sign (context, userid, hash, ipart, opart, ex);
-       
+
        CIPHER_UNLOCK(context);
 
        camel_operation_end(NULL);
@@ -165,19 +165,19 @@ CamelCipherValidity *
 camel_cipher_verify (CamelCipherContext *context, struct _CamelMimePart *ipart, CamelException *ex)
 {
        CamelCipherValidity *valid;
-       
+
        g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), NULL);
-       
+
        camel_operation_start(NULL, _("Verifying message"));
 
        CIPHER_LOCK(context);
-       
+
        valid = CCC_CLASS (context)->verify (context, ipart, ex);
-       
+
        CIPHER_UNLOCK(context);
 
        camel_operation_end(NULL);
-       
+
        return valid;
 }
 
@@ -209,19 +209,19 @@ camel_cipher_encrypt (CamelCipherContext *context, const char *userid, GPtrArray
                      struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex)
 {
        int retval;
-       
+
        g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
 
        camel_operation_start(NULL, _("Encrypting message"));
-       
+
        CIPHER_LOCK(context);
-       
+
        retval = CCC_CLASS (context)->encrypt (context, userid, recipients, ipart, opart, ex);
-       
+
        CIPHER_UNLOCK(context);
 
        camel_operation_end(NULL);
-       
+
        return retval;
 }
 
@@ -235,13 +235,13 @@ cipher_decrypt(CamelCipherContext *context, struct _CamelMimePart *ipart, struct
 
 /**
  * camel_cipher_decrypt:
- * @context: 
- * @ipart: 
- * @opart: 
- * @ex: 
- * 
+ * @context:
+ * @ipart:
+ * @opart:
+ * @ex:
+ *
  * Decrypts @ipart into @opart.
- * 
+ *
  * Return value: A validity/encryption status.
  **/
 CamelCipherValidity *
@@ -252,15 +252,15 @@ camel_cipher_decrypt(CamelCipherContext *context, struct _CamelMimePart *ipart,
        g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), NULL);
 
        camel_operation_start(NULL, _("Decrypting message"));
-       
+
        CIPHER_LOCK(context);
-       
+
        valid = CCC_CLASS (context)->decrypt (context, ipart, opart, ex);
-       
+
        CIPHER_UNLOCK(context);
 
        camel_operation_end(NULL);
-       
+
        return valid;
 }
 
@@ -269,7 +269,7 @@ cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istream, C
 {
        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                             _("You may not import keys with this cipher"));
-       
+
        return -1;
 }
 
@@ -289,7 +289,7 @@ camel_cipher_import_keys (CamelCipherContext *context, struct _CamelStream *istr
 {
        g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
        g_return_val_if_fail (CAMEL_IS_STREAM (istream), -1);
-       
+
        return CCC_CLASS (context)->import_keys (context, istream, ex);
 }
 
@@ -299,7 +299,7 @@ cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
 {
        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                             _("You may not export keys with this cipher"));
-       
+
        return -1;
 }
 
@@ -322,7 +322,7 @@ camel_cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
        g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
        g_return_val_if_fail (CAMEL_IS_STREAM (ostream), -1);
        g_return_val_if_fail (keys != NULL, -1);
-       
+
        return CCC_CLASS (context)->export_keys (context, keys, ostream, ex);
 }
 
@@ -337,7 +337,7 @@ CamelCipherHash
 camel_cipher_id_to_hash(CamelCipherContext *context, const char *id)
 {
        g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), CAMEL_CIPHER_HASH_DEFAULT);
-       
+
        return CCC_CLASS (context)->id_to_hash (context, id);
 }
 
@@ -351,7 +351,7 @@ const char *
 camel_cipher_hash_to_id(CamelCipherContext *context, CamelCipherHash hash)
 {
        g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), NULL);
-       
+
        return CCC_CLASS (context)->hash_to_id (context, hash);
 }
 
@@ -368,7 +368,7 @@ CamelCipherValidity *
 camel_cipher_validity_new (void)
 {
        CamelCipherValidity *validity;
-       
+
        validity = g_malloc(sizeof(*validity));
        camel_cipher_validity_init(validity);
 
@@ -397,7 +397,7 @@ void
 camel_cipher_validity_set_valid (CamelCipherValidity *validity, gboolean valid)
 {
        g_assert (validity != NULL);
-       
+
        validity->sign.status = valid?CAMEL_CIPHER_VALIDITY_SIGN_GOOD:CAMEL_CIPHER_VALIDITY_SIGN_BAD;
 }
 
@@ -406,7 +406,7 @@ camel_cipher_validity_get_description (CamelCipherValidity *validity)
 {
        if (validity == NULL)
                return NULL;
-       
+
        return validity->sign.description;
 }
 
@@ -414,7 +414,7 @@ void
 camel_cipher_validity_set_description (CamelCipherValidity *validity, const gchar *description)
 {
        g_assert (validity != NULL);
-       
+
        g_free(validity->sign.description);
        validity->sign.description = g_strdup(description);
 }
@@ -459,11 +459,11 @@ camel_cipher_validity_clone(CamelCipherValidity *vin)
 
 /**
  * camel_cipher_validity_add_certinfo:
- * @vin: 
- * @mode: 
- * @name: 
- * @email: 
- * 
+ * @vin:
+ * @mode:
+ * @name:
+ * @email:
+ *
  * Add a cert info to the signer or encrypter info.
  **/
 void
@@ -486,7 +486,7 @@ camel_cipher_validity_add_certinfo(CamelCipherValidity *vin, enum _camel_cipher_
  * camel_cipher_validity_envelope:
  * @parent:
  * @valid:
- * 
+ *
  * Calculate a conglomerate validity based on wrapping one secure part inside
  * another one.
  **/
@@ -558,11 +558,11 @@ static void
 camel_cipher_context_finalise (CamelObject *o)
 {
        CamelCipherContext *context = (CamelCipherContext *)o;
-       
+
        camel_object_unref (CAMEL_OBJECT (context->session));
-       
+
        g_mutex_free (context->priv->lock);
-       
+
        g_free (context->priv);
 }
 
@@ -570,7 +570,7 @@ static void
 camel_cipher_context_class_init (CamelCipherContextClass *camel_cipher_context_class)
 {
        parent_class = camel_type_get_global_classfuncs (camel_object_get_type ());
-       
+
        camel_cipher_context_class->hash_to_id = cipher_hash_to_id;
        camel_cipher_context_class->id_to_hash = cipher_id_to_hash;
        camel_cipher_context_class->sign = cipher_sign;
@@ -585,7 +585,7 @@ CamelType
 camel_cipher_context_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_object_get_type (),
                                            "CamelCipherContext",
@@ -596,7 +596,7 @@ camel_cipher_context_get_type (void)
                                            (CamelObjectInitFunc) camel_cipher_context_init,
                                            (CamelObjectFinalizeFunc) camel_cipher_context_finalise);
        }
-       
+
        return type;
 }
 
@@ -610,11 +610,11 @@ cc_prepare_sign(CamelMimePart *part)
        CamelDataWrapper *dw;
        CamelTransferEncoding encoding;
        int parts, i;
-       
+
        dw = camel_medium_get_content_object((CamelMedium *)part);
        if (!dw)
                return;
-       
+
        if (CAMEL_IS_MULTIPART (dw)) {
                parts = camel_multipart_get_number((CamelMultipart *)dw);
                for (i = 0; i < parts; i++)
@@ -636,11 +636,11 @@ cc_prepare_sign(CamelMimePart *part)
  * @part: Part to write.
  * @flags: flags for the canonicalisation filter (CamelMimeFilterCanon)
  * @ostream: stream to write canonicalised output to.
- * 
+ *
  * Writes a part to a stream in a canonicalised format, suitable for signing/encrypting.
  *
  * The transfer encoding paramaters for the part may be changed by this function.
- * 
+ *
  * Return value: -1 on error;
  **/
 int
index 53ee528..de5be44 100644 (file)
@@ -99,11 +99,11 @@ struct _CamelCipherValidity {
 
 typedef struct _CamelCipherContext {
        CamelObject parent_object;
-       
+
        struct _CamelCipherContextPrivate *priv;
-       
+
        CamelSession *session;
-       
+
        /* these MUST be set by implementors */
        const char *sign_protocol;
        const char *encrypt_protocol;
@@ -112,25 +112,25 @@ typedef struct _CamelCipherContext {
 
 typedef struct _CamelCipherContextClass {
        CamelObjectClass parent_class;
-       
+
        CamelCipherHash       (*id_to_hash)(CamelCipherContext *context, const char *id);
        const char *          (*hash_to_id)(CamelCipherContext *context, CamelCipherHash hash);
-       
+
        int                   (*sign)      (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
                                            struct _CamelMimePart *ipart, struct _CamelMimePart *opart, CamelException *ex);
-       
+
        CamelCipherValidity * (*verify)    (CamelCipherContext *context, struct _CamelMimePart *ipart, CamelException *ex);
-       
+
        int                   (*encrypt)   (CamelCipherContext *context, const char *userid,
                                            GPtrArray *recipients, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
                                            CamelException *ex);
-       
+
        CamelCipherValidity  *(*decrypt)  (CamelCipherContext *context, struct _CamelMimePart *ipart, struct _CamelMimePart *opart,
                                           CamelException *ex);
-       
+
        int                   (*import_keys) (CamelCipherContext *context, struct _CamelStream *istream,
                                              CamelException *ex);
-       
+
        int                   (*export_keys) (CamelCipherContext *context, GPtrArray *keys,
                                              struct _CamelStream *ostream, CamelException *ex);
 } CamelCipherContextClass;
index 08dedf7..b1b607a 100644 (file)
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -93,7 +93,7 @@ static void data_cache_finalise(CamelDataCache *cdc)
        p = cdc->priv;
        camel_object_bag_destroy(p->busy_bag);
        g_free(p);
-       
+
        g_free (cdc->path);
 }
 
@@ -101,7 +101,7 @@ CamelType
 camel_data_cache_get_type(void)
 {
        static CamelType camel_data_cache_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_data_cache_type == CAMEL_INVALID_TYPE) {
                camel_data_cache_type = camel_type_register(
                        CAMEL_OBJECT_TYPE, "CamelDataCache",
@@ -120,10 +120,10 @@ camel_data_cache_get_type(void)
  * camel_data_cache_new:
  * @path: Base path of cache, subdirectories will be created here.
  * @flags: Open flags, none defined.
- * @ex: 
- * 
+ * @ex:
+ *
  * Create a new data cache.
- * 
+ *
  * Return value: A new cache object, or NULL if the base path cannot
  * be written to.
  **/
@@ -152,9 +152,9 @@ camel_data_cache_new(const char *path, guint32 flags, CamelException *ex)
  * camel_data_cache_set_expire_age:
  * @cdc: A #CamelDataCache
  * @when: Timeout for age expiry, or -1 to disable.
- * 
+ *
  * Set the cache expiration policy for aged entries.
- * 
+ *
  * Items in the cache older than @when seconds may be
  * flushed at any time.  Items are expired in a lazy
  * manner, so it is indeterminate when the items will
@@ -173,7 +173,7 @@ camel_data_cache_set_expire_age(CamelDataCache *cdc, time_t when)
  * camel_data_cache_set_expire_access:
  * @cdc: A #CamelDataCache
  * @when: Timeout for access, or -1 to disable access expiry.
- * 
+ *
  * Set the cache expiration policy for access times.
  *
  * Items in the cache which haven't been accessed for @when
@@ -207,7 +207,7 @@ data_cache_expire(CamelDataCache *cdc, const char *path, const char *keep, time_
        while ( (dname = g_dir_read_name(dir)) ) {
                if (strcmp(dname, keep) == 0)
                        continue;
-               
+
                g_string_printf (s, "%s/%s", path, dname);
                dd(printf("Checking '%s' for expiry\n", s->str));
                if (g_stat(s->str, &st) == 0
@@ -241,8 +241,8 @@ data_cache_path(CamelDataCache *cdc, int create, const char *path, const char *k
        hash = (hash>>5)&CAMEL_DATA_CACHE_MASK;
        dir = alloca(strlen(cdc->path) + strlen(path) + 8);
        sprintf(dir, "%s/%s/%02x", cdc->path, path, hash);
-       
-#ifdef G_OS_WIN32 
+
+#ifdef G_OS_WIN32
        if (g_access(dir, F_OK) == -1) {
 #else
        if (access (dir, F_OK) == -1) {
@@ -276,13 +276,13 @@ data_cache_path(CamelDataCache *cdc, int create, const char *path, const char *k
  * @cdc: A #CamelDataCache
  * @path: Relative path of item to add.
  * @key: Key of item to add.
- * @ex: 
- * 
+ * @ex:
+ *
  * Add a new item to the cache.
  *
  * The key and the path combine to form a unique key used to store
  * the item.
- * 
+ *
  * Potentially, expiry processing will be performed while this call
  * is executing.
  *
@@ -324,13 +324,13 @@ camel_data_cache_add(CamelDataCache *cdc, const char *path, const char *key, Cam
  * @cdc: A #CamelDataCache
  * @path: Path to the (sub) cache the item exists in.
  * @key: Key for the cache item.
- * @ex: 
- * 
+ * @ex:
+ *
  * Lookup an item in the cache.  If the item exists, a stream
  * is returned for the item.  The stream may be shared by
  * multiple callers, so ensure the stream is in a valid state
  * through external locking.
- * 
+ *
  * Return value: A cache item, or NULL if the cache item does not exist.
  **/
 CamelStream *
@@ -356,13 +356,13 @@ camel_data_cache_get(CamelDataCache *cdc, const char *path, const char *key, Cam
 /**
  * camel_data_cache_remove:
  * @cdc: A #CamelDataCache
- * @path: 
- * @key: 
- * @ex: 
- * 
+ * @path:
+ * @key:
+ * @ex:
+ *
  * Remove/expire a cache item.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 int
 camel_data_cache_remove(CamelDataCache *cdc, const char *path, const char *key, CamelException *ex)
@@ -395,16 +395,16 @@ camel_data_cache_remove(CamelDataCache *cdc, const char *path, const char *key,
 
 /**
  * camel_data_cache_rename:
- * @cache: 
- * @old: 
- * @new: 
- * @ex: 
- * 
+ * @cache:
+ * @old:
+ * @new:
+ * @ex:
+ *
  * Rename a cache path.  All cache items accessed from the old path
  * are accessible using the new path.
  *
  * CURRENTLY UNIMPLEMENTED
- * 
+ *
  * Return value: -1 on error.
  **/
 int camel_data_cache_rename(CamelDataCache *cache,
@@ -416,13 +416,13 @@ int camel_data_cache_rename(CamelDataCache *cache,
 
 /**
  * camel_data_cache_clear:
- * @cache: 
+ * @cache:
  * @path: Path to clear, or NULL to clear all items in
  * all paths.
- * @ex: 
- * 
+ * @ex:
+ *
  * Clear all items in a given cache path or all items in the cache.
- * 
+ *
  * CURRENTLY_UNIMPLEMENTED
  *
  * Return value: -1 on error.
index 60b4b3c..7224c64 100644 (file)
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 9e94e79..480a76f 100644 (file)
@@ -71,10 +71,10 @@ static void
 camel_data_wrapper_init (gpointer object, gpointer klass)
 {
        CamelDataWrapper *camel_data_wrapper = CAMEL_DATA_WRAPPER (object);
-       
+
        camel_data_wrapper->priv = g_malloc (sizeof (struct _CamelDataWrapperPrivate));
        pthread_mutex_init (&camel_data_wrapper->priv->stream_lock, NULL);
-       
+
        camel_data_wrapper->mime_type = camel_content_type_new ("application", "octet-stream");
        camel_data_wrapper->encoding = CAMEL_TRANSFER_ENCODING_DEFAULT;
        camel_data_wrapper->offline = FALSE;
@@ -84,14 +84,14 @@ static void
 camel_data_wrapper_finalize (CamelObject *object)
 {
        CamelDataWrapper *camel_data_wrapper = CAMEL_DATA_WRAPPER (object);
-       
+
        pthread_mutex_destroy (&camel_data_wrapper->priv->stream_lock);
-       
+
        g_free (camel_data_wrapper->priv);
-       
+
        if (camel_data_wrapper->mime_type)
                camel_content_type_unref (camel_data_wrapper->mime_type);
-       
+
        if (camel_data_wrapper->stream)
                camel_object_unref (camel_data_wrapper->stream);
 }
@@ -100,7 +100,7 @@ CamelType
 camel_data_wrapper_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (CAMEL_OBJECT_TYPE,
                                            "CamelDataWrapper",
@@ -111,7 +111,7 @@ camel_data_wrapper_get_type (void)
                                            (CamelObjectInitFunc) camel_data_wrapper_init,
                                            (CamelObjectFinalizeFunc) camel_data_wrapper_finalize);
        }
-       
+
        return type;
 }
 
@@ -133,21 +133,21 @@ static ssize_t
 write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
 {
        ssize_t ret;
-       
+
        if (data_wrapper->stream == NULL) {
                return -1;
        }
-       
+
        CAMEL_DATA_WRAPPER_LOCK (data_wrapper, stream_lock);
        if (camel_stream_reset (data_wrapper->stream) == -1) {
                CAMEL_DATA_WRAPPER_UNLOCK (data_wrapper, stream_lock);
                return -1;
        }
-       
+
        ret = camel_stream_write_to_stream (data_wrapper->stream, stream);
-       
+
        CAMEL_DATA_WRAPPER_UNLOCK (data_wrapper, stream_lock);
-       
+
        return ret;
 }
 
@@ -181,9 +181,9 @@ decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
        CamelMimeFilter *filter;
        CamelStream *fstream;
        ssize_t ret;
-       
+
        fstream = (CamelStream *) camel_stream_filter_new_with_stream (stream);
-       
+
        switch (data_wrapper->encoding) {
        case CAMEL_TRANSFER_ENCODING_BASE64:
                filter = (CamelMimeFilter *) camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_BASE64_DEC);
@@ -203,18 +203,18 @@ decode_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
        default:
                break;
        }
-       
+
        if (camel_content_type_is (data_wrapper->mime_type, "text", "*")) {
                filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE,
                                                     CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
                camel_stream_filter_add (CAMEL_STREAM_FILTER (fstream), filter);
                camel_object_unref (filter);
        }
-       
+
        ret = camel_data_wrapper_write_to_stream (data_wrapper, fstream);
        camel_stream_flush (fstream);
        camel_object_unref (fstream);
-       
+
        return ret;
 }
 
@@ -234,7 +234,7 @@ camel_data_wrapper_decode_to_stream (CamelDataWrapper *data_wrapper,
 {
        g_return_val_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper), -1);
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-       
+
        return CDW_CLASS (data_wrapper)->decode_to_stream (data_wrapper, stream);
 }
 
@@ -244,7 +244,7 @@ construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
 {
        if (data_wrapper->stream)
                camel_object_unref (data_wrapper->stream);
-       
+
        data_wrapper->stream = stream;
        camel_object_ref (stream);
        return 0;
@@ -266,7 +266,7 @@ camel_data_wrapper_construct_from_stream (CamelDataWrapper *data_wrapper,
 {
        g_return_val_if_fail (CAMEL_IS_DATA_WRAPPER (data_wrapper), -1);
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-       
+
        return CDW_CLASS (data_wrapper)->construct_from_stream (data_wrapper, stream);
 }
 
index 1f0810b..70a6779 100644 (file)
@@ -41,18 +41,18 @@ G_BEGIN_DECLS
 struct _CamelDataWrapper {
        CamelObject parent_object;
        struct _CamelDataWrapperPrivate *priv;
-       
+
        CamelTransferEncoding encoding;
-       
+
        CamelContentType *mime_type;
        CamelStream *stream;
-       
+
        unsigned int offline:1;
 };
 
 typedef struct {
        CamelObjectClass parent_class;
-       
+
        /* Virtual methods */
        void                (*set_mime_type)          (CamelDataWrapper *data_wrapper,
                                                       const char *mime_type);
@@ -60,16 +60,16 @@ typedef struct {
        CamelContentType *  (*get_mime_type_field)    (CamelDataWrapper *data_wrapper);
        void                (*set_mime_type_field)    (CamelDataWrapper *data_wrapper,
                                                       CamelContentType *mime_type_field);
-       
+
        ssize_t             (*write_to_stream)        (CamelDataWrapper *data_wrapper,
                                                       CamelStream *stream);
-       
+
        ssize_t             (*decode_to_stream)       (CamelDataWrapper *data_wrapper,
                                                       CamelStream *stream);
-       
+
        int                 (*construct_from_stream)  (CamelDataWrapper *data_wrapper,
                                                       CamelStream *);
-       
+
        gboolean            (*is_offline)             (CamelDataWrapper *data_wrapper);
 } CamelDataWrapperClass;
 
index 0cba9c4..6a32d78 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright 2004 Novell Inc. (www.novell.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -34,8 +34,8 @@ static GHashTable *debug_table = NULL;
 
 /**
  * camel_debug_init:
- * @void: 
- * 
+ * @void:
+ *
  * Init camel debug.  Maintain legacy CAMEL_VERBOSE_DEBUG as well as the
  * new CAMEL_DEBUG based environment variable interfaces.
  *
@@ -77,14 +77,14 @@ void camel_debug_init(void)
 
 /**
  * camel_debug:
- * @mode: 
- * 
+ * @mode:
+ *
  * Check to see if a debug mode is activated.  @mode takes one of two forms,
  * a fully qualified 'module:target', or a wildcard 'module' name.  It
  * returns a boolean to indicate if the module or module and target is
  * currently activated for debug output.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 gboolean camel_debug(const char *mode)
 {
@@ -111,7 +111,7 @@ gboolean camel_debug(const char *mode)
                        /* Now check ':subsystem' */
                        *colon = ':';
                        if (g_hash_table_lookup(debug_table, colon))
-                               return TRUE;            
+                               return TRUE;
                }
        }
 
@@ -122,7 +122,7 @@ static pthread_mutex_t debug_lock = PTHREAD_MUTEX_INITIALIZER;
 /**
  * camel_debug_start:
  * @mode:
- * 
+ *
  * Start debug output for a given mode, used to make sure debug output
  * is output atomically and not interspersed with unrelated stuff.
  *
@@ -143,7 +143,7 @@ camel_debug_start(const char *mode)
 
 /**
  * camel_debug_end:
- * 
+ *
  * Call this when you're done with your debug output.  If and only if
  * you called camel_debug_start, and if it returns TRUE.
  **/
index dd50f5f..dec0060 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright 2004 Novell Inc. (www.novell.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index b66108b..6aef17b 100644 (file)
@@ -72,21 +72,21 @@ static void
 camel_digest_folder_class_init (CamelDigestFolderClass *camel_digest_folder_class)
 {
        CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_digest_folder_class);
-       
+
        parent_class = CAMEL_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_folder_get_type ()));
-       
+
        /* virtual method definition */
-       
+
        /* virtual method overload */
        camel_folder_class->refresh_info = digest_refresh_info;
        camel_folder_class->sync = digest_sync;
        camel_folder_class->expunge = digest_expunge;
        camel_folder_class->get_full_name = digest_get_full_name;
-       
+
        camel_folder_class->get_message = digest_get_message;
        camel_folder_class->append_message = digest_append_message;
        camel_folder_class->transfer_messages_to = digest_transfer_messages_to;
-       
+
        camel_folder_class->search_by_expression = digest_search_by_expression;
        camel_folder_class->search_by_uids = digest_search_by_uids;
        camel_folder_class->search_free = digest_search_free;
@@ -97,11 +97,11 @@ camel_digest_folder_init (gpointer object, gpointer klass)
 {
        CamelDigestFolder *digest_folder = CAMEL_DIGEST_FOLDER (object);
        CamelFolder *folder = CAMEL_FOLDER (object);
-       
+
        folder->folder_flags |= CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY | CAMEL_FOLDER_HAS_SEARCH_CAPABILITY;
-       
+
        folder->summary = camel_digest_summary_new ();
-       
+
        digest_folder->priv = g_new (struct _CamelDigestFolderPrivate, 1);
        digest_folder->priv->message = NULL;
        digest_folder->priv->search = NULL;
@@ -113,19 +113,19 @@ digest_finalize (CamelObject *object)
 {
        CamelDigestFolder *digest_folder = CAMEL_DIGEST_FOLDER (object);
        CamelFolder *folder = CAMEL_FOLDER (object);
-       
+
        if (folder->summary) {
                camel_object_unref (folder->summary);
                folder->summary = NULL;
        }
-       
+
        camel_object_unref (digest_folder->priv->message);
-       
+
        if (digest_folder->priv->search)
                camel_object_unref (digest_folder->priv->search);
-       
+
        g_mutex_free (digest_folder->priv->search_lock);
-       
+
        g_free (digest_folder->priv);
 }
 
@@ -133,7 +133,7 @@ CamelType
 camel_digest_folder_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (CAMEL_FOLDER_TYPE,
                                            "CamelDigestFolder",
@@ -144,7 +144,7 @@ camel_digest_folder_get_type (void)
                                            (CamelObjectInitFunc) camel_digest_folder_init,
                                            (CamelObjectFinalizeFunc) digest_finalize);
        }
-       
+
        return type;
 }
 
@@ -155,7 +155,7 @@ multipart_contains_message_parts (CamelMultipart *multipart)
        CamelDataWrapper *wrapper;
        CamelMimePart *part;
        int i, parts;
-       
+
        parts = camel_multipart_get_number (multipart);
        for (i = 0; i < parts && !has_message_parts; i++) {
                part = camel_multipart_get_part (multipart, i);
@@ -166,7 +166,7 @@ multipart_contains_message_parts (CamelMultipart *multipart)
                        has_message_parts = TRUE;
                }
        }
-       
+
        return has_message_parts;
 }
 
@@ -178,13 +178,13 @@ digest_add_multipart (CamelFolder *folder, CamelMultipart *multipart, const char
        CamelMimePart *part;
        int parts, i;
        char *uid;
-       
+
        parts = camel_multipart_get_number (multipart);
        for (i = 0; i < parts; i++) {
                part = camel_multipart_get_part (multipart, i);
-               
+
                wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-               
+
                if (CAMEL_IS_MULTIPART (wrapper)) {
                        uid = g_strdup_printf ("%s%d.", preuid, i);
                        digest_add_multipart (folder, CAMEL_MULTIPART (wrapper), uid);
@@ -193,7 +193,7 @@ digest_add_multipart (CamelFolder *folder, CamelMultipart *multipart, const char
                } else if (!CAMEL_IS_MIME_MESSAGE (wrapper)) {
                        continue;
                }
-               
+
                info = camel_folder_summary_info_new_from_message (folder->summary, CAMEL_MIME_MESSAGE (wrapper));
                g_free(info->uid);
                info->uid = g_strdup_printf ("%s%d", preuid, i);
@@ -213,34 +213,34 @@ camel_digest_folder_new (CamelStore *parent_store, CamelMimeMessage *message)
        CamelDigestFolder *digest_folder;
        CamelDataWrapper *wrapper;
        CamelFolder *folder;
-       
+
        wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (message));
        if (!wrapper || !CAMEL_IS_MULTIPART (wrapper))
                return NULL;
-       
+
        /* Make sure we have a multipart/digest subpart or at least some message/rfc822 attachments... */
        if (!camel_content_type_is (CAMEL_DATA_WRAPPER (message)->mime_type, "multipart", "digest")) {
                if (!multipart_contains_message_parts (CAMEL_MULTIPART (wrapper)))
                        return NULL;
        }
-       
+
        folder = CAMEL_FOLDER (camel_object_new (camel_digest_folder_get_type ()));
        digest_folder = CAMEL_DIGEST_FOLDER (folder);
-       
+
        camel_folder_construct (folder, parent_store, "folder_name", "short_name");
-       
+
        camel_object_ref (message);
        digest_folder->priv->message = message;
-       
+
        construct_summary (folder, CAMEL_MULTIPART (wrapper));
-       
+
        return folder;
 }
 
 static void
 digest_refresh_info (CamelFolder *folder, CamelException *ex)
 {
-       
+
 }
 
 static void
@@ -290,26 +290,26 @@ digest_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
        CamelMimePart *part;
        char *subuid;
        int id;
-       
+
        part = CAMEL_MIME_PART (digest->priv->message);
        wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-       
+
        do {
                id = strtoul (uid, &subuid, 10);
                if (!CAMEL_IS_MULTIPART (wrapper))
                        return NULL;
-               
+
                part = camel_multipart_get_part (CAMEL_MULTIPART (wrapper), id);
                wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
                uid = subuid + 1;
        } while (*subuid == '.');
-       
+
        if (!CAMEL_IS_MIME_MESSAGE (wrapper))
                return NULL;
-       
+
        message = CAMEL_MIME_MESSAGE (wrapper);
        camel_object_ref (message);
-       
+
        return message;
 }
 
@@ -318,17 +318,17 @@ digest_search_by_expression (CamelFolder *folder, const char *expression, CamelE
 {
        CamelDigestFolder *df = (CamelDigestFolder *) folder;
        GPtrArray *matches;
-       
+
        CAMEL_DIGEST_FOLDER_LOCK (folder, search_lock);
-       
+
        if (!df->priv->search)
                df->priv->search = camel_folder_search_new ();
-       
+
        camel_folder_search_set_folder (df->priv->search, folder);
        matches = camel_folder_search_search(df->priv->search, expression, NULL, ex);
-       
+
        CAMEL_DIGEST_FOLDER_UNLOCK (folder, search_lock);
-       
+
        return matches;
 }
 
@@ -342,15 +342,15 @@ digest_search_by_uids (CamelFolder *folder, const char *expression, GPtrArray *u
                return g_ptr_array_new();
 
        CAMEL_DIGEST_FOLDER_LOCK (folder, search_lock);
-       
+
        if (!df->priv->search)
                df->priv->search = camel_folder_search_new ();
-       
+
        camel_folder_search_set_folder (df->priv->search, folder);
        matches = camel_folder_search_search(df->priv->search, expression, NULL, ex);
-       
+
        CAMEL_DIGEST_FOLDER_UNLOCK (folder, search_lock);
-       
+
        return matches;
 }
 
@@ -358,10 +358,10 @@ static void
 digest_search_free (CamelFolder *folder, GPtrArray *result)
 {
        CamelDigestFolder *digest_folder = CAMEL_DIGEST_FOLDER (folder);
-       
+
        CAMEL_DIGEST_FOLDER_LOCK (folder, search_lock);
-       
+
        camel_folder_search_free_result (digest_folder->priv->search, result);
-       
+
        CAMEL_DIGEST_FOLDER_UNLOCK (folder, search_lock);
 }
index 8a2762c..48b2616 100644 (file)
@@ -38,13 +38,13 @@ typedef struct _CamelDigestFolderClass CamelDigestFolderClass;
 
 struct _CamelDigestFolder {
        CamelFolder parent;
-       
+
        struct _CamelDigestFolderPrivate *priv;
 };
 
 struct _CamelDigestFolderClass {
        CamelFolderClass parent_class;
-       
+
 };
 
 CamelType    camel_digest_folder_get_type (void);
index ebd83cd..77003e0 100644 (file)
@@ -56,7 +56,7 @@ CamelType
 camel_digest_store_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_store_get_type (),
                                            "CamelDigestStore",
@@ -67,7 +67,7 @@ camel_digest_store_get_type (void)
                                            (CamelObjectInitFunc) camel_digest_store_init,
                                            (CamelObjectFinalizeFunc) camel_digest_store_finalise);
        }
-       
+
        return type;
 }
 
@@ -76,19 +76,19 @@ camel_digest_store_class_init (CamelDigestStoreClass *klass)
 {
        CamelObjectClass *object_class = (CamelObjectClass *) klass;
        CamelStoreClass *store_class = (CamelStoreClass *) klass;
-       
+
        parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ()));
-       
+
        /* virtual method overload */
        object_class->setv = digest_setv;
        object_class->getv = digest_getv;
-       
+
        store_class->get_folder = digest_get_folder;
        store_class->rename_folder = digest_rename_folder;
        store_class->delete_folder = digest_delete_folder;
        store_class->get_folder_info = digest_get_folder_info;
        store_class->free_folder_info = camel_store_free_folder_info_full;
-       
+
        store_class->get_trash = digest_get_trash;
        store_class->get_junk = digest_get_junk;
 }
@@ -97,15 +97,15 @@ static void
 camel_digest_store_init (CamelDigestStore *obj)
 {
        CamelStore *store = (CamelStore *) obj;
-       
+
        /* we dont want a vtrash and vjunk on this one */
-       store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);      
+       store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);
 }
 
 static void
 camel_digest_store_finalise (CamelObject *obj)
 {
-       
+
 }
 
 static int
@@ -128,7 +128,7 @@ digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
  * @url:
  *
  * Create a new CamelDigestStore object.
- * 
+ *
  * Return value: A new CamelDigestStore widget.
  **/
 CamelStore *
@@ -136,14 +136,14 @@ camel_digest_store_new (const char *url)
 {
        CamelStore *store;
        CamelURL *uri;
-       
+
        uri = camel_url_new (url, NULL);
        if (!uri)
                return NULL;
-       
+
        store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ()));
        CAMEL_SERVICE (store)->url = uri;
-       
+
        return store;
 }
 
@@ -174,11 +174,11 @@ digest_get_folder_info (CamelStore *store, const char *top, guint32 flags, Camel
 static void
 digest_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
 {
-       
+
 }
 
 static void
 digest_rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
 {
-       
+
 }
index 3bc8b74..329aee6 100644 (file)
@@ -37,12 +37,12 @@ typedef struct _CamelDigestStoreClass CamelDigestStoreClass;
 
 struct _CamelDigestStore {
        CamelStore parent;
-       
+
 };
 
 struct _CamelDigestStoreClass {
        CamelStoreClass parent_class;
-       
+
 };
 
 CamelType camel_digest_store_get_type (void);
index 06ae689..3e75e30 100644 (file)
@@ -41,7 +41,7 @@ CamelType
 camel_digest_summary_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (
                        camel_folder_summary_get_type (),
@@ -53,7 +53,7 @@ camel_digest_summary_get_type(void)
                        (CamelObjectInitFunc) camel_digest_summary_init,
                        (CamelObjectFinalizeFunc) camel_digest_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -67,11 +67,11 @@ static void
 camel_digest_summary_init (CamelDigestSummary *summary)
 {
        CamelFolderSummary *s = (CamelFolderSummary *) summary;
-       
+
        /* subclasses need to set the right instance data sizes */
        s->message_info_size = sizeof (CamelMessageInfo);
        s->content_info_size = sizeof (CamelMessageContentInfo);
-       
+
        /* and a unique file version */
        s->version += CAMEL_DIGEST_SUMMARY_VERSION;
 }
@@ -79,7 +79,7 @@ camel_digest_summary_init (CamelDigestSummary *summary)
 static void
 camel_digest_summary_finalise (CamelObject *object)
 {
-       
+
 }
 
 
index 732879c..6fa515f 100644 (file)
@@ -39,12 +39,12 @@ typedef struct _CamelDigestSummaryClass CamelDigestSummaryClass;
 
 struct _CamelDigestSummary {
        CamelFolderSummary parent_object;
-       
+
 };
 
 struct _CamelDigestSummaryClass {
        CamelFolderSummaryClass parent_class;
-       
+
 };
 
 
index 8c2b11d..37aa738 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-disco-diary.c: class for a disconnected operation log */
 
-/* 
+/*
  * Authors: Dan Winship <danw@ximian.com>
  *
  * Copyright (C) 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -43,7 +43,7 @@
 #include "camel-session.h"
 #include "camel-store.h"
 
-#define d(x) 
+#define d(x)
 
 static void
 camel_disco_diary_class_init (CamelDiscoDiaryClass *camel_disco_diary_class)
index 17504b1..8288350 100644 (file)
@@ -6,8 +6,8 @@
  *
  * Copyright 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 79331b4..b5a8787 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-disco-folder.c: abstract class for a disconnectable folder */
 
-/* 
+/*
  * Authors: Dan Winship <danw@ximian.com>
  *
  * Copyright (C) 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -505,7 +505,7 @@ disco_prepare_for_offline (CamelDiscoFolder *disco_folder,
  * the bodies of all messages described by @expression (using the
  * same syntax as camel_folder_search_by_expression() ).
  **/
-void 
+void
 camel_disco_folder_prepare_for_offline (CamelDiscoFolder *disco_folder,
                                        const char *expression,
                                        CamelException *ex)
index 9e40983..de9a7b9 100644 (file)
@@ -6,8 +6,8 @@
  *
  * Copyright 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 2aba4a9..78efd87 100644 (file)
@@ -36,7 +36,7 @@
 #include "camel-exception.h"
 #include "camel-session.h"
 
-#define d(x) 
+#define d(x)
 
 #define CDS_CLASS(o) (CAMEL_DISCO_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (o)))
 
@@ -70,22 +70,22 @@ camel_disco_store_class_init (CamelDiscoStoreClass *camel_disco_store_class)
                CAMEL_SERVICE_CLASS (camel_disco_store_class);
        CamelStoreClass *camel_store_class =
                CAMEL_STORE_CLASS (camel_disco_store_class);
-       
+
        parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
-       
+
        /* virtual method definition */
        camel_disco_store_class->set_status = set_status;
        camel_disco_store_class->can_work_offline = can_work_offline;
-       
+
        /* virtual method overload */
        camel_object_class->setv = disco_setv;
        camel_object_class->getv = disco_getv;
-       
+
        camel_service_class->construct = disco_construct;
        camel_service_class->connect = disco_connect;
        camel_service_class->disconnect = disco_disconnect;
        camel_service_class->cancel_connect = disco_cancel_connect;
-       
+
        camel_store_class->get_folder = disco_get_folder;
        camel_store_class->get_folder_info = disco_get_folder_info;
 }
@@ -94,7 +94,7 @@ CamelType
 camel_disco_store_get_type (void)
 {
        static CamelType camel_disco_store_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_disco_store_type == CAMEL_INVALID_TYPE) {
                camel_disco_store_type = camel_type_register (
                        CAMEL_STORE_TYPE,
@@ -106,7 +106,7 @@ camel_disco_store_get_type (void)
                        NULL,
                        NULL);
        }
-       
+
        return camel_disco_store_type;
 }
 
@@ -229,18 +229,18 @@ disco_get_folder (CamelStore *store, const char *name,
                  guint32 flags, CamelException *ex)
 {
        CamelDiscoStore *disco_store = CAMEL_DISCO_STORE (store);
-       
+
        switch (camel_disco_store_status (disco_store)) {
        case CAMEL_DISCO_STORE_ONLINE:
                return CDS_CLASS (store)->get_folder_online (store, name, flags, ex);
-               
+
        case CAMEL_DISCO_STORE_OFFLINE:
                return CDS_CLASS (store)->get_folder_offline (store, name, flags, ex);
-               
+
        case CAMEL_DISCO_STORE_RESYNCING:
-               return CDS_CLASS (store)->get_folder_resyncing (store, name, flags, ex);        
+               return CDS_CLASS (store)->get_folder_resyncing (store, name, flags, ex);
        }
-       
+
        g_assert_not_reached ();
        return NULL;
 }
@@ -254,7 +254,7 @@ disco_get_folder_info (CamelStore *store, const char *top,
        switch (camel_disco_store_status (disco_store)) {
        case CAMEL_DISCO_STORE_ONLINE:
                return CDS_CLASS (store)->get_folder_info_online (store, top, flags, ex);
-               
+
        case CAMEL_DISCO_STORE_OFFLINE:
                /* Can't edit subscriptions while offline */
                if ((store->flags & CAMEL_STORE_SUBSCRIPTIONS) &&
@@ -262,13 +262,13 @@ disco_get_folder_info (CamelStore *store, const char *top,
                        camel_disco_store_check_online (disco_store, ex);
                        return NULL;
                }
-               
+
                return CDS_CLASS (store)->get_folder_info_offline (store, top, flags, ex);
-               
+
        case CAMEL_DISCO_STORE_RESYNCING:
                return CDS_CLASS (store)->get_folder_info_resyncing (store, top, flags, ex);
        }
-       
+
        g_assert_not_reached ();
        return NULL;
 }
@@ -315,9 +315,9 @@ set_status(CamelDiscoStore *disco_store, CamelDiscoStoreStatus status, CamelExce
                                GPtrArray *folders;
                                CamelFolder *folder;
                                int i, sync;
-                               
+
                                sync =  camel_url_get_param(((CamelService *)disco_store)->url, "offline_sync") != NULL;
-                               
+
                                folders = camel_object_bag_list(((CamelStore *)disco_store)->folders);
                                for (i=0;i<folders->len;i++) {
                                        folder = folders->pdata[i];
@@ -331,11 +331,11 @@ set_status(CamelDiscoStore *disco_store, CamelDiscoStoreStatus status, CamelExce
                                g_ptr_array_free(folders, TRUE);
                        }
                }
-               
+
                camel_store_sync(CAMEL_STORE (disco_store), FALSE, &x);
                camel_exception_clear(&x);
        }
-       
+
        if (!camel_service_disconnect (CAMEL_SERVICE (disco_store), network_state, ex))
                return;
 
@@ -424,9 +424,9 @@ camel_disco_store_prepare_for_offline(CamelDiscoStore *disco_store, CamelExcepti
                                GPtrArray *folders;
                                CamelFolder *folder;
                                int i, sync;
-                               
+
                                sync =  camel_url_get_param(((CamelService *)disco_store)->url, "offline_sync") != NULL;
-                               
+
                                folders = camel_object_bag_list(((CamelStore *)disco_store)->folders);
                                for (i=0;i<folders->len;i++) {
                                        folder = folders->pdata[i];
@@ -440,7 +440,7 @@ camel_disco_store_prepare_for_offline(CamelDiscoStore *disco_store, CamelExcepti
                                g_ptr_array_free(folders, TRUE);
                        }
                }
-               
+
                camel_store_sync(CAMEL_STORE (disco_store), FALSE, &x);
                camel_exception_clear(&x);
        }
index 6fb2bcb..de794c3 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-disco-store.h: abstruct class for a disconnectable store */
 
-/* 
+/*
  * Authors: Dan Winship <danw@ximian.com>
  *
  * Copyright (C) 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -45,7 +45,7 @@ typedef enum {
 } CamelDiscoStoreStatus;
 
 struct _CamelDiscoStore {
-       CamelStore parent_object;       
+       CamelStore parent_object;
 
        CamelDiscoStoreStatus status;
        CamelDiscoDiary *diary;
index a1ec2e2..f4e1ad0 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  *
- * Author : 
+ * Author :
  *  Bertrand Guiheneuf <bertrand@helixcode.com>
  *
  * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -51,10 +51,10 @@ static pthread_mutex_t exception_mutex = PTHREAD_MUTEX_INITIALIZER;
 static EMemChunk *exception_chunks = NULL;
 
 /**
- * camel_exception_new: allocate a new exception object. 
- * 
+ * camel_exception_new: allocate a new exception object.
+ *
  * Create and returns a new exception object.
- * 
+ *
  * Returns the newly allocated exception object
  **/
 CamelException *
@@ -81,7 +81,7 @@ camel_exception_new (void)
 /**
  * camel_exception_init:
  * @ex: a #CamelException
- * 
+ *
  * Init an exception. This routine is mainly useful when using a
  * statically allocated exception.
  **/
@@ -98,12 +98,12 @@ camel_exception_init (CamelException *ex)
 /**
  * camel_exception_clear:
  * @ex: a #CamelException
- * 
+ *
  * Clear an exception, that is, set the exception ID to
  * #CAMEL_EXCEPTION_NONE and free the description text.  If the
  * exception is %NULL, this funtion just returns.
  **/
-void 
+void
 camel_exception_clear (CamelException *exception)
 {
        if (!exception)
@@ -122,16 +122,16 @@ camel_exception_clear (CamelException *exception)
 /**
  * camel_exception_free:
  * @ex: a #CamelException
- * 
+ *
  * Free an exception object. If the exception is %NULL, nothing is
  * done, the routine simply returns.
  **/
-void 
+void
 camel_exception_free (CamelException *exception)
 {
        if (!exception)
                return;
-       
+
        if (exception->desc)
                g_free (exception->desc);
 
@@ -143,14 +143,14 @@ camel_exception_free (CamelException *exception)
 }
 
 /**
- * camel_exception_set: set an exception 
+ * camel_exception_set: set an exception
  * @ex: a #CamelException
- * @id: exception id 
+ * @id: exception id
  * @desc: textual description of the exception
- * 
- * Set the value of an exception. The exception id is 
- * a unique number representing the exception. The 
- * textual description is a small text explaining 
+ *
+ * Set the value of an exception. The exception id is
+ * a unique number representing the exception. The
+ * textual description is a small text explaining
  * what happened and provoked the exception.
  *
  * When @ex is %NULL, nothing is done, this routine
@@ -178,17 +178,17 @@ camel_exception_set (CamelException *ex, ExceptionId id, const char *desc)
 }
 
 /**
- * camel_exception_setv: set an exception 
+ * camel_exception_setv: set an exception
  * @ex: a #CamelException
- * @id: exception id 
+ * @id: exception id
  * @format: format of the description string. The format string is
  * used as in printf().
- * 
- * Set the value of an exception. The exception id is 
- * a unique number representing the exception. The 
- * textual description is a small text explaining 
- * what happened and provoked the exception. 
- * In this version, the string is created from the format 
+ *
+ * Set the value of an exception. The exception id is
+ * a unique number representing the exception. The
+ * textual description is a small text explaining
+ * what happened and provoked the exception.
+ * In this version, the string is created from the format
  * string and the variable argument list.
  *
  * It is safe to say:
@@ -209,7 +209,7 @@ camel_exception_setv (CamelException *ex, ExceptionId id, const char *format, ..
 
        if (camel_debug("exception"))
                printf("CamelException.setv(%p, %u, '%s')\n", ex, id, desc);
-       
+
        if (!ex) {
                g_free(desc);
                return;
@@ -226,14 +226,14 @@ camel_exception_setv (CamelException *ex, ExceptionId id, const char *format, ..
 
 /**
  * camel_exception_xfer:
- * @ex_dst: Destination exception object 
+ * @ex_dst: Destination exception object
  * @ex_src: Source exception object
- * 
+ *
  * Transfer the content of an exception from an exception object to
  * another.  The destination exception receives the id and the
  * description text of the source exception.
  **/
-void 
+void
 camel_exception_xfer (CamelException *ex_dst,
                      CamelException *ex_src)
 {
@@ -265,9 +265,9 @@ camel_exception_xfer (CamelException *ex_dst,
 /**
  * camel_exception_get_id:
  * @ex: a #CamelException
- * 
+ *
  * Get the id of an exception.
- * 
+ *
  * Returns the exception id (#CAMEL_EXCEPTION_NONE will be returned if
  * @ex is %NULL or unset)
  **/
@@ -276,18 +276,18 @@ camel_exception_get_id (CamelException *ex)
 {
        if (ex)
                return ex->id;
-       
+
        w(g_warning ("camel_exception_get_id called with NULL parameter."));
-       
+
        return CAMEL_EXCEPTION_NONE;
 }
 
 /**
  * camel_exception_get_description:
  * @ex: a #CamelException
- * 
+ *
  * Get the exception description text.
- * 
+ *
  * Returns the exception description text (%NULL will be returned if
  * @ex is %NULL or unset)
  **/
index 9bb09e8..6d4e0b2 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-execpetion.h : exception utils */
 
-/* 
+/*
  *
- * Author : 
+ * Author :
  *  Bertrand Guiheneuf <bertrand@helixcode.com>
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -58,7 +58,7 @@ void                      camel_exception_set           (CamelException *ex,
                                                         const char *desc);
 void                      camel_exception_setv          (CamelException *ex,
                                                         ExceptionId id,
-                                                        const char *format,  
+                                                        const char *format,
                                                         ...);
 
 /* exception content transfer */
index 203e637..3a37142 100644 (file)
@@ -7,8 +7,8 @@
  *
  * Copyright (C) 2000, 2003 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -53,9 +53,9 @@
  * camel_file_util_encode_uint32:
  * @out: file to output to
  * @value: value to output
- * 
+ *
  * Utility function to save an uint32 to a file.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 int
@@ -78,9 +78,9 @@ camel_file_util_encode_uint32 (FILE *out, guint32 value)
  * camel_file_util_decode_uint32:
  * @in: file to read from
  * @dest: pointer to a variable to store the value in
- * 
+ *
  * Retrieve an encoded uint32 from a file.
- * 
+ *
  * Return value: 0 on success, -1 on error.  @*dest will contain the
  * decoded value.
  **/
@@ -109,10 +109,10 @@ camel_file_util_decode_uint32 (FILE *in, guint32 *dest)
  * camel_file_util_encode_fixed_int32:
  * @out: file to output to
  * @value: value to output
- * 
+ *
  * Encode a gint32, performing no compression, but converting
  * to network order.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 int
@@ -131,9 +131,9 @@ camel_file_util_encode_fixed_int32 (FILE *out, gint32 value)
  * camel_file_util_decode_fixed_int32:
  * @in: file to read from
  * @dest: pointer to a variable to store the value in
- * 
+ *
  * Retrieve a gint32.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 int
@@ -185,9 +185,9 @@ camel_file_util_decode_##type(FILE *in, type *dest) \
  * camel_file_util_encode_time_t:
  * @out: file to output to
  * @value: value to output
- * 
+ *
  * Encode a time_t value to the file.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 CFU_ENCODE_T(time_t)
@@ -196,9 +196,9 @@ CFU_ENCODE_T(time_t)
  * camel_file_util_decode_time_t:
  * @in: file to read from
  * @dest: pointer to a variable to store the value in
- * 
+ *
  * Decode a time_t value.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 CFU_DECODE_T(time_t)
@@ -207,9 +207,9 @@ CFU_DECODE_T(time_t)
  * camel_file_util_encode_off_t:
  * @out: file to output to
  * @value: value to output
- * 
+ *
  * Encode an off_t type.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 CFU_ENCODE_T(off_t)
@@ -219,9 +219,9 @@ CFU_ENCODE_T(off_t)
  * camel_file_util_decode_off_t:
  * @in: file to read from
  * @dest: pointer to a variable to put the value in
- * 
+ *
  * Decode an off_t type.
- * 
+ *
  * Return value: 0 on success, -1 on failure.
  **/
 CFU_DECODE_T(off_t)
@@ -230,9 +230,9 @@ CFU_DECODE_T(off_t)
  * camel_file_util_encode_size_t:
  * @out: file to output to
  * @value: value to output
- * 
+ *
  * Encode an size_t type.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 CFU_ENCODE_T(size_t)
@@ -242,9 +242,9 @@ CFU_ENCODE_T(size_t)
  * camel_file_util_decode_size_t:
  * @in: file to read from
  * @dest: pointer to a variable to put the value in
- * 
+ *
  * Decode an size_t type.
- * 
+ *
  * Return value: 0 on success, -1 on failure.
  **/
 CFU_DECODE_T(size_t)
@@ -254,9 +254,9 @@ CFU_DECODE_T(size_t)
  * camel_file_util_encode_string:
  * @out: file to output to
  * @str: value to output
- * 
+ *
  * Encode a normal string and save it in the output file.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 int
@@ -266,10 +266,10 @@ camel_file_util_encode_string (FILE *out, const char *str)
 
        if (str == NULL)
                return camel_file_util_encode_uint32 (out, 1);
-       
+
        if ((len = strlen (str)) > 65536)
                len = 65536;
-       
+
        if (camel_file_util_encode_uint32 (out, len+1) == -1)
                return -1;
        if (len == 0 || fwrite (str, len, 1, out) == 1)
@@ -282,9 +282,9 @@ camel_file_util_encode_string (FILE *out, const char *str)
  * camel_file_util_decode_string:
  * @in: file to read from
  * @str: pointer to a variable to store the value in
- * 
+ *
  * Decode a normal string from the input file.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 int
@@ -321,11 +321,11 @@ camel_file_util_decode_string (FILE *in, char **str)
  * @out: file to output to
  * @str: value to output
  * @len: total-len of str to store
- * 
+ *
  * Encode a normal string and save it in the output file.
  * Unlike @camel_file_util_encode_string, it pads the
  * @str with "NULL" bytes, if @len is > strlen(str)
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 int
@@ -340,7 +340,7 @@ camel_file_util_encode_fixed_string (FILE *out, const char *str, size_t len)
        /* Max size is 64K */
        if (len > 65536)
                len = 65536;
-               
+
        memset(buf, 0x00, len);
        g_strlcpy(buf, str, len);
 
@@ -355,10 +355,10 @@ camel_file_util_encode_fixed_string (FILE *out, const char *str, size_t len)
  * camel_file_util_decode_fixed_string:
  * @in: file to read from
  * @str: pointer to a variable to store the value in
- * @len: total-len to decode.  
- * 
+ * @len: total-len to decode.
+ *
  * Decode a normal string from the input file.
- * 
+ *
  * Return value: 0 on success, -1 on error.
  **/
 int
@@ -403,7 +403,7 @@ camel_file_util_safe_filename (const char *name)
 
        if (name == NULL)
                return NULL;
-       
+
        return camel_url_encode(name, unsafe_chars);
 }
 
@@ -429,7 +429,7 @@ camel_read (int fd, char *buf, size_t n)
 {
        ssize_t nread;
        int cancel_fd;
-       
+
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
@@ -447,10 +447,10 @@ camel_read (int fd, char *buf, size_t n)
 #ifndef G_OS_WIN32
                int errnosav, flags, fdmax;
                fd_set rdset;
-               
+
                flags = fcntl (fd, F_GETFL);
                fcntl (fd, F_SETFL, flags | O_NONBLOCK);
-               
+
                do {
                        struct timeval tv;
                        int res;
@@ -471,7 +471,7 @@ camel_read (int fd, char *buf, size_t n)
                        else if (FD_ISSET (cancel_fd, &rdset)) {
                                errno = EINTR;
                                goto failed;
-                       } else {                                
+                       } else {
                                do {
                                        nread = read (fd, buf, n);
                                } while (nread == -1 && errno == EINTR);
@@ -483,7 +483,7 @@ camel_read (int fd, char *buf, size_t n)
                errno = errnosav;
 #endif
        }
-       
+
        return nread;
 }
 
@@ -507,7 +507,7 @@ camel_write (int fd, const char *buf, size_t n)
 {
        ssize_t w, written = 0;
        int cancel_fd;
-       
+
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
@@ -529,10 +529,10 @@ camel_write (int fd, const char *buf, size_t n)
 #ifndef G_OS_WIN32
                int errnosav, flags, fdmax;
                fd_set rdset, wrset;
-               
+
                flags = fcntl (fd, F_GETFL);
                fcntl (fd, F_SETFL, flags | O_NONBLOCK);
-               
+
                fdmax = MAX (fd, cancel_fd) + 1;
                do {
                        struct timeval tv;
@@ -543,7 +543,7 @@ camel_write (int fd, const char *buf, size_t n)
                        FD_SET (fd, &wrset);
                        FD_SET (cancel_fd, &rdset);
                        tv.tv_sec = IO_TIMEOUT;
-                       tv.tv_usec = 0;                 
+                       tv.tv_usec = 0;
                        w = -1;
 
                        res = select (fdmax, &rdset, &wrset, 0, &tv);
@@ -558,7 +558,7 @@ camel_write (int fd, const char *buf, size_t n)
                                do {
                                        w = write (fd, buf + written, n - written);
                                } while (w == -1 && errno == EINTR);
-                               
+
                                if (w == -1) {
                                        if (errno == EAGAIN || errno == EWOULDBLOCK)
                                                w = 0;
@@ -566,16 +566,16 @@ camel_write (int fd, const char *buf, size_t n)
                                        written += w;
                        }
                } while (w != -1 && written < n);
-               
+
                errnosav = errno;
                fcntl (fd, F_SETFL, flags);
                errno = errnosav;
 #endif
        }
-       
+
        if (w == -1)
                return -1;
-       
+
        return written;
 }
 
@@ -601,7 +601,7 @@ camel_read_socket (int fd, char *buf, size_t n)
 #else
        ssize_t nread;
        int cancel_fd;
-       
+
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
@@ -638,14 +638,14 @@ camel_read_socket (int fd, char *buf, size_t n)
                        else if (FD_ISSET (cancel_fd, &rdset)) {
                                errno = EINTR;
                                goto failed;
-                       } else {                                
+                       } else {
                                nread = recv (fd, buf, n, 0);
                        }
                } while (nread == -1 && WSAGetLastError () == WSAEWOULDBLOCK);
        failed:
                ;
        }
-       
+
        return nread;
 #endif
 }
@@ -671,7 +671,7 @@ camel_write_socket (int fd, const char *buf, size_t n)
 #else
        ssize_t w, written = 0;
        int cancel_fd;
-       
+
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
@@ -702,7 +702,7 @@ camel_write_socket (int fd, const char *buf, size_t n)
                        FD_SET (fd, &wrset);
                        FD_SET (cancel_fd, &rdset);
                        tv.tv_sec = IO_TIMEOUT;
-                       tv.tv_usec = 0;                 
+                       tv.tv_usec = 0;
                        w = -1;
 
                        res = select (fdmax, &rdset, &wrset, 0, &tv);
@@ -724,10 +724,10 @@ camel_write_socket (int fd, const char *buf, size_t n)
                arg = 0;
                ioctlsocket (fd, FIONBIO, &arg);
        }
-       
+
        if (w == -1)
                return -1;
-       
+
        return written;
 #endif
 }
@@ -736,11 +736,11 @@ camel_write_socket (int fd, const char *buf, size_t n)
 /**
  * camel_file_util_savename:
  * @filename: a pathname
- * 
+ *
  * Builds a pathname where the basename is of the form ".#" + the
  * basename of @filename, for instance used in a two-stage commit file
  * write.
- * 
+ *
  * Return value: The new pathname.  It must be free'd with g_free().
  **/
 char *
index e8d495a..f56de70 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
-/* 
+/*
  * Authors:
  *   Michael Zucchi <notzed@ximian.com>
  *   Jeffrey Stedfast <fejj@ximian.com>
@@ -8,8 +8,8 @@
  *
  * Copyright (C) 2000, 2003 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 6de8fec..ba12c24 100644 (file)
@@ -82,46 +82,46 @@ struct _CamelFilterDriverPrivate {
        CamelSession *session;
 
        CamelFolder *defaultfolder;        /* defualt folder */
-       
+
        CamelFilterStatusFunc *statusfunc; /* status callback */
        void *statusdata;                  /* status callback data */
-       
+
        CamelFilterShellFunc *shellfunc;    /* execute shell command callback */
        void *shelldata;                    /* execute shell command callback data */
-       
+
        CamelFilterPlaySoundFunc *playfunc; /* play-sound command callback */
        void *playdata;                     /* play-sound command callback data */
-       
+
        CamelFilterSystemBeepFunc *beep;    /* system beep callback */
        void *beepdata;                     /* system beep callback data */
-       
+
        /* for callback */
        CamelFilterGetFolderFunc get_folder;
        void *data;
-       
+
        /* run-time data */
        GHashTable *folders;       /* folders that message has been copied to */
        int closed;                /* close count */
        GHashTable *forwards;      /* addresses that have been forwarded the message */
        GHashTable *only_once;     /* actions to run only-once */
-       
+
        gboolean terminated;       /* message processing was terminated */
        gboolean deleted;          /* message was marked for deletion */
        gboolean copied;           /* message was copied to some folder or another */
        gboolean moved;            /* message was moved to some folder or another */
-       
+
        CamelMimeMessage *message; /* input message */
        CamelMessageInfo *info;    /* message summary info */
        const char *uid;           /* message uid */
        CamelFolder *source;       /* message source folder */
        gboolean modified;         /* has the input message been modified? */
-       
+
        FILE *logfile;             /* log file */
-       
+
        EDList rules;              /* list of _filter_rule structs */
-       
+
        CamelException *ex;
-       
+
        /* evaluator */
        ESExp *eval;
 };
@@ -196,7 +196,7 @@ camel_filter_driver_get_type (void)
                                            (CamelObjectInitFunc) camel_filter_driver_init,
                                            (CamelObjectFinalizeFunc) camel_filter_driver_finalise);
        }
-       
+
        return type;
 }
 
@@ -213,7 +213,7 @@ camel_filter_driver_init (CamelFilterDriver *obj)
 {
        struct _CamelFilterDriverPrivate *p;
        int i;
-       
+
        p = _PRIVATE (obj) = g_malloc0 (sizeof (*p));
 
        e_dlist_init(&p->rules);
@@ -227,11 +227,11 @@ camel_filter_driver_init (CamelFilterDriver *obj)
                        e_sexp_add_function (p->eval, 0, symbols[i].name, symbols[i].func, obj);
                }
        }
-       
+
        p->globals = g_hash_table_new (g_str_hash, g_str_equal);
-       
+
        p->folders = g_hash_table_new (g_str_hash, g_str_equal);
-       
+
        p->only_once = g_hash_table_new (g_str_hash, g_str_equal);
 }
 
@@ -246,21 +246,21 @@ static void
 camel_filter_driver_finalise (CamelObject *obj)
 {
        CamelFilterDriver *driver = (CamelFilterDriver *) obj;
-       struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);        
+       struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
        struct _filter_rule *node;
 
        /* close all folders that were opened for appending */
        close_folders (driver);
        g_hash_table_destroy (p->folders);
-       
+
        g_hash_table_foreach (p->globals, free_hash_strings, driver);
        g_hash_table_destroy (p->globals);
-       
+
        g_hash_table_foreach (p->only_once, free_hash_strings, driver);
        g_hash_table_destroy (p->only_once);
-       
+
        e_sexp_unref(p->eval);
-       
+
        if (p->defaultfolder) {
                camel_folder_thaw (p->defaultfolder);
                camel_object_unref (p->defaultfolder);
@@ -307,7 +307,7 @@ void
 camel_filter_driver_set_logfile (CamelFilterDriver *d, FILE *logfile)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-       
+
        p->logfile = logfile;
 }
 
@@ -315,7 +315,7 @@ void
 camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, void *data)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-       
+
        p->statusfunc = func;
        p->statusdata = data;
 }
@@ -324,7 +324,7 @@ void
 camel_filter_driver_set_shell_func (CamelFilterDriver *d, CamelFilterShellFunc *func, void *data)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-       
+
        p->shellfunc = func;
        p->shelldata = data;
 }
@@ -333,7 +333,7 @@ void
 camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, void *data)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-       
+
        p->playfunc = func;
        p->playdata = data;
 }
@@ -342,7 +342,7 @@ void
 camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, void *data)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-       
+
        p->beep = func;
        p->beepdata = data;
 }
@@ -351,14 +351,14 @@ void
 camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
-       
+
        if (p->defaultfolder) {
                camel_folder_thaw (p->defaultfolder);
                camel_object_unref (p->defaultfolder);
        }
-       
+
        p->defaultfolder = def;
-       
+
        if (p->defaultfolder) {
                camel_folder_freeze (p->defaultfolder);
                camel_object_ref (p->defaultfolder);
@@ -383,7 +383,7 @@ camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const char *name)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
        struct _filter_rule *node;
-       
+
        node = (struct _filter_rule *) p->rules.head;
        while (node->next) {
                if (!strcmp (node->name, name)) {
@@ -392,13 +392,13 @@ camel_filter_driver_remove_rule_by_name (CamelFilterDriver *d, const char *name)
                        g_free (node->action);
                        g_free (node->name);
                        g_free (node);
-                       
+
                        return 0;
                }
-               
+
                node = node->next;
        }
-       
+
        return -1;
 }
 
@@ -409,7 +409,7 @@ report_status (CamelFilterDriver *driver, enum camel_filter_status_t status, int
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
        va_list ap;
        char *str;
-       
+
        if (p->statusfunc) {
                va_start (ap, desc);
                str = g_strdup_vprintf (desc, ap);
@@ -425,7 +425,7 @@ camel_filter_driver_set_global (CamelFilterDriver *d, const char *name, const ch
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
        char *oldkey, *oldvalue;
-       
+
        if (g_hash_table_lookup_extended (p->globals, name, (void *)&oldkey, (void *)&oldvalue)) {
                g_free (oldvalue);
                g_hash_table_insert (p->globals, oldkey, g_strdup (value));
@@ -439,11 +439,11 @@ static ESExpResult *
 do_delete (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        d(fprintf (stderr, "doing delete\n"));
        p->deleted = TRUE;
        camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Delete");
-       
+
        return NULL;
 }
 
@@ -451,11 +451,11 @@ static ESExpResult *
 mark_forward (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        /*struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);*/
-       
+
        d(fprintf (stderr, "marking message for forwarding\n"));
        /* FIXME: do stuff here */
        camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Forward");
-       
+
        return NULL;
 }
 
@@ -464,25 +464,25 @@ do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
        int i;
-       
+
        d(fprintf (stderr, "copying message...\n"));
-       
+
        for (i = 0; i < argc; i++) {
                if (argv[i]->type == ESEXP_RES_STRING) {
                        /* open folders we intent to copy to */
                        char *folder = argv[i]->value.string;
                        CamelFolder *outbox;
-                       
+
                        outbox = open_folder (driver, folder);
                        if (!outbox)
                                break;
-                       
+
                        if (outbox == p->source)
                                break;
-                       
+
                        if (!p->modified && p->uid && p->source && camel_folder_has_summary_capability (p->source)) {
                                GPtrArray *uids;
-                               
+
                                uids = g_ptr_array_new ();
                                g_ptr_array_add (uids, (char *) p->uid);
                                camel_folder_transfer_messages_to (p->source, uids, outbox, NULL, FALSE, p->ex);
@@ -490,21 +490,21 @@ do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
                        } else {
                                if (p->message == NULL)
                                        p->message = camel_folder_get_message (p->source, p->uid, p->ex);
-                               
+
                                if (!p->message)
                                        continue;
-                               
+
                                camel_folder_append_message (outbox, p->message, p->info, NULL, p->ex);
                        }
-                       
+
                        if (!camel_exception_is_set (p->ex))
                                p->copied = TRUE;
-                       
+
                        camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to folder %s",
                                                 folder);
                }
        }
-       
+
        return NULL;
 }
 
@@ -513,20 +513,20 @@ do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
        int i;
-       
+
        d(fprintf (stderr, "moving message...\n"));
-       
+
        for (i = 0; i < argc; i++) {
                if (argv[i]->type == ESEXP_RES_STRING) {
                        /* open folders we intent to move to */
                        char *folder = argv[i]->value.string;
                        CamelFolder *outbox;
                        int last;
-                       
+
                        outbox = open_folder (driver, folder);
                        if (!outbox)
                                break;
-                       
+
                        if (outbox == p->source)
                                break;
 
@@ -543,10 +543,10 @@ do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
                        } else {
                                if (p->message == NULL)
                                        p->message = camel_folder_get_message (p->source, p->uid, p->ex);
-                               
+
                                if (!p->message)
                                        continue;
-                               
+
                                camel_folder_append_message (outbox, p->message, p->info, NULL, p->ex);
 
                                if (!camel_exception_is_set(p->ex) && last) {
@@ -556,7 +556,7 @@ do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
                                                camel_message_info_set_flags(p->info, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_FOLDER_FLAGGED, ~0);
                                }
                        }
-                       
+
                        if (!camel_exception_is_set (p->ex)) {
                                p->moved = TRUE;
                                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Move to folder %s", folder);
@@ -575,11 +575,11 @@ static ESExpResult *
 do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Stopped processing");
        d(fprintf (stderr, "terminating message processing\n"));
        p->terminated = TRUE;
-       
+
        return NULL;
 }
 
@@ -587,7 +587,7 @@ static ESExpResult *
 do_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        d(fprintf (stderr, "setting label tag\n"));
        if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) {
                if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
@@ -596,7 +596,7 @@ do_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
                        camel_message_info_set_user_tag(p->info, "label", argv[0]->value.string);
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set label to %s", argv[0]->value.string);
        }
-       
+
        return NULL;
 }
 
@@ -604,7 +604,7 @@ static ESExpResult *
 do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        d(fprintf (stderr, "setting colour tag\n"));
        if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) {
                if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
@@ -613,7 +613,7 @@ do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDr
                        camel_message_info_set_user_tag(p->info, "colour", argv[0]->value.string);
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set colour to %s", argv[0]->value.string);
        }
-       
+
        return NULL;
 }
 
@@ -621,17 +621,17 @@ static ESExpResult *
 do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        d(fprintf (stderr, "setting score tag\n"));
        if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
                char *value;
-               
+
                value = g_strdup_printf ("%d", argv[0]->value.number);
                camel_message_info_set_user_tag(p->info, "score", value);
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set score to %d", argv[0]->value.number);
                g_free (value);
        }
-       
+
        return NULL;
 }
 
@@ -639,7 +639,7 @@ static ESExpResult *
 do_adjust_score(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE(driver);
-       
+
        d(fprintf (stderr, "adjusting score tag\n"));
        if (argc > 0 && argv[0]->type == ESEXP_RES_INT) {
                char *value;
@@ -652,7 +652,7 @@ do_adjust_score(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFil
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Adjust score (%d) to %s", argv[0]->value.number, value);
                g_free (value);
        }
-       
+
        return NULL;
 }
 
@@ -661,7 +661,7 @@ set_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
        guint32 flags;
-       
+
        d(fprintf (stderr, "setting flag\n"));
        if (argc == 1 && argv[0]->type == ESEXP_RES_STRING) {
                flags = camel_system_flag (argv[0]->value.string);
@@ -671,7 +671,7 @@ set_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
                        camel_message_info_set_flags(p->info, flags | CAMEL_MESSAGE_FOLDER_FLAGGED, ~0);
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Set %s flag", argv[0]->value.string);
        }
-       
+
        return NULL;
 }
 
@@ -680,7 +680,7 @@ unset_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterD
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
        guint32 flags;
-       
+
        d(fprintf (stderr, "unsetting flag\n"));
        if (argc == 1 && argv[0]->type == ESEXP_RES_STRING) {
                flags = camel_system_flag (argv[0]->value.string);
@@ -690,7 +690,7 @@ unset_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterD
                        camel_message_info_set_flags(p->info, flags | CAMEL_MESSAGE_FOLDER_FLAGGED, 0);
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Unset %s flag", argv[0]->value.string);
        }
-       
+
        return NULL;
 }
 
@@ -737,16 +737,16 @@ pipe_to_system (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFil
        child_watch_data_t child_watch_data;
        GSource *source;
        GMainContext *context;
-       
+
        if (argc < 1 || argv[0]->value.string[0] == '\0')
                return 0;
-       
+
        /* make sure we have the message... */
        if (p->message == NULL) {
                if (!(p->message = camel_folder_get_message (p->source, p->uid, p->ex)))
                        return -1;
        }
-       
+
        args = g_ptr_array_new ();
        for (i = 0; i < argc; i++)
                g_ptr_array_add (args, argv[i]->value.string);
@@ -773,24 +773,24 @@ pipe_to_system (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFil
                g_error_free (error);
                return -1;
        }
-       
+
        g_ptr_array_free (args, TRUE);
-       
+
        stream = camel_stream_fs_new_with_fd (pipe_to_child);
        if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (p->message), stream) == -1) {
                camel_object_unref (stream);
                close (pipe_from_child);
                goto wait;
        }
-       
+
        if (camel_stream_flush (stream) == -1) {
                camel_object_unref (stream);
                close (pipe_from_child);
                goto wait;
        }
-       
+
        camel_object_unref (stream);
-       
+
        stream = camel_stream_fs_new_with_fd (pipe_from_child);
        mem = camel_stream_mem_new ();
        if (camel_stream_write_to_stream (stream, mem) == -1) {
@@ -798,15 +798,15 @@ pipe_to_system (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFil
                camel_object_unref (mem);
                goto wait;
        }
-       
+
        camel_object_unref (stream);
        camel_stream_reset (mem);
-       
+
        parser = camel_mime_parser_new ();
        camel_mime_parser_init_with_stream (parser, mem);
        camel_mime_parser_scan_from (parser, FALSE);
        camel_object_unref (mem);
-       
+
        message = camel_mime_message_new ();
        if (camel_mime_part_construct_from_parser ((CamelMimePart *) message, parser) == -1) {
                camel_exception_setv (p->ex, CAMEL_EXCEPTION_SYSTEM,
@@ -820,9 +820,9 @@ pipe_to_system (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFil
                p->message = message;
                p->modified = TRUE;
        }
-       
+
        camel_object_unref (parser);
-       
+
  wait:
        context = g_main_context_new ();
        child_watch_data.loop = g_main_loop_new (context, FALSE);
@@ -850,16 +850,16 @@ static ESExpResult *
 pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        int i;
-       
+
        /* make sure all args are strings */
        for (i = 0; i < argc; i++) {
                if (argv[i]->type != ESEXP_RES_STRING)
                        return NULL;
        }
-       
+
        camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Piping message to %s", argv[0]->value.string);
        pipe_to_system (f, argc, argv, driver);
-       
+
        return NULL;
 }
 
@@ -870,37 +870,37 @@ do_shell (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDri
        GString *command;
        GPtrArray *args;
        int i;
-       
+
        d(fprintf (stderr, "executing shell command\n"));
-       
+
        command = g_string_new ("");
-       
+
        args = g_ptr_array_new ();
-       
+
        /* make sure all args are strings */
        for (i = 0; i < argc; i++) {
                if (argv[i]->type != ESEXP_RES_STRING)
                        goto done;
-               
+
                g_ptr_array_add (args, argv[i]->value.string);
-               
+
                g_string_append (command, argv[i]->value.string);
                g_string_append_c (command, ' ');
        }
-       
+
        g_string_truncate (command, command->len - 1);
-       
+
        if (p->shellfunc && argc >= 1) {
                p->shellfunc (driver, argc, (char **) args->pdata, p->shelldata);
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Executing shell command: [%s]",
                                         command->str);
        }
-       
+
  done:
-       
+
        g_ptr_array_free (args, TRUE);
        g_string_free (command, TRUE);
-       
+
        return NULL;
 }
 
@@ -908,14 +908,14 @@ static ESExpResult *
 do_beep (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        d(fprintf (stderr, "beep\n"));
-       
+
        if (p->beep) {
                p->beep (driver, p->beepdata);
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Beep");
        }
-       
+
        return NULL;
 }
 
@@ -923,14 +923,14 @@ static ESExpResult *
 play_sound (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        d(fprintf (stderr, "play sound\n"));
-       
+
        if (p->playfunc && argc == 1 && argv[0]->type == ESEXP_RES_STRING) {
                p->playfunc (driver, argv[0]->value.string, p->playdata);
                camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Play sound");
        }
-       
+
        return NULL;
 }
 
@@ -938,13 +938,13 @@ static ESExpResult *
 do_only_once (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        d(fprintf (stderr, "only once\n"));
-       
+
        if (argc == 2 && !g_hash_table_lookup (p->only_once, argv[0]->value.string))
                g_hash_table_insert (p->only_once, g_strdup (argv[0]->value.string),
                                     g_strdup (argv[1]->value.string));
-       
+
        return NULL;
 }
 
@@ -953,7 +953,7 @@ open_folder (CamelFilterDriver *driver, const char *folder_url)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
        CamelFolder *camelfolder;
-       
+
        /* we have a lookup table of currently open folders */
        camelfolder = g_hash_table_lookup (p->folders, folder_url);
        if (camelfolder)
@@ -972,20 +972,20 @@ open_folder (CamelFilterDriver *driver, const char *folder_url)
        } else {
                camelfolder = p->get_folder (driver, folder_url, p->data, p->ex);
        }
-       
+
        if (camelfolder) {
                g_hash_table_insert (p->folders, g_strdup (folder_url), camelfolder);
                camel_folder_freeze (camelfolder);
        } else {
                g_hash_table_insert (p->folders, g_strdup (folder_url), FOLDER_INVALID);
        }
-       
+
        return camelfolder;
 }
 
 static void
 close_folder (void *key, void *value, void *data)
-{      
+{
        CamelFolder *folder = value;
        CamelFilterDriver *driver = data;
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
@@ -1014,7 +1014,7 @@ close_folders (CamelFilterDriver *driver)
        g_hash_table_foreach (p->folders, close_folder, driver);
        g_hash_table_destroy (p->folders);
        p->folders = g_hash_table_new (g_str_hash, g_str_equal);
-       
+
        /* FIXME: status from driver */
        return 0;
 }
@@ -1032,17 +1032,17 @@ static void
 camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const char *desc, ...)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
-       
+
        if (p->logfile) {
                char *str = NULL;
-               
+
                if (desc) {
                        va_list ap;
-                       
+
                        va_start (ap, desc);
                        str = g_strdup_vprintf (desc, ap);
                }
-               
+
                switch (status) {
                case FILTER_LOG_START: {
                        /* write log header */
@@ -1050,17 +1050,17 @@ camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, co
                        const char *from = NULL;
                        char date[50];
                        time_t t;
-                       
+
                        /* FIXME: does this need locking?  Probably */
-                       
+
                        from = camel_message_info_from (p->info);
                        subject = camel_message_info_subject (p->info);
-                       
+
                        time (&t);
                        strftime (date, 49, "%a, %d %b %Y %H:%M:%S", localtime (&t));
                        fprintf (p->logfile, "Applied filter \"%s\" to message from %s - \"%s\" at %s\n",
                                 str, from ? from : "unknown", subject ? subject : "", date);
-                       
+
                        break;
                }
                case FILTER_LOG_ACTION:
@@ -1073,7 +1073,7 @@ camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, co
                        /* nothing else is loggable */
                        break;
                }
-               
+
                g_free (str);
        }
 }
@@ -1090,9 +1090,9 @@ run_only_once (gpointer key, char *action, struct _run_only_once *data)
        struct _CamelFilterDriverPrivate *p = _PRIVATE (data->driver);
        CamelException *ex = data->ex;
        ESExpResult *r;
-       
+
        d(printf ("evaluating: %s\n\n", action));
-       
+
        e_sexp_input_text (p->eval, action, strlen (action));
        if (e_sexp_parse (p->eval) == -1) {
                if (!camel_exception_is_set (ex))
@@ -1101,7 +1101,7 @@ run_only_once (gpointer key, char *action, struct _run_only_once *data)
                                              e_sexp_error (p->eval), action);
                goto done;
        }
-       
+
        r = e_sexp_eval (p->eval);
        if (r == NULL) {
                if (!camel_exception_is_set (ex))
@@ -1110,14 +1110,14 @@ run_only_once (gpointer key, char *action, struct _run_only_once *data)
                                              e_sexp_error (p->eval), action);
                goto done;
        }
-       
+
        e_sexp_result_free (p->eval, r);
-       
+
  done:
-       
+
        g_free (key);
        g_free (action);
-       
+
        return TRUE;
 }
 
@@ -1134,13 +1134,13 @@ camel_filter_driver_flush (CamelFilterDriver *driver, CamelException *ex)
 {
        struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
        struct _run_only_once data;
-       
+
        if (!p->only_once)
                return;
-       
+
        data.driver = driver;
        data.ex = ex;
-       
+
        g_hash_table_foreach_remove (p->only_once, (GHRFunc) run_only_once, &data);
 }
 
@@ -1171,7 +1171,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
        int status;
        off_t last = 0;
        int ret = -1;
-       
+
        fd = g_open (mbox, O_RDONLY|O_BINARY, 0);
        if (fd == -1) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to open spool folder"));
@@ -1179,7 +1179,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
        }
        /* to get the filesize */
        fstat (fd, &st);
-       
+
        mp = camel_mime_parser_new ();
        camel_mime_parser_scan_from (mp, TRUE);
        if (camel_mime_parser_init_with_fd (mp, fd) == -1) {
@@ -1187,19 +1187,19 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
                goto fail;
        }
        fd = -1;
-       
+
        source_url = g_filename_to_uri (mbox, NULL, NULL);
-       
+
        while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) {
                CamelMessageInfo *info;
                CamelMimeMessage *msg;
                int pc = 0;
-               
+
                if (st.st_size > 0)
                        pc = (int)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size));
-               
+
                report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d (%d%%)"), i, pc);
-               
+
                msg = camel_mime_message_new ();
                if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (msg), mp) == -1) {
                        camel_exception_set (ex, (errno==EINTR)?CAMEL_EXCEPTION_USER_CANCEL:CAMEL_EXCEPTION_SYSTEM, _("Cannot open message"));
@@ -1207,11 +1207,11 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
                        camel_object_unref (msg);
                        goto fail;
                }
-               
+
                info = camel_message_info_new_from_header(NULL, ((CamelMimePart *)msg)->headers);
                ((CamelMessageInfoBase *)info)->size = camel_mime_parser_tell(mp) - last;
                last = camel_mime_parser_tell(mp);
-               status = camel_filter_driver_filter_message (driver, msg, info, NULL, NULL, source_url, 
+               status = camel_filter_driver_filter_message (driver, msg, info, NULL, NULL, source_url,
                                                             original_source_url ? original_source_url : source_url, ex);
                camel_object_unref (msg);
                if (camel_exception_is_set (ex) || status == -1) {
@@ -1219,22 +1219,22 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
                        camel_message_info_free (info);
                        goto fail;
                }
-               
+
                i++;
-               
+
                /* skip over the FROM_END state */
                camel_mime_parser_step (mp, 0, 0);
 
                camel_message_info_free (info);
        }
-       
+
        if (p->defaultfolder) {
                report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, 100, _("Syncing folder"));
                camel_folder_sync(p->defaultfolder, FALSE, camel_exception_is_set (ex) ? NULL : ex);
        }
-       
+
        report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Complete"));
-       
+
        ret = 0;
 fail:
        g_free (source_url);
@@ -1242,7 +1242,7 @@ fail:
                close (fd);
        if (mp)
                camel_object_unref (mp);
-       
+
        return ret;
 }
 
@@ -1274,64 +1274,64 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde
        int status = 0;
        CamelURL *url;
        int i;
-       
+
        service_url = camel_service_get_url (CAMEL_SERVICE (camel_folder_get_parent_store (folder)));
        url = camel_url_new (service_url, NULL);
        g_free (service_url);
-       
+
        source_url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
        camel_url_free (url);
-       
+
        if (uids == NULL) {
                uids = camel_folder_get_uids (folder);
                freeuids = TRUE;
        }
-       
+
        for (i = 0; i < uids->len; i++) {
                int pc = (100 * i)/uids->len;
-               
+
                report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d of %d"), i+1,
                               uids->len);
-               
+
                if (camel_folder_has_summary_capability (folder))
                        info = camel_folder_get_message_info (folder, uids->pdata[i]);
                else
                        info = NULL;
-               
+
                status = camel_filter_driver_filter_message (driver, NULL, info, uids->pdata[i],
                                                             folder, source_url, source_url, ex);
-               
+
                if (camel_folder_has_summary_capability (folder))
                        camel_folder_free_message_info (folder, info);
-               
+
                if (camel_exception_is_set (ex) || status == -1) {
                        report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed at message %d of %d"),
                                       i+1, uids->len);
                        status = -1;
                        break;
                }
-               
+
                if (remove)
                        camel_folder_set_message_flags (folder, uids->pdata[i],
                                                        CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN, ~0);
-               
+
                if (cache)
                        camel_uid_cache_save_uid (cache, uids->pdata[i]);
        }
-       
+
        if (p->defaultfolder) {
                report_status (driver, CAMEL_FILTER_STATUS_PROGRESS, 100, _("Syncing folder"));
                camel_folder_sync (p->defaultfolder, FALSE, camel_exception_is_set (ex) ? NULL : ex);
        }
-       
+
        if (i == uids->len)
                report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Complete"));
-       
+
        if (freeuids)
                camel_folder_free_uids (folder, uids);
-       
+
        g_free (source_url);
-       
+
        return status;
 }
 
@@ -1349,24 +1349,24 @@ get_message_cb (void *data, CamelException *ex)
        struct _CamelFilterDriverPrivate *p = msgdata->p;
        const char *source_url = msgdata->source_url;
        CamelMimeMessage *message;
-       
+
        if (p->message) {
                message = p->message;
                camel_object_ref (message);
        } else {
                const char *uid;
-               
+
                if (p->uid)
                        uid = p->uid;
                else
                        uid = camel_message_info_uid (p->info);
-               
+
                message = camel_folder_get_message (p->source, uid, ex);
        }
-       
+
        if (source_url && message && camel_mime_message_get_source (message) == NULL)
                camel_mime_message_set_source (message, source_url);
-       
+
        return message;
 }
 
@@ -1404,16 +1404,16 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
        gboolean filtered = FALSE;
        ESExpResult *r;
        int result;
-       
+
        /* FIXME: make me into a g_return_if_fail/g_assert or whatever... */
        if (message == NULL && (source == NULL || uid == NULL)) {
                g_warning ("there is no way to fetch the message using the information provided...");
                return -1;
        }
-       
+
        if (info == NULL) {
                struct _camel_header_raw *h;
-               
+
                if (message) {
                        camel_object_ref (message);
                } else {
@@ -1421,20 +1421,20 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
                        if (!message)
                                return -1;
                }
-               
+
                h = CAMEL_MIME_PART (message)->headers;
                info = camel_message_info_new_from_header (NULL, h);
                freeinfo = TRUE;
        } else {
                if (camel_message_info_flags(info) & CAMEL_MESSAGE_DELETED)
                        return 0;
-               
+
                uid = camel_message_info_uid (info);
-               
+
                if (message)
                        camel_object_ref (message);
        }
-       
+
        p->ex = ex;
        p->terminated = FALSE;
        p->deleted = FALSE;
@@ -1444,24 +1444,24 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
        p->info = info;
        p->uid = uid;
        p->source = source;
-       
+
        if (message && original_source_url && camel_mime_message_get_source (message) == NULL)
                camel_mime_message_set_source (message, original_source_url);
-       
+
        node = (struct _filter_rule *) p->rules.head;
        result = CAMEL_SEARCH_NOMATCH;
        while (node->next && !p->terminated) {
                struct _get_message data;
-               
+
                d(printf("applying rule %s\naction %s\n", node->match, node->action));
-               
+
                data.p = p;
                data.source_url = original_source_url;
-               
-               result = camel_filter_search_match (p->session, get_message_cb, &data, p->info, 
+
+               result = camel_filter_search_match (p->session, get_message_cb, &data, p->info,
                                                    original_source_url ? original_source_url : source_url,
                                                    node->match, p->ex);
-               
+
                switch (result) {
                case CAMEL_SEARCH_ERROR:
                        goto error;
@@ -1493,10 +1493,10 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
                default:
                        break;
                }
-               
+
                node = node->next;
        }
-       
+
        /* *Now* we can set the DELETED flag... */
        if (p->deleted) {
                if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
@@ -1504,7 +1504,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
                else
                        camel_message_info_set_flags(info, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_FOLDER_FLAGGED, ~0);
        }
-       
+
        /* Logic: if !Moved and there exists a default folder... */
        if (!(p->copied && p->deleted) && !p->moved && p->defaultfolder) {
                /* copy it to the default inbox */
@@ -1518,7 +1518,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
 
                if (!p->modified && p->uid && p->source && camel_folder_has_summary_capability (p->source)) {
                        GPtrArray *uids;
-                       
+
                        uids = g_ptr_array_new ();
                        g_ptr_array_add (uids, (char *) p->uid);
                        camel_folder_transfer_messages_to (p->source, uids, p->defaultfolder, NULL, FALSE, p->ex);
@@ -1533,24 +1533,24 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
                        camel_folder_append_message (p->defaultfolder, p->message, p->info, NULL, p->ex);
                }
        }
-       
+
        if (p->message)
                camel_object_unref (p->message);
-       
+
        if (freeinfo)
                camel_message_info_free (info);
-       
+
        return 0;
-       
+
  error:
        if (filtered)
                camel_filter_driver_log (driver, FILTER_LOG_END, NULL);
-       
+
        if (p->message)
                camel_object_unref (p->message);
-       
+
        if (freeinfo)
                camel_message_info_free (info);
-       
+
        return -1;
 }
index df324e3..c7a3156 100644 (file)
@@ -39,7 +39,7 @@ typedef struct _CamelFilterDriverClass CamelFilterDriverClass;
 
 struct _CamelFilterDriver {
        CamelObject parent;
-       
+
        struct _CamelFilterDriverPrivate *priv;
 };
 
index b9b3f32..c4c930d 100644 (file)
@@ -131,12 +131,12 @@ camel_filter_search_get_message (FilterMessageSearch *fms, struct _ESExp *sexp)
 {
        if (fms->message)
                return fms->message;
-       
+
        fms->message = fms->get_message (fms->get_message_data, fms->ex);
-       
+
        if (fms->message == NULL)
                e_sexp_fatal_error (sexp, _("Failed to retrieve message"));
-       
+
        return fms->message;
 }
 
@@ -146,7 +146,7 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
        gboolean matched = FALSE;
        ESExpResult *r;
        int i;
-       
+
        if (argc > 1 && argv[0]->type == ESEXP_RES_STRING) {
                char *name = argv[0]->value.string;
 
@@ -191,10 +191,10 @@ check_header (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
                        }
                }
        }
-       
+
        r = e_sexp_result_new (f, ESEXP_RES_BOOL);
        r->value.bool = matched;
-       
+
        return r;
 }
 
@@ -236,17 +236,17 @@ header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMes
        gboolean matched = FALSE;
        ESExpResult *r;
        int i;
-       
+
        message = camel_filter_search_get_message (fms, f);
-       
+
        for (i = 0; i < argc && !matched; i++) {
                if (argv[i]->type == ESEXP_RES_STRING)
                        matched = camel_medium_get_header (CAMEL_MEDIUM (message), argv[i]->value.string) != NULL;
        }
-       
+
        r = e_sexp_result_new (f, ESEXP_RES_BOOL);
        r->value.bool = matched;
-       
+
        return r;
 }
 
@@ -257,9 +257,9 @@ header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
        CamelMimeMessage *message;
        regex_t pattern;
        const char *contents;
-       
+
        message = camel_filter_search_get_message (fms, f);
-       
+
        if (argc > 1 && argv[0]->type == ESEXP_RES_STRING
            && (contents = camel_medium_get_header (CAMEL_MEDIUM (message), argv[0]->value.string))
            && camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_ICASE, argc-1, argv+1, fms->ex) == 0) {
@@ -267,7 +267,7 @@ header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
                regfree (&pattern);
        } else
                r->value.bool = FALSE;
-       
+
        return r;
 }
 
@@ -278,7 +278,7 @@ get_full_header (CamelMimeMessage *message)
        GString *str = g_string_new ("");
        char   *ret;
        struct _camel_header_raw *h;
-       
+
        for (h = mp->headers; h; h = h->next) {
                if (h->value != NULL) {
                        g_string_append (str, h->name);
@@ -290,10 +290,10 @@ get_full_header (CamelMimeMessage *message)
                        g_string_append_c(str, '\n');
                }
        }
-       
+
        ret = str->str;
        g_string_free (str, FALSE);
-       
+
        return ret;
 }
 
@@ -304,7 +304,7 @@ header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filte
        CamelMimeMessage *message;
        regex_t pattern;
        char *contents;
-       
+
        if (camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_NEWLINE,
                                           argc, argv, fms->ex) == 0) {
                message = camel_filter_search_get_message (fms, f);
@@ -314,7 +314,7 @@ header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filte
                regfree (&pattern);
        } else
                r->value.bool = FALSE;
-       
+
        return r;
 }
 
@@ -323,13 +323,13 @@ match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSe
 {
        /* match-all: when dealing with single messages is a no-op */
        ESExpResult *r;
-       
+
        if (argc > 0)
                return e_sexp_term_eval (f, argv[0]);
-       
+
        r = e_sexp_result_new (f, ESEXP_RES_BOOL);
        r->value.bool = TRUE;
-       
+
        return r;
 }
 
@@ -339,14 +339,14 @@ body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMes
        ESExpResult *r = e_sexp_result_new (f, ESEXP_RES_BOOL);
        CamelMimeMessage *message;
        regex_t pattern;
-       
+
        if (camel_search_build_match_regex (&pattern, CAMEL_SEARCH_MATCH_ICASE, argc, argv, fms->ex) == 0) {
                message = camel_filter_search_get_message (fms, f);
                r->value.bool = camel_search_message_body_contains ((CamelDataWrapper *) message, &pattern);
                regfree (&pattern);
        } else
                r->value.bool = FALSE;
-       
+
        return r;
 }
 
@@ -356,7 +356,7 @@ body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessag
        ESExpResult *r = e_sexp_result_new(f, ESEXP_RES_BOOL);
        CamelMimeMessage *message;
        regex_t pattern;
-       
+
        if (camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_NEWLINE,
                                           argc, argv, fms->ex) == 0) {
                message = camel_filter_search_get_message (fms, f);
@@ -364,7 +364,7 @@ body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessag
                regfree (&pattern);
        } else
                r->value.bool = FALSE;
-       
+
        return r;
 }
 
@@ -374,7 +374,7 @@ user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessage
        ESExpResult *r;
        gboolean truth = FALSE;
        int i;
-       
+
        /* performs an OR of all words */
        for (i = 0; i < argc && !truth; i++) {
                if (argv[i]->type == ESEXP_RES_STRING
@@ -383,10 +383,10 @@ user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessage
                        break;
                }
        }
-       
+
        r = e_sexp_result_new (f, ESEXP_RES_BOOL);
        r->value.bool = truth;
-       
+
        return r;
 }
 
@@ -394,13 +394,13 @@ static ESExpResult *
 system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
 {
        ESExpResult *r;
-       
+
        if (argc != 1 || argv[0]->type != ESEXP_RES_STRING)
                e_sexp_fatal_error(f, _("Invalid arguments to (system-flag)"));
-       
+
        r = e_sexp_result_new (f, ESEXP_RES_BOOL);
        r->value.bool = camel_system_flag_get (camel_message_info_flags(fms->info), argv[0]->value.string);
-       
+
        return r;
 }
 
@@ -412,12 +412,12 @@ user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageS
 
        if (argc != 1 || argv[0]->type != ESEXP_RES_STRING)
                e_sexp_fatal_error(f, _("Invalid arguments to (user-tag)"));
-       
+
        tag = camel_message_info_user_tag(fms->info, argv[0]->value.string);
-       
+
        r = e_sexp_result_new (f, ESEXP_RES_STRING);
        r->value.string = g_strdup (tag ? tag : "");
-       
+
        return r;
 }
 
@@ -426,11 +426,11 @@ get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMes
 {
        CamelMimeMessage *message;
        ESExpResult *r;
-       
+
        message = camel_filter_search_get_message (fms, f);
        r = e_sexp_result_new (f, ESEXP_RES_INT);
        r->value.number = camel_mime_message_get_date (message, NULL);
-       
+
        return r;
 }
 
@@ -439,11 +439,11 @@ get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filte
 {
        CamelMimeMessage *message;
        ESExpResult *r;
-       
+
        message = camel_filter_search_get_message (fms, f);
        r = e_sexp_result_new (f, ESEXP_RES_INT);
        r->value.number = camel_mime_message_get_date_received (message, NULL);
-       
+
        return r;
 }
 
@@ -451,10 +451,10 @@ static ESExpResult *
 get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
 {
        ESExpResult *r;
-       
+
        r = e_sexp_result_new (f, ESEXP_RES_INT);
        r->value.number = time (NULL);
-       
+
        return r;
 }
 
@@ -493,7 +493,7 @@ header_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMes
 
        r = e_sexp_result_new(f, ESEXP_RES_BOOL);
        r->value.bool = truth;
-       
+
        return r;
 }
 
@@ -502,7 +502,7 @@ static ESExpResult *
 get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms)
 {
        ESExpResult *r;
-       
+
        r = e_sexp_result_new(f, ESEXP_RES_INT);
        r->value.number = camel_message_info_size(fms->info) / 1024;
 
@@ -550,15 +550,15 @@ run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessa
        child_watch_data_t child_watch_data;
        GSource *source;
        GMainContext *context;
-       
+
        if (argc < 1 || argv[0]->value.string[0] == '\0')
                return 0;
-       
+
        args = g_ptr_array_new ();
        for (i = 0; i < argc; i++)
                g_ptr_array_add (args, argv[i]->value.string);
        g_ptr_array_add (args, NULL);
-       
+
        if (!g_spawn_async_with_pipes (NULL,
                                       (gchar **) args->pdata,
                                       NULL,
@@ -581,16 +581,16 @@ run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessa
                g_error_free (error);
                return -1;
        }
-       
+
        g_ptr_array_free (args, TRUE);
-       
+
        message = camel_filter_search_get_message (fms, f);
-       
+
        stream = camel_stream_fs_new_with_fd (pipe_to_child);
        camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream);
        camel_stream_flush (stream);
        camel_object_unref (stream);
-       
+
        context = g_main_context_new ();
        child_watch_data.loop = g_main_loop_new (context, FALSE);
        g_main_context_unref (context);
@@ -618,7 +618,7 @@ pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
 {
        ESExpResult *r;
        int retval, i;
-       
+
        /* make sure all args are strings */
        for (i = 0; i < argc; i++) {
                if (argv[i]->type != ESEXP_RES_STRING) {
@@ -626,13 +626,13 @@ pipe_message (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
                        goto done;
                }
        }
-       
+
        retval = run_command (f, argc, argv, fms);
-       
+
  done:
        r = e_sexp_result_new (f, ESEXP_RES_INT);
        r->value.number = retval;
-       
+
        return r;
 }
 
@@ -644,7 +644,7 @@ junk_test (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessage
 
        if (fms->session->junk_plugin != NULL) {
                retval = camel_junk_plugin_check_junk (fms->session->junk_plugin, camel_filter_search_get_message (fms, f));
-               
+
                if (camel_debug ("junk"))
                        printf("junk filter => %s\n", retval ? "*JUNK*" : "clean");
        }
@@ -686,16 +686,16 @@ camel_filter_search_match (CamelSession *session,
        fms.info = info;
        fms.source = source;
        fms.ex = ex;
-       
+
        sexp = e_sexp_new ();
-       
+
        for (i = 0; i < sizeof (symbols) / sizeof (symbols[0]); i++) {
                if (symbols[i].type == 1)
                        e_sexp_add_ifunction (sexp, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, &fms);
                else
                        e_sexp_add_function (sexp, 0, symbols[i].name, symbols[i].func, &fms);
        }
-       
+
        e_sexp_input_text (sexp, expression, strlen (expression));
        if (e_sexp_parse (sexp) == -1) {
                if (!camel_exception_is_set (ex))
@@ -704,7 +704,7 @@ camel_filter_search_match (CamelSession *session,
                                              e_sexp_error (sexp), expression);
                goto error;
        }
-       
+
        result = e_sexp_eval (sexp);
        if (result == NULL) {
                if (!camel_exception_is_set (ex))
@@ -712,25 +712,25 @@ camel_filter_search_match (CamelSession *session,
                                              e_sexp_error (sexp), expression);
                goto error;
        }
-       
+
        if (result->type == ESEXP_RES_BOOL)
                retval = result->value.bool ? CAMEL_SEARCH_MATCHED : CAMEL_SEARCH_NOMATCH;
        else
                retval = CAMEL_SEARCH_NOMATCH;
-       
+
        e_sexp_result_free (sexp, result);
        e_sexp_unref (sexp);
-       
+
        if (fms.message)
                camel_object_unref (fms.message);
-       
+
        return retval;
-       
+
  error:
        if (fms.message)
                camel_object_unref (fms.message);
-       
+
        e_sexp_unref (sexp);
-       
+
        return CAMEL_SEARCH_ERROR;
 }
index f777046..ffb3926 100644 (file)
@@ -49,8 +49,8 @@
 #include "camel-search-private.h"
 #include "camel-stream-mem.h"
 
-#define d(x) 
-#define r(x) 
+#define d(x)
+#define r(x)
 
 struct _CamelFolderSearchPrivate {
        GHashTable *mempool_hash;
@@ -163,7 +163,7 @@ CamelType
 camel_folder_search_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_object_get_type (), "CamelFolderSearch",
                                            sizeof (CamelFolderSearch),
@@ -173,7 +173,7 @@ camel_folder_search_get_type (void)
                                            (CamelObjectInitFunc) camel_folder_search_init,
                                            (CamelObjectFinalizeFunc) camel_folder_search_finalize);
        }
-       
+
        return type;
 }
 
@@ -245,7 +245,7 @@ camel_folder_search_construct (CamelFolderSearch *search)
  * camel_folder_search_new:
  *
  * Create a new CamelFolderSearch object.
- * 
+ *
  * A CamelFolderSearch is a subclassable, extensible s-exp
  * evaluator which enforces a particular set of s-expressions.
  * Particular methods may be overriden by an implementation to
@@ -266,7 +266,7 @@ camel_folder_search_new (void)
  * camel_folder_search_set_folder:
  * @search:
  * @folder: A folder.
- * 
+ *
  * Set the folder attribute of the search.  This is currently unused, but
  * could be used to perform a slow-search when indexes and so forth are not
  * available.  Or for use by subclasses.
@@ -279,9 +279,9 @@ camel_folder_search_set_folder(CamelFolderSearch *search, CamelFolder *folder)
 
 /**
  * camel_folder_search_set_summary:
- * @search: 
+ * @search:
  * @summary: An array of CamelMessageInfo pointers.
- * 
+ *
  * Set the array of summary objects representing the span of the search.
  *
  * If this is not set, then a subclass must provide the functions
@@ -302,9 +302,9 @@ camel_folder_search_set_summary(CamelFolderSearch *search, GPtrArray *summary)
 
 /**
  * camel_folder_search_set_body_index:
- * @search: 
- * @index: 
- * 
+ * @search:
+ * @index:
+ *
  * Set the index representing the contents of all messages
  * in this folder.  If this is not set, then the folder implementation
  * should sub-class the CamelFolderSearch and provide its own
@@ -322,10 +322,10 @@ camel_folder_search_set_body_index(CamelFolderSearch *search, CamelIndex *index)
 
 /**
  * camel_folder_search_execute_expression:
- * @search: 
- * @expr: 
- * @ex: 
- * 
+ * @search:
+ * @expr:
+ * @ex:
+ *
  * Execute the search expression @expr, returning an array of
  * all matches as a GPtrArray of uid's of matching messages.
  *
@@ -334,7 +334,7 @@ camel_folder_search_set_body_index(CamelFolderSearch *search, CamelIndex *index)
  *
  * TODO: The interface should probably return summary items instead
  * (since they are much more useful to any client).
- * 
+ *
  * Return value: A GPtrArray of strings of all matching messages.
  * This must only be freed by camel_folder_search_free_result.
  **/
@@ -427,15 +427,15 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
 
 /**
  * camel_folder_search_search:
- * @search: 
- * @expr: 
+ * @search:
+ * @expr:
  * @uids: to search against, NULL for all uid's.
- * @ex: 
- * 
+ * @ex:
+ *
  * Run a search.  Search must have had Folder already set on it, and
  * it must implement summaries.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 GPtrArray *
 camel_folder_search_search(CamelFolderSearch *search, const char *expr, GPtrArray *uids, CamelException *ex)
@@ -967,19 +967,19 @@ static ESExpResult *
 search_header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
 {
        ESExpResult *r;
-       
+
        r(printf ("executing header-exists\n"));
-       
+
        if (search->current) {
                r = e_sexp_result_new(f, ESEXP_RES_BOOL);
                if (argc == 1 && argv[0]->type == ESEXP_RES_STRING)
                        r->value.bool = camel_medium_get_header(CAMEL_MEDIUM(search->current), argv[0]->value.string) != NULL;
-               
+
        } else {
                r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
                r->value.ptrarray = g_ptr_array_new();
        }
-       
+
        return r;
 }
 
@@ -1053,7 +1053,7 @@ match_words_index(CamelFolderSearch *search, struct _camel_search_words *words,
        int i;
 
        /* we can have a maximum of 32 words, as we use it as the AND mask */
-                       
+
        wc = camel_index_words(search->body_index);
        if (wc) {
                while ((word = camel_index_cursor_next(wc))) {
@@ -1094,12 +1094,12 @@ match_words_1message (CamelDataWrapper *object, struct _camel_search_words *word
        CamelDataWrapper *containee;
        int truth = FALSE;
        int parts, i;
-       
+
        containee = camel_medium_get_content_object (CAMEL_MEDIUM (object));
-       
+
        if (containee == NULL)
                return FALSE;
-       
+
        /* using the object types is more accurate than using the mime/types */
        if (CAMEL_IS_MULTIPART (containee)) {
                parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
@@ -1127,10 +1127,10 @@ match_words_1message (CamelDataWrapper *object, struct _camel_search_words *word
                                        return TRUE;
                        }
                }
-               
+
                camel_object_unref (mem);
        }
-       
+
        return truth;
 }
 
@@ -1171,11 +1171,11 @@ match_words_messages(CamelFolderSearch *search, struct _camel_search_words *word
 
                for (i=0;i<indexed->len;i++) {
                        const char *uid = g_ptr_array_index(indexed, i);
-                       
+
                        if (match_words_message(search->folder, uid, words, ex))
                                g_ptr_array_add(matches, (char *)uid);
                }
-               
+
                g_ptr_array_free(indexed, TRUE);
        } else {
                GPtrArray *v = search->summary_set?search->summary_set:search->summary;
@@ -1183,7 +1183,7 @@ match_words_messages(CamelFolderSearch *search, struct _camel_search_words *word
                for (i=0;i<v->len;i++) {
                        CamelMessageInfo *info = g_ptr_array_index(v, i);
                        const char *uid = camel_message_info_uid(info);
-                       
+
                        if (match_words_message(search->folder, uid, words, ex))
                                g_ptr_array_add(matches, (char *)uid);
                }
@@ -1201,7 +1201,7 @@ search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
        ESExpResult *r;
        struct _glib_sux_donkeys lambdafoo;
 
-       if (search->current) {  
+       if (search->current) {
                int truth = FALSE;
 
                if (argc == 1 && argv[0]->value.string[0] == 0) {
@@ -1296,22 +1296,22 @@ static ESExpResult *
 search_system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
 {
        ESExpResult *r;
-       
+
        r(printf ("executing system-flag\n"));
-       
+
        if (search->current) {
                gboolean truth = FALSE;
-               
+
                if (argc == 1)
                        truth = camel_system_flag_get (camel_message_info_flags(search->current), argv[0]->value.string);
-               
+
                r = e_sexp_result_new(f, ESEXP_RES_BOOL);
                r->value.bool = truth;
        } else {
                r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
                r->value.ptrarray = g_ptr_array_new ();
        }
-       
+
        return r;
 }
 
@@ -1320,15 +1320,15 @@ search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFol
 {
        const char *value = NULL;
        ESExpResult *r;
-       
+
        r(printf("executing user-tag\n"));
-       
+
        if (argc == 1)
                value = camel_message_info_user_tag(search->current, argv[0]->value.string);
-       
+
        r = e_sexp_result_new(f, ESEXP_RES_STRING);
        r->value.string = g_strdup (value ? value : "");
-       
+
        return r;
 }
 
@@ -1388,9 +1388,9 @@ static ESExpResult *
 search_get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s)
 {
        ESExpResult *r;
-       
+
        r(printf("executing get-size\n"));
-       
+
        /* are we inside a match-all? */
        if (s->current) {
                r = e_sexp_result_new (f, ESEXP_RES_INT);
@@ -1399,7 +1399,7 @@ search_get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFo
                r = e_sexp_result_new (f, ESEXP_RES_ARRAY_PTR);
                r->value.ptrarray = g_ptr_array_new ();
        }
-       
+
        return r;
 }
 
index 078939c..a9dc4c3 100644 (file)
@@ -77,28 +77,28 @@ struct _CamelFolderSearchClass {
 
        /* (header-contains "headername" "string1" ...) List of matches, or true if in single-message mode */
        ESExpResult * (*header_contains)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-       
+
        /* (header-matches "headername" "string") */
        ESExpResult * (*header_matches)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-       
+
        /* (header-starts-with "headername" "string") */
        ESExpResult * (*header_starts_with)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-       
+
        /* (header-ends-with "headername" "string") */
        ESExpResult * (*header_ends_with)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-       
+
        /* (header-exists "headername") */
        ESExpResult * (*header_exists)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-       
+
        /* (user-flag "flagname" "flagname" ...) If one of user-flag set */
        ESExpResult * (*user_flag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
 
        /* (user-tag "flagname") Returns the value of a user tag.  Can only be used in match-all */
        ESExpResult * (*user_tag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-       
+
        /* (system-flag "flagname") Returns the value of a system flag.  Can only be used in match-all */
        ESExpResult * (*system_flag)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
-       
+
        /* (get-sent-date) Retrieve the date that the message was sent on as a time_t */
        ESExpResult * (*get_sent_date)(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
 
index 9a8484d..00c3cf2 100644 (file)
@@ -145,7 +145,7 @@ camel_folder_summary_init (CamelFolderSummary *s)
 
        s->messages = g_ptr_array_new();
        s->messages_uid = g_hash_table_new(g_str_hash, g_str_equal);
-       
+
        p->summary_lock = g_mutex_new();
        p->io_lock = g_mutex_new();
        p->filter_lock = g_mutex_new();
@@ -155,7 +155,7 @@ camel_folder_summary_init (CamelFolderSummary *s)
        s->meta_summary = g_malloc0(sizeof(CamelFolderMetaSummary));
 
        /* Default is 20, any implementor having UIDs that has length
-          exceeding 20, has to override this value 
+          exceeding 20, has to override this value
        */
        s->meta_summary->uid_len = 20;
 }
@@ -209,13 +209,13 @@ camel_folder_summary_finalize (CamelObject *obj)
        /* Freeing memory occupied by meta-summary-header */
        g_free(s->meta_summary->path);
        g_free(s->meta_summary);
-       
+
        g_mutex_free(p->summary_lock);
        g_mutex_free(p->io_lock);
        g_mutex_free(p->filter_lock);
        g_mutex_free(p->alloc_lock);
        g_mutex_free(p->ref_lock);
-       
+
        g_free(p);
 }
 
@@ -223,7 +223,7 @@ CamelType
 camel_folder_summary_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_object_get_type (), "CamelFolderSummary",
                                            sizeof (CamelFolderSummary),
@@ -233,7 +233,7 @@ camel_folder_summary_get_type (void)
                                            (CamelObjectInitFunc) camel_folder_summary_init,
                                            (CamelObjectFinalizeFunc) camel_folder_summary_finalize);
        }
-       
+
        return type;
 }
 
@@ -243,7 +243,7 @@ camel_folder_summary_get_type (void)
  * @folder: parent #CamelFolder object
  *
  * Create a new #CamelFolderSummary object.
- * 
+ *
  * Returns a new #CamelFolderSummary object
  **/
 CamelFolderSummary *
@@ -261,7 +261,7 @@ camel_folder_summary_new (struct _CamelFolder *folder)
  * camel_folder_summary_set_filename:
  * @summary: a #CamelFolderSummary object
  * @filename: a filename
- * 
+ *
  * Set the filename where the summary will be loaded to/saved from.
  **/
 void
@@ -283,7 +283,7 @@ camel_folder_summary_set_filename(CamelFolderSummary *s, const char *name)
  * camel_folder_summary_set_index:
  * @summary: a #CamelFolderSummary object
  * @index: a #CamelIndex
- * 
+ *
  * Set the index used to index body content.  If the index is %NULL, or
  * not set (the default), no indexing of body content will take place.
  *
@@ -307,7 +307,7 @@ camel_folder_summary_set_index(CamelFolderSummary *s, CamelIndex *index)
  * camel_folder_summary_set_build_content:
  * @summary: a #CamelFolderSummary object
  * @state: to build or not to build the content
- * 
+ *
  * Set a flag to tell the summary to build the content info summary
  * (#CamelMessageInfo.content).  The default is not to build content
  * info summaries.
@@ -322,9 +322,9 @@ camel_folder_summary_set_build_content(CamelFolderSummary *s, gboolean state)
 /**
  * camel_folder_summary_count:
  * @summary: a #CamelFolderSummary object
- * 
+ *
  * Get the number of summary items stored in this summary.
- * 
+ *
  * Returns the number of items in the summary
  **/
 int
@@ -338,12 +338,12 @@ camel_folder_summary_count(CamelFolderSummary *s)
  * camel_folder_summary_index:
  * @summary: a #CamelFolderSummary object
  * @index: item index
- * 
+ *
  * Retrieve a summary item by index number.
  *
  * A referenced to the summary item is returned, which may be
  * ref'd or free'd as appropriate.
- * 
+ *
  * Returns the summary item, or %NULL if @index is out of range
  **/
 CamelMessageInfo *
@@ -370,7 +370,7 @@ camel_folder_summary_index(CamelFolderSummary *s, int i)
 /**
  * camel_folder_summary_array:
  * @summary: a #CamelFolderSummary object
- * 
+ *
  * Obtain a copy of the summary array.  This is done atomically,
  * so cannot contain empty entries.
  *
@@ -384,7 +384,7 @@ camel_folder_summary_array(CamelFolderSummary *s)
        CamelMessageInfo *info;
        GPtrArray *res = g_ptr_array_new();
        int i;
-       
+
        CAMEL_SUMMARY_LOCK(s, summary_lock);
        CAMEL_SUMMARY_LOCK(s, ref_lock);
 
@@ -405,7 +405,7 @@ camel_folder_summary_array(CamelFolderSummary *s)
  * camel_folder_summary_array_free:
  * @summary: a #CamelFolderSummary object
  * @array: array of #CamelMessageInfo items as returned from #camel_folder_summary_array
- * 
+ *
  * Free the folder summary array.
  **/
 void
@@ -425,12 +425,12 @@ camel_folder_summary_array_free(CamelFolderSummary *s, GPtrArray *array)
  * camel_folder_summary_uid:
  * @summary: a #CamelFolderSummary object
  * @uid: a uid
- * 
+ *
  * Retrieve a summary item by uid.
  *
  * A referenced to the summary item is returned, which may be
  * ref'd or free'd as appropriate.
- * 
+ *
  * Returns the summary item, or %NULL if the uid @uid is not available
  **/
 CamelMessageInfo *
@@ -456,10 +456,10 @@ camel_folder_summary_uid(CamelFolderSummary *s, const char *uid)
 /**
  * camel_folder_summary_next_uid:
  * @summary: a #CamelFolderSummary object
- * 
+ *
  * Generate a new unique uid value as an integer.  This
  * may be used to create a unique sequence of numbers.
- * 
+ *
  * Returns the next unique uid value
  **/
 guint32
@@ -485,7 +485,7 @@ camel_folder_summary_next_uid(CamelFolderSummary *s)
  * @summary: a #CamelFolderSummary object
  * @uid: The next minimum uid to assign.  To avoid clashing
  * uid's, set this to the uid of a given messages + 1.
- * 
+ *
  * Set the next minimum uid available.  This can be used to
  * ensure new uid's do not clash with existing uid's.
  **/
@@ -595,7 +595,7 @@ camel_folder_summary_load(CamelFolderSummary *s)
        }
 
        CAMEL_SUMMARY_UNLOCK(s, io_lock);
-       
+
        if (fclose (in) != 0)
                return -1;
 
@@ -606,7 +606,7 @@ camel_folder_summary_load(CamelFolderSummary *s)
 error:
        if (errno != EINVAL)
                g_warning ("Cannot load summary file: `%s': %s", s->summary_path, g_strerror (errno));
-       
+
        CAMEL_SUMMARY_UNLOCK(s, io_lock);
        fclose (in);
        s->flags |= ~CAMEL_SUMMARY_DIRTY;
@@ -622,17 +622,17 @@ perform_content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentI
 
        if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->content_info_save (s, out, ci) == -1)
                return -1;
-       
+
        if (camel_file_util_encode_uint32 (out, my_list_size ((struct _node **)&ci->childs)) == -1)
                return -1;
-       
+
        part = ci->childs;
        while (part) {
                if (perform_content_info_save (s, out, part) == -1)
                        return -1;
                part = part->next;
        }
-       
+
        return 0;
 }
 
@@ -640,10 +640,10 @@ perform_content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentI
 /**
  * camel_folder_summary_save:
  * @summary: a #CamelFolderSummary object
- * 
+ *
  * Writes the summary to disk.  The summary is only written if changes
  * have occured.
- * 
+ *
  * Returns %0 on success or %-1 on fail
  **/
 int
@@ -659,7 +659,7 @@ camel_folder_summary_save(CamelFolderSummary *s)
 
        g_assert(s->message_info_size >= sizeof(CamelMessageInfoBase));
 
-       if (s->summary_path == NULL 
+       if (s->summary_path == NULL
            || s->meta_summary->path == NULL
            || (s->flags & CAMEL_SUMMARY_DIRTY) == 0)
                return 0;
@@ -679,8 +679,8 @@ camel_folder_summary_save(CamelFolderSummary *s)
        }
 
        /* Meta summary code */
-       /* This meta summary will be used by beagle in order to 
-          quickly pass through the actual summary file, which 
+       /* This meta summary will be used by beagle in order to
+          quickly pass through the actual summary file, which
           is quite time consuming otherwise.
        */
        /* FIXME: Merge meta-summary and summary */
@@ -708,7 +708,7 @@ camel_folder_summary_save(CamelFolderSummary *s)
 
        if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_save(s, out) == -1)
                goto exception;
-       
+
        if (summary_meta_header_save(s, out_meta) == -1)
                goto exception;
 
@@ -719,7 +719,7 @@ camel_folder_summary_save(CamelFolderSummary *s)
                mi = s->messages->pdata[i];
                if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->meta_message_info_save (s, out_meta, out, mi) == -1)
                        goto exception;
-               
+
                if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->message_info_save (s, out, mi) == -1)
                        goto exception;
 
@@ -728,11 +728,11 @@ camel_folder_summary_save(CamelFolderSummary *s)
                                goto exception;
                }
        }
-       
+
        /* FIXME: Can't we use the above "fd" variables, instead of fileno()? */
        if (fflush (out) != 0 || fsync (fileno (out)) == -1)
                goto exception;
-       
+
        if (fflush (out_meta) != 0 || fsync (fileno (out_meta)) == -1)
                goto exception;
 
@@ -740,7 +740,7 @@ camel_folder_summary_save(CamelFolderSummary *s)
        fclose (out_meta);
 
        CAMEL_SUMMARY_UNLOCK(s, io_lock);
-       
+
 #ifdef G_OS_WIN32
        g_unlink(s->summary_path);
 #endif
@@ -757,23 +757,23 @@ camel_folder_summary_save(CamelFolderSummary *s)
                errno = i;
                return -1;
        }
-       
+
        s->flags &= ~CAMEL_SUMMARY_DIRTY;
        return 0;
-       
+
  exception:
-       
+
        i = errno;
-       
+
        fclose (out);
        fclose (out_meta);
-       
+
        CAMEL_SUMMARY_UNLOCK(s, io_lock);
-       
+
        g_unlink (path);
        g_unlink (path_meta);
        errno = i;
-       
+
        return -1;
 }
 
@@ -781,11 +781,11 @@ camel_folder_summary_save(CamelFolderSummary *s)
 /**
  * camel_folder_summary_header_load:
  * @summary: a #CamelFolderSummary object
- * 
+ *
  * Only load the header information from the summary,
  * keep the rest on disk.  This should only be done on
  * a fresh summary object.
- * 
+ *
  * Returns %0 on success or %-1 on fail
  **/
 int
@@ -813,7 +813,7 @@ camel_folder_summary_header_load(CamelFolderSummary *s)
        ret = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in);
        ret = summary_meta_header_load(s, in_meta);
        CAMEL_SUMMARY_UNLOCK(s, io_lock);
-       
+
        fclose(in);
        fclose(in_meta);
        s->flags &= ~CAMEL_SUMMARY_DIRTY;
@@ -855,7 +855,7 @@ summary_assign_uid(CamelFolderSummary *s, CamelMessageInfo *info)
  * camel_folder_summary_add:
  * @summary: a #CamelFolderSummary object
  * @info: a #CamelMessageInfo
- * 
+ *
  * Adds a new @info record to the summary.  If @info->uid is %NULL,
  * then a new uid is automatically re-assigned by calling
  * #camel_folder_summary_next_uid_string.
@@ -894,13 +894,13 @@ camel_folder_summary_add(CamelFolderSummary *s, CamelMessageInfo *info)
  * camel_folder_summary_add_from_header:
  * @summary: a #CamelFolderSummary object
  * @headers: rfc822 headers
- * 
+ *
  * Build a new info record based on a set of headers, and add it to
  * the summary.
  *
  * Note that this function should not be used if build_content_info
  * has been specified for this summary.
- * 
+ *
  * Returns the newly added record
  **/
 CamelMessageInfo *
@@ -918,13 +918,13 @@ camel_folder_summary_add_from_header(CamelFolderSummary *s, struct _camel_header
  * camel_folder_summary_add_from_parser:
  * @summary: a #CamelFolderSummary object
  * @parser: a #CamelMimeParser object
- * 
+ *
  * Build a new info record based on the current position of a #CamelMimeParser.
  *
  * The parser should be positioned before the start of the message to summarise.
  * This function may be used if build_contnet_info or an index has been
  * specified for the summary.
- * 
+ *
  * Returns the newly added record
  **/
 CamelMessageInfo *
@@ -947,9 +947,9 @@ camel_folder_summary_add_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
  * camel_folder_summary_add_from_message:
  * @summary: a #CamelFolderSummary object
  * @message: a #CamelMimeMessage object
- * 
+ *
  * Add a summary item from an existing message.
- * 
+ *
  * Returns the newly added record
  **/
 CamelMessageInfo *
@@ -967,7 +967,7 @@ camel_folder_summary_add_from_message(CamelFolderSummary *s, CamelMimeMessage *m
  * camel_folder_summary_info_new_from_header:
  * @summary: a #CamelFolderSummary object
  * @headers: rfc822 headers
- * 
+ *
  * Create a new info record from a header.
  *
  * Returns the newly allocated record which must be freed with
@@ -984,7 +984,7 @@ camel_folder_summary_info_new_from_header(CamelFolderSummary *s, struct _camel_h
  * camel_folder_summary_info_new_from_parser:
  * @summary: a #CamelFolderSummary object
  * @parser: a #CamelMimeParser object
- * 
+ *
  * Create a new info record from a parser.  If the parser cannot
  * determine a uid, then none will be assigned.
  *
@@ -1055,9 +1055,9 @@ camel_folder_summary_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser
  * camel_folder_summary_info_new_from_message:
  * @summary: a #CamelFodlerSummary object
  * @message: a #CamelMimeMessage object
- * 
+ *
  * Create a summary item from a message.
- * 
+ *
  * Returns the newly allocated record which must be freed using
  * #camel_message_info_free
  **/
@@ -1110,7 +1110,7 @@ camel_folder_summary_info_new_from_message(CamelFolderSummary *s, CamelMimeMessa
  * camel_folder_summary_content_info_free:
  * @summary: a #CamelFolderSummary object
  * @ci: a #CamelMessageContentInfo
- * 
+ *
  * Free the content info @ci, and all associated memory.
  **/
 void
@@ -1131,7 +1131,7 @@ camel_folder_summary_content_info_free(CamelFolderSummary *s, CamelMessageConten
 /**
  * camel_folder_summary_touch:
  * @summary: a #CamelFolderSummary object
- * 
+ *
  * Mark the summary as changed, so that a save will force it to be
  * written back to disk.
  **/
@@ -1147,7 +1147,7 @@ camel_folder_summary_touch(CamelFolderSummary *s)
 /**
  * camel_folder_summary_clear:
  * @summary: a #CamelFolderSummary object
- * 
+ *
  * Empty the summary contents.
  **/
 void
@@ -1177,7 +1177,7 @@ camel_folder_summary_clear(CamelFolderSummary *s)
  * camel_folder_summary_remove:
  * @summary: a #CamelFolderSummary object
  * @info: a #CamelMessageInfo
- * 
+ *
  * Remove a specific @info record from the summary.
  **/
 void
@@ -1189,7 +1189,7 @@ camel_folder_summary_remove(CamelFolderSummary *s, CamelMessageInfo *info)
        s->flags |= CAMEL_SUMMARY_DIRTY;
        s->meta_summary->msg_expunged = TRUE;
        CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-       
+
        camel_message_info_free(info);
 }
 
@@ -1198,7 +1198,7 @@ camel_folder_summary_remove(CamelFolderSummary *s, CamelMessageInfo *info)
  * camel_folder_summary_remove_uid:
  * @summary: a #CamelFolderSummary object
  * @uid: a uid
- * 
+ *
  * Remove a specific info record from the summary, by @uid.
  **/
 void
@@ -1227,7 +1227,7 @@ camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid)
  * camel_folder_summary_remove_index:
  * @summary: a #CamelFolderSummary object
  * @index: record index
- * 
+ *
  * Remove a specific info record from the summary, by index.
  **/
 void
@@ -1254,7 +1254,7 @@ camel_folder_summary_remove_index(CamelFolderSummary *s, int index)
  * @summary: a #CamelFolderSummary object
  * @start: initial index
  * @end: last index to remove
- * 
+ *
  * Removes an indexed range of info records.
  **/
 void
@@ -1345,11 +1345,11 @@ token_search_cmp(char *key, char **index)
  * camel_folder_summary_encode_token:
  * @out: output FILE pointer
  * @str: string token to encode
- * 
+ *
  * Encode a string value, but use tokenisation and compression
  * to reduce the size taken for common mailer words.  This
  * can still be used to encode normal strings as well.
- * 
+ *
  * Returns %0 on success or %-1 on fail
  **/
 int
@@ -1400,9 +1400,9 @@ camel_folder_summary_encode_token(FILE *out, const char *str)
  * camel_folder_summary_decode_token:
  * @in: input FILE pointer
  * @str: string pointer to hold the decoded result
- * 
+ *
  * Decode a token value.
- * 
+ *
  * Returns %0 on success or %-1 on fail
  **/
 int
@@ -1412,7 +1412,7 @@ camel_folder_summary_decode_token(FILE *in, char **str)
        guint32 len;
 
        io(printf("Decode token ...\n"));
-       
+
        if (camel_file_util_decode_uint32(in, &len) == -1) {
                io(printf ("Could not decode token from file"));
                *str = NULL;
@@ -1488,7 +1488,7 @@ summary_meta_header_load(CamelFolderSummary *s, FILE *in)
            || camel_file_util_decode_uint32(in, &s->meta_summary->uid_len) == -1) {
                return -1;
        }
-       
+
        return 0;
 }
 
@@ -1674,7 +1674,7 @@ summary_format_address(struct _camel_header_raw *h, const char *name, const char
        } else {
                ret = g_strdup (text);
        }
-       
+
        return ret;
 }
 
@@ -1682,7 +1682,7 @@ static char *
 summary_format_string (struct _camel_header_raw *h, const char *name, const char *charset)
 {
        const char *text;
-       
+
        text = camel_header_raw_find (&h, name, NULL);
        if (text) {
                while (isspace ((unsigned) *text))
@@ -1697,10 +1697,10 @@ summary_format_string (struct _camel_header_raw *h, const char *name, const char
 /**
  * camel_folder_summary_content_info_new:
  * @summary: a #CamelFolderSummary object
- * 
+ *
  * Allocate a new #CamelMessageContentInfo, suitable for adding
  * to this summary.
- * 
+ *
  * Returns a newly allocated #CamelMessageContentInfo
  **/
 CamelMessageContentInfo *
@@ -1738,9 +1738,9 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
             && (charset = camel_content_type_param(ct, "charset"))
             && (g_ascii_strcasecmp(charset, "us-ascii") == 0))
                charset = NULL;
-       
+
        charset = charset ? e_iconv_charset_name (charset) : NULL;
-       
+
        subject = summary_format_string(h, "subject", charset);
        from = summary_format_address(h, "from", charset);
        to = summary_format_address(h, "to", charset);
@@ -1749,13 +1749,13 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
 
        if (ct)
                camel_content_type_unref(ct);
-       
+
        mi->subject = camel_pstring_add (subject, TRUE);
        mi->from = camel_pstring_add (from, TRUE);
        mi->to = camel_pstring_add (to, TRUE);
        mi->cc = camel_pstring_add (cc, TRUE);
        mi->mlist = camel_pstring_add (mlist, TRUE);
-       
+
        mi->user_flags = NULL;
        mi->user_tags = NULL;
        mi->date_sent = camel_header_decode_date(camel_header_raw_find(&h, "date", NULL), NULL);
@@ -1773,7 +1773,7 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
                memcpy(mi->message_id.id.hash, digest, sizeof(mi->message_id.id.hash));
                g_free(msgid);
        }
-       
+
        /* decode our references and in-reply-to headers */
        refs = camel_header_references_decode (camel_header_raw_find (&h, "references", NULL));
        irt = camel_header_references_inreplyto_decode (camel_header_raw_find (&h, "in-reply-to", NULL));
@@ -1782,13 +1782,13 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
                        /* The References field is populated from the ``References'' and/or ``In-Reply-To''
                           headers. If both headers exist, take the first thing in the In-Reply-To header
                           that looks like a Message-ID, and append it to the References header. */
-                       
+
                        if (refs)
                                irt->next = refs;
-                       
+
                        refs = irt;
                }
-               
+
                count = camel_header_references_list_size(&refs);
                mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
                count = 0;
@@ -1828,14 +1828,14 @@ message_info_load(CamelFolderSummary *s, FILE *in)
        camel_file_util_decode_string(in, &to);
        camel_file_util_decode_string(in, &cc);
        camel_file_util_decode_string(in, &mlist);
-       
+
        mi->uid = uid;
        mi->subject = camel_pstring_add (subject, TRUE);
        mi->from = camel_pstring_add (from, TRUE);
        mi->to = camel_pstring_add (to, TRUE);
        mi->cc = camel_pstring_add (cc, TRUE);
        mi->mlist = camel_pstring_add (mlist, TRUE);
-       
+
        mi->content = NULL;
 
        camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.hi);
@@ -1896,11 +1896,11 @@ meta_message_info_save(CamelFolderSummary *s, FILE *out_meta, FILE *out, CamelMe
        time (&timestamp);
        offset = ftell (out);
        /* FIXME: errno check after ftell */
-       
+
        camel_file_util_encode_time_t(out_meta, timestamp);
        camel_file_util_encode_fixed_string(out_meta, camel_message_info_uid(mi), s->meta_summary->uid_len);
        camel_file_util_encode_uint32(out_meta, mi->flags);
-       camel_file_util_encode_off_t(out_meta, offset); 
+       camel_file_util_encode_off_t(out_meta, offset);
 
        return ferror(out);
 }
@@ -1985,9 +1985,9 @@ content_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
 {
        CamelMessageContentInfo *ci;
        const char *charset;
-       
+
        ci = camel_folder_summary_content_info_new (s);
-       
+
        charset = e_iconv_locale_charset ();
        ci->id = camel_header_msgid_decode (camel_header_raw_find (&h, "content-id", NULL));
        ci->description = camel_header_decode_string (camel_header_raw_find (&h, "content-description", NULL), charset);
@@ -2008,7 +2008,7 @@ content_info_load(CamelFolderSummary *s, FILE *in)
        io(printf("Loading content info\n"));
 
        ci = camel_folder_summary_content_info_new(s);
-       
+
        camel_folder_summary_decode_token(in, &type);
        camel_folder_summary_decode_token(in, &subtype);
        ct = camel_content_type_new(type, subtype);
@@ -2016,14 +2016,14 @@ content_info_load(CamelFolderSummary *s, FILE *in)
        g_free(subtype);
        if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
                goto error;
-       
+
        for (i=0;i<count;i++) {
                char *name, *value;
                camel_folder_summary_decode_token(in, &name);
                camel_folder_summary_decode_token(in, &value);
                if (!(name && value))
                        goto error;
-               
+
                camel_content_type_set_param(ct, name, value);
                /* TODO: do this so we dont have to double alloc/free */
                g_free(name);
@@ -2117,7 +2117,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
 
        /* start of this part */
        state = camel_mime_parser_step(mp, &buffer, &len);
-       
+
        if (s->build_content)
                info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_parser(s, mp);
 
@@ -2139,7 +2139,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
                        const char *charset;
 
                        d(printf("generating index:\n"));
-                       
+
                        encoding = camel_content_transfer_encoding_decode(camel_mime_parser_header(mp, "content-transfer-encoding", NULL));
                        if (encoding) {
                                if (!g_ascii_strcasecmp(encoding, "base64")) {
@@ -2198,7 +2198,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
                                        camel_mime_filter_reset((CamelMimeFilter *)p->filter_html);
                                html_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_html);
                        }
-                       
+
                        /* and this filter actually does the indexing */
                        idx_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_index);
                }
@@ -2266,7 +2266,7 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
 
        if (s->build_content)
                info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_message(s, object);
-       
+
        containee = camel_medium_get_content_object(CAMEL_MEDIUM(object));
 
        if (containee == NULL)
@@ -2339,9 +2339,9 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
  * camel_flag_get:
  * @list: the address of a #CamelFlag list
  * @name: name of the flag to get
- * 
+ *
  * Find the state of the flag @name in @list.
- * 
+ *
  * Returns the state of the flag (%TRUE or %FALSE)
  **/
 gboolean
@@ -2363,7 +2363,7 @@ camel_flag_get(CamelFlag **list, const char *name)
  * @list: the address of a #CamelFlag list
  * @name: name of the flag to set or change
  * @value: the value to set on the flag
- * 
+ *
  * Set the state of a flag @name in the list @list to @value.
  *
  * Returns %TRUE if the value of the flag has been changed or %FALSE
@@ -2401,9 +2401,9 @@ camel_flag_set(CamelFlag **list, const char *name, gboolean value)
 /**
  * camel_flag_list_size:
  * @list: the address of a #CamelFlag list
- * 
+ *
  * Get the length of the flag list.
- * 
+ *
  * Returns the number of flags in the list
  **/
 int
@@ -2424,7 +2424,7 @@ camel_flag_list_size(CamelFlag **list)
 /**
  * camel_flag_list_free:
  * @list: the address of a #CamelFlag list
- * 
+ *
  * Free the memory associated with the flag list @list.
  **/
 void
@@ -2445,9 +2445,9 @@ camel_flag_list_free(CamelFlag **list)
  * camel_flag_list_copy:
  * @to: the address of the #CamelFlag list to copy to
  * @from: the address of the #CamelFlag list to copy from
- * 
+ *
  * Copy a flag list.
- * 
+ *
  * Returns %TRUE if @to is changed or %FALSE otherwise
  **/
 gboolean
@@ -2489,7 +2489,7 @@ camel_flag_list_copy(CamelFlag **to, CamelFlag **from)
  * @name: name of the tag to get
  *
  * Find the flag @name in @list and get the value.
- * 
+ *
  * Returns the value of the flag  or %NULL if unset
  **/
 const char *
@@ -2512,7 +2512,7 @@ camel_tag_get(CamelTag **list, const char *name)
  * @list: the address of a #CamelTag list
  * @name: name of the tag to set
  * @value: value to set on the tag
- * 
+ *
  * Set the tag @name in the tag list @list to @value.
  *
  * Returns %TRUE if the value on the tag changed or %FALSE otherwise
@@ -2557,9 +2557,9 @@ camel_tag_set(CamelTag **list, const char *name, const char *value)
 /**
  * camel_tag_list_size:
  * @list: the address of a #CamelTag list
- * 
+ *
  * Get the number of tags present in the tag list @list.
- * 
+ *
  * Returns the number of tags
  **/
 int
@@ -2587,9 +2587,9 @@ rem_tag(char *key, char *value, CamelTag **to)
  * camel_tag_list_copy:
  * @to: the address of the #CamelTag list to copy to
  * @from: the address of the #CamelTag list to copy from
- * 
+ *
  * Copy a tag list.
- * 
+ *
  * Returns %TRUE if @to is changed or %FALSE otherwise
  **/
 gboolean
@@ -2629,7 +2629,7 @@ camel_tag_list_copy(CamelTag **to, CamelTag **from)
 /**
  * camel_tag_list_free:
  * @list: the address of a #CamelTag list
- * 
+ *
  * Free the tag list @list.
  **/
 void
@@ -2665,20 +2665,20 @@ static struct flag_names_t {
 /**
  * camel_system_flag:
  * @name: name of a system flag
- * 
+ *
  * Returns the integer value of the system flag string
  **/
 guint32
 camel_system_flag (const char *name)
 {
        struct flag_names_t *flag;
-       
+
        g_return_val_if_fail (name != NULL, 0);
-       
+
        for (flag = flag_names; *flag->name; flag++)
                if (!g_ascii_strcasecmp (name, flag->name))
                        return flag->value;
-       
+
        return 0;
 }
 
@@ -2687,16 +2687,16 @@ camel_system_flag (const char *name)
  * camel_system_flag_get:
  * @flags: bitwise system flags
  * @name: name of the flag to check for
- * 
+ *
  * Find the state of the flag @name in @flags.
- * 
+ *
  * Returns %TRUE if the named flag is set or %FALSE otherwise
  **/
 gboolean
 camel_system_flag_get (guint32 flags, const char *name)
 {
        g_return_val_if_fail (name != NULL, FALSE);
-       
+
        return flags & camel_system_flag (name);
 }
 
@@ -2734,7 +2734,7 @@ camel_message_info_new (CamelFolderSummary *s)
 /**
  * camel_message_info_ref:
  * @info: a #CamelMessageInfo
- * 
+ *
  * Reference an info.
  **/
 void
@@ -3188,16 +3188,16 @@ void
 camel_content_info_dump (CamelMessageContentInfo *ci, int depth)
 {
        char *p;
-       
+
        p = alloca (depth * 4 + 1);
        memset (p, ' ', depth * 4);
        p[depth * 4] = 0;
-       
+
        if (ci == NULL) {
                printf ("%s<empty>\n", p);
                return;
        }
-       
+
        if (ci->type)
                printf ("%scontent-type: %s/%s\n", p, ci->type->type ? ci->type->type : "(null)",
                        ci->type->subtype ? ci->type->subtype : "(null)");
index c9d5eae..e66874b 100644 (file)
@@ -49,10 +49,10 @@ typedef struct _CamelFolderMetaSummary CamelFolderMetaSummary;
    describe the content structure of the message (if it has any) */
 struct _CamelMessageContentInfo {
        struct _CamelMessageContentInfo *next;
-       
+
        struct _CamelMessageContentInfo *childs;
        struct _CamelMessageContentInfo *parent;
-       
+
        CamelContentType *type;
        char *id;
        char *description;
@@ -67,7 +67,7 @@ typedef enum _CamelMessageFlags {
        CAMEL_MESSAGE_DRAFT = 1<<2,
        CAMEL_MESSAGE_FLAGGED = 1<<3,
        CAMEL_MESSAGE_SEEN = 1<<4,
-       
+
        /* these aren't really system flag bits, but are convenience flags */
        CAMEL_MESSAGE_ATTACHMENTS = 1<<5,
        CAMEL_MESSAGE_ANSWERED_ALL = 1<<6,
@@ -75,7 +75,7 @@ typedef enum _CamelMessageFlags {
        CAMEL_MESSAGE_SECURE = 1<<8,
        CAMEL_MESSAGE_USER_NOT_DELETABLE = 1<<9,
        CAMEL_MESSAGE_HIDDEN = 1<<10,
-       
+
        /* following flags are for the folder, and are not really permanent flags */
        CAMEL_MESSAGE_FOLDER_FLAGGED = 1<<16, /* for use by the folder implementation */
 
@@ -181,7 +181,7 @@ struct _CamelMessageInfoBase {
        CamelMessageContentInfo *content;
 };
 
-/* probably do this as well, removing CamelFolderChangeInfo and interfaces 
+/* probably do this as well, removing CamelFolderChangeInfo and interfaces
 typedef struct _CamelChangeInfo CamelChangeInfo;
 struct _CamelChangeInfo {
        GPtrArray *added;
index 0c29df1..a89f176 100644 (file)
@@ -39,8 +39,8 @@
 
 #include "camel-folder-thread.h"
 
-#define d(x) 
-#define m(x) 
+#define d(x)
+#define m(x)
 
 /*#define TIMEIT*/
 
@@ -159,7 +159,7 @@ get_root_subject(CamelFolderThreadNode *c)
 {
        char *s, *p;
        CamelFolderThreadNode *scan;
-       
+
        s = NULL;
        c->re = FALSE;
        if (c->message)
@@ -234,7 +234,7 @@ group_root_set(CamelFolderThread *thread, CamelFolderThreadNode **cp)
        GHashTable *subject_table = g_hash_table_new(g_str_hash, g_str_equal);
        CamelFolderThreadNode *c, *clast, *scan, *container;
 
-       /* gather subject lines */ 
+       /* gather subject lines */
        d(printf("gathering subject lines\n"));
        clast = (CamelFolderThreadNode *)cp;
        c = clast->next;
@@ -366,7 +366,7 @@ sort_node(const void *a, const void *b)
        const CamelFolderThreadNode *a1 = ((CamelFolderThreadNode **)a)[0];
        const CamelFolderThreadNode *b1 = ((CamelFolderThreadNode **)b)[0];
 
-       /* if we have no message, it must be a dummy node, which 
+       /* if we have no message, it must be a dummy node, which
           also means it must have a child, just use that as the
           sort data (close enough?) */
        if (a1->message == NULL)
@@ -508,7 +508,7 @@ thread_summary(CamelFolderThread *thread, GPtrArray *summary)
 
        /* remove empty parent nodes */
        prune_empty(thread, &head);
-       
+
        /* find any siblings which missed out - but only if we are allowing threading by subject */
        if (thread->subject)
                group_root_set (thread, &head);
@@ -577,18 +577,18 @@ thread_summary(CamelFolderThread *thread, GPtrArray *summary)
 
 /**
  * camel_folder_thread_messages_new:
- * @folder: 
+ * @folder:
  * @uids: The subset of uid's to thread.  If NULL. then thread all
  * uid's in @folder.
  * @thread_subject: thread based on subject also
- * 
+ *
  * Thread a (subset) of the messages in a folder.  And sort the result
  * in summary order.
  *
  * If @thread_subject is %TRUE, messages with
  * related subjects will also be threaded. The default behaviour is to
  * only thread based on message-id.
- * 
+ *
  * This function is probably to be removed soon.
  *
  * Return value: A CamelFolderThread contianing a tree of CamelFolderThreadNode's
@@ -699,8 +699,8 @@ camel_folder_thread_messages_ref(CamelFolderThread *thread)
 
 /**
  * camel_folder_thread_messages_unref:
- * @thread: 
- * 
+ * @thread:
+ *
  * Free all memory associated with the thread descriptor @thread.
  **/
 void
@@ -727,11 +727,11 @@ camel_folder_thread_messages_unref(CamelFolderThread *thread)
 /**
  * camel_folder_thread_messages_new_summary:
  * @summary: Array of CamelMessageInfo's to thread.
- * 
+ *
  * Thread a list of MessageInfo's.  The summary must remain valid for the
  * life of the CamelFolderThread created by this function, and it is upto the
  * caller to ensure this.
- * 
+ *
  * Return value: A CamelFolderThread contianing a tree of CamelFolderThreadNode's
  * which represent the threaded structure of the messages.
  **/
index 9b58840..3169aa3 100644 (file)
@@ -38,7 +38,7 @@ typedef struct _CamelFolderThreadNode {
 typedef struct _CamelFolderThread {
        guint32 refcount  : 31;
        guint32 subject   : 1;
-       
+
        struct _CamelFolderThreadNode *tree;
        struct _EMemChunk *node_chunks;
        CamelFolder *folder;
index a90928a..63f335d 100644 (file)
@@ -196,10 +196,10 @@ camel_folder_finalize (CamelObject *object)
                camel_object_unref (camel_folder->summary);
 
        camel_folder_change_info_free(p->changed_frozen);
-       
+
        g_static_rec_mutex_free(&p->lock);
        g_static_mutex_free(&p->change_lock);
-       
+
        g_free(p);
 }
 
@@ -272,10 +272,10 @@ camel_folder_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
        g_return_if_fail (CAMEL_IS_FOLDER (folder));
 
        CAMEL_FOLDER_REC_LOCK(folder, lock);
-       
+
        if (!(folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED))
                CF_CLASS (folder)->sync (folder, expunge, ex);
-       
+
        CAMEL_FOLDER_REC_UNLOCK(folder, lock);
 }
 
@@ -532,12 +532,12 @@ void
 camel_folder_expunge (CamelFolder *folder, CamelException *ex)
 {
        g_return_if_fail (CAMEL_IS_FOLDER (folder));
-       
+
        CAMEL_FOLDER_REC_LOCK(folder, lock);
-       
+
        if (!(folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED))
                CF_CLASS (folder)->expunge (folder, ex);
-       
+
        CAMEL_FOLDER_REC_UNLOCK(folder, lock);
 }
 
@@ -584,7 +584,7 @@ camel_folder_get_unread_message_count (CamelFolder *folder)
        int count = -1;
 
        g_return_val_if_fail (CAMEL_IS_FOLDER (folder), -1);
-       
+
        camel_object_get(folder, NULL, CAMEL_FOLDER_UNREAD, &count, 0);
 
        return count;
@@ -618,10 +618,10 @@ append_message (CamelFolder *folder, CamelMimeMessage *message,
        camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
                              _("Unsupported operation: append message: for %s"),
                              camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder)));
-       
+
        w(g_warning ("CamelFolder::append_message not implemented for `%s'",
                     camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-       
+
        return;
 
 }
@@ -980,7 +980,7 @@ free_message_info (CamelFolder *folder, CamelMessageInfo *info)
  * camel_folder_free_message_info:
  * @folder: a #CamelFolder object
  * @info: a #CamelMessageInfo
- * 
+ *
  * Free (unref) a #CamelMessageInfo, previously obtained with
  * #camel_folder_get_message_info.
  **/
@@ -1006,7 +1006,7 @@ ref_message_info (CamelFolder *folder, CamelMessageInfo *info)
  * camel_folder_ref_message_info:
  * @folder: a #CamelFolder object
  * @info: a #CamelMessageInfo
- * 
+ *
  * DEPRECATED: Use #camel_message_info_ref directly.
  *
  * Ref a #CamelMessageInfo, previously obtained with
@@ -1047,7 +1047,7 @@ get_message (CamelFolder *folder, const char *uid, CamelException *ex)
 {
        w(g_warning ("CamelFolder::get_message not implemented for `%s'",
                     camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-       
+
        return NULL;
 }
 
@@ -1098,15 +1098,15 @@ get_uids(CamelFolder *folder)
        g_ptr_array_set_size(array, count);
        for (i = 0, j = 0; i < count; i++) {
                CamelMessageInfo *info = camel_folder_summary_index(folder->summary, i);
-               
+
                if (info) {
                        array->pdata[j++] = g_strdup (camel_message_info_uid (info));
                        camel_message_info_free(info);
                }
        }
-       
+
        g_ptr_array_set_size (array, j);
-       
+
        return array;
 }
 
@@ -1240,10 +1240,10 @@ search_by_expression (CamelFolder *folder, const char *expression,
        camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
                              _("Unsupported operation: search by expression: for %s"),
                              camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder)));
-       
+
        w(g_warning ("CamelFolder::search_by_expression not implemented for "
                     "`%s'", camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-       
+
        return NULL;
 }
 
@@ -1281,10 +1281,10 @@ search_by_uids(CamelFolder *folder, const char *exp, GPtrArray *uids, CamelExcep
        camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
                              _("Unsupported operation: search by UIDs: for %s"),
                              camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder)));
-       
+
        w(g_warning ("CamelFolder::search_by_expression not implemented for "
                     "`%s'", camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
-       
+
        return NULL;
 }
 
@@ -1331,11 +1331,11 @@ search_free (CamelFolder *folder, GPtrArray *result)
  * camel_folder_search_free:
  * @folder: a #CamelFolder object
  * @result: search results to free
- * 
+ *
  * Free the result of a search as gotten by #camel_folder_search or
  * #camel_folder_search_by_uids.
  **/
-void 
+void
 camel_folder_search_free (CamelFolder *folder, GPtrArray *result)
 {
        g_return_if_fail (CAMEL_IS_FOLDER (folder));
@@ -1352,9 +1352,9 @@ transfer_message_to (CamelFolder *source, const char *uid, CamelFolder *dest,
 {
        CamelMimeMessage *msg;
        CamelMessageInfo *minfo, *info;
-       
+
        /* Default implementation. */
-       
+
        msg = camel_folder_get_message(source, uid, ex);
        if (!msg)
                return;
@@ -1366,16 +1366,16 @@ transfer_message_to (CamelFolder *source, const char *uid, CamelFolder *dest,
                camel_folder_free_message_info(source, minfo);
        } else
                info = camel_message_info_new_from_header(NULL, ((CamelMimePart *)msg)->headers);
-       
+
        /* we don't want to retain the deleted flag */
        camel_message_info_set_flags(info, CAMEL_MESSAGE_DELETED, 0);
-       
+
        camel_folder_append_message (dest, msg, info, transferred_uid, ex);
        camel_object_unref (msg);
-       
+
        if (delete_original && !camel_exception_is_set (ex))
                camel_folder_set_message_flags (source, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, ~0);
-       
+
        camel_message_info_free (info);
 }
 
@@ -1441,12 +1441,12 @@ camel_folder_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
        g_return_if_fail (CAMEL_IS_FOLDER (source));
        g_return_if_fail (CAMEL_IS_FOLDER (dest));
        g_return_if_fail (uids != NULL);
-       
+
        if (source == dest || uids->len == 0) {
                /* source and destination folders are the same, or no work to do, do nothing. */
                return;
        }
-       
+
        if (source->parent_store == dest->parent_store) {
                /* If either folder is a vtrash, we need to use the
                 * vtrash transfer method.
@@ -1477,15 +1477,15 @@ void
 camel_folder_delete (CamelFolder *folder)
 {
        g_return_if_fail (CAMEL_IS_FOLDER (folder));
-       
+
        CAMEL_FOLDER_REC_LOCK (folder, lock);
        if (folder->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED) {
                CAMEL_FOLDER_REC_UNLOCK (folder, lock);
                return;
        }
-       
+
        folder->folder_flags |= CAMEL_FOLDER_HAS_BEEN_DELETED;
-       
+
        CF_CLASS (folder)->delete (folder);
 
        CAMEL_FOLDER_REC_UNLOCK (folder, lock);
@@ -1512,7 +1512,7 @@ folder_rename (CamelFolder *folder, const char *new)
  * camel_folder_rename:
  * @folder: a #CamelFolder object
  * @new: new name for the folder
- * 
+ *
  * Mark an active folder object as renamed.
  *
  * NOTE: This is an internal function used by camel stores, no locking
@@ -1580,7 +1580,7 @@ thaw (CamelFolder * folder)
                info = folder->priv->changed_frozen;
                folder->priv->changed_frozen = camel_folder_change_info_new();
        }
-       
+
        CAMEL_FOLDER_UNLOCK(folder, change_lock);
 
        if (info) {
@@ -1654,7 +1654,7 @@ filter_filter(CamelSession *session, CamelSessionThreadMsg *tmsg)
                for (i = 0; i < m->junk->len; i ++) {
                        CamelMimeMessage *msg = camel_folder_get_message(m->folder, m->junk->pdata[i], NULL);
                        int pc = 100 * i / m->junk->len;
-                       
+
                        camel_operation_progress(NULL, pc);
 
                        if (msg) {
@@ -1809,7 +1809,7 @@ folder_changed (CamelObject *obj, gpointer event_data)
                                                notjunk = g_ptr_array_new();
                                        g_ptr_array_add (notjunk, g_strdup (changed->uid_changed->pdata [i]));
                                }
-                               /* reset junk learn flag so that we don't process it again*/ 
+                               /* reset junk learn flag so that we don't process it again*/
                                camel_folder_set_message_flags (folder, changed->uid_changed->pdata [i], CAMEL_MESSAGE_JUNK_LEARN, 0);
                        }
                }
@@ -1818,17 +1818,17 @@ folder_changed (CamelObject *obj, gpointer event_data)
        if ((folder->folder_flags & (CAMEL_FOLDER_FILTER_RECENT|CAMEL_FOLDER_FILTER_JUNK))
            && p->uid_filter->len > 0)
                driver = camel_session_get_filter_driver(session,
-                                                        (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) 
+                                                        (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT)
                                                         ? "incoming":"junktest", NULL);
-               
+
        if (driver) {
                recents = g_ptr_array_new();
                for (i = 0; i < p->uid_filter->len; i++)
                        g_ptr_array_add (recents, g_strdup (p->uid_filter->pdata[i]));
-               
+
                g_ptr_array_set_size (p->uid_filter, 0);
        }
-       
+
        if (driver || junk || notjunk) {
                struct _folder_filter_msg *msg;
 
@@ -1912,7 +1912,7 @@ camel_folder_free_deep (CamelFolder *folder, GPtrArray *array)
 
 /**
  * camel_folder_change_info_new:
- * 
+ *
  * Create a new folder change info structure.
  *
  * Change info structures are not MT-SAFE and must be
@@ -1944,18 +1944,18 @@ camel_folder_change_info_new(void)
  * camel_folder_change_info_add_source:
  * @info: a #CamelFolderChangeInfo
  * @uid: a uid
- * 
+ *
  * Add a source uid for generating a changeset.
  **/
 void
 camel_folder_change_info_add_source(CamelFolderChangeInfo *info, const char *uid)
 {
        struct _CamelFolderChangeInfoPrivate *p;
-       
+
        g_assert(info != NULL);
-       
+
        p = info->priv;
-       
+
        if (p->uid_source == NULL)
                p->uid_source = g_hash_table_new(g_str_hash, g_str_equal);
 
@@ -1968,7 +1968,7 @@ camel_folder_change_info_add_source(CamelFolderChangeInfo *info, const char *uid
  * camel_folder_change_info_add_source_list:
  * @info: a #CamelFolderChangeInfo
  * @list: a list of uids
- * 
+ *
  * Add a list of source uid's for generating a changeset.
  **/
 void
@@ -1976,10 +1976,10 @@ camel_folder_change_info_add_source_list(CamelFolderChangeInfo *info, const GPtr
 {
        struct _CamelFolderChangeInfoPrivate *p;
        int i;
-       
+
        g_assert(info != NULL);
        g_assert(list != NULL);
-       
+
        p = info->priv;
 
        if (p->uid_source == NULL)
@@ -1998,7 +1998,7 @@ camel_folder_change_info_add_source_list(CamelFolderChangeInfo *info, const GPtr
  * camel_folder_change_info_add_update:
  * @info: a #CamelFolderChangeInfo
  * @uid: a uid
- * 
+ *
  * Add a uid from the updated list, used to generate a changeset diff.
  **/
 void
@@ -2007,11 +2007,11 @@ camel_folder_change_info_add_update(CamelFolderChangeInfo *info, const char *uid
        struct _CamelFolderChangeInfoPrivate *p;
        char *key;
        int value;
-       
+
        g_assert(info != NULL);
-       
+
        p = info->priv;
-       
+
        if (p->uid_source == NULL) {
                camel_folder_change_info_add_uid(info, uid);
                return;
@@ -2029,17 +2029,17 @@ camel_folder_change_info_add_update(CamelFolderChangeInfo *info, const char *uid
  * camel_folder_change_info_add_update_list:
  * @info: a #CamelFolderChangeInfo
  * @list: a list of uids
- * 
+ *
  * Add a list of uid's from the updated list.
  **/
 void
 camel_folder_change_info_add_update_list(CamelFolderChangeInfo *info, const GPtrArray *list)
 {
        int i;
-       
+
        g_assert(info != NULL);
        g_assert(list != NULL);
-       
+
        for (i=0;i<list->len;i++)
                camel_folder_change_info_add_update(info, list->pdata[i]);
 }
@@ -2070,7 +2070,7 @@ change_info_remove(char *key, void *value, CamelFolderChangeInfo *info)
 /**
  * camel_folder_change_info_build_diff:
  * @info: a #CamelFolderChangeInfo
- * 
+ *
  * Compare the source uid set to the updated uid set and generate the
  * differences into the added and removed lists.
  **/
@@ -2078,11 +2078,11 @@ void
 camel_folder_change_info_build_diff(CamelFolderChangeInfo *info)
 {
        struct _CamelFolderChangeInfoPrivate *p;
-       
+
        g_assert(info != NULL);
-       
+
        p = info->priv;
-       
+
        if (p->uid_source) {
                g_hash_table_foreach(p->uid_source, (GHFunc)change_info_remove, info);
                g_hash_table_destroy(p->uid_source);
@@ -2096,10 +2096,10 @@ change_info_recent_uid(CamelFolderChangeInfo *info, const char *uid)
        struct _CamelFolderChangeInfoPrivate *p;
        GPtrArray *olduids;
        char *olduid;
-       
+
        p = info->priv;
 
-       /* always add to recent, but dont let anyone else know */       
+       /* always add to recent, but dont let anyone else know */
        if (!g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
                olduid = e_mempool_strdup(p->uid_pool, uid);
        }
@@ -2112,10 +2112,10 @@ change_info_filter_uid(CamelFolderChangeInfo *info, const char *uid)
        struct _CamelFolderChangeInfoPrivate *p;
        GPtrArray *olduids;
        char *olduid;
-       
+
        p = info->priv;
 
-       /* always add to filter, but dont let anyone else know */       
+       /* always add to filter, but dont let anyone else know */
        if (!g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
                olduid = e_mempool_strdup(p->uid_pool, uid);
        }
@@ -2136,7 +2136,7 @@ change_info_cat(CamelFolderChangeInfo *info, GPtrArray *source, void (*add)(Came
  * camel_folder_change_info_cat:
  * @info: a #CamelFolderChangeInfo to append to
  * @src: a #CamelFolderChangeInfo to append from
- * 
+ *
  * Concatenate one change info onto antoher.  Can be used to copy them
  * too.
  **/
@@ -2145,7 +2145,7 @@ camel_folder_change_info_cat(CamelFolderChangeInfo *info, CamelFolderChangeInfo
 {
        g_assert(info != NULL);
        g_assert(source != NULL);
-       
+
        change_info_cat(info, source->uid_added, camel_folder_change_info_add_uid);
        change_info_cat(info, source->uid_removed, camel_folder_change_info_remove_uid);
        change_info_cat(info, source->uid_changed, camel_folder_change_info_change_uid);
@@ -2157,7 +2157,7 @@ camel_folder_change_info_cat(CamelFolderChangeInfo *info, CamelFolderChangeInfo
  * camel_folder_change_info_add_uid:
  * @info: a #CamelFolderChangeInfo
  * @uid: a uid
- * 
+ *
  * Add a new uid to the changeinfo.
  **/
 void
@@ -2166,11 +2166,11 @@ camel_folder_change_info_add_uid(CamelFolderChangeInfo *info, const char *uid)
        struct _CamelFolderChangeInfoPrivate *p;
        GPtrArray *olduids;
        char *olduid;
-       
+
        g_assert(info != NULL);
-       
+
        p = info->priv;
-       
+
        if (g_hash_table_lookup_extended(p->uid_stored, uid, (gpointer) &olduid, (gpointer) &olduids)) {
                /* if it was removed then added, promote it to a changed */
                /* if it was changed then added, leave as changed */
@@ -2192,7 +2192,7 @@ camel_folder_change_info_add_uid(CamelFolderChangeInfo *info, const char *uid)
  * camel_folder_change_info_remove_uid:
  * @info: a #CamelFolderChangeInfo
  * @uid: a uid
- * 
+ *
  * Add a uid to the removed uid list.
  **/
 void
@@ -2201,11 +2201,11 @@ camel_folder_change_info_remove_uid(CamelFolderChangeInfo *info, const char *uid
        struct _CamelFolderChangeInfoPrivate *p;
        GPtrArray *olduids;
        char *olduid;
-       
+
        g_assert(info != NULL);
-       
+
        p = info->priv;
-       
+
        if (g_hash_table_lookup_extended(p->uid_stored, uid, (gpointer) &olduid, (gpointer) &olduids)) {
                /* if it was added/changed them removed, then remove it */
                if (olduids != info->uid_removed) {
@@ -2226,7 +2226,7 @@ camel_folder_change_info_remove_uid(CamelFolderChangeInfo *info, const char *uid
  * camel_folder_change_info_change_uid:
  * @info: a #CamelFolderChangeInfo
  * @uid: a uid
- * 
+ *
  * Add a uid to the changed uid list.
  **/
 void
@@ -2235,11 +2235,11 @@ camel_folder_change_info_change_uid(CamelFolderChangeInfo *info, const char *uid
        struct _CamelFolderChangeInfoPrivate *p;
        GPtrArray *olduids;
        char *olduid;
-       
+
        g_assert(info != NULL);
-       
+
        p = info->priv;
-       
+
        if (g_hash_table_lookup_extended(p->uid_stored, uid, (gpointer) &olduid, (gpointer) &olduids)) {
                /* if we have it already, leave it as that */
                return;
@@ -2264,7 +2264,7 @@ void
 camel_folder_change_info_recent_uid(CamelFolderChangeInfo *info, const char *uid)
 {
        g_assert(info != NULL);
-       
+
        change_info_recent_uid(info, uid);
        change_info_filter_uid(info, uid);
 }
@@ -2282,7 +2282,7 @@ gboolean
 camel_folder_change_info_changed(CamelFolderChangeInfo *info)
 {
        g_assert(info != NULL);
-       
+
        return (info->uid_added->len || info->uid_removed->len || info->uid_changed->len || info->uid_recent->len);
 }
 
@@ -2290,7 +2290,7 @@ camel_folder_change_info_changed(CamelFolderChangeInfo *info)
 /**
  * camel_folder_change_info_clear:
  * @info: a #CamelFolderChangeInfo
- * 
+ *
  * Empty out the change info; called after changes have been
  * processed.
  **/
@@ -2298,11 +2298,11 @@ void
 camel_folder_change_info_clear(CamelFolderChangeInfo *info)
 {
        struct _CamelFolderChangeInfoPrivate *p;
-       
+
        g_assert(info != NULL);
-       
+
        p = info->priv;
-       
+
        g_ptr_array_set_size(info->uid_added, 0);
        g_ptr_array_set_size(info->uid_removed, 0);
        g_ptr_array_set_size(info->uid_changed, 0);
@@ -2321,7 +2321,7 @@ camel_folder_change_info_clear(CamelFolderChangeInfo *info)
 /**
  * camel_folder_change_info_free:
  * @info: a #CamelFolderChangeInfo
- * 
+ *
  * Free memory associated with the folder change info lists.
  **/
 void
@@ -2330,9 +2330,9 @@ camel_folder_change_info_free(CamelFolderChangeInfo *info)
        struct _CamelFolderChangeInfoPrivate *p;
 
        g_assert(info != NULL);
-       
+
        p = info->priv;
-       
+
        if (p->uid_source)
                g_hash_table_destroy(p->uid_source);
 
index 29e387f..6afeee4 100644 (file)
@@ -7,8 +7,8 @@
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -110,10 +110,10 @@ struct _CamelFolder {
 typedef struct {
        CamelObjectClass parent_class;
 
-       /* Virtual methods */   
+       /* Virtual methods */
        void   (*refresh_info) (CamelFolder *folder, CamelException *ex);
 
-       void   (*sync) (CamelFolder *folder, gboolean expunge, 
+       void   (*sync) (CamelFolder *folder, gboolean expunge,
                        CamelException *ex);
 
        const char *  (*get_name)  (CamelFolder *folder);
@@ -121,17 +121,17 @@ typedef struct {
 
        CamelStore *  (*get_parent_store) (CamelFolder *folder);
 
-       void (*expunge)  (CamelFolder *folder, 
+       void (*expunge)  (CamelFolder *folder,
                          CamelException *ex);
 
        int   (*get_message_count)   (CamelFolder *folder);
 
-       void (*append_message)  (CamelFolder *folder, 
+       void (*append_message)  (CamelFolder *folder,
                                 CamelMimeMessage *message,
                                 const CamelMessageInfo *info,
                                 char **appended_uid,
                                 CamelException *ex);
-       
+
        guint32 (*get_permanent_flags) (CamelFolder *folder);
        guint32 (*get_message_flags)   (CamelFolder *folder,
                                        const char *uid);
@@ -155,8 +155,8 @@ typedef struct {
                                          const char *name,
                                          const char *value);
 
-       CamelMimeMessage * (*get_message)  (CamelFolder *folder, 
-                                           const char *uid, 
+       CamelMimeMessage * (*get_message)  (CamelFolder *folder,
+                                           const char *uid,
                                            CamelException *ex);
 
        GPtrArray * (*get_uids)       (CamelFolder *folder);
@@ -184,10 +184,10 @@ typedef struct {
                                      GPtrArray **transferred_uids,
                                      gboolean delete_originals,
                                      CamelException *ex);
-       
+
        void (*delete)           (CamelFolder *folder);
        void (*rename)           (CamelFolder *folder, const char *newname);
-       
+
        void     (*freeze)    (CamelFolder *folder);
        void     (*thaw)      (CamelFolder *folder);
        gboolean (*is_frozen) (CamelFolder *folder);
@@ -203,17 +203,17 @@ void               camel_folder_construct              (CamelFolder *folder,
                                                        const char *full_name,
                                                        const char *name);
 
-void               camel_folder_refresh_info           (CamelFolder *folder, 
+void               camel_folder_refresh_info           (CamelFolder *folder,
                                                        CamelException *ex);
-void               camel_folder_sync                   (CamelFolder *folder, 
-                                                       gboolean expunge, 
+void               camel_folder_sync                   (CamelFolder *folder,
+                                                       gboolean expunge,
                                                        CamelException *ex);
 
 CamelStore *       camel_folder_get_parent_store       (CamelFolder *folder);
 
 
 /* delete operations */
-void              camel_folder_expunge                (CamelFolder *folder, 
+void              camel_folder_expunge                (CamelFolder *folder,
                                                        CamelException *ex);
 
 
@@ -256,7 +256,7 @@ void                   camel_folder_set_message_user_tag  (CamelFolder *folder,
 
 
 /* message manipulation */
-void               camel_folder_append_message         (CamelFolder *folder, 
+void               camel_folder_append_message         (CamelFolder *folder,
                                                        CamelMimeMessage *message,
                                                        const CamelMessageInfo *info,
                                                        char **appended_uid,
@@ -280,8 +280,8 @@ void               camel_folder_free_summary          (CamelFolder *folder,
                                                       GPtrArray *array);
 
 /* uid based access operations */
-CamelMimeMessage * camel_folder_get_message           (CamelFolder *folder, 
-                                                      const char *uid, 
+CamelMimeMessage * camel_folder_get_message           (CamelFolder *folder,
+                                                      const char *uid,
                                                       CamelException *ex);
 #define camel_folder_delete_message(folder, uid) \
        camel_folder_set_message_flags (folder, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN)
index 5e5fdea..a954bb1 100644 (file)
@@ -67,7 +67,7 @@
 #include "camel-stream-fs.h"
 #include "camel-stream-mem.h"
 
-#define d(x) 
+#define d(x)
 
 #ifdef GPG_LOG
 static int logid;
@@ -88,15 +88,15 @@ camel_gpg_context_new (CamelSession *session)
 {
        CamelCipherContext *cipher;
        CamelGpgContext *ctx;
-       
+
        g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
-       
+
        ctx = (CamelGpgContext *) camel_object_new (camel_gpg_context_get_type ());
-       
+
        cipher = (CamelCipherContext *) ctx;
        cipher->session = session;
        camel_object_ref (session);
-       
+
        return cipher;
 }
 
@@ -113,7 +113,7 @@ void
 camel_gpg_context_set_always_trust (CamelGpgContext *ctx, gboolean always_trust)
 {
        g_return_if_fail (CAMEL_IS_GPG_CONTEXT (ctx));
-       
+
        ctx->always_trust = always_trust;
 }
 
@@ -136,7 +136,7 @@ gpg_hash_to_id (CamelCipherContext *context, CamelCipherHash hash)
        case CAMEL_CIPHER_HASH_HAVAL5160:
                return "pgp-haval-5-160";
        }
-       
+
        return NULL;
 }
 
@@ -157,7 +157,7 @@ gpg_id_to_hash (CamelCipherContext *context, const char *id)
                else if (!strcmp (id, "haval-5-160"))
                        return CAMEL_CIPHER_HASH_HAVAL5160;
        }
-       
+
        return CAMEL_CIPHER_HASH_DEFAULT;
 }
 
@@ -185,34 +185,34 @@ struct _GpgCtx {
        CamelSession *session;
        GHashTable *userid_hint;
        pid_t pid;
-       
+
        char *userid;
        char *sigfile;
        GPtrArray *recipients;
        CamelCipherHash hash;
-       
+
        int stdin_fd;
        int stdout_fd;
        int stderr_fd;
        int status_fd;
        int passwd_fd;  /* only needed for sign/decrypt */
-       
+
        /* status-fd buffer */
        unsigned char *statusbuf;
        unsigned char *statusptr;
        unsigned int statusleft;
-       
+
        char *need_id;
        char *passwd;
-       
+
        CamelStream *istream;
        CamelStream *ostream;
-       
+
        GByteArray *diagbuf;
        CamelStream *diagnostics;
-       
+
        int exit_status;
-       
+
        unsigned int exited:1;
        unsigned int complete:1;
        unsigned int seen_eof1:1;
@@ -221,9 +221,9 @@ struct _GpgCtx {
        unsigned int armor:1;
        unsigned int need_passwd:1;
        unsigned int send_passwd:1;
-       
+
        unsigned int bad_passwds:2;
-       
+
        unsigned int hadsig:1;
        unsigned int badsig:1;
        unsigned int errsig:1;
@@ -232,11 +232,11 @@ struct _GpgCtx {
        unsigned int nopubkey:1;
        unsigned int nodata:1;
        unsigned int trust:3;
-       
+
        unsigned int diagflushed:1;
-       
+
        unsigned int utf8:1;
-       
+
        unsigned int padding:10;
 };
 
@@ -246,7 +246,7 @@ gpg_ctx_new (CamelSession *session)
        struct _GpgCtx *gpg;
        const char *charset;
        CamelStream *stream;
-       
+
        gpg = g_new (struct _GpgCtx, 1);
        gpg->mode = GPG_CTX_MODE_SIGN;
        gpg->session = session;
@@ -258,30 +258,30 @@ gpg_ctx_new (CamelSession *session)
        gpg->pid = (pid_t) -1;
        gpg->exit_status = 0;
        gpg->exited = FALSE;
-       
+
        gpg->userid = NULL;
        gpg->sigfile = NULL;
        gpg->recipients = NULL;
        gpg->hash = CAMEL_CIPHER_HASH_DEFAULT;
        gpg->always_trust = FALSE;
        gpg->armor = FALSE;
-       
+
        gpg->stdin_fd = -1;
        gpg->stdout_fd = -1;
        gpg->stderr_fd = -1;
        gpg->status_fd = -1;
        gpg->passwd_fd = -1;
-       
+
        gpg->statusbuf = g_malloc (128);
        gpg->statusptr = gpg->statusbuf;
        gpg->statusleft = 128;
-       
+
        gpg->bad_passwds = 0;
        gpg->need_passwd = FALSE;
        gpg->send_passwd = FALSE;
        gpg->need_id = NULL;
        gpg->passwd = NULL;
-       
+
        gpg->nodata = FALSE;
        gpg->hadsig = FALSE;
        gpg->badsig = FALSE;
@@ -290,34 +290,34 @@ gpg_ctx_new (CamelSession *session)
        gpg->validsig = FALSE;
        gpg->nopubkey = FALSE;
        gpg->trust = GPG_TRUST_NONE;
-       
+
        gpg->istream = NULL;
        gpg->ostream = NULL;
-       
+
        stream = camel_stream_mem_new ();
        gpg->diagbuf = CAMEL_STREAM_MEM (stream)->buffer;
        gpg->diagflushed = FALSE;
-       
+
        if ((charset = e_iconv_locale_charset ()) && g_ascii_strcasecmp (charset, "UTF-8") != 0) {
                CamelMimeFilterCharset *filter;
                CamelStreamFilter *fstream;
-               
+
                gpg->utf8 = FALSE;
-               
+
                if ((filter = camel_mime_filter_charset_new_convert (charset, "UTF-8"))) {
                        fstream = camel_stream_filter_new_with_stream (stream);
                        camel_stream_filter_add (fstream, (CamelMimeFilter *) filter);
                        camel_object_unref (filter);
                        camel_object_unref (stream);
-                       
+
                        stream = (CamelStream *) fstream;
                }
        } else {
                gpg->utf8 = TRUE;
        }
-       
+
        gpg->diagnostics = stream;
-       
+
        return gpg;
 }
 
@@ -352,10 +352,10 @@ gpg_ctx_add_recipient (struct _GpgCtx *gpg, const char *keyid)
 {
        if (gpg->mode != GPG_CTX_MODE_ENCRYPT && gpg->mode != GPG_CTX_MODE_EXPORT)
                return;
-       
+
        if (!gpg->recipients)
                gpg->recipients = g_ptr_array_new ();
-       
+
        g_ptr_array_add (gpg->recipients, g_strdup (keyid));
 }
 
@@ -399,10 +399,10 @@ gpg_ctx_get_diagnostics (struct _GpgCtx *gpg)
                camel_stream_flush (gpg->diagnostics);
                if (gpg->diagbuf->len == 0)
                        return NULL;
-               
+
                g_byte_array_append (gpg->diagbuf, (guchar *) "", 1);
        }
-       
+
        return (const char *) gpg->diagbuf->data;
 }
 
@@ -423,21 +423,21 @@ gpg_ctx_free (struct _GpgCtx *gpg)
 
        if (gpg->session)
                camel_object_unref (gpg->session);
-       
+
        g_hash_table_foreach (gpg->userid_hint, userid_hint_free, NULL);
        g_hash_table_destroy (gpg->userid_hint);
-       
+
        g_free (gpg->userid);
-       
+
        g_free (gpg->sigfile);
-       
+
        if (gpg->recipients) {
                for (i = 0; i < gpg->recipients->len; i++)
                        g_free (gpg->recipients->pdata[i]);
-       
+
                g_ptr_array_free (gpg->recipients, TRUE);
        }
-       
+
        if (gpg->stdin_fd != -1)
                close (gpg->stdin_fd);
        if (gpg->stdout_fd != -1)
@@ -448,24 +448,24 @@ gpg_ctx_free (struct _GpgCtx *gpg)
                close (gpg->status_fd);
        if (gpg->passwd_fd != -1)
                close (gpg->passwd_fd);
-       
+
        g_free (gpg->statusbuf);
-       
+
        g_free (gpg->need_id);
-       
+
        if (gpg->passwd) {
                memset (gpg->passwd, 0, strlen (gpg->passwd));
                g_free (gpg->passwd);
        }
-       
+
        if (gpg->istream)
                camel_object_unref (gpg->istream);
-       
+
        if (gpg->ostream)
                camel_object_unref (gpg->ostream);
-       
+
        camel_object_unref (gpg->diagnostics);
-       
+
        g_free (gpg);
 }
 
@@ -495,10 +495,10 @@ gpg_ctx_get_argv (struct _GpgCtx *gpg, int status_fd, char **sfd, int passwd_fd,
        GPtrArray *argv;
        char *buf;
        int i;
-       
+
        argv = g_ptr_array_new ();
        g_ptr_array_add (argv, "gpg");
-       
+
        g_ptr_array_add (argv, "--verbose");
        g_ptr_array_add (argv, "--no-secmem-warning");
        g_ptr_array_add (argv, "--no-greeting");
@@ -509,15 +509,15 @@ gpg_ctx_get_argv (struct _GpgCtx *gpg, int status_fd, char **sfd, int passwd_fd,
                g_ptr_array_add (argv, "--batch");
                g_ptr_array_add (argv, "--yes");
        }
-       
+
        *sfd = buf = g_strdup_printf ("--status-fd=%d", status_fd);
        g_ptr_array_add (argv, buf);
-       
+
        if (passwd_fd != -1) {
                *pfd = buf = g_strdup_printf ("--command-fd=%d", passwd_fd);
                g_ptr_array_add (argv, buf);
        }
-       
+
        switch (gpg->mode) {
        case GPG_CTX_MODE_SIGN:
                g_ptr_array_add (argv, "--sign");
@@ -582,9 +582,9 @@ gpg_ctx_get_argv (struct _GpgCtx *gpg, int status_fd, char **sfd, int passwd_fd,
                        g_ptr_array_add (argv, gpg->recipients->pdata[i]);
                break;
        }
-       
+
        g_ptr_array_add (argv, NULL);
-       
+
        return argv;
 }
 
@@ -598,32 +598,32 @@ gpg_ctx_op_start (struct _GpgCtx *gpg)
        int i, maxfd, errnosave, fds[10];
        GPtrArray *argv;
        int flags;
-       
+
        for (i = 0; i < 10; i++)
                fds[i] = -1;
-       
+
        maxfd = gpg->need_passwd ? 10 : 8;
        for (i = 0; i < maxfd; i += 2) {
                if (pipe (fds + i) == -1)
                        goto exception;
        }
-       
+
        argv = gpg_ctx_get_argv (gpg, fds[7], &status_fd, fds[8], &passwd_fd);
-       
+
        if (!(gpg->pid = fork ())) {
                /* child process */
-               
+
                if ((dup2 (fds[0], STDIN_FILENO) < 0 ) ||
                    (dup2 (fds[3], STDOUT_FILENO) < 0 ) ||
                    (dup2 (fds[5], STDERR_FILENO) < 0 )) {
                        _exit (255);
                }
-               
+
                /* Dissociate from camel's controlling terminal so
                 * that gpg won't be able to read from it.
                 */
                setsid ();
-               
+
                maxfd = sysconf (_SC_OPEN_MAX);
                /* Loop over all fds. */
                for (i = 3; i < maxfd; i++) {
@@ -631,7 +631,7 @@ gpg_ctx_op_start (struct _GpgCtx *gpg)
                        if (i != fds[7] && i != fds[8])
                                fcntl (i, F_SETFD, FD_CLOEXEC);
                }
-               
+
                /* run gpg */
                execvp ("gpg", (char **) argv->pdata);
                _exit (255);
@@ -641,11 +641,11 @@ gpg_ctx_op_start (struct _GpgCtx *gpg)
                g_free (passwd_fd);
                goto exception;
        }
-       
+
        g_ptr_array_free (argv, TRUE);
        g_free (status_fd);
        g_free (passwd_fd);
-       
+
        /* Parent */
        close (fds[0]);
        gpg->stdin_fd = fds[1];
@@ -661,30 +661,30 @@ gpg_ctx_op_start (struct _GpgCtx *gpg)
                flags = fcntl (gpg->passwd_fd, F_GETFL);
                fcntl (gpg->passwd_fd, F_SETFL, flags | O_NONBLOCK);
        }
-       
+
        flags = fcntl (gpg->stdin_fd, F_GETFL);
        fcntl (gpg->stdin_fd, F_SETFL, flags | O_NONBLOCK);
-       
+
        flags = fcntl (gpg->stdout_fd, F_GETFL);
        fcntl (gpg->stdout_fd, F_SETFL, flags | O_NONBLOCK);
-       
+
        flags = fcntl (gpg->stderr_fd, F_GETFL);
        fcntl (gpg->stderr_fd, F_SETFL, flags | O_NONBLOCK);
-       
+
        flags = fcntl (gpg->status_fd, F_GETFL);
        fcntl (gpg->status_fd, F_SETFL, flags | O_NONBLOCK);
-       
+
        return 0;
-       
+
  exception:
-       
+
        errnosave = errno;
-       
+
        for (i = 0; i < 10; i++) {
                if (fds[i] != -1)
                        close (fds[i]);
        }
-       
+
        errno = errnosave;
 #else
        /* FIXME: Port me */
@@ -692,7 +692,7 @@ gpg_ctx_op_start (struct _GpgCtx *gpg)
 
        errno = EINVAL;
 #endif
-       
+
        return -1;
 }
 
@@ -702,23 +702,23 @@ static const char *
 next_token (const char *in, char **token)
 {
        const char *start, *inptr = in;
-       
+
        while (*inptr == ' ')
                inptr++;
-       
+
        if (*inptr == '\0' || *inptr == '\n') {
                if (token)
                        *token = NULL;
                return inptr;
        }
-       
+
        start = inptr;
        while (*inptr && *inptr != ' ' && *inptr != '\n')
                inptr++;
-       
+
        if (token)
                *token = g_strndup (start, inptr - start);
-       
+
        return inptr;
 }
 
@@ -729,24 +729,24 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
        const unsigned char *status;
        size_t nread, nwritten;
        int len;
-       
+
  parse:
-       
+
        inptr = gpg->statusbuf;
        while (inptr < gpg->statusptr && *inptr != '\n')
                inptr++;
-       
+
        if (*inptr != '\n') {
                /* we don't have enough data buffered to parse this status line */
                return 0;
        }
-       
+
        *inptr++ = '\0';
        status = gpg->statusbuf;
 
        if (camel_debug("gpg:status"))
                printf ("status: %s\n", status);
-       
+
        if (strncmp (status, "[GNUPG:] ", 9) != 0) {
                char *message;
                message = g_locale_to_utf8(status, -1, NULL, NULL, NULL);
@@ -756,12 +756,12 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
                g_free(message);
                return -1;
        }
-       
+
        status += 9;
-       
+
        if (!strncmp ((char *) status, "USERID_HINT ", 12)) {
                char *hint, *user;
-               
+
                status += 12;
                status = (const unsigned char *) next_token ((char *) status, &hint);
                if (!hint) {
@@ -769,59 +769,59 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
                                             _("Failed to parse gpg userid hint."));
                        return -1;
                }
-               
+
                if (g_hash_table_lookup (gpg->userid_hint, hint)) {
                        /* we already have this userid hint... */
                        g_free (hint);
                        goto recycle;
                }
-               
+
                if (gpg->utf8 || !(user = g_locale_to_utf8 ((gchar *) status, -1, &nread, &nwritten, NULL)))
                        user = g_strdup ((gchar *) status);
-               
+
                g_strstrip (user);
-               
+
                g_hash_table_insert (gpg->userid_hint, hint, user);
        } else if (!strncmp ((char *) status, "NEED_PASSPHRASE ", 16)) {
                char *userid;
-               
+
                status += 16;
-               
+
                status = (const unsigned char *) next_token ((char *) status, &userid);
                if (!userid) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Failed to parse gpg passphrase request."));
                        return -1;
                }
-               
+
                g_free (gpg->need_id);
                gpg->need_id = userid;
        } else if (!strncmp ((char *) status, "NEED_PASSPHRASE_PIN ", 20)) {
                char *userid;
-               
+
                status += 20;
-               
+
                status = (const unsigned char *) next_token ((char *) status, &userid);
                if (!userid) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Failed to parse gpg passphrase request."));
                        return -1;
                }
-               
+
                g_free (gpg->need_id);
                gpg->need_id = userid;
        } else if (!strncmp ((char *) status, "GET_HIDDEN ", 11)) {
                const char *name = NULL;
                char *prompt, *passwd;
                guint32 flags;
-               
+
                status += 11;
-               
+
                if (gpg->need_id && !(name = g_hash_table_lookup (gpg->userid_hint, gpg->need_id)))
                        name = gpg->need_id;
                else if (!name)
                        name = "";
-               
+
                if (!strncmp ((char *) status, "passphrase.pin.ask", 18)) {
                        prompt = g_strdup_printf (_("You need a PIN to unlock the key for your\n"
                                                    "SmartCard: \"%s\""), name);
@@ -835,12 +835,12 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
                        g_free (prompt);
                        return -1;
                }
-               
+
                flags = CAMEL_SESSION_PASSWORD_SECRET | CAMEL_SESSION_PASSPHRASE;
                if ((passwd = camel_session_get_password (gpg->session, NULL, NULL, prompt, gpg->need_id, flags, ex))) {
                        if (!gpg->utf8) {
                                char *opasswd = passwd;
-                               
+
                                if ((passwd = g_locale_to_utf8 (passwd, -1, &nread, &nwritten, NULL))) {
                                        memset (opasswd, 0, strlen (opasswd));
                                        g_free (opasswd);
@@ -848,26 +848,26 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
                                        passwd = opasswd;
                                }
                        }
-                       
+
                        gpg->passwd = g_strdup_printf ("%s\n", passwd);
                        memset (passwd, 0, strlen (passwd));
                        g_free (passwd);
-                       
+
                        gpg->send_passwd = TRUE;
                } else {
                        if (!camel_exception_is_set (ex))
                                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Canceled."));
                        return -1;
                }
-               
+
                g_free (prompt);
        } else if (!strncmp ((char *) status, "GOOD_PASSPHRASE", 15)) {
                gpg->bad_passwds = 0;
        } else if (!strncmp ((char *) status, "BAD_PASSPHRASE", 14)) {
                gpg->bad_passwds++;
-               
+
                camel_session_forget_password (gpg->session, NULL, NULL, gpg->need_id, ex);
-               
+
                if (gpg->bad_passwds == 3) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                             _("Failed to unlock secret key: 3 bad passphrases given."));
@@ -950,21 +950,21 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
                        break;
                }
        }
-       
+
  recycle:
-       
+
        /* recycle our statusbuf by moving inptr to the beginning of statusbuf */
        len = gpg->statusptr - inptr;
        memmove (gpg->statusbuf, inptr, len);
-       
+
        len = inptr - gpg->statusbuf;
        gpg->statusleft += len;
        gpg->statusptr -= len;
-       
+
        /* if we have more data, try parsing the next line? */
        if (gpg->statusptr > gpg->statusbuf)
                goto parse;
-       
+
        return 0;
 }
 
@@ -997,10 +997,10 @@ gpg_ctx_op_cancel (struct _GpgCtx *gpg)
 {
        pid_t retval;
        int status;
-       
+
        if (gpg->exited)
                return;
-       
+
        kill (gpg->pid, SIGTERM);
        sleep (1);
        retval = waitpid (gpg->pid, &status, WNOHANG);
@@ -1071,42 +1071,42 @@ gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
           the next file descriptor and so on until we've done what we
           can to all of them. If one fails along the way, return
           -1. */
-       
+
        if (polls[2].revents & (POLLIN|POLLHUP)) {
                /* read the status message and decide what to do... */
                char buffer[4096];
                ssize_t nread;
-               
+
                d(printf ("reading from gpg's status-fd...\n"));
-               
+
                do {
                        nread = read (gpg->status_fd, buffer, sizeof (buffer));
                } while (nread == -1 && (errno == EINTR || errno == EAGAIN));
                if (nread == -1)
                        goto exception;
-               
+
                if (nread > 0) {
                        status_backup (gpg, buffer, nread);
-                       
+
                        if (gpg_ctx_parse_status (gpg, ex) == -1)
                                return -1;
                } else {
                        gpg->complete = TRUE;
                }
        }
-       
+
        if ((polls[0].revents & (POLLIN|POLLHUP)) && gpg->ostream) {
                char buffer[4096];
                ssize_t nread;
-               
+
                d(printf ("reading gpg's stdout...\n"));
-               
+
                do {
                        nread = read (gpg->stdout_fd, buffer, sizeof (buffer));
                } while (nread == -1 && (errno == EINTR || errno == EAGAIN));
                if (nread == -1)
                        goto exception;
-               
+
                if (nread > 0) {
                        if (camel_stream_write (gpg->ostream, buffer, (size_t) nread) == -1)
                                goto exception;
@@ -1114,89 +1114,89 @@ gpg_ctx_op_step (struct _GpgCtx *gpg, CamelException *ex)
                        gpg->seen_eof1 = TRUE;
                }
        }
-       
+
        if (polls[1].revents & (POLLIN|POLLHUP)) {
                char buffer[4096];
                ssize_t nread;
-               
+
                d(printf ("reading gpg's stderr...\n"));
-               
+
                do {
                        nread = read (gpg->stderr_fd, buffer, sizeof (buffer));
                } while (nread == -1 && (errno == EINTR || errno == EAGAIN));
                if (nread == -1)
                        goto exception;
-               
+
                if (nread > 0) {
                        camel_stream_write (gpg->diagnostics, buffer, nread);
                } else {
                        gpg->seen_eof2 = TRUE;
                }
        }
-       
+
        if ((polls[4].revents & (POLLOUT|POLLHUP)) && gpg->need_passwd && gpg->send_passwd) {
                ssize_t w, nwritten = 0;
                size_t n;
-               
+
                d(printf ("sending gpg our passphrase...\n"));
-               
+
                /* send the passphrase to gpg */
                n = strlen (gpg->passwd);
                do {
                        do {
                                w = write (gpg->passwd_fd, gpg->passwd + nwritten, n - nwritten);
                        } while (w == -1 && (errno == EINTR || errno == EAGAIN));
-                       
+
                        if (w > 0)
                                nwritten += w;
                } while (nwritten < n && w != -1);
-               
+
                /* zero and free our passwd buffer */
                memset (gpg->passwd, 0, n);
                g_free (gpg->passwd);
                gpg->passwd = NULL;
-               
+
                if (w == -1)
                        goto exception;
-               
+
                gpg->send_passwd = FALSE;
        }
-       
+
        if ((polls[3].revents & (POLLOUT|POLLHUP)) && gpg->istream) {
                char buffer[4096];
                ssize_t nread;
-               
+
                d(printf ("writing to gpg's stdin...\n"));
-               
+
                /* write our stream to gpg's stdin */
                nread = camel_stream_read (gpg->istream, buffer, sizeof (buffer));
                if (nread > 0) {
                        ssize_t w, nwritten = 0;
-                       
+
                        do {
                                do {
                                        w = write (gpg->stdin_fd, buffer + nwritten, nread - nwritten);
                                } while (w == -1 && (errno == EINTR || errno == EAGAIN));
-                               
+
                                if (w > 0)
                                        nwritten += w;
                        } while (nwritten < nread && w != -1);
-                                               
+
                        if (w == -1)
                                goto exception;
-                       
+
                        d(printf ("wrote %d (out of %d) bytes to gpg's stdin\n", nwritten, nread));
                }
-               
+
                if (camel_stream_eos (gpg->istream)) {
                        d(printf ("closing gpg's stdin\n"));
                        close (gpg->stdin_fd);
                        gpg->stdin_fd = -1;
                }
        }
-       
+
        return 0;
-       
+
  exception:
        /* always called on an i/o error */
        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to execute gpg: %s"), g_strerror(errno));
@@ -1217,17 +1217,17 @@ gpg_ctx_op_exited (struct _GpgCtx *gpg)
 {
        pid_t retval;
        int status;
-       
+
        if (gpg->exited)
                return TRUE;
-       
+
        retval = waitpid (gpg->pid, &status, WNOHANG);
        if (retval == gpg->pid) {
                gpg->exit_status = status;
                gpg->exited = TRUE;
                return TRUE;
        }
-       
+
        return FALSE;
 }
 #endif
@@ -1239,7 +1239,7 @@ gpg_ctx_op_wait (struct _GpgCtx *gpg)
        sigset_t mask, omask;
        pid_t retval;
        int status;
-       
+
        if (!gpg->exited) {
                sigemptyset (&mask);
                sigaddset (&mask, SIGALRM);
@@ -1248,7 +1248,7 @@ gpg_ctx_op_wait (struct _GpgCtx *gpg)
                retval = waitpid (gpg->pid, &status, 0);
                alarm (0);
                sigprocmask (SIG_SETMASK, &omask, NULL);
-               
+
                if (retval == (pid_t) -1 && errno == EINTR) {
                        /* The child is hanging: send a friendly reminder. */
                        kill (gpg->pid, SIGTERM);
@@ -1265,7 +1265,7 @@ gpg_ctx_op_wait (struct _GpgCtx *gpg)
                status = gpg->exit_status;
                retval = gpg->pid;
        }
-       
+
        if (retval != (pid_t) -1 && WIFEXITED (status))
                return WEXITSTATUS (status);
        else
@@ -1287,9 +1287,9 @@ gpg_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
        int res = -1;
        CamelMimePart *sigpart;
        CamelMultipartSigned *mps;
-       
+
        /* Note: see rfc2015 or rfc3156, section 5 */
-       
+
        /* FIXME: stream this, we stream output at least */
        istream = camel_stream_mem_new();
        if (camel_cipher_canonical_to_stream(ipart, CAMEL_MIME_FILTER_CANON_STRIP|CAMEL_MIME_FILTER_CANON_CRLF|CAMEL_MIME_FILTER_CANON_FROM,
@@ -1324,21 +1324,21 @@ gpg_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
        gpg_ctx_set_userid (gpg, userid);
        gpg_ctx_set_istream (gpg, istream);
        gpg_ctx_set_ostream (gpg, ostream);
-       
+
        if (gpg_ctx_op_start (gpg) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to execute gpg: %s"), g_strerror (errno));
                goto fail;
        }
-       
+
        while (!gpg_ctx_op_complete (gpg)) {
                if (gpg_ctx_op_step (gpg, ex) == -1)
                        goto fail;
        }
-       
+
        if (gpg_ctx_op_wait (gpg) != 0) {
                const char *diagnostics;
-               
+
                diagnostics = gpg_ctx_get_diagnostics (gpg);
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     diagnostics && *diagnostics ? diagnostics :
@@ -1379,10 +1379,10 @@ gpg_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
        camel_medium_set_content_object((CamelMedium *)opart, (CamelDataWrapper *)mps);
 fail:
        camel_object_unref(ostream);
-       
+
        if (gpg)
                gpg_ctx_free (gpg);
-       
+
        return res;
 }
 
@@ -1393,15 +1393,15 @@ swrite (CamelMimePart *sigpart)
        CamelStream *ostream;
        char *template;
        int fd, ret;
-       
+
        template = g_build_filename (g_get_tmp_dir (), "evolution-pgp.XXXXXX", NULL);
        if ((fd = g_mkstemp (template)) == -1) {
                g_free (template);
                return NULL;
        }
-       
+
        /* TODO: This should probably just write the decoded message content out, not the part + headers */
-       
+
        ostream = camel_stream_fs_new_with_fd (fd);
        ret = camel_data_wrapper_write_to_stream((CamelDataWrapper *)sigpart, ostream);
        if (ret != -1) {
@@ -1409,15 +1409,15 @@ swrite (CamelMimePart *sigpart)
                if (ret != -1)
                        ret = camel_stream_close (ostream);
        }
-       
+
        camel_object_unref(ostream);
-       
+
        if (ret == -1) {
                g_unlink (template);
                g_free (template);
                return NULL;
        }
-       
+
        return template;
 }
 
@@ -1435,7 +1435,7 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
 
        mps = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)ipart);
        ct = ((CamelDataWrapper *)mps)->mime_type;
-       
+
        /* Inline signature (using our fake mime type) or PGP/Mime signature */
        if (camel_content_type_is(ct, "multipart", "signed")) {
                /* PGP/Mime Signature */
@@ -1443,19 +1443,19 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
 
                tmp = camel_content_type_param(ct, "protocol");
                if (!CAMEL_IS_MULTIPART_SIGNED(mps)
-                   || tmp == NULL  
+                   || tmp == NULL
                    || g_ascii_strcasecmp(tmp, context->sign_protocol) != 0) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot verify message signature: Incorrect message format"));
                        return NULL;
                }
-       
+
                if (!(istream = camel_multipart_signed_get_content_stream ((CamelMultipartSigned *) mps, NULL))) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot verify message signature: Incorrect message format"));
                        return NULL;
                }
-       
+
                if (!(sigpart = camel_multipart_get_part (mps, CAMEL_MULTIPART_SIGNED_SIGNATURE))) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot verify message signature: Incorrect message format"));
@@ -1477,7 +1477,7 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
                              _("Cannot verify message signature: Incorrect message format"));
                return NULL;
        }
-       
+
        /* Now start the real work of verifying the message */
 #ifdef GPG_LOG
        if (camel_debug_start("gpg:sign")) {
@@ -1516,25 +1516,25 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
                        goto exception;
                }
        }
-       
+
        camel_stream_reset(istream);
        gpg = gpg_ctx_new (context->session);
        gpg_ctx_set_mode (gpg, GPG_CTX_MODE_VERIFY);
        if (sigfile)
                 gpg_ctx_set_sigfile (gpg, sigfile);
        gpg_ctx_set_istream (gpg, istream);
-       
+
        if (gpg_ctx_op_start (gpg) == -1) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Failed to execute gpg."));
                goto exception;
        }
-       
+
        while (!gpg_ctx_op_complete (gpg)) {
                if (gpg_ctx_op_step (gpg, ex) == -1)
                        goto exception;
        }
-       
+
        gpg_ctx_op_wait (gpg);
        validity = camel_cipher_validity_new ();
        diagnostics = gpg_ctx_get_diagnostics (gpg);
@@ -1551,22 +1551,22 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
        } else {
                validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_BAD;
        }
-       
+
        gpg_ctx_free (gpg);
-       
+
        if (sigfile) {
                g_unlink (sigfile);
                g_free (sigfile);
        }
        camel_object_unref(istream);
-       
+
        return validity;
-       
+
  exception:
-       
+
        if (gpg != NULL)
                gpg_ctx_free (gpg);
-       
+
        if (istream)
                camel_object_unref(istream);
 
@@ -1574,7 +1574,7 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
                g_unlink (sigfile);
                g_free (sigfile);
        }
-       
+
        return NULL;
 }
 
@@ -1609,7 +1609,7 @@ gpg_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipie
        for (i = 0; i < recipients->len; i++) {
                gpg_ctx_add_recipient (gpg, recipients->pdata[i]);
        }
-       
+
        if (gpg_ctx_op_start (gpg) == -1) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to execute gpg."));
                goto fail;
@@ -1620,10 +1620,10 @@ gpg_encrypt (CamelCipherContext *context, const char *userid, GPtrArray *recipie
                if (gpg_ctx_op_step (gpg, ex) == -1)
                        goto fail;
        }
-       
+
        if (gpg_ctx_op_wait (gpg) != 0) {
                const char *diagnostics;
-               
+
                diagnostics = gpg_ctx_get_diagnostics (gpg);
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     diagnostics && *diagnostics ? diagnostics : _("Failed to execute gpg."));
@@ -1679,7 +1679,7 @@ fail:
 fail1:
        camel_object_unref(istream);
        camel_object_unref(ostream);
-               
+
        return res;
 }
 
@@ -1711,7 +1711,7 @@ gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *op
 
        ct = camel_mime_part_get_content_type((CamelMimePart *)content);
        /* Encrypted part (using our fake mime type) or PGP/Mime multipart */
-       if (camel_content_type_is(ct, "multipart", "encrypted")) {      
+       if (camel_content_type_is(ct, "multipart", "encrypted")) {
                mp = (CamelMultipart *) camel_medium_get_content_object ((CamelMedium *) ipart);
                if (!(encrypted = camel_multipart_get_part (mp, CAMEL_MULTIPART_ENCRYPTED_CONTENT))) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to decrypt MIME part: protocol error"));
@@ -1728,11 +1728,11 @@ gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *op
                                _("Cannot decrypt message: Incorrect message format"));
                return NULL;
        }
-       
+
        istream = camel_stream_mem_new();
        camel_data_wrapper_decode_to_stream (content, istream);
        camel_stream_reset(istream);
-       
+
        ostream = camel_stream_mem_new();
        camel_stream_mem_set_secure((CamelStreamMem *)ostream);
 
@@ -1740,21 +1740,21 @@ gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *op
        gpg_ctx_set_mode (gpg, GPG_CTX_MODE_DECRYPT);
        gpg_ctx_set_istream (gpg, istream);
        gpg_ctx_set_ostream (gpg, ostream);
-       
+
        if (gpg_ctx_op_start (gpg) == -1) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Failed to execute gpg."));
                goto fail;
        }
-       
+
        while (!gpg_ctx_op_complete (gpg)) {
                if (gpg_ctx_op_step (gpg, ex) == -1)
                        goto fail;
        }
-       
+
        if (gpg_ctx_op_wait (gpg) != 0) {
                const char *diagnostics;
-               
+
                diagnostics = gpg_ctx_get_diagnostics (gpg);
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     diagnostics && *diagnostics ? diagnostics :
@@ -1777,11 +1777,11 @@ gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *op
                /* Set mime/type of this new part to application/octet-stream to force type snooping */
                camel_mime_part_set_content_type(opart, "application/octet-stream");
        }
-       if (rv != -1) { 
+       if (rv != -1) {
                valid = camel_cipher_validity_new();
                valid->encrypt.description = g_strdup(_("Encrypted content"));
                valid->encrypt.status = CAMEL_CIPHER_VALIDITY_ENCRYPT_ENCRYPTED;
-               
+
                if (gpg->hadsig) {
                        if (gpg->validsig) {
                                if (gpg->trust == GPG_TRUST_UNDEFINED || gpg->trust == GPG_TRUST_NONE)
@@ -1800,7 +1800,7 @@ gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *op
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Unable to parse message content"));
        }
-       
+
  fail:
        camel_object_unref(ostream);
        camel_object_unref(istream);
@@ -1818,22 +1818,22 @@ gpg_import_keys (CamelCipherContext *context, CamelStream *istream, CamelExcepti
        gpg = gpg_ctx_new (context->session);
        gpg_ctx_set_mode (gpg, GPG_CTX_MODE_IMPORT);
        gpg_ctx_set_istream (gpg, istream);
-       
+
        if (gpg_ctx_op_start (gpg) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to execute gpg: %s"),
                                      errno ? g_strerror (errno) : _("Unknown"));
                goto fail;
        }
-       
+
        while (!gpg_ctx_op_complete (gpg)) {
                if (gpg_ctx_op_step (gpg, ex) == -1)
                        goto fail;
        }
-       
+
        if (gpg_ctx_op_wait (gpg) != 0) {
                const char *diagnostics;
-               
+
                diagnostics = gpg_ctx_get_diagnostics (gpg);
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     diagnostics && *diagnostics ? diagnostics :
@@ -1844,7 +1844,7 @@ gpg_import_keys (CamelCipherContext *context, CamelStream *istream, CamelExcepti
        res = 0;
 fail:
        gpg_ctx_free (gpg);
-       
+
        return res;
 }
 
@@ -1859,26 +1859,26 @@ gpg_export_keys (CamelCipherContext *context, GPtrArray *keys, CamelStream *ostr
        gpg_ctx_set_mode (gpg, GPG_CTX_MODE_EXPORT);
        gpg_ctx_set_armor (gpg, TRUE);
        gpg_ctx_set_ostream (gpg, ostream);
-       
+
        for (i = 0; i < keys->len; i++) {
                gpg_ctx_add_recipient (gpg, keys->pdata[i]);
        }
-       
+
        if (gpg_ctx_op_start (gpg) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to execute gpg: %s"),
                                      errno ? g_strerror (errno) : _("Unknown"));
                goto fail;
        }
-       
+
        while (!gpg_ctx_op_complete (gpg)) {
                if (gpg_ctx_op_step (gpg, ex) == -1)
                        goto fail;
        }
-       
+
        if (gpg_ctx_op_wait (gpg) != 0) {
                const char *diagnostics;
-               
+
                diagnostics = gpg_ctx_get_diagnostics (gpg);
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     diagnostics && *diagnostics ? diagnostics :
@@ -1889,7 +1889,7 @@ gpg_export_keys (CamelCipherContext *context, GPtrArray *keys, CamelStream *ostr
        res = 0;
 fail:
        gpg_ctx_free (gpg);
-       
+
        return res;
 }
 
@@ -1899,9 +1899,9 @@ static void
 camel_gpg_context_class_init (CamelGpgContextClass *klass)
 {
        CamelCipherContextClass *cipher_class = CAMEL_CIPHER_CONTEXT_CLASS (klass);
-       
+
        parent_class = CAMEL_CIPHER_CONTEXT_CLASS (camel_type_get_global_classfuncs (camel_cipher_context_get_type ()));
-       
+
        cipher_class->hash_to_id = gpg_hash_to_id;
        cipher_class->id_to_hash = gpg_id_to_hash;
        cipher_class->sign = gpg_sign;
@@ -1916,9 +1916,9 @@ static void
 camel_gpg_context_init (CamelGpgContext *context)
 {
        CamelCipherContext *cipher = (CamelCipherContext *) context;
-       
+
        context->always_trust = FALSE;
-       
+
        cipher->sign_protocol = "application/pgp-signature";
        cipher->encrypt_protocol = "application/pgp-encrypted";
        cipher->key_protocol = "application/pgp-keys";
@@ -1934,7 +1934,7 @@ CamelType
 camel_gpg_context_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_cipher_context_get_type (),
                                            "CamelGpgContext",
@@ -1945,7 +1945,7 @@ camel_gpg_context_get_type (void)
                                            (CamelObjectInitFunc) camel_gpg_context_init,
                                            (CamelObjectFinalizeFunc) camel_gpg_context_finalise);
        }
-       
+
        return type;
 }
 
index bce5dd2..b73013c 100644 (file)
@@ -38,13 +38,13 @@ typedef struct _CamelGpgContextClass CamelGpgContextClass;
 
 struct _CamelGpgContext {
        CamelCipherContext parent_object;
-       
+
        gboolean always_trust;
 };
 
 struct _CamelGpgContextClass {
        CamelCipherContextClass parent_class;
-       
+
 };
 
 
index 649832e..8353a14 100644 (file)
@@ -74,7 +74,7 @@ CamelType
 camel_html_parser_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_object_get_type (), "CamelHTMLParser",
                                            sizeof (CamelHTMLParser),
@@ -84,7 +84,7 @@ camel_html_parser_get_type (void)
                                            (CamelObjectInitFunc) camel_html_parser_init,
                                            (CamelObjectFinalizeFunc) camel_html_parser_finalize);
        }
-       
+
        return type;
 }
 
@@ -116,7 +116,7 @@ camel_html_parser_class_init (CamelHTMLParserClass *klass)
  * camel_html_parser_new:
  *
  * Create a new CamelHTMLParser object.
- * 
+ *
  * Return value: A new CamelHTMLParser widget.
  **/
 CamelHTMLParser *
@@ -487,7 +487,7 @@ static CamelHTMLParserPrivate *tokenise_init(void)
        p->tag = g_string_new("");
        p->ent = g_string_new("");
        p->charset = NULL;
-       
+
        if (entities == NULL)
                tokenise_setup();
 
index 16ea063..1aa8d59 100644 (file)
@@ -43,7 +43,7 @@
 #include "camel-tcp-stream-ssl.h"
 #endif
 
-#define d(x) 
+#define d(x)
 
 static CamelStreamClass *parent_class = NULL;
 
@@ -58,9 +58,9 @@ camel_http_stream_class_init (CamelHttpStreamClass *camel_http_stream_class)
 {
        CamelStreamClass *camel_stream_class =
                CAMEL_STREAM_CLASS (camel_http_stream_class);
-       
+
        parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (camel_stream_get_type ()));
-       
+
        /* virtual method overload */
        camel_stream_class->read = stream_read;
        camel_stream_class->write = stream_write;
@@ -73,7 +73,7 @@ static void
 camel_http_stream_init (gpointer object, gpointer klass)
 {
        CamelHttpStream *http = CAMEL_HTTP_STREAM (object);
-       
+
        http->parser = NULL;
        http->content_type = NULL;
        http->headers = NULL;
@@ -90,28 +90,28 @@ static void
 camel_http_stream_finalize (CamelObject *object)
 {
        CamelHttpStream *http = CAMEL_HTTP_STREAM (object);
-       
+
        if (http->parser)
                camel_object_unref(http->parser);
-       
+
        if (http->content_type)
                camel_content_type_unref (http->content_type);
-       
+
        if (http->headers)
                camel_header_raw_clear (&http->headers);
-       
+
        if (http->session)
                camel_object_unref(http->session);
-       
+
        if (http->url)
                camel_url_free (http->url);
-       
+
        if (http->proxy)
                camel_url_free (http->proxy);
-       
+
        g_free (http->authrealm);
        g_free (http->authpass);
-       
+
        if (http->raw)
                camel_object_unref(http->raw);
        if (http->read)
@@ -122,7 +122,7 @@ CamelType
 camel_http_stream_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_stream_get_type (),
                                            "CamelHttpStream",
@@ -133,7 +133,7 @@ camel_http_stream_get_type (void)
                                            (CamelObjectInitFunc) camel_http_stream_init,
                                            (CamelObjectFinalizeFunc) camel_http_stream_finalize);
        }
-       
+
        return type;
 }
 
@@ -150,20 +150,20 @@ camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, Ca
 {
        CamelHttpStream *stream;
        char *str;
-       
+
        g_return_val_if_fail(CAMEL_IS_SESSION(session), NULL);
        g_return_val_if_fail(url != NULL, NULL);
-       
+
        stream = CAMEL_HTTP_STREAM (camel_object_new (camel_http_stream_get_type ()));
-       
+
        stream->method = method;
        stream->session = session;
        camel_object_ref(session);
-       
+
        str = camel_url_to_string (url, 0);
        stream->url = camel_url_new (str, NULL);
        g_free (str);
-       
+
        return (CamelStream *)stream;
 }
 
@@ -186,7 +186,7 @@ http_connect (CamelHttpStream *http, CamelURL *url)
        } else {
                stream = camel_tcp_stream_raw_new ();
        }
-       
+
        if (stream == NULL) {
                errno = EINVAL;
                return NULL;
@@ -205,7 +205,7 @@ http_connect (CamelHttpStream *http, CamelURL *url)
                camel_object_unref (stream);
                return NULL;
        }
-       
+
        if (camel_tcp_stream_connect (CAMEL_TCP_STREAM (stream), ai) == -1) {
                errsave = errno;
                camel_object_unref (stream);
@@ -213,12 +213,12 @@ http_connect (CamelHttpStream *http, CamelURL *url)
                errno = errsave;
                return NULL;
        }
-       
+
        camel_freeaddrinfo(ai);
 
        http->raw = stream;
        http->read = camel_stream_buffer_new (stream, CAMEL_STREAM_BUFFER_READ);
-       
+
        return stream;
 }
 
@@ -229,7 +229,7 @@ http_disconnect(CamelHttpStream *http)
                camel_object_unref(http->raw);
                http->raw = NULL;
        }
-                       
+
        if (http->read) {
                camel_object_unref(http->read);
                http->read = NULL;
@@ -245,13 +245,13 @@ static const char *
 http_next_token (const unsigned char *in)
 {
        const unsigned char *inptr = in;
-       
+
        while (*inptr && !isspace ((int) *inptr))
                inptr++;
-       
+
        while (*inptr && isspace ((int) *inptr))
                inptr++;
-       
+
        return (const char *) inptr;
 }
 
@@ -260,7 +260,7 @@ http_get_statuscode (CamelHttpStream *http)
 {
        const char *token;
        char buffer[4096];
-       
+
        if (camel_stream_buffer_gets ((CamelStreamBuffer *)http->read, buffer, sizeof (buffer)) <= 0)
                return -1;
 
@@ -274,7 +274,7 @@ http_get_statuscode (CamelHttpStream *http)
        }
 
        http_disconnect(http);
-       
+
        return -1;
 }
 
@@ -286,13 +286,13 @@ http_get_headers (CamelHttpStream *http)
        char *buf;
        size_t len;
        int err;
-       
+
        if (http->parser)
                camel_object_unref (http->parser);
-       
+
        http->parser = camel_mime_parser_new ();
        camel_mime_parser_init_with_stream (http->parser, http->read);
-       
+
        switch (camel_mime_parser_step (http->parser, &buf, &len)) {
        case CAMEL_MIME_PARSER_STATE_MESSAGE:
        case CAMEL_MIME_PARSER_STATE_HEADER:
@@ -304,13 +304,13 @@ http_get_headers (CamelHttpStream *http)
                        http->content_type = camel_content_type_decode (type);
                else
                        http->content_type = NULL;
-               
+
                if (http->headers)
                        camel_header_raw_clear (&http->headers);
-               
+
                http->headers = NULL;
                tail = (struct _camel_header_raw *) &http->headers;
-               
+
                d(printf("HTTP Headers:\n"));
                while (headers) {
                        d(printf(" %s:%s\n", headers->name, headers->value));
@@ -323,27 +323,27 @@ http_get_headers (CamelHttpStream *http)
                        tail = node;
                        headers = headers->next;
                }
-               
+
                break;
        default:
                g_warning ("Invalid state encountered???: %u", camel_mime_parser_state (http->parser));
        }
-       
+
        err = camel_mime_parser_errno (http->parser);
-       
+
        if (err != 0) {
                camel_object_unref (http->parser);
                http->parser = NULL;
                goto exception;
        }
-       
+
        camel_mime_parser_drop_step (http->parser);
-       
+
        return 0;
-       
+
  exception:
        http_disconnect(http);
-       
+
        return -1;
 }
 
@@ -352,7 +352,7 @@ http_method_invoke (CamelHttpStream *http)
 {
        const char *method = NULL;
        char *url;
-       
+
        switch (http->method) {
        case CAMEL_HTTP_METHOD_GET:
                method = "GET";
@@ -363,7 +363,7 @@ http_method_invoke (CamelHttpStream *http)
        default:
                g_assert_not_reached ();
        }
-       
+
        url = camel_url_to_string (http->url, 0);
        d(printf("HTTP Stream Sending: %s %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\n",
                 method,
@@ -383,7 +383,7 @@ http_method_invoke (CamelHttpStream *http)
 
        if (http->authrealm)
                d(printf("HTTP Stream Sending: WWW-Authenticate: %s\n", http->authrealm));
-       
+
        if (http->authrealm && camel_stream_printf (http->raw, "WWW-Authenticate: %s\r\n", http->authrealm) == -1) {
                http_disconnect(http);
                return -1;
@@ -391,19 +391,19 @@ http_method_invoke (CamelHttpStream *http)
 
        if (http->authpass && http->proxy)
                d(printf("HTTP Stream Sending: Proxy-Aurhorization: Basic %s\n", http->authpass));
-       
+
        if (http->authpass && http->proxy && camel_stream_printf (http->raw, "Proxy-Authorization: Basic %s\r\n",
                                                                  http->authpass) == -1) {
                http_disconnect(http);
                return -1;
        }
-       
+
        /* end the headers */
        if (camel_stream_write (http->raw, "\r\n", 2) == -1 || camel_stream_flush (http->raw) == -1) {
                http_disconnect(http);
                return -1;
        }
-       
+
        return 0;
 }
 
@@ -413,27 +413,27 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
        CamelHttpStream *http = CAMEL_HTTP_STREAM (stream);
        const char *parser_buf;
        ssize_t nread;
-       
+
        if (http->method != CAMEL_HTTP_METHOD_GET && http->method != CAMEL_HTTP_METHOD_HEAD) {
                errno = EIO;
                return -1;
        }
-       
+
  redirect:
-       
+
        if (!http->raw) {
                if (http_connect (http, http->proxy ? http->proxy : http->url) == NULL)
                        return -1;
-               
+
                if (http_method_invoke (http) == -1)
                        return -1;
-               
+
                if (http_get_statuscode (http) == -1)
                        return -1;
-               
+
                if (http_get_headers (http) == -1)
                        return -1;
-               
+
                switch (http->statuscode) {
                case 200:
                case 206:
@@ -480,14 +480,14 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                        return -1;
                }
        }
-       
+
        nread = camel_mime_parser_read (http->parser, &parser_buf, n);
-       
+
        if (nread > 0)
                memcpy (buffer, parser_buf, nread);
        else if (nread == 0)
                stream->eos = TRUE;
-       
+
        return nread;
 }
 
@@ -501,7 +501,7 @@ static int
 stream_flush (CamelStream *stream)
 {
        CamelHttpStream *http = (CamelHttpStream *) stream;
-       
+
        if (http->raw)
                return camel_stream_flush (http->raw);
        else
@@ -512,14 +512,14 @@ static int
 stream_close (CamelStream *stream)
 {
        CamelHttpStream *http = (CamelHttpStream *) stream;
-       
+
        if (http->raw) {
                if (camel_stream_close (http->raw) == -1)
                        return -1;
 
                http_disconnect(http);
        }
-       
+
        return 0;
 }
 
@@ -527,7 +527,7 @@ static int
 stream_reset (CamelStream *stream)
 {
        CamelHttpStream *http = CAMEL_HTTP_STREAM (stream);
-       
+
        if (http->raw)
                http_disconnect(http);
 
@@ -538,21 +538,21 @@ CamelContentType *
 camel_http_stream_get_content_type (CamelHttpStream *http_stream)
 {
        g_return_val_if_fail (CAMEL_IS_HTTP_STREAM (http_stream), NULL);
-       
+
        if (!http_stream->content_type && !http_stream->raw) {
                if (http_connect (http_stream, http_stream->url) == NULL)
                        return NULL;
-               
+
                if (http_method_invoke (http_stream) == -1)
                        return NULL;
-               
+
                if (http_get_headers (http_stream) == -1)
                        return NULL;
        }
-       
+
        if (http_stream->content_type)
                camel_content_type_ref (http_stream->content_type);
-       
+
        return http_stream->content_type;
 }
 
@@ -560,7 +560,7 @@ void
 camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const char *user_agent)
 {
        g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
-       
+
        g_free (http_stream->user_agent);
        http_stream->user_agent = g_strdup (user_agent);
 }
@@ -569,7 +569,7 @@ void
 camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url)
 {
        g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
-       
+
        if (http_stream->proxy)
                camel_url_free (http_stream->proxy);
 
@@ -598,7 +598,7 @@ void
 camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const char *proxy_authrealm)
 {
        g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
-       
+
        g_free (http_stream->authrealm);
        http_stream->authrealm = g_strdup (proxy_authrealm);
 }
@@ -607,7 +607,7 @@ void
 camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const char *proxy_authpass)
 {
        g_return_if_fail (CAMEL_IS_HTTP_STREAM (http_stream));
-       
+
        g_free (http_stream->authpass);
        http_stream->authpass = g_strdup (proxy_authpass);
 }
index 1be6509..241d047 100644 (file)
@@ -52,32 +52,32 @@ typedef struct _CamelHttpStreamClass CamelHttpStreamClass;
 
 struct _CamelHttpStream {
        CamelStream parent_object;
-       
+
        CamelMimeParser *parser;
-       
+
        CamelContentType *content_type;
        struct _camel_header_raw *headers;
-       
+
        CamelHttpMethod method;
        struct _CamelSession *session;
        CamelURL *url;
-       
+
        char *user_agent;
-       
+
        /* proxy info */
        CamelURL *proxy;
        char *authrealm;
        char *authpass;
-       
+
        int statuscode;
-       
+
        CamelStream *raw;
        CamelStream *read;
 };
 
 struct _CamelHttpStreamClass {
        CamelStreamClass parent_class;
-       
+
        /* Virtual methods */
 };
 
index 121235a..aa68273 100644 (file)
@@ -32,7 +32,7 @@
 #    ifdef CAMEL_EXPLICIT_TRANSLATION_DOMAIN
 #        undef _
 #        define _(String) dgettext (CAMEL_EXPLICIT_TRANSLATION_DOMAIN, String)
-#    else 
+#    else
 #        define _(String) gettext (String)
 #    endif
 #    ifdef gettext_noop
index 8e4a417..a24e1a1 100644 (file)
@@ -80,7 +80,7 @@ CamelType
 camel_index_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_object_get_type(), "CamelIndex",
                                           sizeof (CamelIndex),
@@ -90,7 +90,7 @@ camel_index_get_type(void)
                                           (CamelObjectInitFunc) camel_index_init,
                                           (CamelObjectFinalizeFunc) camel_index_finalise);
        }
-       
+
        return type;
 }
 
@@ -116,7 +116,7 @@ int
 camel_index_rename(CamelIndex *idx, const char *path)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->rename(idx, path);
        else {
@@ -129,7 +129,7 @@ void
 camel_index_set_normalise(CamelIndex *idx, CamelIndexNorm func, void *data)
 {
        g_return_if_fail (CAMEL_IS_INDEX (idx));
-       
+
        idx->normalise = func;
        idx->normalise_data = data;
 }
@@ -138,7 +138,7 @@ int
 camel_index_sync(CamelIndex *idx)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->sync(idx);
        else {
@@ -151,7 +151,7 @@ int
 camel_index_compress(CamelIndex *idx)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->compress(idx);
        else {
@@ -166,7 +166,7 @@ camel_index_delete(CamelIndex *idx)
        int ret;
 
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0) {
                ret = CI_CLASS(idx)->delete(idx);
                idx->state |= CAMEL_INDEX_DELETED;
@@ -182,7 +182,7 @@ int
 camel_index_has_name(CamelIndex *idx, const char *name)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), FALSE);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->has_name(idx, name);
        else
@@ -193,7 +193,7 @@ CamelIndexName *
 camel_index_add_name(CamelIndex *idx, const char *name)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->add_name(idx, name);
        else
@@ -204,7 +204,7 @@ int
 camel_index_write_name(CamelIndex *idx, CamelIndexName *idn)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), -1);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->write_name(idx, idn);
        else {
@@ -217,7 +217,7 @@ CamelIndexCursor *
 camel_index_find_name(CamelIndex *idx, const char *name)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->find_name(idx, name);
        else
@@ -228,7 +228,7 @@ void
 camel_index_delete_name(CamelIndex *idx, const char *name)
 {
        g_return_if_fail (CAMEL_IS_INDEX (idx));
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                CI_CLASS(idx)->delete_name(idx, name);
 }
@@ -240,7 +240,7 @@ camel_index_find(CamelIndex *idx, const char *word)
        CamelIndexCursor *ret;
 
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) != 0)
                return NULL;
 
@@ -259,7 +259,7 @@ CamelIndexCursor *
 camel_index_words(CamelIndex *idx)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->words(idx);
        else
@@ -270,7 +270,7 @@ CamelIndexCursor *
 camel_index_names(CamelIndex *idx)
 {
        g_return_val_if_fail (CAMEL_IS_INDEX (idx), NULL);
-       
+
        if ((idx->state & CAMEL_INDEX_DELETED) == 0)
                return CI_CLASS(idx)->names(idx);
        else
@@ -307,7 +307,7 @@ CamelType
 camel_index_name_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_object_get_type(), "CamelIndexName",
                                           sizeof (CamelIndexName),
@@ -317,7 +317,7 @@ camel_index_name_get_type(void)
                                           (CamelObjectInitFunc) camel_index_name_init,
                                           (CamelObjectFinalizeFunc) camel_index_name_finalise);
        }
-       
+
        return type;
 }
 
@@ -382,7 +382,7 @@ CamelType
 camel_index_cursor_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_object_get_type(), "CamelIndexCursor",
                                           sizeof (CamelIndexCursor),
@@ -392,7 +392,7 @@ camel_index_cursor_get_type(void)
                                           (CamelObjectInitFunc) camel_index_cursor_init,
                                           (CamelObjectFinalizeFunc) camel_index_cursor_finalise);
        }
-       
+
        return type;
 }
 
index 11f0d5d..59708aa 100644 (file)
@@ -67,7 +67,7 @@ CamelType
 camel_internet_address_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_address_get_type(), "CamelInternetAddress",
                                           sizeof (CamelInternetAddress),
@@ -77,7 +77,7 @@ camel_internet_address_get_type(void)
                                           (CamelObjectInitFunc) camel_internet_address_init,
                                           NULL);
        }
-       
+
        return type;
 }
 
@@ -107,7 +107,7 @@ internet_decode     (CamelAddress *a, const char *raw)
                }
                camel_header_address_list_clear(&ha);
        }
-       
+
        return a->addresses->len - count;
 }
 
@@ -121,9 +121,9 @@ internet_encode     (CamelAddress *a)
 
        if (a->addresses->len == 0)
                return NULL;
-       
+
        out = g_string_new("");
-       
+
        for (i = 0;i < a->addresses->len; i++) {
                struct _address *addr = g_ptr_array_index(a->addresses, i);
                char *enc;
@@ -135,10 +135,10 @@ internet_encode   (CamelAddress *a)
                g_string_append(out, enc);
                g_free(enc);
        }
-       
+
        ret = out->str;
        g_string_free(out, FALSE);
-       
+
        return ret;
 }
 
@@ -214,12 +214,12 @@ internet_format   (CamelAddress *a)
        int i;
        GString *out;
        char *ret;
-       
+
        if (a->addresses->len == 0)
                return NULL;
-       
+
        out = g_string_new("");
-       
+
        for (i = 0;i < a->addresses->len; i++) {
                struct _address *addr = g_ptr_array_index(a->addresses, i);
                char *enc;
@@ -231,10 +231,10 @@ internet_format   (CamelAddress *a)
                g_string_append(out, enc);
                g_free(enc);
        }
-       
+
        ret = out->str;
        g_string_free(out, FALSE);
-       
+
        return ret;
 }
 
@@ -257,10 +257,10 @@ static void
 internet_remove        (CamelAddress *a, int index)
 {
        struct _address *addr;
-       
+
        if (index < 0 || index >= a->addresses->len)
                return;
-       
+
        addr = g_ptr_array_index(a->addresses, index);
        g_free(addr->name);
        g_free(addr->address);
@@ -273,7 +273,7 @@ internet_remove     (CamelAddress *a, int index)
  * camel_internet_address_new:
  *
  * Create a new #CamelInternetAddress object.
- * 
+ *
  * Returns a new #CamelInternetAddress object
  **/
 CamelInternetAddress *
@@ -289,9 +289,9 @@ camel_internet_address_new (void)
  * @addr: a #CamelInternetAddress object
  * @name: name associated with the new address
  * @address: routing address associated with the new address
- * 
+ *
  * Add a new internet address to @addr.
- * 
+ *
  * Returns the index of added entry
  **/
 int
@@ -318,9 +318,9 @@ camel_internet_address_add (CamelInternetAddress *addr, const char *name, const
  * @index: address's array index
  * @namep: holder for the returned name, or %NULL, if not required.
  * @addressp: holder for the returned address, or %NULL, if not required.
- * 
+ *
  * Get the address at @index.
- * 
+ *
  * Returns %TRUE if such an address exists, or %FALSE otherwise
  **/
 gboolean
@@ -347,9 +347,9 @@ camel_internet_address_get (const CamelInternetAddress *addr, int index, const c
  * @addr: a #CamelInternetAddress object
  * @name: name to lookup
  * @addressp: holder for address part, or %NULL, if not required.
- * 
+ *
  * Find address by real name.
- * 
+ *
  * Returns the index of the address matching the name, or %-1 if no
  * match was found
  **/
@@ -379,9 +379,9 @@ camel_internet_address_find_name(CamelInternetAddress *addr, const char *name, c
  * @addr: a #CamelInternetAddress object
  * @address: address to lookup
  * @namep: holder for the matching name, or %NULL, if not required.
- * 
+ *
  * Find an address by address.
- * 
+ *
  * Returns the index of the address, or %-1 if not found
  **/
 int
@@ -447,13 +447,13 @@ append:
  * @len: the length of the line the address is being appended to
  * @name: the unencoded real name associated with the address
  * @addr: the routing address
- * 
+ *
  * Encode a single address ready for internet usage.  Header folding
  * as per rfc822 is also performed, based on the length *@len.  If @len
  * is %NULL, then no folding will occur.
  *
  * Note: The value at *@in will be updated based on any linewrapping done
- * 
+ *
  * Returns the encoded address
  **/
 char *
@@ -505,12 +505,12 @@ camel_internet_address_encode_address(int *inlen, const char *real, const char *
                g_string_append_printf(out, ">");
 
        len += out->len;
-       
+
        if (inlen != NULL)
                *inlen = len;
 
        g_free(name);
-       
+
        ret = out->str;
        g_string_free(out, FALSE);
 
@@ -522,9 +522,9 @@ camel_internet_address_encode_address(int *inlen, const char *real, const char *
  * camel_internet_address_format_address:
  * @name: a name, quotes may be stripped from it
  * @addr: an rfc822 routing address
- * 
+ *
  * Function to format a single address, suitable for display.
- * 
+ *
  * Returns a nicely formatted string containing the rfc822 address
  **/
 char *
index 9ffe9a0..ce4aa8e 100644 (file)
@@ -30,8 +30,8 @@
 
 /**
  * camel_dlist_init:
- * @v: 
- * 
+ * @v:
+ *
  * Initialise a double-linked list header.  All list headers must be
  * initialised before use.
  **/
@@ -46,9 +46,9 @@ void camel_dlist_init(CamelDList *v)
  * camel_dlist_addhead:
  * @l: An initialised list header.
  * @n: A node, the next and prev pointers will be overwritten.
- * 
+ *
  * Add the list node @n to the head (start) of the list @l.
- * 
+ *
  * Return value: @n.
  **/
 CamelDListNode *camel_dlist_addhead(CamelDList *l, CamelDListNode *n)
@@ -64,9 +64,9 @@ CamelDListNode *camel_dlist_addhead(CamelDList *l, CamelDListNode *n)
  * camel_dlist_addtail:
  * @l: An intialised list header.
  * @n: A node, the next and prev pointers will be overwritten.
- * 
+ *
  * Add the list onde @n to the tail (end) of the list @l.
- * 
+ *
  * Return value: @n.
  **/
 CamelDListNode *camel_dlist_addtail(CamelDList *l, CamelDListNode *n)
@@ -81,9 +81,9 @@ CamelDListNode *camel_dlist_addtail(CamelDList *l, CamelDListNode *n)
 /**
  * camel_dlist_remove:
  * @n: A node which is part of a list.
- * 
+ *
  * Remove @n from the list it's in.  @n must belong to a list.
- * 
+ *
  * Return value: @n.
  **/
 CamelDListNode *camel_dlist_remove(CamelDListNode *n)
@@ -96,9 +96,9 @@ CamelDListNode *camel_dlist_remove(CamelDListNode *n)
 /**
  * camel_dlist_remhead:
  * @l: An initialised list, maybe containing items.
- * 
+ *
  * Remove the head node (start) of the list.
- * 
+ *
  * xReturn value: The previously first-node in the list, or NULLif @l
  * is an empty list.
  **/
@@ -119,9 +119,9 @@ CamelDListNode *camel_dlist_remhead(CamelDList *l)
 /**
  * camel_dlist_remtail:
  * @l: An initialised list, maybe containing items.
- * 
+ *
  * Remove the last node in the list.
- * 
+ *
  * Return value: The previously last-node in the list, or NULL if @l
  * is an empty list.
  **/
@@ -142,9 +142,9 @@ CamelDListNode *camel_dlist_remtail(CamelDList *l)
 /**
  * camel_dlist_empty:
  * @l: An initialised list header.
- * 
+ *
  * Returns %TRUE if @l is an empty list.
- * 
+ *
  * Return value: %TRUE if @l is an empty list, %FALSE otherwise.
  **/
 int camel_dlist_empty(CamelDList *l)
@@ -155,9 +155,9 @@ int camel_dlist_empty(CamelDList *l)
 /**
  * camel_dlist_length:
  * @l: An initialised list header.
- * 
+ *
  * Returns the number of nodes in the list @l.
- * 
+ *
  * Return value: The number of nodes.
  **/
 int camel_dlist_length(CamelDList *l)
index d2ef550..db2d13f 100644 (file)
@@ -35,10 +35,10 @@ typedef struct _CamelDListNode CamelDListNode;
 
 /**
  * struct _CamelDListNode - A double-linked list node.
- * 
+ *
  * @next: The next node link.
  * @prev: The previous node link.
- * 
+ *
  * A double-linked list node header.  Put this at the start of the
  * list node structure.  Data is stored in the list by subclassing the
  * node header rather than using a pointer.  Or more normally by just
@@ -51,11 +51,11 @@ struct _CamelDListNode {
 
 /**
  * struct _CamelDList - A double-linked list header.
- * 
+ *
  * @head: The head node's next pointer.
  * @tail: The tail node's next pointer.
  * @tailpred: The previous node to the tail node.
- * 
+ *
  * This is the merging of two separate head and tail nodes into a
  * single structure.  i.e. if you ahve a NULL terminated head and tail
  * node such as head = { first, NULL } and tail = { NULL, last } then
@@ -91,7 +91,7 @@ typedef struct _CamelSList CamelSList;
 
 /**
  * struct _CamelSListNode - A single-linked list node.
- * 
+ *
  * @next: The next node in the list.
  *
  * A single-linked list node header.  Put this at hte start of the
@@ -105,9 +105,9 @@ struct _CamelSListNode {
 
 /**
  * struct _CamelSList - A single-linked list header.
- * 
+ *
  * @head: The head of the list.
- * 
+ *
  * This is the header of a single-linked list.
  **/
 struct _CamelSList {
index 15c4cd3..aeac151 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 1fb0ccd..054915b 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 2001 Ximian Inc (www.ximian.com/)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 7c92d4d..79eb39c 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -255,20 +255,20 @@ static void setup_process(void)
 {
        struct sigaction sa;
        sigset_t sigset;
-       
+
        /* ignore sigint/sigio */
        sa.sa_handler = SIG_IGN;
        sigemptyset (&sa.sa_mask);
        sa.sa_flags = 0;
-       
+
        sigemptyset(&sigset);
        sigaddset(&sigset, SIGIO);
        sigaddset(&sigset, SIGINT);
        sigprocmask(SIG_UNBLOCK, &sigset, NULL);
-       
+
        sigaction (SIGIO, &sa, NULL);
        sigaction (SIGINT, &sa, NULL);
-       
+
        /* FIXME: add more sanity checks/setup here */
 
 #ifdef SETEUID_SAVES
@@ -315,7 +315,7 @@ int main(int argc, char **argv)
                        tv.tv_sec = delay;
                        tv.tv_usec = 0;
                }
-               
+
                d(fprintf(stderr, "lock helper waiting for input\n"));
                if (select(STDIN_FILENO+1, &rset, NULL, NULL, lock_info_list?&tv:NULL) == -1) {
                        if (errno == EINTR)
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
                                }
                                info = info->next;
                        }
-                       
+
                        continue;
                }
 
index 61b90b6..729b133 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 1999 Ximian (www.ximian.com/).
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 8559e2e..f211f85 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 1999 Ximian (www.ximian.com/).
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
 
 /**
  * camel_lock_dot:
- * @path: 
- * @ex: 
- * 
+ * @path:
+ * @ex:
+ *
  * Create an exclusive lock using .lock semantics.
  * All locks are equivalent to write locks (exclusive).
- * 
+ *
  * Return value: -1 on error, sets @ex appropriately.
  **/
 int
@@ -150,8 +150,8 @@ camel_lock_dot(const char *path, CamelException *ex)
 
 /**
  * camel_unlock_dot:
- * @path: 
- * 
+ * @path:
+ *
  * Attempt to unlock a .lock lock.
  **/
 void
@@ -169,15 +169,15 @@ camel_unlock_dot(const char *path)
 
 /**
  * camel_lock_fcntl:
- * @fd: 
- * @type: 
- * @ex: 
- * 
+ * @fd:
+ * @type:
+ * @ex:
+ *
  * Create a lock using fcntl(2).
  *
  * @type is CAMEL_LOCK_WRITE or CAMEL_LOCK_READ,
  * to create exclusive or shared read locks
- * 
+ *
  * Return value: -1 on error.
  **/
 int
@@ -213,8 +213,8 @@ camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex)
 
 /**
  * camel_unlock_fcntl:
- * @fd: 
- * 
+ * @fd:
+ *
  * Unlock an fcntl lock.
  **/
 void
@@ -233,12 +233,12 @@ camel_unlock_fcntl(int fd)
 
 /**
  * camel_lock_flock:
- * @fd: 
- * @type: 
- * @ex: 
- * 
+ * @fd:
+ * @type:
+ * @ex:
+ *
  * Create a lock using flock(2).
- * 
+ *
  * @type is CAMEL_LOCK_WRITE or CAMEL_LOCK_READ,
  * to create exclusive or shared read locks
  *
@@ -269,8 +269,8 @@ camel_lock_flock(int fd, CamelLockType type, CamelException *ex)
 
 /**
  * camel_unlock_flock:
- * @fd: 
- * 
+ * @fd:
+ *
  * Unlock an flock lock.
  **/
 void
@@ -288,11 +288,11 @@ camel_unlock_flock(int fd)
  * @path: Path to the file to lock (used for .locking only).
  * @fd: Open file descriptor of the right type to lock.
  * @type: Type of lock, CAMEL_LOCK_READ or CAMEL_LOCK_WRITE.
- * @ex: 
- * 
+ * @ex:
+ *
  * Attempt to lock a folder, multiple attempts will be made using all
  * locking strategies available.
- * 
+ *
  * Return value: -1 on error, @ex will describe the locking system that failed.
  **/
 int
@@ -322,7 +322,7 @@ camel_lock_folder(const char *path, int fd, CamelLockType type, CamelException *
  * camel_unlock_folder:
  * @path: Filename of folder.
  * @fd: Open descrptor on which locks were placed.
- * 
+ *
  * Free a lock on a folder.
  **/
 void
@@ -362,7 +362,7 @@ int main(int argc, char **argv)
                return 1;
        }
        fd2 = open("mylock", O_RDWR);
-       if (fd2 == -1) {                
+       if (fd2 == -1) {
                printf("Could not open lock file (mylock): %s", g_strerror (errno));
                close (fd1);
                return 1;
index 112b137..0eb7c95 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 1999 Ximian (www.ximian.com/).
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 0ba581c..b14f61d 100644 (file)
 #include "camel-mime-utils.h"
 
 static void reset(CamelMimeFilter *mf);
-static void complete(CamelMimeFilter *mf, char *in, size_t len, 
-                    size_t prespace, char **out, 
+static void complete(CamelMimeFilter *mf, char *in, size_t len,
+                    size_t prespace, char **out,
                     size_t *outlen, size_t *outprespace);
-static void filter(CamelMimeFilter *mf, char *in, size_t len, 
-                  size_t prespace, char **out, 
+static void filter(CamelMimeFilter *mf, char *in, size_t len,
+                  size_t prespace, char **out,
                   size_t *outlen, size_t *outprespace);
 
 static void camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *klass);
@@ -41,7 +41,7 @@ static void
 camel_mime_filter_basic_class_init (CamelMimeFilterBasicClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        camel_mime_filter_basic_parent = CAMEL_MIME_FILTER_CLASS(camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
 
        filter_class->reset = reset;
@@ -61,7 +61,7 @@ CamelType
 camel_mime_filter_basic_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterBasic",
                                            sizeof (CamelMimeFilterBasic),
@@ -71,7 +71,7 @@ camel_mime_filter_basic_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_basic_init,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -80,7 +80,7 @@ static void
 reset(CamelMimeFilter *mf)
 {
        CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
-       
+
        switch(f->type) {
        case CAMEL_MIME_FILTER_BASIC_QP_ENC:
                f->state = -1;
@@ -96,7 +96,7 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
 {
        CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
        size_t newlen = 0;
-       
+
        switch(f->type) {
        case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
                /* wont go to more than 2x size (overly conservative) */
@@ -161,7 +161,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
 {
        CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf;
        size_t newlen;
-       
+
        switch(f->type) {
        case CAMEL_MIME_FILTER_BASIC_BASE64_ENC:
                /* wont go to more than 2x size (overly conservative) */
@@ -197,10 +197,10 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
                if (!(f->state & CAMEL_UUDECODE_STATE_BEGIN)) {
                        register char *inptr, *inend;
                        size_t left;
-                       
+
                        inptr = in;
                        inend = inptr + len;
-                       
+
                        while (inptr < inend) {
                                left = inend - inptr;
                                if (left < 6) {
@@ -220,15 +220,15 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
                                        }
                                        break;
                                }
-                               
+
                                /* go to the next line */
                                for ( ; inptr < inend && *inptr != '\n'; inptr++);
-                               
+
                                if (inptr < inend)
                                        inptr++;
                        }
                }
-               
+
                if ((f->state & CAMEL_UUDECODE_STATE_BEGIN) && !(f->state & CAMEL_UUDECODE_STATE_END)) {
                        /* "begin <mode> <filename>\n" has been found, so we can now start decoding */
                        camel_mime_filter_set_size (mf, len + 3, FALSE);
@@ -258,7 +258,7 @@ donothing:
  * camel_mime_filter_basic_new:
  *
  * Create a new #CamelMimeFilterBasic object.
- * 
+ *
  * Returns a new #CamelMimeFilterBasic object
  **/
 CamelMimeFilterBasic *
@@ -274,7 +274,7 @@ camel_mime_filter_basic_new (void)
  * @type: a #CamelMimeFilterBasicType type
  *
  * Create a new #CamelMimeFilterBasic object of type @type.
- * 
+ *
  * Returns a new #CamelMimeFilterBasic object
  **/
 CamelMimeFilterBasic *
index 7fbdd70..b6d88b7 100644 (file)
@@ -47,7 +47,7 @@ struct _CamelMimeFilterBasic {
        struct _CamelMimeFilterBasicPrivate *priv;
 
        CamelMimeFilterBasicType type;
-       
+
        unsigned char uubuf[60];
        int state;
        int save;
index 259f6b3..8370827 100644 (file)
@@ -37,7 +37,7 @@ CamelType
 camel_mime_filter_bestenc_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterBestenc",
                                            sizeof (CamelMimeFilterBestenc),
@@ -47,7 +47,7 @@ camel_mime_filter_bestenc_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_bestenc_init,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -81,7 +81,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
        if (f->flags & CAMEL_BESTENC_GET_ENCODING) {
                register unsigned int /* hopefully reg's are assinged in the order they appear? */
                        c,
-                       lastc=f->lastc, 
+                       lastc=f->lastc,
                        countline=f->countline,
                        count0=f->count0,
                        count8 = f->count8;
@@ -197,8 +197,8 @@ camel_mime_filter_bestenc_init (CamelMimeFilter *f)
  * camel_mime_filter_bestenc_new:
  * @flags: a bitmask of data required.
  *
- * Create a new #CamelMimeFilterBestenc object. 
- * 
+ * Create a new #CamelMimeFilterBestenc object.
+ *
  * Returns a new #CamelMimeFilterBestenc object
  **/
 CamelMimeFilterBestenc *
@@ -214,10 +214,10 @@ camel_mime_filter_bestenc_new (unsigned int flags)
  * camel_mime_filter_bestenc_get_best_encoding:
  * @filter: a #CamelMimeFilterBestenc object
  * @required: maximum level of output encoding allowed.
- * 
+ *
  * Get the best encoding, given specific constraints, that can be used to
  * encode a stream of bytes.
- * 
+ *
  * Returns the best encoding to use
  **/
 CamelTransferEncoding
@@ -225,10 +225,10 @@ camel_mime_filter_bestenc_get_best_encoding(CamelMimeFilterBestenc *filter, Came
 {
        CamelTransferEncoding bestenc;
        int istext;
-       
+
        istext = (required & CAMEL_BESTENC_TEXT) ? 1 : 0;
        required = required & ~CAMEL_BESTENC_TEXT;
-       
+
 #if 0
        printf("count0 = %d, count8 = %d, total = %d\n", filter->count0, filter->count8, filter->total);
        printf("maxline = %d, crlfnoorder = %s\n", filter->maxline, filter->crlfnoorder?"TRUE":"FALSE");
@@ -248,7 +248,7 @@ camel_mime_filter_bestenc_get_best_encoding(CamelMimeFilterBestenc *filter, Came
                bestenc = CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE;
        else
                bestenc = CAMEL_TRANSFER_ENCODING_BASE64;
-       
+
        /* if we have nocrlf order, or long lines, we need to encode always */
        if (filter->crlfnoorder || filter->maxline >= 998)
                return bestenc;
@@ -276,9 +276,9 @@ camel_mime_filter_bestenc_get_best_encoding(CamelMimeFilterBestenc *filter, Came
 /**
  * camel_mime_filter_bestenc_get_best_charset:
  * @filter: a #CamelMimeFilterBestenc object
- * 
+ *
  * Gets the best charset that can be used to contain this content.
- * 
+ *
  * Returns the name of the best charset to use to encode the input
  * text filtered by @filter
  **/
@@ -293,7 +293,7 @@ camel_mime_filter_bestenc_get_best_charset (CamelMimeFilterBestenc *filter)
  * camel_mime_filter_bestenc_set_flags:
  * @filter: a #CamelMimeFilterBestenc object
  * @flags: bestenc filter flags
- * 
+ *
  * Set the flags for subsequent operations.
  **/
 void
index dd51bab..98b1d80 100644 (file)
@@ -48,7 +48,7 @@ typedef enum _CamelBestencEncoding {
        CAMEL_BESTENC_7BIT,
        CAMEL_BESTENC_8BIT,
        CAMEL_BESTENC_BINARY,
-       
+
        /* is the content stream to be treated as text? */
        CAMEL_BESTENC_TEXT = 1<<8,
 } CamelBestencEncoding;
index 9d4a64f..57f0639 100644 (file)
@@ -43,7 +43,7 @@ static void
 camel_mime_filter_canon_class_init (CamelMimeFilterCanonClass *klass)
 {
        CamelMimeFilterClass *mime_filter_class = (CamelMimeFilterClass *) klass;
-       
+
        mime_filter_class->filter = filter;
        mime_filter_class->complete = complete;
        mime_filter_class->reset = reset;
@@ -53,7 +53,7 @@ CamelType
 camel_mime_filter_canon_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterCanon",
                                            sizeof (CamelMimeFilterCanon),
@@ -63,7 +63,7 @@ camel_mime_filter_canon_get_type (void)
                                            NULL,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -136,7 +136,7 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
                                        /* empty line */
                                        *o++ = '\r';
                                }
-                               
+
                                *o++ = c;
                                start = inptr;
                                starto = o;
@@ -167,7 +167,7 @@ filter(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, si
        filter_run(f, in, len, prespace, out, outlen, outprespace, FALSE);
 }
 
-static void 
+static void
 complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
 {
        filter_run(f, in, len, prespace, out, outlen, outprespace, TRUE);
index 24b0755..fbb1d67 100644 (file)
@@ -45,7 +45,7 @@ CamelType
 camel_mime_filter_charset_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterCharset",
                                            sizeof (CamelMimeFilterCharset),
@@ -55,7 +55,7 @@ camel_mime_filter_charset_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_charset_init,
                                            (CamelObjectFinalizeFunc) camel_mime_filter_charset_finalize);
        }
-       
+
        return type;
 }
 
@@ -79,7 +79,7 @@ reset(CamelMimeFilter *mf)
        char buf[16];
        char *buffer;
        size_t outlen = 16;
-       
+
        /* what happens with the output bytes if this resets the state? */
        if (f->ic != (iconv_t) -1) {
                buffer = buf;
@@ -94,17 +94,17 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
        size_t inleft, outleft, converted = 0;
        const char *inbuf;
        char *outbuf;
-       
+
        if (charset->ic == (iconv_t) -1)
                goto noop;
-       
+
        camel_mime_filter_set_size (mf, len * 5 + 16, FALSE);
        outbuf = mf->outbuf;
        outleft = mf->outsize;
-       
+
        inbuf = in;
        inleft = len;
-       
+
        if (inleft > 0) {
                do {
                        converted = e_iconv (charset->ic, &inbuf, &inleft, &outbuf, &outleft);
@@ -115,7 +115,7 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
                                         *
                                         * We just need to grow our outbuffer and try again.
                                         */
-                                       
+
                                        converted = outbuf - mf->outbuf;
                                        camel_mime_filter_set_size (mf, inleft * 5 + mf->outsize + 16, TRUE);
                                        outbuf = mf->outbuf + converted;
@@ -127,7 +127,7 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
                                         *
                                         * What we do here is eat the invalid bytes in the sequence and continue
                                         */
-                                       
+
                                        inbuf++;
                                        inleft--;
                                } else if (errno == EINVAL) {
@@ -138,25 +138,25 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
                                         * We assume that this can only happen if we've run out of
                                         * bytes for a multibyte sequence, if not we're in trouble.
                                         */
-                                       
+
                                        break;
                                } else
                                        goto noop;
                        }
                } while (((int) inleft) > 0);
        }
-       
+
        /* flush the iconv conversion */
        e_iconv (charset->ic, NULL, NULL, &outbuf, &outleft);
-       
+
        *out = mf->outbuf;
        *outlen = mf->outsize - outleft;
        *outprespace = mf->outpre;
-       
+
        return;
-       
+
  noop:
-       
+
        *out = in;
        *outlen = len;
        *outprespace = prespace;
@@ -169,23 +169,23 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
        size_t inleft, outleft, converted = 0;
        const char *inbuf;
        char *outbuf;
-       
+
        if (charset->ic == (iconv_t) -1)
                goto noop;
-       
+
        camel_mime_filter_set_size (mf, len * 5 + 16, FALSE);
        outbuf = mf->outbuf + converted;
        outleft = mf->outsize - converted;
-       
+
        inbuf = in;
        inleft = len;
-       
+
        do {
                converted = e_iconv (charset->ic, &inbuf, &inleft, &outbuf, &outleft);
                if (converted == (size_t) -1) {
                        if (errno == E2BIG || errno == EINVAL)
                                break;
-                       
+
                        if (errno == EILSEQ) {
                                /*
                                 * EILSEQ An invalid multibyte sequence has been  encountered
@@ -193,7 +193,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
                                 *
                                 * What we do here is eat the invalid bytes in the sequence and continue
                                 */
-                               
+
                                inbuf++;
                                inleft--;
                        } else {
@@ -202,22 +202,22 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
                        }
                }
        } while (((int) inleft) > 0);
-       
+
        if (((int) inleft) > 0) {
                /* We've either got an E2BIG or EINVAL. Save the
                    remainder of the buffer as we'll process this next
                    time through */
                camel_mime_filter_backup (mf, inbuf, inleft);
        }
-       
+
        *out = mf->outbuf;
        *outlen = outbuf - mf->outbuf;
        *outprespace = mf->outpre;
-       
+
        return;
-       
+
  noop:
-       
+
        *out = in;
        *outlen = len;
        *outprespace = prespace;
@@ -227,7 +227,7 @@ static void
 camel_mime_filter_charset_class_init (CamelMimeFilterCharsetClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        camel_mime_filter_charset_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
 
        filter_class->reset = reset;
@@ -246,7 +246,7 @@ camel_mime_filter_charset_init (CamelMimeFilterCharset *obj)
  * camel_mime_filter_charset_new:
  *
  * Create a new #CamelMimeFilterCharset object.
- * 
+ *
  * Returns a new #CamelMimeFilterCharset object
  **/
 CamelMimeFilterCharset *
@@ -270,9 +270,9 @@ CamelMimeFilterCharset *
 camel_mime_filter_charset_new_convert (const char *from_charset, const char *to_charset)
 {
        CamelMimeFilterCharset *new;
-       
+
        new = CAMEL_MIME_FILTER_CHARSET (camel_object_new (camel_mime_filter_charset_get_type ()));
-       
+
        new->ic = e_iconv_open (to_charset, from_charset);
        if (new->ic == (iconv_t) -1) {
                w(g_warning ("Cannot create charset conversion from %s to %s: %s",
@@ -285,6 +285,6 @@ camel_mime_filter_charset_new_convert (const char *from_charset, const char *to_
                new->from = g_strdup (from_charset);
                new->to = g_strdup (to_charset);
        }
-       
+
        return new;
 }
index 8b89180..7f83014 100644 (file)
@@ -35,7 +35,7 @@ camel_mime_filter_crlf_class_init (CamelMimeFilterCRLFClass *klass)
 {
        CamelMimeFilterClass *mime_filter_class =
                (CamelMimeFilterClass *) klass;
-       
+
        mime_filter_class->filter = filter;
        mime_filter_class->complete = complete;
        mime_filter_class->reset = reset;
@@ -45,7 +45,7 @@ CamelType
 camel_mime_filter_crlf_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterCRLF",
                                            sizeof (CamelMimeFilterCRLF),
@@ -68,15 +68,15 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
        const char *inend;
        gboolean do_dots;
        char *outptr;
-       
+
        do_dots = crlf->mode == CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS;
-       
+
        inptr = in;
        inend = in + len;
-       
+
        if (crlf->direction == CAMEL_MIME_FILTER_CRLF_ENCODE) {
                camel_mime_filter_set_size (f, 3 * len, FALSE);
-               
+
                outptr = f->outbuf;
                while (inptr < inend) {
                        if (*inptr == '\r') {
@@ -89,11 +89,11 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
                        } else {
                                if (do_dots && *inptr == '.' && crlf->saw_lf)
                                        *outptr++ = '.';
-                               
+
                                crlf->saw_cr = FALSE;
                                crlf->saw_lf = FALSE;
                        }
-                       
+
                        *outptr++ = *inptr++;
                }
        } else {
@@ -102,7 +102,7 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
                 * in practice, as the input is processed in arbitrarily-sized
                 * blocks. */
                camel_mime_filter_set_size (f, len + 1, FALSE);
-               
+
                outptr = f->outbuf;
                while (inptr < inend) {
                        if (*inptr == '\r') {
@@ -110,7 +110,7 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
                        } else {
                                if (crlf->saw_cr) {
                                        crlf->saw_cr = FALSE;
-                                       
+
                                        if (*inptr == '\n') {
                                                crlf->saw_lf = TRUE;
                                                *outptr++ = *inptr++;
@@ -118,10 +118,10 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
                                        } else
                                                *outptr++ = '\r';
                                }
-                               
+
                                *outptr++ = *inptr;
                        }
-                       
+
                        if (do_dots && *inptr == '.') {
                                if (crlf->saw_lf) {
                                        crlf->saw_dot = TRUE;
@@ -131,19 +131,19 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
                                        crlf->saw_dot = FALSE;
                                }
                        }
-                       
+
                        crlf->saw_lf = FALSE;
-                       
+
                        inptr++;
                }
        }
-       
+
        *out = f->outbuf;
        *outlen = outptr - f->outbuf;
        *outprespace = f->outpre;
 }
 
-static void 
+static void
 complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
          char **out, size_t *outlen, size_t *outprespace)
 {
@@ -155,7 +155,7 @@ static void
 reset (CamelMimeFilter *f)
 {
        CamelMimeFilterCRLF *crlf = (CamelMimeFilterCRLF *)f;
-       
+
        crlf->saw_cr = FALSE;
        crlf->saw_lf = TRUE;
        crlf->saw_dot = FALSE;
@@ -175,12 +175,12 @@ CamelMimeFilter *
 camel_mime_filter_crlf_new (CamelMimeFilterCRLFDirection direction, CamelMimeFilterCRLFMode mode)
 {
        CamelMimeFilterCRLF *crlf = CAMEL_MIME_FILTER_CRLF(camel_object_new (CAMEL_MIME_FILTER_CRLF_TYPE));
-       
+
        crlf->direction = direction;
        crlf->mode = mode;
        crlf->saw_cr = FALSE;
        crlf->saw_lf = TRUE;
        crlf->saw_dot = FALSE;
-       
+
        return (CamelMimeFilter *)crlf;
 }
index f6513ba..1a60339 100644 (file)
@@ -77,11 +77,11 @@ static struct {
        { "/color",      "</font>",             FALSE, NULL               },
        { "lang",        "<span lang=\"%s\">",  TRUE,  param_parse_lang   },
        { "/lang",       "</span>",             FALSE, NULL               },
-       
+
        /* don't handle this tag yet... */
        { "paraindent",  "<!-- ",               /* TRUE */ FALSE, NULL    },
        { "/paraindent", " -->",                FALSE, NULL               },
-       
+
        /* as soon as we support all the tags that can have a param
         * tag argument, these should be unnecessary, but we'll keep
         * them anyway just in case? */
@@ -112,7 +112,7 @@ CamelType
 camel_mime_filter_enriched_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (),
                                            "CamelMimeFilterEnriched",
@@ -123,7 +123,7 @@ camel_mime_filter_enriched_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_enriched_init,
                                            (CamelObjectFinalizeFunc) camel_mime_filter_enriched_finalize);
        }
-       
+
        return type;
 }
 
@@ -132,13 +132,13 @@ camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
        int i;
-       
+
        parent_class = CAMEL_MIME_FILTER_CLASS (camel_mime_filter_get_type ());
-       
+
        filter_class->reset = filter_reset;
        filter_class->filter = filter_filter;
        filter_class->complete = filter_complete;
-       
+
        if (!enriched_hash) {
                enriched_hash = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
                for (i = 0; i < NUM_ENRICHED_TAGS; i++)
@@ -166,11 +166,11 @@ static gboolean
 enriched_tag_needs_param (const char *tag)
 {
        int i;
-       
+
        for (i = 0; i < NUM_ENRICHED_TAGS; i++)
                if (!g_ascii_strcasecmp (tag, enriched_tags[i].enriched))
                        return enriched_tags[i].needs_param;
-       
+
        return FALSE;
 }
 #endif
@@ -194,12 +194,12 @@ param_parse_colour (const char *inptr, int inlen)
        guint32 rgb = 0;
        guint v;
        int i;
-       
+
        for (i = 0; i < NUM_VALID_COLOURS; i++) {
                if (!g_ascii_strncasecmp (inptr, valid_colours[i], inlen))
                        return g_strdup (valid_colours[i]);
        }
-       
+
        /* check for numeric r/g/b in the format: ####,####,#### */
        if (inptr[4] != ',' || inptr[9] != ',') {
                /* okay, mailer must have used a string name that
@@ -209,25 +209,25 @@ param_parse_colour (const char *inptr, int inlen)
                inend = inptr + inlen;
                while (end < inend && ((*end >= 'a' && *end <= 'z') || (*end >= 'A' && *end <= 'Z')))
                        end++;
-               
+
                return g_strndup (inptr, end - inptr);
        }
-       
+
        for (i = 0; i < 3; i++) {
                v = strtoul (inptr, (char **) &end, 16);
                if (end != inptr + 4)
                        goto invalid_format;
-               
+
                v >>= 8;
                rgb = (rgb << 8) | (v & 0xff);
-               
+
                inptr += 5;
        }
-       
+
        return g_strdup_printf ("#%.6X", rgb);
-       
+
  invalid_format:
-       
+
        /* default colour? */
        return g_strdup ("black");
 }
@@ -237,11 +237,11 @@ param_parse_font (const char *fontfamily, int inlen)
 {
        register const char *inptr = fontfamily;
        const char *inend = inptr + inlen;
-       
+
        /* don't allow any of '"', '<', nor '>' */
        while (inptr < inend && *inptr != '"' && *inptr != '<' && *inptr != '>')
                inptr++;
-       
+
        return g_strndup (fontfamily, inptr - fontfamily);
 }
 
@@ -250,11 +250,11 @@ param_parse_lang (const char *lang, int inlen)
 {
        register const char *inptr = lang;
        const char *inend = inptr + inlen;
-       
+
        /* don't allow any of '"', '<', nor '>' */
        while (inptr < inend && *inptr != '"' && *inptr != '<' && *inptr != '>')
                inptr++;
-       
+
        return g_strndup (lang, inptr - lang);
 }
 
@@ -262,14 +262,14 @@ static char *
 param_parse (const char *enriched, const char *inptr, int inlen)
 {
        int i;
-       
+
        for (i = 0; i < NUM_ENRICHED_TAGS; i++) {
                if (!g_ascii_strcasecmp (enriched, enriched_tags[i].enriched))
                        return enriched_tags[i].parse_param (inptr, inlen);
        }
-       
+
        g_assert_not_reached ();
-       
+
        return NULL;
 }
 
@@ -283,25 +283,25 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
        const char *tag, *inend, *outend;
        register const char *inptr;
        register char *outptr;
-       
+
        camel_mime_filter_set_size (filter, inlen * 2 + 6, FALSE);
-       
+
        inptr = in;
        inend = in + inlen;
        outptr = filter->outbuf;
        outend = filter->outbuf + filter->outsize;
-       
+
  retry:
        do {
                while (inptr < inend && outptr < outend && !strchr (" <>&\n", *inptr))
                        *outptr++ = *inptr++;
-               
+
                if (outptr == outend)
                        goto backup;
-               
+
                if ((inptr + 1) >= inend)
                        break;
-               
+
                switch (*inptr++) {
                case ' ':
                        while (inptr < inend && (outptr + 7) < outend && *inptr == ' ') {
@@ -309,10 +309,10 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
                                outptr += 6;
                                inptr++;
                        }
-                       
+
                        if (outptr < outend)
                                *outptr++ = ' ';
-                       
+
                        break;
                case '\n':
                        if (!(enriched->flags & IS_RICHTEXT)) {
@@ -330,7 +330,7 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
                                                inptr--;
                                                goto backup;
                                        }
-                                       
+
                                        while (inptr < inend && (outptr + 4) < outend && *inptr == '\n') {
                                                memcpy (outptr, "<br>", 4);
                                                outptr += 4;
@@ -395,16 +395,16 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
                                        goto backup;
                                }
                        }
-                       
+
                        tag = inptr;
                        while (inptr < inend && *inptr != '>')
                                inptr++;
-                       
+
                        if (inptr == inend) {
                                inptr = tag - 1;
                                goto need_input;
                        }
-                       
+
                        if (!g_ascii_strncasecmp (tag, "nofill>", 7)) {
                                if ((outptr + 5) < outend) {
                                        enriched->nofill++;
@@ -423,58 +423,58 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
                                const char *html_tag;
                                char *enriched_tag;
                                int len;
-                               
+
                                len = inptr - tag;
                                enriched_tag = g_alloca (len + 1);
                                memcpy (enriched_tag, tag, len);
                                enriched_tag[len] = '\0';
-                               
+
                                html_tag = g_hash_table_lookup (enriched_hash, enriched_tag);
-                               
+
                                if (html_tag) {
                                        if (html_tag_needs_param (html_tag)) {
                                                const char *start;
                                                char *param;
-                                               
+
                                                while (inptr < inend && *inptr != '<')
                                                        inptr++;
-                                               
+
                                                if (inptr == inend || (inend - inptr) <= 15) {
                                                        inptr = tag - 1;
                                                        goto need_input;
                                                }
-                                               
+
                                                if (g_ascii_strncasecmp (inptr, "<param>", 7) != 0) {
                                                        /* ignore the enriched command tag... */
                                                        inptr -= 1;
                                                        goto loop;
                                                }
-                                               
+
                                                inptr += 7;
                                                start = inptr;
-                                               
+
                                                while (inptr < inend && *inptr != '<')
                                                        inptr++;
-                                               
+
                                                if (inptr == inend || (inend - inptr) <= 8) {
                                                        inptr = tag - 1;
                                                        goto need_input;
                                                }
-                                               
+
                                                if (g_ascii_strncasecmp (inptr, "</param>", 8) != 0) {
                                                        /* ignore the enriched command tag... */
                                                        inptr += 7;
                                                        goto loop;
                                                }
-                                               
+
                                                len = inptr - start;
                                                param = param_parse (enriched_tag, start, len);
                                                len = strlen (param);
-                                               
+
                                                inptr += 7;
-                                               
+
                                                len += strlen (html_tag);
-                                               
+
                                                if ((outptr + len) < outend) {
                                                        outptr += snprintf (outptr, len, html_tag, param);
                                                        g_free (param);
@@ -495,7 +495,7 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
                                        }
                                }
                        }
-                       
+
                loop:
                        inptr++;
                        break;
@@ -503,38 +503,38 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa
                        break;
                }
        } while (inptr < inend);
-       
+
  need_input:
-       
+
        /* the reason we ignore @flush here is because if there isn't
            enough input to parse a tag, then there's nothing we can
            do. */
-       
+
        if (inptr < inend)
                camel_mime_filter_backup (filter, inptr, (unsigned) (inend - inptr));
-       
+
        *out = filter->outbuf;
        *outlen = outptr - filter->outbuf;
        *outprespace = filter->outpre;
-       
+
        return;
-       
+
  backup:
-       
+
        if (flush) {
                size_t offset, grow;
-               
+
                grow = (inend - inptr) * 2 + 20;
                offset = outptr - filter->outbuf;
                camel_mime_filter_set_size (filter, filter->outsize + grow, TRUE);
                outend = filter->outbuf + filter->outsize;
                outptr = filter->outbuf + offset;
-               
+
                goto retry;
        } else {
                camel_mime_filter_backup (filter, inptr, (unsigned) (inend - inptr));
        }
-       
+
        *out = filter->outbuf;
        *outlen = outptr - filter->outbuf;
        *outprespace = filter->outpre;
@@ -547,7 +547,7 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
        enriched_to_html (filter, in, len, prespace, out, outlen, outprespace, FALSE);
 }
 
-static void 
+static void
 filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                 char **out, size_t *outlen, size_t *outprespace)
 {
@@ -558,7 +558,7 @@ static void
 filter_reset (CamelMimeFilter *filter)
 {
        CamelMimeFilterEnriched *enriched = (CamelMimeFilterEnriched *) filter;
-       
+
        enriched->nofill = 0;
 }
 
@@ -576,10 +576,10 @@ CamelMimeFilter *
 camel_mime_filter_enriched_new (guint32 flags)
 {
        CamelMimeFilterEnriched *new;
-       
+
        new = (CamelMimeFilterEnriched *) camel_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED);
        new->flags = flags;
-       
+
        return CAMEL_MIME_FILTER (new);
 }
 
@@ -604,12 +604,12 @@ camel_enriched_to_html(const char *in, guint32 flags)
 
        if (in == NULL)
                return NULL;
-       
+
        filter = camel_mime_filter_enriched_new(flags);
-       
+
        camel_mime_filter_complete(filter, (char *)in, strlen(in), 0, &outbuf, &outlen, &outpre);
        outbuf = g_strndup (outbuf, outlen);
        camel_object_unref (filter);
-       
+
        return outbuf;
 }
index d67de26..f8697df 100644 (file)
@@ -40,14 +40,14 @@ typedef struct _CamelMimeFilterEnrichedClass CamelMimeFilterEnrichedClass;
 
 struct _CamelMimeFilterEnriched {
        CamelMimeFilter parent_object;
-       
+
        guint32 flags;
        int nofill;
 };
 
 struct _CamelMimeFilterEnrichedClass {
        CamelMimeFilterClass parent_class;
-       
+
 };
 
 CamelType        camel_mime_filter_enriched_get_type (void);
index 7a61ccd..a7414ec 100644 (file)
@@ -39,7 +39,7 @@ CamelType
 camel_mime_filter_from_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterFrom",
                                            sizeof (CamelMimeFilterFrom),
@@ -49,7 +49,7 @@ camel_mime_filter_from_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_from_init,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -147,7 +147,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s
                *out = in;
                *outlen = inend - in;
                *outprespace = prespace;
-               
+
                d(printf("Filtered '%.*s'\n", *outlen, *out));
        }
 }
@@ -156,7 +156,7 @@ static void
 camel_mime_filter_from_class_init (CamelMimeFilterFromClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        camel_mime_filter_from_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
 
        filter_class->filter = filter;
@@ -174,7 +174,7 @@ camel_mime_filter_from_init (CamelMimeFilterFrom *obj)
  * camel_mime_filter_from_new:
  *
  * Create a new #CamelMimeFilterFrom object.
- * 
+ *
  * Returns a new #CamelMimeFilterFrom object
  **/
 CamelMimeFilterFrom *
@@ -211,7 +211,7 @@ int main(int argc, char **argv)
        prespace = 0;
        camel_mime_filter_complete(f, buffer, len, prespace, &buffer, &len, &prespace);
        printf("complete = '%.*s'\n", len, buffer);
-       
+
 
        return 0;
 }
index 7678109..d1fd3e9 100644 (file)
@@ -36,7 +36,7 @@ typedef struct _CamelMimeFilterFromClass CamelMimeFilterFromClass;
 
 struct _CamelMimeFilterFrom {
        CamelMimeFilter parent;
-       
+
        int midline;            /* are we between lines? */
 };
 
index 4c32d4d..3726d2d 100644 (file)
@@ -66,7 +66,7 @@ typedef union {
                guint16 xlen;
                guint16 xlen_nread;
                guint16 crc16;
-               
+
                guint8 got_hdr:1;
                guint8 is_valid:1;
                guint8 got_xlen:1;
@@ -81,10 +81,10 @@ typedef union {
 
 struct _CamelMimeFilterGZipPrivate {
        z_stream *stream;
-       
+
        gzip_state_t state;
        gzip_hdr_t hdr;
-       
+
        guint32 crc32;
        guint32 isize;
 };
@@ -107,7 +107,7 @@ CamelType
 camel_mime_filter_gzip_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (),
                                            "CamelMimeFilterGZip",
@@ -118,7 +118,7 @@ camel_mime_filter_gzip_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_gzip_init,
                                            (CamelObjectFinalizeFunc) camel_mime_filter_gzip_finalize);
        }
-       
+
        return type;
 }
 
@@ -127,9 +127,9 @@ static void
 camel_mime_filter_gzip_class_init (CamelMimeFilterGZipClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        parent_class = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-       
+
        filter_class->reset = filter_reset;
        filter_class->filter = filter_filter;
        filter_class->complete = filter_complete;
@@ -148,12 +148,12 @@ camel_mime_filter_gzip_finalize (CamelObject *object)
 {
        CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) object;
        struct _CamelMimeFilterGZipPrivate *priv = gzip->priv;
-       
+
        if (gzip->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
                deflateEnd (priv->stream);
        else
                inflateEnd (priv->stream);
-       
+
        g_free (priv->stream);
        g_free (priv);
 }
@@ -166,7 +166,7 @@ gzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
        CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
        struct _CamelMimeFilterGZipPrivate *priv = gzip->priv;
        int retval;
-       
+
        if (!priv->state.zip.wrote_hdr) {
                priv->hdr.v.id1 = 31;
                priv->hdr.v.id2 = 139;
@@ -180,64 +180,64 @@ gzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                else
                        priv->hdr.v.xfl = 0;
                priv->hdr.v.os = 255;
-               
+
                camel_mime_filter_set_size (filter, (len * 2) + 22, FALSE);
-               
+
                memcpy (filter->outbuf, priv->hdr.buf, 10);
-               
+
                priv->stream->next_out = filter->outbuf + 10;
                priv->stream->avail_out = filter->outsize - 10;
-               
+
                priv->state.zip.wrote_hdr = TRUE;
        } else {
                camel_mime_filter_set_size (filter, (len * 2) + 12, FALSE);
-               
+
                priv->stream->next_out = filter->outbuf;
                priv->stream->avail_out = filter->outsize;
        }
-       
+
        priv->stream->next_in = in;
        priv->stream->avail_in = len;
-       
+
        do {
                /* FIXME: handle error cases? */
                if ((retval = deflate (priv->stream, flush)) != Z_OK)
                        fprintf (stderr, "gzip: %d: %s\n", retval, priv->stream->msg);
-               
+
                if (flush == Z_FULL_FLUSH) {
                        size_t n;
-                       
+
                        n = filter->outsize - priv->stream->avail_out;
                        camel_mime_filter_set_size (filter, n + (priv->stream->avail_in * 2) + 12, TRUE);
                        priv->stream->avail_out = filter->outsize - n;
                        priv->stream->next_out = filter->outbuf + n;
-                       
+
                        if (priv->stream->avail_in == 0) {
                                guint32 val;
-                               
+
                                val = GUINT32_TO_LE (priv->crc32);
                                memcpy (priv->stream->next_out, &val, 4);
                                priv->stream->avail_out -= 4;
                                priv->stream->next_out += 4;
-                               
+
                                val = GUINT32_TO_LE (priv->isize);
                                memcpy (priv->stream->next_out, &val, 4);
                                priv->stream->avail_out -= 4;
                                priv->stream->next_out += 4;
-                               
+
                                break;
                        }
                } else {
                        if (priv->stream->avail_in > 0)
                                camel_mime_filter_backup (filter, priv->stream->next_in, priv->stream->avail_in);
-                       
+
                        break;
                }
        } while (1);
-       
+
        priv->crc32 = crc32 (priv->crc32, in, len - priv->stream->avail_in);
        priv->isize += len - priv->stream->avail_in;
-       
+
        *out = filter->outbuf;
        *outlen = filter->outsize - priv->stream->avail_out;
        *outprespace = filter->outpre;
@@ -251,43 +251,43 @@ gunzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
        struct _CamelMimeFilterGZipPrivate *priv = gzip->priv;
        guint16 need, val;
        int retval;
-       
+
        if (!priv->state.unzip.got_hdr) {
                if (len < 10) {
                        camel_mime_filter_backup (filter, in, len);
                        return;
                }
-               
+
                memcpy (priv->hdr.buf, in, 10);
                priv->state.unzip.got_hdr = TRUE;
                len -= 10;
                in += 10;
-               
+
                priv->state.unzip.is_valid = (priv->hdr.v.id1 == 31 &&
                                              priv->hdr.v.id2 == 139 &&
                                              priv->hdr.v.cm == Z_DEFLATED);
        }
-       
+
        if (!priv->state.unzip.is_valid)
                return;
-       
+
        if (priv->hdr.v.flg & GZIP_FLAG_FEXTRA) {
                if (!priv->state.unzip.got_xlen) {
                        if (len < 2) {
                                camel_mime_filter_backup (filter, in, len);
                                return;
                        }
-                       
+
                        memcpy (&val, in, 2);
                        priv->state.unzip.xlen = GUINT16_FROM_LE (val);
                        priv->state.unzip.got_xlen = TRUE;
                        len -= 2;
                        in += 2;
                }
-               
+
                if (priv->state.unzip.xlen_nread < priv->state.unzip.xlen) {
                        need = priv->state.unzip.xlen - priv->state.unzip.xlen_nread;
-                       
+
                        if (need < len) {
                                priv->state.unzip.xlen_nread += need;
                                len -= need;
@@ -298,13 +298,13 @@ gunzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                        }
                }
        }
-       
+
        if ((priv->hdr.v.flg & GZIP_FLAG_FNAME) && !priv->state.unzip.got_fname) {
                while (*in && len > 0) {
                        len--;
                        in++;
                }
-               
+
                if (*in == '\0' && len > 0) {
                        priv->state.unzip.got_fname = TRUE;
                        len--;
@@ -313,13 +313,13 @@ gunzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                        return;
                }
        }
-       
+
        if ((priv->hdr.v.flg & GZIP_FLAG_FCOMMENT) && !priv->state.unzip.got_fcomment) {
                while (*in && len > 0) {
                        len--;
                        in++;
                }
-               
+
                if (*in == '\0' && len > 0) {
                        priv->state.unzip.got_fcomment = TRUE;
                        len--;
@@ -328,63 +328,63 @@ gunzip_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                        return;
                }
        }
-       
+
        if ((priv->hdr.v.flg & GZIP_FLAG_FHCRC) && !priv->state.unzip.got_crc16) {
                if (len < 2) {
                        camel_mime_filter_backup (filter, in, len);
                        return;
                }
-               
+
                memcpy (&val, in, 2);
                priv->state.unzip.crc16 = GUINT16_FROM_LE (val);
                len -= 2;
                in += 2;
        }
-       
+
        if (len == 0)
                return;
-       
+
        camel_mime_filter_set_size (filter, (len * 2) + 12, FALSE);
-       
+
        priv->stream->next_in = in;
        priv->stream->avail_in = len - 8;
-       
+
        priv->stream->next_out = filter->outbuf;
        priv->stream->avail_out = filter->outsize;
-       
+
        do {
                /* FIXME: handle error cases? */
                if ((retval = inflate (priv->stream, flush)) != Z_OK)
                        fprintf (stderr, "gunzip: %d: %s\n", retval, priv->stream->msg);
-               
+
                if (flush == Z_FULL_FLUSH) {
                        size_t n;
-                       
+
                        if (priv->stream->avail_in == 0) {
                                /* FIXME: extract & compare calculated crc32 and isize values? */
                                break;
                        }
-                       
+
                        n = filter->outsize - priv->stream->avail_out;
                        camel_mime_filter_set_size (filter, n + (priv->stream->avail_in * 2) + 12, TRUE);
                        priv->stream->avail_out = filter->outsize - n;
                        priv->stream->next_out = filter->outbuf + n;
                } else {
                        priv->stream->avail_in += 8;
-                       
+
                        if (priv->stream->avail_in > 0)
                                camel_mime_filter_backup (filter, priv->stream->next_in, priv->stream->avail_in);
-                       
+
                        break;
                }
        } while (1);
-       
+
        /* FIXME: if we keep this, we could check that the gzip'd
         * stream is sane, but how would we tell our consumer if it
         * was/wasn't? */
        /*priv->crc32 = crc32 (priv->crc32, in, len - priv->stream->avail_in - 8);
          priv->isize += len - priv->stream->avail_in - 8;*/
-       
+
        *out = filter->outbuf;
        *outlen = filter->outsize - priv->stream->avail_out;
        *outprespace = filter->outpre;
@@ -395,7 +395,7 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
               char **out, size_t *outlen, size_t *outprespace)
 {
        CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
-       
+
        if (gzip->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
                gzip_filter (filter, in, len, prespace, out, outlen, outprespace, Z_SYNC_FLUSH);
        else
@@ -407,7 +407,7 @@ filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                 char **out, size_t *outlen, size_t *outprespace)
 {
        CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
-       
+
        if (gzip->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
                gzip_filter (filter, in, len, prespace, out, outlen, outprespace, Z_FULL_FLUSH);
        else
@@ -420,14 +420,14 @@ filter_reset (CamelMimeFilter *filter)
 {
        CamelMimeFilterGZip *gzip = (CamelMimeFilterGZip *) filter;
        struct _CamelMimeFilterGZipPrivate *priv = gzip->priv;
-       
+
        memset (&priv->state, 0, sizeof (priv->state));
-       
+
        if (gzip->mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
                deflateReset (priv->stream);
        else
                inflateReset (priv->stream);
-       
+
        priv->crc32 = crc32 (0, Z_NULL, 0);
        priv->isize = 0;
 }
@@ -447,20 +447,20 @@ camel_mime_filter_gzip_new (CamelMimeFilterGZipMode mode, int level)
 {
        CamelMimeFilterGZip *new;
        int retval;
-       
+
        new = (CamelMimeFilterGZip *) camel_object_new (CAMEL_TYPE_MIME_FILTER_GZIP);
        new->mode = mode;
        new->level = level;
-       
+
        if (mode == CAMEL_MIME_FILTER_GZIP_MODE_ZIP)
                retval = deflateInit2 (new->priv->stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY);
        else
                retval = inflateInit2 (new->priv->stream, -MAX_WBITS);
-       
+
        if (retval != Z_OK) {
                camel_object_unref (new);
                return NULL;
        }
-       
+
        return (CamelMimeFilter *) new;
 }
index 9fc5d4f..46e3dbb 100644 (file)
@@ -45,16 +45,16 @@ typedef enum {
 
 struct _CamelMimeFilterGZip {
        CamelMimeFilter parent_object;
-       
+
        struct _CamelMimeFilterGZipPrivate *priv;
-       
+
        CamelMimeFilterGZipMode mode;
        int level;
 };
 
 struct _CamelMimeFilterGZipClass {
        CamelMimeFilterClass parent_class;
-       
+
 };
 
 
index af92a6d..bd9be35 100644 (file)
@@ -77,7 +77,7 @@ CamelType
 camel_mime_filter_html_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterHTML",
                                            sizeof (CamelMimeFilterHTML),
@@ -87,7 +87,7 @@ camel_mime_filter_html_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_html_init,
                                            (CamelObjectFinalizeFunc) camel_mime_filter_html_finalize);
        }
-       
+
        return type;
 }
 
@@ -115,20 +115,20 @@ run(CamelMimeFilter *mf, char *in, size_t inlen, size_t prespace, char **out, si
        CamelMimeFilterHTML *f = (CamelMimeFilterHTML *) mf;
        camel_html_parser_t state;
        char *outp;
-       
+
        d(printf("converting html:\n%.*s\n", (int)inlen, in));
-       
+
        /* We should generally shrink the data, but this'll do */
        camel_mime_filter_set_size (mf, inlen * 2 + 256, FALSE);
        outp = mf->outbuf;
-       
+
        camel_html_parser_set_data (f->priv->ctxt, in, inlen, last);
        do {
                const char *data;
                int len;
-               
+
                state = camel_html_parser_step(f->priv->ctxt, &data, &len);
-               
+
                switch(state) {
                case CAMEL_HTML_PARSER_DATA:
                case CAMEL_HTML_PARSER_ENT:
@@ -176,7 +176,7 @@ static void
 camel_mime_filter_html_class_init (CamelMimeFilterHTMLClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        camel_mime_filter_html_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
 
        filter_class->reset = reset;
@@ -189,7 +189,7 @@ camel_mime_filter_html_class_init (CamelMimeFilterHTMLClass *klass)
  * camel_mime_filter_html_new:
  *
  * Create a new #CamelMimeFilterHTML object.
- * 
+ *
  * Returns a new #CamelMimeFilterHTML object
  **/
 CamelMimeFilterHTML *
index 5af1124..4660400 100644 (file)
@@ -30,7 +30,7 @@ CamelType
 camel_mime_filter_index_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (), "CamelMimeFilterIndex",
                                            sizeof (CamelMimeFilterIndex),
@@ -40,7 +40,7 @@ camel_mime_filter_index_get_type (void)
                                            NULL,
                                            (CamelObjectFinalizeFunc) camel_mime_filter_index_finalize);
        }
-       
+
        return type;
 }
 
@@ -93,7 +93,7 @@ static void
 camel_mime_filter_index_class_init (CamelMimeFilterIndexClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        camel_mime_filter_index_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
 
        /*filter_class->reset = reset;*/
@@ -105,7 +105,7 @@ camel_mime_filter_index_class_init (CamelMimeFilterIndexClass *klass)
  * camel_mime_filter_index_new:
  *
  * Create a new #CamelMimeFilterIndex object
- * 
+ *
  * Returns a new #CamelMimeFilterIndex object
  **/
 CamelMimeFilterIndex *
index e3c4614..7511e46 100644 (file)
@@ -42,7 +42,7 @@ camel_mime_filter_linewrap_class_init (CamelMimeFilterLinewrapClass *klass)
 {
        CamelMimeFilterClass *mime_filter_class =
                (CamelMimeFilterClass *) klass;
-       
+
        mime_filter_class->filter = filter;
        mime_filter_class->complete = complete;
        mime_filter_class->reset = reset;
@@ -52,7 +52,7 @@ CamelType
 camel_mime_filter_linewrap_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterLinewrap",
                                            sizeof (CamelMimeFilterLinewrap),
@@ -62,7 +62,7 @@ camel_mime_filter_linewrap_get_type (void)
                                            NULL,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -73,14 +73,14 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
        CamelMimeFilterLinewrap *linewrap = (CamelMimeFilterLinewrap *)f;
        char *inend, *p, *q;
        int nchars = linewrap->nchars;
-       
+
        /* we'll be adding chars here so we need a bigger buffer */
        camel_mime_filter_set_size (f, 3 * len, FALSE);
-       
+
        p = in;
        q = f->outbuf;
        inend = in + len;
-       
+
        while (p < inend) {
                if (*p == '\n') {
                        *q++ = *p++;
@@ -97,7 +97,7 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
                        *q++ = *p++;
                        nchars++;
                }
-               
+
                /* line is getting way too long, we must force a wrap here */
                if (nchars >= (linewrap->max_len - 1) && *p != '\n') {
                        *q++ = '\n';
@@ -105,15 +105,15 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
                        nchars = 0;
                }
        }
-       
+
        linewrap->nchars = nchars;
-       
+
        *out = f->outbuf;
        *outlen = q - f->outbuf;
        *outprespace = f->outpre;
 }
 
-static void 
+static void
 complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
          char **out, size_t *outlen, size_t *outprespace)
 {
@@ -125,7 +125,7 @@ static void
 reset (CamelMimeFilter *f)
 {
        CamelMimeFilterLinewrap *linewrap = (CamelMimeFilterLinewrap *)f;
-       
+
        linewrap->nchars = 0;
 }
 
@@ -134,11 +134,11 @@ camel_mime_filter_linewrap_new (guint preferred_len, guint max_len, char indent_
 {
        CamelMimeFilterLinewrap *linewrap =
                CAMEL_MIME_FILTER_LINEWRAP (camel_object_new (CAMEL_MIME_FILTER_LINEWRAP_TYPE));
-       
+
        linewrap->indent = indent_char;
        linewrap->wrap_len = preferred_len;
        linewrap->max_len = max_len;
        linewrap->nchars = 0;
-       
+
        return (CamelMimeFilter *) linewrap;
 }
index b8aeb1d..bbeceb3 100644 (file)
@@ -35,7 +35,7 @@ typedef struct _CamelMimeFilterLinewrapClass CamelMimeFilterLinewrapClass;
 
 struct _CamelMimeFilterLinewrap {
        CamelMimeFilter parent;
-       
+
        guint wrap_len;
        guint max_len;
        char indent;
index 6b71420..96e246b 100644 (file)
@@ -50,7 +50,7 @@ static void
 camel_mime_filter_pgp_class_init (CamelMimeFilterPgpClass *klass)
 {
        CamelMimeFilterClass *mime_filter_class = (CamelMimeFilterClass *) klass;
-       
+
        mime_filter_class->filter = filter;
        mime_filter_class->complete = complete;
        mime_filter_class->reset = reset;
@@ -60,7 +60,7 @@ CamelType
 camel_mime_filter_pgp_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (),
                                            "CamelMimeFilterPgp",
@@ -71,7 +71,7 @@ camel_mime_filter_pgp_get_type (void)
                                            NULL,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -86,18 +86,18 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
        const char *start, *inend = in + len;
        register const char *inptr = in;
        register char *o;
-       
+
        /* only need as much space as the input, we're stripping chars */
        camel_mime_filter_set_size (f, len, FALSE);
-       
+
        o = f->outbuf;
-       
+
        while (inptr < inend) {
                start = inptr;
-               
+
                while (inptr < inend && *inptr != '\n')
                        inptr++;
-               
+
                if (inptr == inend) {
                        if (!last) {
                                camel_mime_filter_backup (f, start, inend - start);
@@ -105,9 +105,9 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
                        }
                        break;
                }
-               
+
                inptr++;
-               
+
                switch (pgp->state) {
                case PGP_PREFACE:
                        /* check for the beginning of the pgp block */
@@ -115,7 +115,7 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
                                pgp->state++;
                                break;
                        }
-                       
+
                        memcpy (o, start, inptr - start);
                        o += (inptr - start);
                        break;
@@ -131,13 +131,13 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
                                pgp->state++;
                                break;
                        }
-                       
+
                        /* do dash decoding */
                        if (!strncmp (start, "- ", 2)) {
                                /* Dash encoded line found, skip encoding */
                                start += 2;
                        }
-                       
+
                        memcpy (o, start, inptr - start);
                        o += (inptr - start);
                        break;
@@ -147,7 +147,7 @@ filter_run(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out
                        break;
                }
        }
-       
+
        *out = f->outbuf;
        *outlen = o - f->outbuf;
        *outprespace = f->outpre;
@@ -159,7 +159,7 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, s
        filter_run (f, in, len, prespace, out, outlen, outprespace, FALSE);
 }
 
-static void 
+static void
 complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace)
 {
        filter_run (f, in, len, prespace, out, outlen, outprespace, TRUE);
index e4bcb46..86832fc 100644 (file)
@@ -41,7 +41,7 @@ camel_mime_filter_save_class_init (CamelMimeFilterSaveClass *klass)
 {
        CamelMimeFilterClass *mime_filter_class =
                (CamelMimeFilterClass *) klass;
-       
+
        mime_filter_class->filter = filter;
        mime_filter_class->complete = complete;
        mime_filter_class->reset = reset;
@@ -51,7 +51,7 @@ CamelType
 camel_mime_filter_save_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type(), "CamelMimeFilterSave",
                                            sizeof (CamelMimeFilterSave),
@@ -61,7 +61,7 @@ camel_mime_filter_save_get_type (void)
                                            NULL,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -70,16 +70,16 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
        char **out, size_t *outlen, size_t *outprespace)
 {
        CamelMimeFilterSave *save = (CamelMimeFilterSave *) f;
-       
+
        if (save->stream)
                camel_stream_write (save->stream, in, len);
-       
+
        *out = in;
        *outlen = len;
        *outprespace = f->outpre;
 }
 
-static void 
+static void
 complete (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
          char **out, size_t *outlen, size_t *outprespace)
 {
@@ -105,9 +105,9 @@ CamelMimeFilter *
 camel_mime_filter_save_new (void)
 {
        CamelMimeFilterSave *save = CAMEL_MIME_FILTER_SAVE (camel_object_new (CAMEL_MIME_FILTER_SAVE_TYPE));
-       
+
        save->stream = camel_stream_mem_new ();
-       
+
        return (CamelMimeFilter *) save;
 }
 
@@ -125,9 +125,9 @@ CamelMimeFilter *
 camel_mime_filter_save_new_with_stream (CamelStream *stream)
 {
        CamelMimeFilterSave *save = CAMEL_MIME_FILTER_SAVE (camel_object_new (CAMEL_MIME_FILTER_SAVE_TYPE));
-       
+
        save->stream = stream;
        camel_object_ref (stream);
-       
+
        return (CamelMimeFilter *) save;
 }
index a968248..83f14df 100644 (file)
@@ -38,7 +38,7 @@ typedef struct _CamelMimeFilterSaveClass CamelMimeFilterSaveClass;
 
 struct _CamelMimeFilterSave {
        CamelMimeFilter parent;
-       
+
        CamelStream *stream;
 };
 
index e99482c..b4fe747 100644 (file)
@@ -82,7 +82,7 @@ CamelType
 camel_mime_filter_tohtml_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (),
                                            "CamelMimeFilterToHTML",
@@ -93,7 +93,7 @@ camel_mime_filter_tohtml_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_tohtml_init,
                                            (CamelObjectFinalizeFunc) camel_mime_filter_tohtml_finalize);
        }
-       
+
        return type;
 }
 
@@ -101,7 +101,7 @@ static void
 camel_mime_filter_tohtml_finalize (CamelObject *obj)
 {
        CamelMimeFilterToHTML *filter = (CamelMimeFilterToHTML *) obj;
-       
+
        camel_url_scanner_free (filter->scanner);
 }
 
@@ -109,7 +109,7 @@ static void
 camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter)
 {
        filter->scanner = camel_url_scanner_new ();
-       
+
        filter->flags = 0;
        filter->colour = 0;
        filter->column = 0;
@@ -121,16 +121,16 @@ static char *
 check_size (CamelMimeFilter *filter, char *outptr, char **outend, size_t len)
 {
        size_t offset;
-       
+
        if (*outend - outptr >= len)
                return outptr;
-       
+
        offset = outptr - filter->outbuf;
-       
+
        camel_mime_filter_set_size (filter, filter->outsize + len, TRUE);
-       
+
        *outend = filter->outbuf + filter->outsize;
-       
+
        return filter->outbuf + offset;
 }
 
@@ -139,26 +139,26 @@ citation_depth (const char *in)
 {
        register const char *inptr = in;
        int depth = 1;
-       
+
        if (*inptr++ != '>')
                return 0;
-       
+
 #if FOOLISHLY_UNMUNGE_FROM
        /* check that it isn't an escaped From line */
        if (!strncmp (inptr, "From", 4))
                return 0;
 #endif
-       
+
        while (*inptr != '\n') {
                if (*inptr == ' ')
                        inptr++;
-               
+
                if (*inptr++ != '>')
                        break;
-               
+
                depth++;
        }
-       
+
        return depth;
 }
 
@@ -167,10 +167,10 @@ writeln (CamelMimeFilter *filter, const unsigned char *in, const unsigned char *
 {
        CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
        const unsigned char *inptr = in;
-       
+
        while (inptr < inend) {
                guint32 u;
-               
+
                outptr = check_size (filter, outptr, outend, 16);
 
                u = camel_utf8_getc_limit (&inptr, inend);
@@ -225,7 +225,7 @@ writeln (CamelMimeFilter *filter, const unsigned char *in, const unsigned char *
                        break;
                }
        }
-       
+
        return outptr;
 }
 
@@ -258,14 +258,14 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
 
                return;
        }
-       
+
        camel_mime_filter_set_size (filter, inlen * 2 + 6, FALSE);
-       
+
        inptr = in;
        inend = in + inlen;
        outptr = filter->outbuf;
        outend = filter->outbuf + filter->outsize;
-       
+
        if (html->flags & CAMEL_MIME_FILTER_TOHTML_PRE && !html->pre_open) {
                outptr = g_stpcpy (outptr, "<pre>");
                html->pre_open = TRUE;
@@ -281,11 +281,11 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
 
                html->column = 0;
                depth = 0;
-               
+
                if (html->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) {
                        if ((depth = citation_depth (start)) > 0) {
                                /* FIXME: we could easily support multiple colour depths here */
-                               
+
                                outptr = check_size (filter, outptr, &outend, 25);
                                outptr += sprintf(outptr, "<font color=\"#%06x\">", (html->colour & 0xffffff));
                        }
@@ -300,42 +300,42 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
                        outptr = g_stpcpy (outptr, "&gt; ");
                        html->column += 2;
                }
-               
+
 #define CONVERT_URLS (CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES)
                if (html->flags & CONVERT_URLS) {
                        size_t matchlen, buflen, len;
                        urlmatch_t match;
-                       
+
                        len = inptr - start;
-                       
+
                        do {
                                if (camel_url_scanner_scan (html->scanner, start, len, &match)) {
                                        /* write out anything before the first regex match */
                                        outptr = writeln (filter, (const unsigned char *)start, (const unsigned char *)start + match.um_so,
                                                          outptr, &outend);
-                                       
+
                                        start += match.um_so;
                                        len -= match.um_so;
-                                       
+
                                        matchlen = match.um_eo - match.um_so;
-                                       
+
                                        buflen = 20 + strlen (match.prefix) + matchlen + matchlen;
                                        outptr = check_size (filter, outptr, &outend, buflen);
-                                       
+
                                        /* write out the href tag */
                                        outptr = g_stpcpy (outptr, "<a href=\"");
                                        outptr = g_stpcpy (outptr, match.prefix);
                                        memcpy (outptr, start, matchlen);
                                        outptr += matchlen;
                                        outptr = g_stpcpy (outptr, "\">");
-                                       
+
                                        /* now write the matched string */
                                        memcpy (outptr, start, matchlen);
                                        html->column += matchlen;
                                        outptr += matchlen;
                                        start += matchlen;
                                        len -= matchlen;
-                                       
+
                                        /* close the href tag */
                                        outptr = g_stpcpy (outptr, "</a>");
                                } else {
@@ -347,29 +347,29 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
                } else {
                        outptr = writeln (filter, (const unsigned char *)start, (const unsigned char *)inptr, outptr, &outend);
                }
-               
+
                if ((html->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) && depth > 0) {
                        outptr = check_size (filter, outptr, &outend, 8);
                        outptr = g_stpcpy (outptr, "</font>");
                }
-               
+
                if (inptr < inend) {
                        if (html->flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_NL) {
                                outptr = check_size (filter, outptr, &outend, 5);
                                outptr = g_stpcpy (outptr, "<br>");
                        }
-                       
+
                        *outptr++ = '\n';
                }
-               
+
                start = ++inptr;
        } while (inptr < inend);
-       
+
        if (flush) {
                /* flush the rest of our input buffer */
                if (start < inend)
                        outptr = writeln (filter, (const unsigned char *)start, (const unsigned char *)inend, outptr, &outend);
-               
+
                if (html->pre_open) {
                        /* close the pre-tag */
                        outptr = check_size (filter, outptr, &outend, 10);
@@ -379,7 +379,7 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace,
                /* backup */
                camel_mime_filter_backup (filter, start, (unsigned) (inend - start));
        }
-       
+
        *out = filter->outbuf;
        *outlen = outptr - filter->outbuf;
        *outprespace = filter->outpre;
@@ -392,7 +392,7 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
        html_convert (filter, in, len, prespace, out, outlen, outprespace, FALSE);
 }
 
-static void 
+static void
 filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                 char **out, size_t *outlen, size_t *outprespace)
 {
@@ -403,7 +403,7 @@ static void
 filter_reset (CamelMimeFilter *filter)
 {
        CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
-       
+
        html->column = 0;
        html->pre_open = FALSE;
 }
@@ -412,9 +412,9 @@ static void
 camel_mime_filter_tohtml_class_init (CamelMimeFilterToHTMLClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        camel_mime_filter_tohtml_parent = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-       
+
        filter_class->reset = filter_reset;
        filter_class->filter = filter_filter;
        filter_class->complete = filter_complete;
@@ -436,17 +436,17 @@ camel_mime_filter_tohtml_new (guint32 flags, guint32 colour)
 {
        CamelMimeFilterToHTML *new;
        int i;
-       
+
        new = CAMEL_MIME_FILTER_TOHTML (camel_object_new (camel_mime_filter_tohtml_get_type ()));
-       
+
        new->flags = flags;
        new->colour = colour;
-       
+
        for (i = 0; i < NUM_URL_PATTERNS; i++) {
                if (patterns[i].mask & flags)
                        camel_url_scanner_add (new->scanner, &patterns[i].pattern);
        }
-       
+
        return CAMEL_MIME_FILTER (new);
 }
 
@@ -468,17 +468,17 @@ camel_text_to_html (const char *in, guint32 flags, guint32 colour)
        CamelMimeFilter *filter;
        size_t outlen, outpre;
        char *outbuf;
-       
+
        g_return_val_if_fail (in != NULL, NULL);
-       
+
        filter = camel_mime_filter_tohtml_new (flags, colour);
-       
+
        camel_mime_filter_complete (filter, (char *) in, strlen (in), 0,
                                    &outbuf, &outlen, &outpre);
-       
+
        outbuf = g_strndup (outbuf, outlen);
-       
+
        camel_object_unref (filter);
-       
+
        return outbuf;
 }
index 51369e6..c2a7fb6 100644 (file)
@@ -48,12 +48,12 @@ typedef struct _CamelMimeFilterToHTML CamelMimeFilterToHTML;
 
 struct _CamelMimeFilterToHTML {
        CamelMimeFilter parent;
-       
+
        struct _CamelUrlScanner *scanner;
-       
+
        guint32 flags;
        guint32 colour;
-       
+
        guint32 column   : 31;
        guint32 pre_open : 1;
 };
index 4529c56..3a14e35 100644 (file)
@@ -45,7 +45,7 @@ CamelType
 camel_mime_filter_windows_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (),
                                            "CamelMimeFilterWindows",
@@ -56,7 +56,7 @@ camel_mime_filter_windows_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_windows_init,
                                            (CamelObjectFinalizeFunc) camel_mime_filter_windows_finalize);
        }
-       
+
        return type;
 }
 
@@ -64,7 +64,7 @@ static void
 camel_mime_filter_windows_finalize (CamelObject *o)
 {
        CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) o;
-       
+
        g_free (windows->claimed_charset);
 }
 
@@ -72,7 +72,7 @@ static void
 camel_mime_filter_windows_init (CamelObject *o)
 {
        CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) o;
-       
+
        windows->is_windows = FALSE;
        windows->claimed_charset = NULL;
 }
@@ -84,14 +84,14 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
        CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) filter;
        register unsigned char *inptr;
        unsigned char *inend;
-       
+
        if (!windows->is_windows) {
                inptr = (unsigned char *) in;
                inend = inptr + len;
-               
+
                while (inptr < inend) {
                        register unsigned char c = *inptr++;
-                       
+
                        if (c >= 128 && c <= 159) {
                                w(g_warning ("Encountered Windows charset masquerading as %s",
                                             windows->claimed_charset));
@@ -100,13 +100,13 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                        }
                }
        }
-       
+
        *out = in;
        *outlen = len;
        *outprespace = prespace;
 }
 
-static void 
+static void
 filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                 char **out, size_t *outlen, size_t *outprespace)
 {
@@ -117,7 +117,7 @@ static void
 filter_reset (CamelMimeFilter *filter)
 {
        CamelMimeFilterWindows *windows = (CamelMimeFilterWindows *) filter;
-       
+
        windows->is_windows = FALSE;
 }
 
@@ -125,9 +125,9 @@ static void
 camel_mime_filter_windows_class_init (CamelMimeFilterWindowsClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        parent_class = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-       
+
        filter_class->reset = filter_reset;
        filter_class->filter = filter_filter;
        filter_class->complete = filter_complete;
@@ -147,13 +147,13 @@ CamelMimeFilter *
 camel_mime_filter_windows_new (const char *claimed_charset)
 {
        CamelMimeFilterWindows *new;
-       
+
        g_return_val_if_fail (claimed_charset != NULL, NULL);
-       
+
        new = CAMEL_MIME_FILTER_WINDOWS (camel_object_new (camel_mime_filter_windows_get_type ()));
-       
+
        new->claimed_charset = g_strdup (claimed_charset);
-       
+
        return CAMEL_MIME_FILTER (new);
 }
 
@@ -173,7 +173,7 @@ gboolean
 camel_mime_filter_windows_is_windows_charset (CamelMimeFilterWindows *filter)
 {
        g_return_val_if_fail (CAMEL_IS_MIME_FILTER_WINDOWS (filter), FALSE);
-       
+
        return filter->is_windows;
 }
 
@@ -193,7 +193,7 @@ const char *
 camel_mime_filter_windows_real_charset (CamelMimeFilterWindows *filter)
 {
        g_return_val_if_fail (CAMEL_IS_MIME_FILTER_WINDOWS (filter), NULL);
-       
+
        if (filter->is_windows)
                return camel_charset_iso_to_windows (filter->claimed_charset);
        else
index df04ebe..f780fa4 100644 (file)
@@ -37,14 +37,14 @@ typedef struct _CamelMimeFilterWindows CamelMimeFilterWindows;
 
 struct _CamelMimeFilterWindows {
        CamelMimeFilter parent;
-       
+
        gboolean is_windows;
        char *claimed_charset;
 };
 
 struct _CamelMimeFilterWindowsClass {
        CamelMimeFilterClass parent_class;
-       
+
 };
 
 
index a3cb7b0..88494cf 100644 (file)
@@ -46,7 +46,7 @@ CamelType
 camel_mime_filter_yenc_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_mime_filter_get_type (),
                                            "CamelMimeFilterYenc",
@@ -57,7 +57,7 @@ camel_mime_filter_yenc_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_filter_yenc_init,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -66,9 +66,9 @@ static void
 camel_mime_filter_yenc_class_init (CamelMimeFilterYencClass *klass)
 {
        CamelMimeFilterClass *filter_class = (CamelMimeFilterClass *) klass;
-       
+
        parent_class = CAMEL_MIME_FILTER_CLASS (camel_type_get_global_classfuncs (camel_mime_filter_get_type ()));
-       
+
        filter_class->reset = filter_reset;
        filter_class->filter = filter_filter;
        filter_class->complete = filter_complete;
@@ -90,7 +90,7 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
 {
        CamelMimeFilterYenc *yenc = (CamelMimeFilterYenc *) filter;
        size_t newlen = 0;
-       
+
        switch (yenc->direction) {
        case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
                /* won't go to more than 2 * (x + 2) + 62 */
@@ -103,10 +103,10 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                if (!(yenc->state & CAMEL_MIME_YDECODE_STATE_DECODE)) {
                        register char *inptr, *inend;
                        size_t left;
-                       
+
                        inptr = in;
                        inend = inptr + len;
-                       
+
                        /* we cannot start decoding until we have found an =ybegin line */
                        if (!(yenc->state & CAMEL_MIME_YDECODE_STATE_BEGIN)) {
                                while (inptr < inend) {
@@ -130,16 +130,16 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                                                }
                                                break;
                                        }
-                                       
+
                                        /* go to the next line */
                                        while (inptr < inend && *inptr != '\n')
                                                inptr++;
-                                       
+
                                        if (inptr < inend)
                                                inptr++;
                                }
                        }
-                       
+
                        left = inend - inptr;
                        if ((yenc->state & CAMEL_MIME_YDECODE_STATE_BEGIN) && left > 0) {
                                /* we have found an '=ybegin' line but we may yet have an "=ypart" line to
@@ -162,7 +162,7 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                                }
                        }
                }
-               
+
                if ((yenc->state & CAMEL_MIME_YDECODE_STATE_DECODE) && !(yenc->state & CAMEL_MIME_YDECODE_STATE_END)) {
                        /* all yEnc headers have been found so we can now start decoding */
                        camel_mime_filter_set_size (filter, len + 3, FALSE);
@@ -173,7 +173,7 @@ filter_filter (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                }
                break;
        }
-       
+
        *out = filter->outbuf;
        *outlen = newlen;
        *outprespace = filter->outpre;
@@ -185,7 +185,7 @@ filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
 {
        CamelMimeFilterYenc *yenc = (CamelMimeFilterYenc *) filter;
        size_t newlen = 0;
-       
+
        switch (yenc->direction) {
        case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
                /* won't go to more than 2 * (x + 2) + 62 */
@@ -206,7 +206,7 @@ filter_complete (CamelMimeFilter *filter, char *in, size_t len, size_t prespace,
                }
                break;
        }
-       
+
        *out = filter->outbuf;
        *outlen = newlen;
        *outprespace = filter->outpre;
@@ -217,7 +217,7 @@ static void
 filter_reset (CamelMimeFilter *filter)
 {
        CamelMimeFilterYenc *yenc = (CamelMimeFilterYenc *) filter;
-       
+
        switch (yenc->direction) {
        case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
                yenc->state = CAMEL_MIME_YENCODE_STATE_INIT;
@@ -243,10 +243,10 @@ CamelMimeFilter *
 camel_mime_filter_yenc_new (CamelMimeFilterYencDirection direction)
 {
        CamelMimeFilterYenc *new;
-       
+
        new = (CamelMimeFilterYenc *) camel_object_new (CAMEL_TYPE_MIME_FILTER_YENC);
        new->direction = direction;
-       
+
        switch (direction) {
        case CAMEL_MIME_FILTER_YENC_DIRECTION_ENCODE:
                new->state = CAMEL_MIME_YENCODE_STATE_INIT;
@@ -257,7 +257,7 @@ camel_mime_filter_yenc_new (CamelMimeFilterYencDirection direction)
        default:
                g_assert_not_reached ();
        }
-       
+
        return (CamelMimeFilter *) new;
 }
 
@@ -273,7 +273,7 @@ void
 camel_mime_filter_yenc_set_state (CamelMimeFilterYenc *yenc, int state)
 {
        g_return_if_fail (CAMEL_IS_MIME_FILTER_YENC (yenc));
-       
+
        yenc->state = state;
 }
 
@@ -289,7 +289,7 @@ void
 camel_mime_filter_yenc_set_crc (CamelMimeFilterYenc *yenc, guint32 crc)
 {
        g_return_if_fail (CAMEL_IS_MIME_FILTER_YENC (yenc));
-       
+
        yenc->crc = crc;
 }
 
@@ -309,10 +309,10 @@ int
 camel_mime_filter_yenc_get_part (CamelMimeFilterYenc *yenc)
 {
        g_return_val_if_fail (CAMEL_IS_MIME_FILTER_YENC (yenc), -1);
-       
+
        if (yenc->state & CAMEL_MIME_YDECODE_STATE_PART)
                return yenc->part;
-       
+
        return -1;
 }
 #endif
@@ -329,7 +329,7 @@ guint32
 camel_mime_filter_yenc_get_pcrc (CamelMimeFilterYenc *yenc)
 {
        g_return_val_if_fail (CAMEL_IS_MIME_FILTER_YENC (yenc), -1);
-       
+
        return CAMEL_MIME_YENCODE_CRC_FINAL (yenc->pcrc);
 }
 
@@ -346,7 +346,7 @@ guint32
 camel_mime_filter_yenc_get_crc (CamelMimeFilterYenc *yenc)
 {
        g_return_val_if_fail (CAMEL_IS_MIME_FILTER_YENC (yenc), -1);
-       
+
        return CAMEL_MIME_YENCODE_CRC_FINAL (yenc->crc);
 }
 
@@ -421,34 +421,34 @@ camel_ydecode_step (const unsigned char *in, size_t inlen, unsigned char *out,
        const unsigned char *inend;
        unsigned char ch;
        int ystate;
-       
+
        if (*state & CAMEL_MIME_YDECODE_STATE_END)
                return 0;
-       
+
        ystate = *state;
-       
+
        inend = in + inlen;
        outptr = out;
-       
+
        inptr = in;
        while (inptr < inend) {
                ch = *inptr++;
-               
+
                if ((ystate & YENC_NEWLINE_ESCAPE) == YENC_NEWLINE_ESCAPE) {
                        ystate &= ~CAMEL_MIME_YDECODE_STATE_EOLN;
-                       
+
                        if (ch == 'y') {
                                /* we probably have a =yend here */
                                ystate |= CAMEL_MIME_YDECODE_STATE_END;
                                break;
                        }
                }
-               
+
                if (ch == '\n') {
                        ystate |= CAMEL_MIME_YDECODE_STATE_EOLN;
                        continue;
                }
-               
+
                if (ystate & CAMEL_MIME_YDECODE_STATE_ESCAPE) {
                        ystate &= ~CAMEL_MIME_YDECODE_STATE_ESCAPE;
                        ch -= 64;
@@ -456,17 +456,17 @@ camel_ydecode_step (const unsigned char *in, size_t inlen, unsigned char *out,
                        ystate |= CAMEL_MIME_YDECODE_STATE_ESCAPE;
                        continue;
                }
-               
+
                ystate &= ~CAMEL_MIME_YDECODE_STATE_EOLN;
-               
+
                *outptr++ = ch -= 42;
-               
+
                *pcrc = yenc_crc_add (*pcrc, ch);
                *crc = yenc_crc_add (*crc, ch);
        }
-       
+
        *state = ystate;
-       
+
        return outptr - out;
 }
 
@@ -501,21 +501,21 @@ camel_yencode_step (const unsigned char *in, size_t inlen, unsigned char *out,
        const unsigned char *inend;
        register int already;
        unsigned char ch;
-       
+
        inend = in + inlen;
        outptr = out;
-       
+
        already = *state;
-       
+
        inptr = in;
        while (inptr < inend) {
                ch = (*inptr++);
-               
+
                *pcrc = yenc_crc_add (*pcrc, ch);
                *crc = yenc_crc_add (*crc, ch);
-               
+
                ch += 42;
-               
+
                if (ch == '\0' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '=') {
                        *outptr++ = '=';
                        *outptr++ = ch + 64;
@@ -524,15 +524,15 @@ camel_yencode_step (const unsigned char *in, size_t inlen, unsigned char *out,
                        *outptr++ = ch;
                        already++;
                }
-               
+
                if (already >= 128) {
                        *outptr++ = '\n';
                        already = 0;
                }
        }
-       
+
        *state = already;
-       
+
        return outptr - out;
 }
 
@@ -562,16 +562,16 @@ camel_yencode_close (const unsigned char *in, size_t inlen, unsigned char *out,
                     int *state, guint32 *pcrc, guint32 *crc)
 {
        register unsigned char *outptr;
-       
+
        outptr = out;
-       
+
        if (inlen)
                outptr += camel_yencode_step (in, inlen, out, state, pcrc, crc);
-       
+
        if (*state)
                *outptr++ = '\n';
-       
+
        *state = CAMEL_MIME_YENCODE_STATE_INIT;
-       
+
        return outptr - out;
 }
index a393dc5..9ee9d74 100644 (file)
@@ -64,11 +64,11 @@ typedef enum {
 
 struct _CamelMimeFilterYenc {
        CamelMimeFilter parent_object;
-       
+
        CamelMimeFilterYencDirection direction;
-       
+
        int part;
-       
+
        int state;
        guint32 pcrc;
        guint32 crc;
@@ -76,7 +76,7 @@ struct _CamelMimeFilterYenc {
 
 struct _CamelMimeFilterYencClass {
        CamelMimeFilterClass parent_class;
-       
+
 };
 
 
index aecd367..ddc0bee 100644 (file)
@@ -41,8 +41,8 @@ struct _CamelMimeFilterPrivate {
 
 static CamelObjectClass *camel_mime_filter_parent;
 
-static void complete (CamelMimeFilter *mf, char *in, size_t len, 
-                     size_t prespace, char **out, size_t *outlen, 
+static void complete (CamelMimeFilter *mf, char *in, size_t len,
+                     size_t prespace, char **out, size_t *outlen,
                      size_t *outprespace);
 
 static void
@@ -83,7 +83,7 @@ CamelType
 camel_mime_filter_get_type (void)
 {
        static CamelType camel_mime_filter_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_mime_filter_type == CAMEL_INVALID_TYPE) {
                camel_mime_filter_type = camel_type_register (CAMEL_OBJECT_TYPE, "CamelMimeFilter",
                                                              sizeof (CamelMimeFilter),
@@ -93,7 +93,7 @@ camel_mime_filter_get_type (void)
                                                              (CamelObjectInitFunc) camel_mime_filter_init,
                                                              (CamelObjectFinalizeFunc) camel_mime_filter_finalize);
        }
-       
+
        return camel_mime_filter_type;
 }
 
@@ -108,7 +108,7 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out,
  * camel_mime_filter_new:
  *
  * Create a new #CamelMimeFilter object.
- * 
+ *
  * Returns a new #CamelMimeFilter
  **/
 CamelMimeFilter *
@@ -185,7 +185,7 @@ static void filter_run(CamelMimeFilter *f,
                prespace -= f->backlen;
                f->backlen = 0;
        }
-       
+
        filterfunc(f, in, len, prespace, out, outlen, outprespace);
 
 #ifdef MALLOC_CHECK
@@ -313,7 +313,7 @@ camel_mime_filter_set_size(CamelMimeFilter *filter, size_t size, int keep)
                filter->outptr = filter->outreal + offset;
                filter->outbuf = filter->outreal + PRE_HEAD*4;
                filter->outsize = size;
-               /* this could be offset from the end of the structure, but 
+               /* this could be offset from the end of the structure, but
                   this should be good enough */
                filter->outpre = PRE_HEAD*4;
        }
index 3945db9..8d182b1 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
 /* camel-mime-message.c : class for a mime_message */
 
-/* 
+/*
  * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
  *         Michael Zucchi <notzed@ximian.com>
  *          Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -107,9 +107,9 @@ camel_mime_message_class_init (CamelMimeMessageClass *camel_mime_message_class)
        CamelMimePartClass *camel_mime_part_class = CAMEL_MIME_PART_CLASS (camel_mime_message_class);
        CamelMediumClass *camel_medium_class = CAMEL_MEDIUM_CLASS (camel_mime_message_class);
        int i;
-       
+
        parent_class = CAMEL_MIME_PART_CLASS (camel_type_get_global_classfuncs (camel_mime_part_get_type ()));
-       
+
        header_name_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
        for (i = 0;header_names[i]; i++)
                g_hash_table_insert (header_name_table, header_names[i], GINT_TO_POINTER(i+1));
@@ -130,7 +130,7 @@ camel_mime_message_init (gpointer object, gpointer klass)
 {
        CamelMimeMessage *mime_message = (CamelMimeMessage *)object;
        int i;
-       
+
        mime_message->recipients =  g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
        for (i=0;recipient_names[i];i++) {
                g_hash_table_insert(mime_message->recipients, recipient_names[i], camel_internet_address_new());
@@ -146,21 +146,21 @@ camel_mime_message_init (gpointer object, gpointer klass)
        mime_message->message_id = NULL;
 }
 
-static void           
+static void
 camel_mime_message_finalize (CamelObject *object)
 {
        CamelMimeMessage *message = CAMEL_MIME_MESSAGE (object);
-       
+
        g_free (message->subject);
-       
+
        g_free (message->message_id);
-       
+
        if (message->reply_to)
                camel_object_unref ((CamelObject *)message->reply_to);
-       
+
        if (message->from)
                camel_object_unref ((CamelObject *)message->from);
-       
+
        g_hash_table_foreach (message->recipients, unref_recipient, NULL);
        g_hash_table_destroy (message->recipients);
 }
@@ -169,7 +169,7 @@ CamelType
 camel_mime_message_get_type (void)
 {
        static CamelType camel_mime_message_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_mime_message_type == CAMEL_INVALID_TYPE)      {
                camel_mime_message_type = camel_type_register (camel_mime_part_get_type(), "CamelMimeMessage",
                                                               sizeof (CamelMimeMessage),
@@ -179,7 +179,7 @@ camel_mime_message_get_type (void)
                                                               (CamelObjectInitFunc) camel_mime_message_init,
                                                               (CamelObjectFinalizeFunc) camel_mime_message_finalize);
        }
-       
+
        return camel_mime_message_type;
 }
 
@@ -198,11 +198,11 @@ unref_recipient (gpointer key, gpointer value, gpointer user_data)
  * Returns a new #CamelMimeMessage object
  **/
 CamelMimeMessage *
-camel_mime_message_new (void) 
+camel_mime_message_new (void)
 {
        CamelMimeMessage *mime_message;
        mime_message = CAMEL_MIME_MESSAGE (camel_object_new (CAMEL_MIME_MESSAGE_TYPE));
-       
+
        return mime_message;
 }
 
@@ -221,20 +221,20 @@ void
 camel_mime_message_set_date (CamelMimeMessage *message,  time_t date, int offset)
 {
        char *datestr;
-       
+
        g_assert(message);
-       
+
        if (date == CAMEL_MESSAGE_DATE_CURRENT) {
                struct tm local;
                int tz;
-               
+
                date = time(NULL);
                e_localtime_with_offset(date, &local, &tz);
                offset = (((tz/60/60) * 100) + (tz/60 % 60));
        }
        message->date = date;
        message->date_offset = offset;
-       
+
        datestr = camel_header_format_date (date, offset);
        CAMEL_MEDIUM_CLASS (parent_class)->set_header ((CamelMedium *)message, "Date", datestr);
        g_free (datestr);
@@ -255,7 +255,7 @@ camel_mime_message_get_date (CamelMimeMessage *msg, int *offset)
 {
        if (offset)
                *offset = msg->date_offset;
-       
+
        return msg->date;
 }
 
@@ -274,17 +274,17 @@ camel_mime_message_get_date_received (CamelMimeMessage *msg, int *offset)
 {
        if (msg->date_received == CAMEL_MESSAGE_DATE_CURRENT) {
                const char *received;
-               
+
                received = camel_medium_get_header ((CamelMedium *)msg, "received");
                if (received)
                        received = strrchr (received, ';');
                if (received)
                        msg->date_received = camel_header_decode_date (received + 1, &msg->date_received_offset);
        }
-       
+
        if (offset)
                *offset = msg->date_received_offset;
-       
+
        return msg->date_received;
 }
 
@@ -301,17 +301,17 @@ void
 camel_mime_message_set_message_id (CamelMimeMessage *mime_message, const char *message_id)
 {
        char *id;
-       
+
        g_assert (mime_message);
-       
+
        g_free (mime_message->message_id);
-       
+
        if (message_id) {
                id = g_strstrip (g_strdup (message_id));
        } else {
                id = camel_header_msgid_generate ();
        }
-       
+
        mime_message->message_id = id;
        id = g_strdup_printf ("<%s>", mime_message->message_id);
        CAMEL_MEDIUM_CLASS (parent_class)->set_header (CAMEL_MEDIUM (mime_message), "Message-Id", id);
@@ -331,7 +331,7 @@ const char *
 camel_mime_message_get_message_id (CamelMimeMessage *mime_message)
 {
        g_assert (mime_message);
-       
+
        return mime_message->message_id;
 }
 
@@ -349,19 +349,19 @@ void
 camel_mime_message_set_reply_to (CamelMimeMessage *msg, const CamelInternetAddress *reply_to)
 {
        char *addr;
-       
+
        g_assert(msg);
-       
+
        if (msg->reply_to) {
                camel_object_unref ((CamelObject *)msg->reply_to);
                msg->reply_to = NULL;
        }
-       
+
        if (reply_to == NULL) {
                CAMEL_MEDIUM_CLASS (parent_class)->remove_header (CAMEL_MEDIUM (msg), "Reply-To");
                return;
        }
-       
+
        msg->reply_to = (CamelInternetAddress *)camel_address_new_clone ((CamelAddress *)reply_to);
        addr = camel_address_encode ((CamelAddress *)msg->reply_to);
        CAMEL_MEDIUM_CLASS (parent_class)->set_header (CAMEL_MEDIUM (msg), "Reply-To", addr);
@@ -381,9 +381,9 @@ const CamelInternetAddress *
 camel_mime_message_get_reply_to (CamelMimeMessage *mime_message)
 {
        g_assert (mime_message);
-       
+
        /* TODO: ref for threading? */
-       
+
        return mime_message->reply_to;
 }
 
@@ -400,11 +400,11 @@ void
 camel_mime_message_set_subject (CamelMimeMessage *message, const char *subject)
 {
        char *text;
-       
+
        g_assert(message);
-       
+
        g_free (message->subject);
-       
+
        if (subject) {
                message->subject = g_strstrip (g_strdup (subject));
                text = camel_header_encode_string ((unsigned char *) message->subject);
@@ -412,7 +412,7 @@ camel_mime_message_set_subject (CamelMimeMessage *message, const char *subject)
                message->subject = NULL;
                text = NULL;
        }
-       
+
        CAMEL_MEDIUM_CLASS (parent_class)->set_header (CAMEL_MEDIUM (message), "Subject", text);
        g_free (text);
 }
@@ -430,7 +430,7 @@ const char *
 camel_mime_message_get_subject (CamelMimeMessage *mime_message)
 {
        g_assert(mime_message);
-       
+
        return mime_message->subject;
 }
 
@@ -451,19 +451,19 @@ void
 camel_mime_message_set_from (CamelMimeMessage *msg, const CamelInternetAddress *from)
 {
        char *addr;
-       
+
        g_assert(msg);
-       
+
        if (msg->from) {
                camel_object_unref((CamelObject *)msg->from);
                msg->from = NULL;
        }
-       
+
        if (from == NULL || camel_address_length((CamelAddress *)from) == 0) {
                CAMEL_MEDIUM_CLASS(parent_class)->remove_header(CAMEL_MEDIUM(msg), "From");
                return;
        }
-       
+
        msg->from = (CamelInternetAddress *)camel_address_new_clone((CamelAddress *)from);
        addr = camel_address_encode((CamelAddress *)msg->from);
        CAMEL_MEDIUM_CLASS (parent_class)->set_header(CAMEL_MEDIUM(msg), "From", addr);
@@ -483,9 +483,9 @@ const CamelInternetAddress *
 camel_mime_message_get_from (CamelMimeMessage *mime_message)
 {
        g_assert (mime_message);
-       
+
        /* TODO: we should really ref this for multi-threading to work */
-       
+
        return mime_message->from;
 }
 
@@ -504,24 +504,24 @@ camel_mime_message_set_recipients(CamelMimeMessage *mime_message, const char *ty
 {
        char *text;
        CamelInternetAddress *addr;
-       
+
        g_assert(mime_message);
-       
+
        addr = g_hash_table_lookup (mime_message->recipients, type);
        if (addr == NULL) {
                g_warning ("trying to set a non-valid receipient type: %s", type);
                return;
        }
-       
+
        if (r == NULL || camel_address_length ((CamelAddress *)r) == 0) {
                camel_address_remove ((CamelAddress *)addr, -1);
                CAMEL_MEDIUM_CLASS (parent_class)->remove_header (CAMEL_MEDIUM (mime_message), type);
                return;
        }
-       
+
        /* note this does copy, and not append (cat) */
        camel_address_copy ((CamelAddress *)addr, (const CamelAddress *)r);
-       
+
        /* and sync our headers */
        text = camel_address_encode (CAMEL_ADDRESS (addr));
        CAMEL_MEDIUM_CLASS (parent_class)->set_header (CAMEL_MEDIUM (mime_message), type, text);
@@ -542,7 +542,7 @@ const CamelInternetAddress *
 camel_mime_message_get_recipients (CamelMimeMessage *mime_message, const char *type)
 {
        g_assert(mime_message);
-       
+
        return g_hash_table_lookup (mime_message->recipients, type);
 }
 
@@ -552,9 +552,9 @@ camel_mime_message_set_source (CamelMimeMessage *mime_message, const char *src)
 {
        CamelURL *url;
        char *uri;
-       
+
        g_assert (mime_message);
-       
+
        url = camel_url_new (src, NULL);
        if (url) {
                uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
@@ -568,9 +568,9 @@ const char *
 camel_mime_message_get_source (CamelMimeMessage *mime_message)
 {
        const char *src;
-       
+
        g_assert(mime_message);
-       
+
        src = camel_medium_get_header (CAMEL_MEDIUM (mime_message), "X-Evolution-Source");
        if (src) {
                while (*src && isspace ((unsigned) *src))
@@ -626,7 +626,7 @@ static ssize_t
 write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
 {
        CamelMimeMessage *mm = CAMEL_MIME_MESSAGE (data_wrapper);
-       
+
        /* force mandatory headers ... */
        if (mm->from == NULL) {
                /* FIXME: should we just abort?  Should we make one up? */
@@ -635,18 +635,18 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
        }
        if (!camel_medium_get_header ((CamelMedium *)mm, "Date"))
                camel_mime_message_set_date (mm, CAMEL_MESSAGE_DATE_CURRENT, 0);
-       
+
        if (mm->subject == NULL)
                camel_mime_message_set_subject (mm, "No Subject");
-       
+
        if (mm->message_id == NULL)
                camel_mime_message_set_message_id (mm, NULL);
-       
+
        /* FIXME: "To" header needs to be set explicitly as well ... */
-       
+
        if (!camel_medium_get_header ((CamelMedium *)mm, "Mime-Version"))
                camel_medium_set_header ((CamelMedium *)mm, "Mime-Version", "1.0");
-       
+
        return CAMEL_DATA_WRAPPER_CLASS (parent_class)->write_to_stream (data_wrapper, stream);
 }
 
@@ -658,7 +658,7 @@ process_header (CamelMedium *medium, const char *name, const char *value)
        CamelMimeMessage *message = CAMEL_MIME_MESSAGE (medium);
        CamelInternetAddress *addr;
        const char *charset;
-       
+
        header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, name);
        switch (header_type) {
        case HEADER_FROM:
@@ -720,7 +720,7 @@ process_header (CamelMedium *medium, const char *name, const char *value)
        default:
                return FALSE;
        }
-       
+
        return TRUE;
 }
 
@@ -756,27 +756,27 @@ message_foreach_part_rec (CamelMimeMessage *msg, CamelMimePart *part, CamelPartF
        CamelDataWrapper *containee;
        int parts, i;
        int go = TRUE;
-       
+
        if (callback (msg, part, data) == FALSE)
                return FALSE;
-       
+
        containee = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-       
+
        if (containee == NULL)
                return go;
-       
+
        /* using the object types is more accurate than using the mime/types */
        if (CAMEL_IS_MULTIPART (containee)) {
                parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
                for (i = 0; go && i < parts; i++) {
                        CamelMimePart *mpart = camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
-                       
+
                        go = message_foreach_part_rec (msg, mpart, callback, data);
                }
        } else if (CAMEL_IS_MIME_MESSAGE (containee)) {
                go = message_foreach_part_rec (msg, (CamelMimePart *)containee, callback, data);
        }
-       
+
        return go;
 }
 
@@ -793,12 +793,12 @@ check_8bit (CamelMimeMessage *msg, CamelMimePart *part, void *data)
 {
        CamelTransferEncoding encoding;
        int *has8bit = data;
-       
+
        /* check this part, and stop as soon as we are done */
        encoding = camel_mime_part_get_encoding (part);
-       
+
        *has8bit = encoding == CAMEL_TRANSFER_ENCODING_8BIT || encoding == CAMEL_TRANSFER_ENCODING_BINARY;
-       
+
        return !(*has8bit);
 }
 
@@ -815,9 +815,9 @@ gboolean
 camel_mime_message_has_8bit_parts (CamelMimeMessage *msg)
 {
        int has8bit = FALSE;
-       
+
        camel_mime_message_foreach_part (msg, check_8bit, &has8bit);
-       
+
        return has8bit;
 }
 
@@ -836,13 +836,13 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
        CamelStream *null;
        int idb, idc = -1;
        gboolean istext;
-       
+
        /* we use all these weird stream things so we can do it with streams, and
           not have to read the whole lot into memory - although i have a feeling
           it would make things a fair bit simpler to do so ... */
-       
+
        d(printf("starting to check part\n"));
-       
+
        content = camel_medium_get_content_object ((CamelMedium *)part);
        if (content == NULL) {
                /* charset might not be right here, but it'll get the right stuff
@@ -850,7 +850,7 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
                *charsetp = NULL;
                return CAMEL_TRANSFER_ENCODING_DEFAULT;
        }
-       
+
        istext = camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*");
        if (istext) {
                flags = CAMEL_BESTENC_GET_CHARSET | CAMEL_BESTENC_GET_ENCODING;
@@ -858,17 +858,17 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
        } else {
                flags = CAMEL_BESTENC_GET_ENCODING;
        }
-       
+
        /* when building the message, any encoded parts are translated already */
        flags |= CAMEL_BESTENC_LF_IS_CRLF;
        /* and get any flags the caller passed in */
        callerflags = (required & CAMEL_BESTENC_NO_FROM);
        flags |= callerflags;
-       
+
        /* first a null stream, so any filtering is thrown away; we only want the sideeffects */
        null = (CamelStream *)camel_stream_null_new ();
        filter = camel_stream_filter_new_with_stream (null);
-       
+
        /* if we're looking for the best charset, then we need to convert to UTF-8 */
        if (istext && (required & CAMEL_BESTENC_GET_CHARSET) != 0
            && (charsetin = camel_content_type_param (content->mime_type, "charset"))) {
@@ -877,7 +877,7 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
                        idc = camel_stream_filter_add (filter, (CamelMimeFilter *)charenc);
                charsetin = NULL;
        }
-       
+
        bestenc = camel_mime_filter_bestenc_new (flags);
        idb = camel_stream_filter_add (filter, (CamelMimeFilter *)bestenc);
        d(printf("writing to checking stream\n"));
@@ -888,56 +888,56 @@ find_best_encoding (CamelMimePart *part, CamelBestencRequired required, CamelBes
                camel_object_unref (charenc);
                charenc = NULL;
        }
-       
+
        if (istext && (required & CAMEL_BESTENC_GET_CHARSET) != 0) {
                charsetin = camel_mime_filter_bestenc_get_best_charset (bestenc);
                d(printf("best charset = %s\n", charsetin ? charsetin : "(null)"));
                charset = g_strdup (charsetin);
-               
+
                charsetin = camel_content_type_param (content->mime_type, "charset");
        } else {
                charset = NULL;
        }
-       
+
        /* if we have US-ASCII, or we're not doing text, we dont need to bother with the rest */
        if (istext && charsetin && charset && (required & CAMEL_BESTENC_GET_CHARSET) != 0) {
                d(printf("have charset, trying conversion/etc\n"));
-               
+
                /* now that 'bestenc' has told us what the best encoding is, we can use that to create
                   a charset conversion filter as well, and then re-add the bestenc to filter the
                   result to find the best encoding to use as well */
-               
+
                charenc = camel_mime_filter_charset_new_convert (charsetin, charset);
                if (charenc != NULL) {
                        /* otherwise, try another pass, converting to the real charset */
-                       
+
                        camel_mime_filter_reset ((CamelMimeFilter *)bestenc);
                        camel_mime_filter_bestenc_set_flags (bestenc, CAMEL_BESTENC_GET_ENCODING |
                                                             CAMEL_BESTENC_LF_IS_CRLF | callerflags);
-                       
+
                        camel_stream_filter_add (filter, (CamelMimeFilter *)charenc);
                        camel_stream_filter_add (filter, (CamelMimeFilter *)bestenc);
-                       
+
                        /* and write it to the new stream */
                        camel_data_wrapper_write_to_stream (content, (CamelStream *)filter);
-                       
+
                        camel_object_unref (charenc);
                }
        }
-       
+
        encoding = camel_mime_filter_bestenc_get_best_encoding (bestenc, enctype);
-       
+
        camel_object_unref (filter);
        camel_object_unref (bestenc);
        camel_object_unref (null);
-       
+
        d(printf("done, best encoding = %d\n", encoding));
-       
+
        if (charsetp)
                *charsetp = charset;
        else
                g_free (charset);
-       
+
        return encoding;
 }
 
@@ -953,38 +953,38 @@ best_encoding (CamelMimeMessage *msg, CamelMimePart *part, void *datap)
        CamelTransferEncoding encoding;
        CamelDataWrapper *wrapper;
        char *charset;
-       
+
        wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
        if (!wrapper)
                return FALSE;
-       
+
        /* we only care about actual content objects */
        if (!CAMEL_IS_MULTIPART (wrapper) && !CAMEL_IS_MIME_MESSAGE (wrapper)) {
                encoding = find_best_encoding (part, data->required, data->enctype, &charset);
                /* we always set the encoding, if we got this far.  GET_CHARSET implies
                   also GET_ENCODING */
                camel_mime_part_set_encoding (part, encoding);
-               
+
                if ((data->required & CAMEL_BESTENC_GET_CHARSET) != 0) {
                        if (camel_content_type_is (((CamelDataWrapper *) part)->mime_type, "text", "*")) {
                                char *newct;
-                               
+
                                /* FIXME: ick, the part content_type interface needs fixing bigtime */
                                camel_content_type_set_param (((CamelDataWrapper *) part)->mime_type, "charset",
                                                               charset ? charset : "us-ascii");
                                newct = camel_content_type_format (((CamelDataWrapper *) part)->mime_type);
                                if (newct) {
                                        d(printf("Setting content-type to %s\n", newct));
-                                       
+
                                        camel_mime_part_set_content_type (part, newct);
                                        g_free (newct);
                                }
                        }
                }
-               
+
                g_free (charset);
        }
-       
+
        return TRUE;
 }
 
@@ -1007,13 +1007,13 @@ void
 camel_mime_message_set_best_encoding (CamelMimeMessage *msg, CamelBestencRequired required, CamelBestencEncoding enctype)
 {
        struct _enc_data data;
-       
+
        if ((required & (CAMEL_BESTENC_GET_ENCODING|CAMEL_BESTENC_GET_CHARSET)) == 0)
                return;
-       
+
        data.required = required;
        data.enctype = enctype;
-       
+
        camel_mime_message_foreach_part (msg, best_encoding, &data);
 }
 
@@ -1042,15 +1042,15 @@ check_content_id (CamelMimeMessage *message, CamelMimePart *part, void *data)
        struct _check_content_id *check = (struct _check_content_id *) data;
        const char *content_id;
        gboolean found;
-       
+
        content_id = camel_mime_part_get_content_id (part);
-       
+
        found = content_id && !strcmp (content_id, check->content_id) ? TRUE : FALSE;
        if (found) {
                check->part = part;
                camel_object_ref (part);
        }
-       
+
        return !found;
 }
 
@@ -1068,17 +1068,17 @@ CamelMimePart *
 camel_mime_message_get_part_by_content_id (CamelMimeMessage *message, const char *id)
 {
        struct _check_content_id check;
-       
+
        g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), NULL);
-       
+
        if (id == NULL)
                return NULL;
-       
+
        check.content_id = id;
        check.part = NULL;
-       
+
        camel_mime_message_foreach_part (message, check_content_id, &check);
-       
+
        return check.part;
 }
 
@@ -1110,13 +1110,13 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
        time_t thetime;
        int offset;
        struct tm tm;
-       
+
        tmp = camel_header_raw_find (&header, "Sender", NULL);
        if (tmp == NULL)
                tmp = camel_header_raw_find (&header, "From", NULL);
        if (tmp != NULL) {
                struct _camel_header_address *addr = camel_header_address_decode (tmp, NULL);
-               
+
                tmp = NULL;
                if (addr) {
                        if (addr->type == CAMEL_HEADER_ADDRESS_NAME) {
@@ -1126,10 +1126,10 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
                        camel_header_address_unref (addr);
                }
        }
-       
+
        if (tmp == NULL)
                g_string_append (out, "unknown@nodomain.now.au");
-       
+
        /* try use the received header to get the date */
        tmp = camel_header_raw_find (&header, "Received", NULL);
        if (tmp) {
@@ -1137,11 +1137,11 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
                if (tmp)
                        tmp++;
        }
-       
+
        /* if there isn't one, try the Date field */
        if (tmp == NULL)
                tmp = camel_header_raw_find (&header, "Date", NULL);
-       
+
        thetime = camel_header_decode_date (tmp, &offset);
        thetime += ((offset / 100) * (60 * 60)) + (offset % 100) * 60;
        gmtime_r (&thetime, &tm);
@@ -1149,10 +1149,10 @@ camel_mime_message_build_mbox_from (CamelMimeMessage *message)
                                tz_days[tm.tm_wday], tz_months[tm.tm_mon],
                                tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec,
                                tm.tm_year + 1900);
-       
+
        ret = out->str;
        g_string_free (out, FALSE);
-       
+
        return ret;
 }
 
@@ -1172,19 +1172,19 @@ cmm_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int body, int depth)
        printf("%smime-type: %s\n", s, camel_content_type_format(((CamelDataWrapper *)part)->mime_type));
 
        containee = camel_medium_get_content_object((CamelMedium *)part);
-       
+
        if (containee == NULL)
                return;
 
        printf("%scontent class: %s\n", s, ((CamelObject *)containee)->klass->name);
        printf("%scontent mime-type: %s\n", s, camel_content_type_format(((CamelDataWrapper *)containee)->mime_type));
-       
+
        /* using the object types is more accurate than using the mime/types */
        if (CAMEL_IS_MULTIPART(containee)) {
                parts = camel_multipart_get_number((CamelMultipart *)containee);
                for (i = 0; go && i < parts; i++) {
                        CamelMimePart *mpart = camel_multipart_get_part((CamelMultipart *)containee, i);
-                       
+
                        cmm_dump_rec(msg, mpart, body, depth+2);
                }
        } else if (CAMEL_IS_MIME_MESSAGE(containee)) {
@@ -1194,9 +1194,9 @@ cmm_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int body, int depth)
 
 /**
  * camel_mime_message_dump:
- * @msg: 
- * @body: 
- * 
+ * @msg:
+ * @body:
+ *
  * Dump information about the mime message to stdout.
  *
  * If body is TRUE, then dump body content of the message as well (currently unimplemented).
index 61c5b12..1d2c61b 100644 (file)
@@ -6,8 +6,8 @@
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -73,7 +73,7 @@ struct _CamelMimeMessage
 typedef struct {
        CamelMimePartClass parent_class;
 
-       /* Virtual methods */   
+       /* Virtual methods */
 
 } CamelMimeMessageClass;
 
@@ -115,7 +115,7 @@ void                        camel_mime_message_set_recipients     (CamelMimeMess
 void                        camel_mime_message_set_source         (CamelMimeMessage           *message,
                                                                   const char                 *identity);
 const char                 *camel_mime_message_get_source         (CamelMimeMessage           *message);
-                                                                  
+
 
 /* utility functions */
 gboolean                    camel_mime_message_has_8bit_parts     (CamelMimeMessage           *message);
index 61c86e2..6c1ac60 100644 (file)
 #include "camel-seekable-stream.h"
 #include "camel-stream.h"
 
-#define r(x) 
-#define h(x) 
-#define c(x) 
-#define d(x) 
+#define r(x)
+#define h(x)
+#define c(x)
+#define d(x)
 
 /*#define PRESERVE_HEADERS*/
 
@@ -219,7 +219,7 @@ CamelType
 camel_mime_parser_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_object_get_type (), "CamelMimeParser",
                                            sizeof (CamelMimeParser),
@@ -229,7 +229,7 @@ camel_mime_parser_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_parser_init,
                                            (CamelObjectFinalizeFunc) camel_mime_parser_finalise);
        }
-       
+
        return type;
 }
 
@@ -237,7 +237,7 @@ camel_mime_parser_get_type (void)
  * camel_mime_parser_new:
  *
  * Create a new CamelMimeParser object.
- * 
+ *
  * Return value: A new CamelMimeParser widget.
  **/
 CamelMimeParser *
@@ -250,9 +250,9 @@ camel_mime_parser_new (void)
 
 /**
  * camel_mime_parser_filter_add:
- * @m: 
- * @mf: 
- * 
+ * @m:
+ * @mf:
+ *
  * Add a filter that will be applied to any body content before it is passed
  * to the caller.  Filters may be pipelined to perform multi-pass operations
  * on the content, and are applied in the order they were added.
@@ -260,7 +260,7 @@ camel_mime_parser_new (void)
  * Note that filters are only applied to the body content of messages, and once
  * a filter has been set, all content returned by a filter_step() with a state
  * of CAMEL_MIME_PARSER_STATE_BODY will have passed through the filter.
- * 
+ *
  * Return value: An id that may be passed to filter_remove() to remove
  * the filter, or -1 if the operation failed.
  **/
@@ -288,9 +288,9 @@ camel_mime_parser_filter_add(CamelMimeParser *m, CamelMimeFilter *mf)
 
 /**
  * camel_mime_parser_filter_remove:
- * @m: 
- * @id: 
- * 
+ * @m:
+ * @id:
+ *
  * Remove a processing filter from the pipeline.  There is no
  * restriction on the order the filters can be removed.
  **/
@@ -299,7 +299,7 @@ camel_mime_parser_filter_remove(CamelMimeParser *m, int id)
 {
        struct _header_scan_state *s = _PRIVATE(m);
        struct _header_scan_filter *f, *old;
-       
+
        f = (struct _header_scan_filter *)&s->filters;
        while (f && f->next) {
                old = f->next;
@@ -316,13 +316,13 @@ camel_mime_parser_filter_remove(CamelMimeParser *m, int id)
 
 /**
  * camel_mime_parser_header:
- * @m: 
+ * @m:
  * @name: Name of header.
  * @offset: Pointer that can receive the offset of the header in
  * the stream from the start of parsing.
- * 
+ *
  * Lookup a header by name.
- * 
+ *
  * Return value: The header value, or NULL if the header is not
  * defined.
  **/
@@ -340,12 +340,12 @@ camel_mime_parser_header(CamelMimeParser *m, const char *name, int *offset)
 
 /**
  * camel_mime_parser_headers_raw:
- * @m: 
- * 
+ * @m:
+ *
  * Get the list of the raw headers which are defined for the
  * current state of the parser.  These headers are valid
  * until the next call to parser_step(), or parser_drop_step().
- * 
+ *
  * Return value: The raw headers, or NULL if there are no headers
  * defined for the current part or state.  These are READ ONLY.
  **/
@@ -373,11 +373,11 @@ byte_array_to_string(GByteArray *array)
 
 /**
  * camel_mime_parser_preface:
- * @m: 
- * 
+ * @m:
+ *
  * Retrieve the preface text for the current multipart.
  * Can only be used when the state is CAMEL_MIME_PARSER_STATE_MULTIPART_END.
- * 
+ *
  * Return value: The preface text, or NULL if there wasn't any.
  **/
 const char *
@@ -393,12 +393,12 @@ camel_mime_parser_preface(CamelMimeParser *m)
 
 /**
  * camel_mime_parser_postface:
- * @m: 
- * 
+ * @m:
+ *
  * Retrieve the postface text for the current multipart.
  * Only returns valid data when the current state if
  * CAMEL_MIME_PARSER_STATE_MULTIPART_END.
- * 
+ *
  * Return value: The postface text, or NULL if there wasn't any.
  **/
 const char *
@@ -414,15 +414,15 @@ camel_mime_parser_postface(CamelMimeParser *m)
 
 /**
  * camel_mime_parser_from_line:
- * @m: 
- * 
+ * @m:
+ *
  * Get the last scanned "From " line, from a recently scanned from.
  * This should only be called in the CAMEL_MIME_PARSER_STATE_FROM state.  The
  * from line will include the closing \n found (if there was one).
  *
  * The return value will remain valid while in the CAMEL_MIME_PARSER_STATE_FROM
  * state, or any deeper state.
- * 
+ *
  * Return value: The From line, or NULL if called out of context.
  **/
 const char *
@@ -438,9 +438,9 @@ camel_mime_parser_from_line(CamelMimeParser *m)
 
 /**
  * camel_mime_parser_init_with_fd:
- * @m: 
+ * @m:
  * @fd: A valid file descriptor.
- * 
+ *
  * Initialise the scanner with an fd.  The scanner's offsets
  * will be relative to the current file position of the file
  * descriptor.  As a result, seekable descritors should
@@ -458,14 +458,14 @@ camel_mime_parser_init_with_fd(CamelMimeParser *m, int fd)
 
 /**
  * camel_mime_parser_init_with_stream:
- * @m: 
- * @stream: 
- * 
+ * @m:
+ * @stream:
+ *
  * Initialise the scanner with a source stream.  The scanner's
  * offsets will be relative to the current file position of
  * the stream.  As a result, seekable streams should only
  * be seeked using the parser seek function.
- * 
+ *
  * Return value: -1 on error.
  **/
 int
@@ -480,7 +480,7 @@ camel_mime_parser_init_with_stream(CamelMimeParser *m, CamelStream *stream)
  * camel_mime_parser_scan_from:
  * @parser: MIME parser object
  * @scan_from: #TRUE if the scanner should scan From lines.
- * 
+ *
  * Tell the scanner if it should scan "^From " lines or not.
  *
  * If the scanner is scanning from lines, two additional
@@ -496,7 +496,7 @@ void
 camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        s->scan_from = scan_from;
 }
 
@@ -504,7 +504,7 @@ camel_mime_parser_scan_from (CamelMimeParser *parser, gboolean scan_from)
  * camel_mime_parser_scan_pre_from:
  * @parser: MIME parser object
  * @scan_pre_from: #TRUE if we want to get pre-from data.
- * 
+ *
  * Tell the scanner whether we want to know abou the pre-from
  * data during a scan.  If we do, then we may get an additional
  * state CAMEL_MIME_PARSER_STATE_PRE_FROM which returns the specified data.
@@ -513,16 +513,16 @@ void
 camel_mime_parser_scan_pre_from (CamelMimeParser *parser, gboolean scan_pre_from)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        s->scan_pre_from = scan_pre_from;
 }
 
 /**
  * camel_mime_parser_content_type:
  * @parser: MIME parser object
- * 
+ *
  * Get the content type defined in the current part.
- * 
+ *
  * Return value: A content_type structure, or NULL if there
  * is no content-type defined for this part of state of the
  * parser.
@@ -531,20 +531,20 @@ CamelContentType *
 camel_mime_parser_content_type (CamelMimeParser *parser)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        /* FIXME: should this search up until it's found the 'right'
           content-type?  can it? */
        if (s->parts)
                return s->parts->content_type;
-       
+
        return NULL;
 }
 
 /**
  * camel_mime_parser_unstep:
  * @parser: MIME parser object
- * 
- * Cause the last step operation to repeat itself.  If this is 
+ *
+ * Cause the last step operation to repeat itself.  If this is
  * called repeated times, then the same step will be repeated
  * that many times.
  *
@@ -555,14 +555,14 @@ void
 camel_mime_parser_unstep (CamelMimeParser *parser)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        s->unstep++;
 }
 
 /**
  * camel_mime_parser_drop_step:
  * @parser: MIME parser object
- * 
+ *
  * Drop the last step call.  This should only be used
  * in conjunction with seeking of the stream as the
  * stream may be in an undefined state relative to the
@@ -574,20 +574,20 @@ void
 camel_mime_parser_drop_step (CamelMimeParser *parser)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        s->unstep = 0;
        folder_scan_drop_step(s);
 }
 
 /**
  * camel_mime_parser_step:
- * @parser: MIME parser object 
+ * @parser: MIME parser object
  * @databuffer: Pointer to accept a pointer to the data
  * associated with this step (if any).  May be #NULL,
  * in which case datalength is also ingored.
  * @datalength: Pointer to accept a pointer to the data
  * length associated with this step (if any).
- * 
+ *
  * Parse the next part of the MIME message.  If _unstep()
  * has been called, then continue to return the same state
  * for that many calls.
@@ -619,7 +619,7 @@ camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *data
                        databuffer = &dummy;
                        datalength = &dummylength;
                }
-                       
+
                folder_scan_step(s, databuffer, datalength);
        } else
                s->unstep--;
@@ -632,9 +632,9 @@ camel_mime_parser_step (CamelMimeParser *parser, char **databuffer, size_t *data
 /**
  * camel_mime_parser_read:
  * @parser: MIME parser object
- * @databuffer: 
- * @len: 
- * 
+ * @databuffer:
+ * @len:
+ *
  * Read at most @len bytes from the internal mime parser buffer.
  *
  * Returns the address of the internal buffer in @databuffer,
@@ -683,7 +683,7 @@ camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int le
 /**
  * camel_mime_parser_tell:
  * @parser: MIME parser object
- * 
+ *
  * Return the current scanning offset.  The meaning of this
  * value will depend on the current state of the parser.
  *
@@ -697,7 +697,7 @@ camel_mime_parser_read (CamelMimeParser *parser, const char **databuffer, int le
  * CAMEL_MIME_PARSER_STATE_*_END, The position of the character starting
  * the next section of the scan (the last position + 1 of
  * the respective current state).
- * 
+ *
  * Return value: See above.
  **/
 off_t
@@ -711,11 +711,11 @@ camel_mime_parser_tell (CamelMimeParser *parser)
 /**
  * camel_mime_parser_tell_start_headers:
  * @parser: MIME parser object
- * 
+ *
  * Find out the position within the file of where the
  * headers started, this is cached by the parser
  * at the time.
- * 
+ *
  * Return value: The header start position, or -1 if
  * no headers were scanned in the current state.
  **/
@@ -730,10 +730,10 @@ camel_mime_parser_tell_start_headers (CamelMimeParser *parser)
 /**
  * camel_mime_parser_tell_start_from:
  * @parser: MIME parser object
- * 
+ *
  * If the parser is scanning From lines, then this returns
  * the position of the start of the From line.
- * 
+ *
  * Return value: The start of the from line, or -1 if there
  * was no From line, or From lines are not being scanned.
  **/
@@ -748,10 +748,10 @@ camel_mime_parser_tell_start_from (CamelMimeParser *parser)
 /**
  * camel_mime_parser_tell_start_boundary:
  * @parser: MIME parser object
- * 
+ *
  * When parsing a multipart, this returns the start of the last
  * boundary.
- * 
+ *
  * Return value: The start of the boundary, or -1 if there
  * was no boundary encountered yet.
  **/
@@ -768,14 +768,14 @@ camel_mime_parser_tell_start_boundary(CamelMimeParser *parser)
  * @parser: MIME parser object
  * @offset: Number of bytes to offset the seek by.
  * @whence: SEEK_SET, SEEK_CUR, SEEK_END
- * 
+ *
  * Reset the source position to a known value.
  *
  * Note that if the source stream/descriptor was not
  * positioned at 0 to begin with, and an absolute seek
  * is specified (whence != SEEK_CUR), then the seek
  * position may not match the desired seek position.
- * 
+ *
  * Return value: The new seek offset, or -1 on
  * an error (for example, trying to seek on a non-seekable
  * stream or file descriptor).
@@ -784,23 +784,23 @@ off_t
 camel_mime_parser_seek(CamelMimeParser *parser, off_t offset, int whence)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        return folder_seek(s, offset, whence);
 }
 
 /**
  * camel_mime_parser_state:
  * @parser: MIME parser object
- * 
+ *
  * Get the current parser state.
- * 
+ *
  * Return value: The current parser state.
  **/
 camel_mime_parser_state_t
 camel_mime_parser_state (CamelMimeParser *parser)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        return s->state;
 }
 
@@ -809,7 +809,7 @@ camel_mime_parser_state (CamelMimeParser *parser)
  * @mp: MIME parser object
  * @newstate: New state
  * @boundary: Boundary marker for state.
- * 
+ *
  * Pre-load a new parser state.  Used to post-parse multipart content
  * without headers.
  **/
@@ -831,12 +831,12 @@ camel_mime_parser_push_state(CamelMimeParser *mp, camel_mime_parser_state_t news
 /**
  * camel_mime_parser_stream:
  * @parser: MIME parser object
- * 
+ *
  * Get the stream, if any, the parser has been initialised
  * with.  May be used to setup sub-streams, but should not
  * be read from directly (without saving and restoring
  * the seek position in between).
- * 
+ *
  * Return value: The stream from _init_with_stream(), or NULL
  * if the parser is reading from a file descriptor or is
  * uninitialised.
@@ -845,21 +845,21 @@ CamelStream *
 camel_mime_parser_stream (CamelMimeParser *parser)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        return s->stream;
 }
 
 /**
  * camel_mime_parser_fd:
  * @parser: MIME parser object
- * 
+ *
  * Return the file descriptor, if any, the parser has been
  * initialised with.
  *
  * Should not be read from unless the parser it to terminate,
  * or the seek offset can be reset before the next parse
  * step.
- * 
+ *
  * Return value: The file descriptor or -1 if the parser
  * is reading from a stream or has not been initialised.
  **/
@@ -867,7 +867,7 @@ int
 camel_mime_parser_fd (CamelMimeParser *parser)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        return s->fd;
 }
 
@@ -876,7 +876,7 @@ int
 camel_mime_parser_errno (CamelMimeParser *parser)
 {
        struct _header_scan_state *s = _PRIVATE (parser);
-       
+
        return s->ioerrno;
 }
 
@@ -938,7 +938,7 @@ folder_tell(struct _header_scan_state *s)
 }
 
 /*
-  need some way to prime the parser state, so this actually works for 
+  need some way to prime the parser state, so this actually works for
   other than top-level messages
 */
 static off_t
@@ -1075,7 +1075,7 @@ folder_boundary_check(struct _header_scan_state *s, const char *boundary, int *l
                        /* again, make sure we're in range */
                        if (part->boundarylenfinal <= len) {
                                int extra = part->boundarylenfinal - part->boundarylen;
-                               
+
                                /* check the extra stuff on an final boundary, normally -- for mime parts */
                                if (extra>0) {
                                        *lastone = memcmp(&boundary[part->boundarylen],
@@ -1103,34 +1103,34 @@ header_append_mempool(struct _header_scan_state *s, struct _header_scan_stack *h
 {
        struct _camel_header_raw *l, *n;
        char *content;
-       
+
        content = strchr(header, ':');
        if (content) {
                register int len;
                n = e_mempool_alloc(h->pool, sizeof(*n));
                n->next = NULL;
-               
+
                len = content-header;
                n->name = e_mempool_alloc(h->pool, len+1);
                memcpy(n->name, header, len);
                n->name[len] = 0;
-               
+
                content++;
-               
+
                len = s->outptr - content;
                n->value = e_mempool_alloc(h->pool, len+1);
                memcpy(n->value, content, len);
                n->value[len] = 0;
-               
+
                n->offset = offset;
-               
+
                l = (struct _camel_header_raw *)&h->headers;
                while (l->next) {
                        l = l->next;
                }
                l->next = n;
        }
-       
+
 }
 
 #define header_raw_append_parse(a, b, c) (header_append_mempool(s, h, b, c))
@@ -1195,25 +1195,25 @@ folder_scan_header(struct _header_scan_state *s, int *lastone)
                while ((len = folder_read(s))>0 && len >= s->atleast) { /* ensure we have at least enough room here */
                        inptr = s->inptr;
                        inend = s->inend-s->atleast+1;
-                       
+
                        while (inptr<inend) {
                                if (!s->midline) {
                                        if (folder_boundary_check(s, inptr, lastone)) {
                                                if ((s->outptr>s->outbuf))
                                                        goto header_truncated; /* may not actually be truncated */
-                                               
+
                                                goto header_done;
                                        }
                                }
-                               
+
                                start = inptr;
 
                                /* goto next line/sentinal */
                                while ((*inptr++)!='\n')
                                        ;
-                       
+
                                g_assert(inptr<=s->inend+1);
-                               
+
                                /* check for sentinal or real end of line */
                                if (inptr > inend) {
                                        h(printf("not at end of line yet, going further\n"));
@@ -1254,9 +1254,9 @@ folder_scan_header(struct _header_scan_state *s, int *lastone)
                                                        s->outptr--;
 #endif
                                                s->outptr[0] = 0;
-                               
+
                                                h(printf("header '%s' at %d\n", s->outbuf, (int)s->header_start));
-                                               
+
                                                header_raw_append_parse(&h->headers, s->outbuf, s->header_start);
                                                s->outptr = s->outbuf;
                                                s->header_start = -1;
@@ -1278,20 +1278,20 @@ folder_scan_header(struct _header_scan_state *s, int *lastone)
                }
                goto header_truncated;
        }
-       
+
        s->atleast = atleast;
-       
+
        return h;
-       
+
 header_truncated:
        header_append(s, start, inptr);
-       
+
        s->outptr[0] = 0;
        if (s->outbuf == s->outptr)
                goto header_done;
-       
+
        header_raw_append_parse(&h->headers, s->outbuf, s->header_start);
-       
+
        s->outptr = s->outbuf;
 header_done:
        s->inptr = inptr;
@@ -1348,7 +1348,7 @@ folder_scan_content(struct _header_scan_state *s, int *lastone, char **data, siz
                                        /* otherwise, jump to the state of the boundary we actually found */
                                        goto normal_exit;
                                }
-                               
+
                                /* goto the next line */
                                while ((*inptr++)!='\n')
                                        ;
@@ -1648,16 +1648,16 @@ tail_recurse:
                folder_push_part(s, h);
                s->state = type;
                return;
-               
+
        case CAMEL_MIME_PARSER_STATE_HEADER:
                s->state = CAMEL_MIME_PARSER_STATE_BODY;
-               
+
        case CAMEL_MIME_PARSER_STATE_BODY:
                h = s->parts;
                *datalength = 0;
                presize = SCAN_HEAD;
                f = s->filters;
-               
+
                do {
                        hb = folder_scan_content (s, &state, databuffer, datalength);
 
@@ -1677,7 +1677,7 @@ tail_recurse:
                                return;
                        }
                } while (hb == h && *datalength > 0);
-               
+
                /* check for any filter completion data */
                while (f) {
                        camel_mime_filter_complete(f->filter, *databuffer, *datalength, presize,
@@ -1687,10 +1687,10 @@ tail_recurse:
 
                if (*datalength > 0)
                        return;
-               
+
                s->state = CAMEL_MIME_PARSER_STATE_BODY_END;
                break;
-               
+
        case CAMEL_MIME_PARSER_STATE_MULTIPART:
                h = s->parts;
                /* This mess looks for the next boundary on this
@@ -1828,7 +1828,7 @@ int main(int argc, char **argv)
 
                name = argv[i];
                printf("opening: %s", name);
-               
+
                fd = g_open(name, O_RDONLY|O_BINARY, 0);
                if (fd==-1) {
                        perror("Cannot open mailbox");
@@ -1841,7 +1841,7 @@ int main(int argc, char **argv)
                h = g_malloc0(sizeof(*h));
                h->savestate = CAMEL_MIME_PARSER_STATE_EOF;
                folder_push_part(s, h);
-#endif 
+#endif
                while (s->state != CAMEL_MIME_PARSER_STATE_EOF) {
                        folder_scan_step(s, &data, &len);
                        printf("\n -- PARSER STEP RETURN -- %d '%s'\n\n", s->state, states[s->state]);
index a50e9a2..f24b8e5 100644 (file)
@@ -48,11 +48,11 @@ typedef enum _camel_mime_parser_state_t {
        CAMEL_MIME_PARSER_STATE_BODY,           /* scanning body of message */
        CAMEL_MIME_PARSER_STATE_MULTIPART,      /* got multipart header */
        CAMEL_MIME_PARSER_STATE_MESSAGE,        /* rfc822 message */
-       
+
        CAMEL_MIME_PARSER_STATE_PART,           /* part of a multipart */
-       
+
        CAMEL_MIME_PARSER_STATE_END = 8,        /* bit mask for 'end' flags */
-       
+
        CAMEL_MIME_PARSER_STATE_EOF = 8,        /* end of file */
        CAMEL_MIME_PARSER_STATE_PRE_FROM_END,   /* pre from end */
        CAMEL_MIME_PARSER_STATE_FROM_END,       /* end of whole from bracket */
index 4e4ce7f..c695fe0 100644 (file)
@@ -7,8 +7,8 @@
  *
  * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -61,18 +61,18 @@ simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser
        GByteArray *buffer;
        CamelStream *mem;
        size_t len;
-       
+
        d(printf ("simple_data_wrapper_construct_from_parser()\n"));
-       
+
        /* read in the entire content */
        buffer = g_byte_array_new ();
        while (camel_mime_parser_step (mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_BODY_END) {
                d(printf("appending o/p data: %d: %.*s\n", len, len, buf));
                g_byte_array_append (buffer, buf, len);
        }
-       
+
        d(printf("message part kept in memory!\n"));
-       
+
        mem = camel_stream_mem_new_with_byte_array (buffer);
        camel_data_wrapper_construct_from_stream (dw, mem);
        camel_object_unref (mem);
@@ -92,7 +92,7 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParse
        ct = camel_mime_parser_content_type (mp);
 
        encoding = camel_content_transfer_encoding_decode (camel_mime_parser_header (mp, "Content-Transfer-Encoding", NULL));
-       
+
        switch (camel_mime_parser_state (mp)) {
        case CAMEL_MIME_PARSER_STATE_HEADER:
                d(printf("Creating body part\n"));
@@ -118,14 +118,14 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParse
                        content = (CamelDataWrapper *) camel_multipart_signed_new ();
                else
                        content = (CamelDataWrapper *) camel_multipart_new ();
-               
+
                camel_multipart_construct_from_parser((CamelMultipart *)content, mp);
                d(printf("Created multi-part\n"));
                break;
        default:
                g_warning("Invalid state encountered???: %u", camel_mime_parser_state (mp));
        }
-       
+
        if (content) {
                if (encoding)
                        content->encoding = camel_transfer_encoding_from_string (encoding);
index 1e3fa71..e9bb6bf 100644 (file)
@@ -2,15 +2,15 @@
 /* camel-mime-part-utils : Utility for mime parsing and so on */
 
 
-/* 
+/*
  *
- * Author : 
+ * Author :
  *  Bertrand Guiheneuf <bertrand@helixcode.com>
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 26c5d7a..888931e 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
 /* camelMimePart.c : Abstract class for a mime_part */
 
-/* 
+/*
  * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
  *         Michael Zucchi <notzed@ximian.com>
  *          Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -77,7 +77,7 @@ static CamelMediumClass *parent_class=NULL;
 static ssize_t         write_to_stream                 (CamelDataWrapper *dw, CamelStream *stream);
 static int            construct_from_stream           (CamelDataWrapper *dw, CamelStream *stream);
 
-/* from CamelMedium */ 
+/* from CamelMedium */
 static void            add_header                      (CamelMedium *medium, const char *name, const void *value);
 static void            set_header                      (CamelMedium *medium, const char *name, const void *value);
 static void            remove_header                   (CamelMedium *medium, const char *name);
@@ -137,8 +137,8 @@ camel_mime_part_class_init (CamelMimePartClass *camel_mime_part_class)
        init_header_name_table();
 
        camel_mime_part_class->construct_from_parser = construct_from_parser;
-       
-       /* virtual method overload */   
+
+       /* virtual method overload */
        camel_medium_class->add_header                = add_header;
        camel_medium_class->set_header                = set_header;
        camel_medium_class->get_header                = get_header;
@@ -146,7 +146,7 @@ camel_mime_part_class_init (CamelMimePartClass *camel_mime_part_class)
        camel_medium_class->get_headers               = get_headers;
        camel_medium_class->free_headers              = free_headers;
        camel_medium_class->set_content_object        = set_content_object;
-       
+
        camel_data_wrapper_class->write_to_stream     = write_to_stream;
        camel_data_wrapper_class->construct_from_stream= construct_from_stream;
 }
@@ -155,11 +155,11 @@ static void
 camel_mime_part_init (gpointer object, gpointer klass)
 {
        CamelMimePart *mime_part = CAMEL_MIME_PART (object);
-       
+
        if (((CamelDataWrapper *) mime_part)->mime_type)
                camel_content_type_unref (((CamelDataWrapper *) mime_part)->mime_type);
        ((CamelDataWrapper *) mime_part)->mime_type = camel_content_type_new ("text", "plain");
-       
+
        mime_part->description          = NULL;
        mime_part->disposition          = NULL;
        mime_part->content_id           = NULL;
@@ -170,18 +170,18 @@ camel_mime_part_init (gpointer object, gpointer klass)
 }
 
 
-static void           
+static void
 camel_mime_part_finalize (CamelObject *object)
 {
        CamelMimePart *mime_part = CAMEL_MIME_PART (object);
-       
+
        g_free (mime_part->description);
        g_free (mime_part->content_id);
        g_free (mime_part->content_MD5);
        g_free (mime_part->content_location);
        camel_string_list_free (mime_part->content_languages);
        camel_content_disposition_unref(mime_part->disposition);
-       
+
        camel_header_raw_clear(&mime_part->headers);
 }
 
@@ -191,7 +191,7 @@ CamelType
 camel_mime_part_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (CAMEL_MEDIUM_TYPE,
                                            "CamelMimePart",
@@ -202,7 +202,7 @@ camel_mime_part_get_type (void)
                                            (CamelObjectInitFunc) camel_mime_part_init,
                                            (CamelObjectFinalizeFunc) camel_mime_part_finalize);
        }
-       
+
        return type;
 }
 
@@ -267,7 +267,7 @@ static void
 set_header (CamelMedium *medium, const char *name, const void *value)
 {
        CamelMimePart *part = CAMEL_MIME_PART (medium);
-       
+
        process_header(medium, name, value);
        camel_header_raw_replace(&part->headers, name, value, -1);
 }
@@ -276,7 +276,7 @@ static void
 add_header (CamelMedium *medium, const char *name, const void *value)
 {
        CamelMimePart *part = CAMEL_MIME_PART (medium);
-       
+
        /* Try to parse the header pair. If it corresponds to something   */
        /* known, the job is done in the parsing routine. If not,         */
        /* we simply add the header in a raw fashion                      */
@@ -292,7 +292,7 @@ static void
 remove_header (CamelMedium *medium, const char *name)
 {
        CamelMimePart *part = (CamelMimePart *)medium;
-       
+
        process_header(medium, name, NULL);
        camel_header_raw_remove(&part->headers, name);
 }
@@ -342,7 +342,7 @@ void
 camel_mime_part_set_description (CamelMimePart *mime_part, const char *description)
 {
        char *text = camel_header_encode_string (description);
-       
+
        camel_medium_set_header (CAMEL_MEDIUM (mime_part),
                                 "Content-Description", text);
        g_free (text);
@@ -436,7 +436,7 @@ void
 camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename)
 {
        char *str;
-       
+
        if (mime_part->disposition == NULL)
                mime_part->disposition = camel_content_disposition_decode("attachment");
 
@@ -446,7 +446,7 @@ camel_mime_part_set_filename (CamelMimePart *mime_part, const char *filename)
        camel_medium_set_header (CAMEL_MEDIUM (mime_part),
                                 "Content-Disposition", str);
        g_free(str);
-       
+
        camel_content_type_set_param (((CamelDataWrapper *) mime_part)->mime_type, "name", filename);
        str = camel_content_type_format (((CamelDataWrapper *) mime_part)->mime_type);
        camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", str);
@@ -470,7 +470,7 @@ camel_mime_part_get_filename (CamelMimePart *mime_part)
                if (name)
                        return name;
        }
-       
+
        return camel_content_type_param (((CamelDataWrapper *) mime_part)->mime_type, "name");
 }
 
@@ -488,12 +488,12 @@ void
 camel_mime_part_set_content_id (CamelMimePart *mime_part, const char *contentid)
 {
        char *cid, *id;
-       
+
        if (contentid)
                id = g_strstrip (g_strdup (contentid));
        else
                id = camel_header_msgid_generate ();
-       
+
        cid = g_strdup_printf ("<%s>", id);
        g_free (id);
        camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-ID", cid);
@@ -628,7 +628,7 @@ camel_mime_part_set_content_languages (CamelMimePart *mime_part, GList *content_
 {
        if (mime_part->content_languages)
                camel_string_list_free (mime_part->content_languages);
-       
+
        mime_part->content_languages = content_languages;
 
        /* FIXME: translate to a header and set it */
@@ -688,13 +688,13 @@ set_content_object (CamelMedium *medium, CamelDataWrapper *content)
 {
        CamelDataWrapper *mime_part = CAMEL_DATA_WRAPPER (medium);
        CamelContentType *content_type;
-       
+
        parent_class->set_content_object (medium, content);
-       
+
        content_type = camel_data_wrapper_get_mime_type_field (content);
        if (mime_part->mime_type != content_type) {
                char *txt;
-               
+
                txt = camel_content_type_format (content_type);
                camel_medium_set_header (CAMEL_MEDIUM (mime_part), "Content-Type", txt);
                g_free (txt);
@@ -708,7 +708,7 @@ write_references(CamelStream *stream, struct _camel_header_raw *h)
 {
        ssize_t len, out, total;
        char *v, *ids, *ide;
-       
+
        /* this is only approximate, based on the next >, this way it retains any content
           from the original which may not be properly formatted, etc.  It also doesn't handle
           the case where an individual messageid is too long, however thats a bad mail to
@@ -779,17 +779,17 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
        ssize_t total = 0;
        ssize_t count;
        int errnosav;
-       
+
        d(printf("mime_part::write_to_stream\n"));
-       
+
        /* FIXME: something needs to be done about this ... */
        /* TODO: content-languages header? */
-       
+
        if (mp->headers) {
                struct _camel_header_raw *h = mp->headers;
                char *val;
                ssize_t (*writefn)(CamelStream *stream, struct _camel_header_raw *);
-               
+
                /* fold/write the headers.   But dont fold headers that are already formatted
                   (e.g. ones with parameter-lists, that we know about, and have created) */
                while (h) {
@@ -810,12 +810,12 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
                        h = h->next;
                }
        }
-       
+
        count = camel_stream_write(stream, "\n", 1);
        if (count == -1)
                return -1;
        total += count;
-       
+
        content = camel_medium_get_content_object(medium);
        if (content) {
                CamelMimeFilter *filter = NULL;
@@ -825,17 +825,17 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
                const char *part_charset = NULL;
                gboolean reencode = FALSE;
                const char *filename;
-               
+
                if (camel_content_type_is (dw->mime_type, "text", "*")) {
                        content_charset = camel_content_type_param (content->mime_type, "charset");
                        part_charset = camel_content_type_param (dw->mime_type, "charset");
-                       
+
                        if (content_charset && part_charset) {
                                content_charset = e_iconv_charset_name (content_charset);
                                part_charset = e_iconv_charset_name (part_charset);
                        }
                }
-               
+
                if (mp->encoding != content->encoding) {
                        switch (mp->encoding) {
                        case CAMEL_TRANSFER_ENCODING_BASE64:
@@ -858,55 +858,55 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
                                break;
                        }
                }
-               
+
                if (content_charset && part_charset && part_charset != content_charset)
                        charenc = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (content_charset, part_charset);
-               
+
                if (filter || charenc) {
                        filter_stream = camel_stream_filter_new_with_stream(stream);
-                       
+
                        /* if we have a character encoder, add that always */
                        if (charenc) {
                                camel_stream_filter_add(filter_stream, charenc);
                                camel_object_unref (charenc);
                        }
-                       
+
                        /* we only re-do crlf on encoded blocks */
                        if (filter && camel_content_type_is (dw->mime_type, "text", "*")) {
                                CamelMimeFilter *crlf = camel_mime_filter_crlf_new(CAMEL_MIME_FILTER_CRLF_ENCODE,
                                                                                   CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
-                               
+
                                camel_stream_filter_add(filter_stream, crlf);
                                camel_object_unref (crlf);
                        }
-                       
+
                        if (filter) {
                                camel_stream_filter_add(filter_stream, filter);
                                camel_object_unref (filter);
                        }
-                       
+
                        stream = (CamelStream *)filter_stream;
-                       
+
                        reencode = TRUE;
                }
-               
+
                if (reencode)
                        count = camel_data_wrapper_decode_to_stream (content, stream);
                else
                        count = camel_data_wrapper_write_to_stream (content, stream);
-               
+
                if (filter_stream) {
                        errnosav = errno;
                        camel_stream_flush (stream);
                        camel_object_unref (filter_stream);
                        errno = errnosav;
                }
-               
+
                if (count == -1)
                        return -1;
-               
+
                total += count;
-               
+
                if (reencode && mp->encoding == CAMEL_TRANSFER_ENCODING_UUENCODE) {
                        count = camel_stream_write (ostream, "end\n", 4);
                        if (count == -1)
@@ -916,7 +916,7 @@ write_to_stream (CamelDataWrapper *dw, CamelStream *stream)
        } else {
                g_warning("No content for medium, nothing to write");
        }
-       
+
        return total;
 }
 
@@ -930,9 +930,9 @@ construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
        char *buf;
        size_t len;
        int err;
-       
+
        d(printf("mime_part::construct_from_parser()\n"));
-       
+
        switch (camel_mime_parser_step(mp, &buf, &len)) {
        case CAMEL_MIME_PARSER_STATE_MESSAGE:
                /* set the default type of a message always */
@@ -980,7 +980,7 @@ construct_from_parser (CamelMimePart *mime_part, CamelMimeParser *mp)
  * @parser: a #CamelMimeParser object
  *
  * Constructs a MIME part from a parser.
- * 
+ *
  * Returns %0 on success or %-1 on fail
  **/
 int
@@ -1030,13 +1030,13 @@ camel_mime_part_new (void)
  * @data: data to put into the part
  * @length: length of @data
  * @type: Content-Type of the data
- * 
- * Utility function used to set the content of a mime part object to 
+ *
+ * Utility function used to set the content of a mime part object to
  * be the provided data. If @length is 0, this routine can be used as
  * a way to remove old content (in which case @data and @type are
  * ignored and may be %NULL).
  **/
-void 
+void
 camel_mime_part_set_content (CamelMimePart *mime_part,
                             const char *data, int length,
                             const char *type) /* why on earth is the type last? */
index ae3531f..95883df 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
 /* camel-mime-part.h : class for a mime part */
 
-/* 
+/*
  *
  * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
  *         Michael Zucchi <notzed@ximian.com>
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -41,9 +41,9 @@ G_BEGIN_DECLS
 /* Do not change these values directly, you would regret it one day */
 struct _CamelMimePart {
        CamelMedium parent_object;
-       
+
        struct _camel_header_raw *headers; /* mime headers */
-       
+
        /* All fields here are -** PRIVATE **- */
        /* TODO: these should be in a camelcontentinfo */
        char *description;
@@ -57,7 +57,7 @@ struct _CamelMimePart {
 
 typedef struct _CamelMimePartClass {
        CamelMediumClass parent_class;
-       
+
        /* Virtual methods */
        int (*construct_from_parser) (CamelMimePart *, CamelMimeParser *);
 } CamelMimePartClass;
index 0fa72bd..caa567e 100644 (file)
@@ -226,62 +226,62 @@ camel_uuencode_close (unsigned char *in, size_t len, unsigned char *out, unsigne
        register unsigned char *outptr, *bufptr;
        register guint32 saved;
        int uulen, uufill, i;
-       
+
        outptr = out;
-       
+
        if (len > 0)
                outptr += camel_uuencode_step (in, len, out, uubuf, state, save);
-       
+
        uufill = 0;
-       
+
        saved = *save;
        i = *state & 0xff;
        uulen = (*state >> 8) & 0xff;
-       
+
        bufptr = uubuf + ((uulen / 3) * 4);
-       
+
        if (i > 0) {
                while (i < 3) {
                        saved <<= 8 | 0;
                        uufill++;
                        i++;
                }
-               
+
                if (i == 3) {
                        /* convert 3 normal bytes into 4 uuencoded bytes */
                        unsigned char b0, b1, b2;
-                       
+
                        b0 = saved >> 16;
                        b1 = saved >> 8 & 0xff;
                        b2 = saved & 0xff;
-                       
+
                        *bufptr++ = CAMEL_UUENCODE_CHAR ((b0 >> 2) & 0x3f);
                        *bufptr++ = CAMEL_UUENCODE_CHAR (((b0 << 4) | ((b1 >> 4) & 0xf)) & 0x3f);
                        *bufptr++ = CAMEL_UUENCODE_CHAR (((b1 << 2) | ((b2 >> 6) & 0x3)) & 0x3f);
                        *bufptr++ = CAMEL_UUENCODE_CHAR (b2 & 0x3f);
-                       
+
                        i = 0;
                        saved = 0;
                        uulen += 3;
                }
        }
-       
+
        if (uulen > 0) {
                int cplen = ((uulen / 3) * 4);
-               
+
                *outptr++ = CAMEL_UUENCODE_CHAR ((uulen - uufill) & 0xff);
                memcpy (outptr, uubuf, cplen);
                outptr += cplen;
                *outptr++ = '\n';
                uulen = 0;
        }
-       
+
        *outptr++ = CAMEL_UUENCODE_CHAR (uulen & 0xff);
        *outptr++ = '\n';
-       
+
        *save = 0;
        *state = 0;
-       
+
        return outptr - out;
 }
 
@@ -309,44 +309,44 @@ camel_uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned
        unsigned char *inend;
        register guint32 saved;
        int uulen, i;
-       
+
        saved = *save;
        i = *state & 0xff;
        uulen = (*state >> 8) & 0xff;
-       
+
        inptr = in;
        inend = in + len;
-       
+
        outptr = out;
-       
+
        bufptr = uubuf + ((uulen / 3) * 4);
-       
+
        while (inptr < inend) {
                while (uulen < 45 && inptr < inend) {
                        while (i < 3 && inptr < inend) {
                                saved = (saved << 8) | *inptr++;
                                i++;
                        }
-                       
+
                        if (i == 3) {
                                /* convert 3 normal bytes into 4 uuencoded bytes */
                                unsigned char b0, b1, b2;
-                               
+
                                b0 = saved >> 16;
                                b1 = saved >> 8 & 0xff;
                                b2 = saved & 0xff;
-                               
+
                                *bufptr++ = CAMEL_UUENCODE_CHAR ((b0 >> 2) & 0x3f);
                                *bufptr++ = CAMEL_UUENCODE_CHAR (((b0 << 4) | ((b1 >> 4) & 0xf)) & 0x3f);
                                *bufptr++ = CAMEL_UUENCODE_CHAR (((b1 << 2) | ((b2 >> 6) & 0x3)) & 0x3f);
                                *bufptr++ = CAMEL_UUENCODE_CHAR (b2 & 0x3f);
-                               
+
                                i = 0;
                                saved = 0;
                                uulen += 3;
                        }
                }
-               
+
                if (uulen >= 45) {
                        *outptr++ = CAMEL_UUENCODE_CHAR (uulen & 0xff);
                        memcpy (outptr, uubuf, ((uulen / 3) * 4));
@@ -356,10 +356,10 @@ camel_uuencode_step (unsigned char *in, size_t len, unsigned char *out, unsigned
                        bufptr = uubuf;
                }
        }
-       
+
        *save = saved;
        *state = ((uulen & 0xff) << 8) | (i & 0xff);
-       
+
        return outptr - out;
 }
 
@@ -386,10 +386,10 @@ camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *sta
        register guint32 saved;
        gboolean last_was_eoln;
        int uulen, i;
-       
+
        if (*state & CAMEL_UUDECODE_STATE_END)
                return 0;
-       
+
        saved = *save;
        i = *state & 0xff;
        uulen = (*state >> 8) & 0xff;
@@ -397,10 +397,10 @@ camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *sta
                last_was_eoln = TRUE;
        else
                last_was_eoln = FALSE;
-       
+
        inend = in + len;
        outptr = out;
-       
+
        inptr = in;
        while (inptr < inend) {
                if (*inptr == '\n' || last_was_eoln) {
@@ -414,13 +414,13 @@ camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *sta
                        } else {
                                last_was_eoln = TRUE;
                        }
-                       
+
                        inptr++;
                        continue;
                }
-               
+
                ch = *inptr++;
-               
+
                if (uulen > 0) {
                        /* save the byte */
                        saved = (saved << 8) | ch;
@@ -428,12 +428,12 @@ camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *sta
                        if (i == 4) {
                                /* convert 4 uuencoded bytes to 3 normal bytes */
                                unsigned char b0, b1, b2, b3;
-                               
+
                                b0 = saved >> 24;
                                b1 = saved >> 16 & 0xff;
                                b2 = saved >> 8 & 0xff;
                                b3 = saved & 0xff;
-                               
+
                                if (uulen >= 3) {
                                        *outptr++ = CAMEL_UUDECODE_CHAR (b0) << 2 | CAMEL_UUDECODE_CHAR (b1) >> 4;
                                        *outptr++ = CAMEL_UUDECODE_CHAR (b1) << 4 | CAMEL_UUDECODE_CHAR (b2) >> 2;
@@ -446,7 +446,7 @@ camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *sta
                                                *outptr++ = CAMEL_UUDECODE_CHAR (b1) << 4 | CAMEL_UUDECODE_CHAR (b2) >> 2;
                                        }
                                }
-                               
+
                                i = 0;
                                saved = 0;
                                uulen -= 3;
@@ -455,10 +455,10 @@ camel_uudecode_step (unsigned char *in, size_t len, unsigned char *out, int *sta
                        break;
                }
        }
-       
+
        *save = saved;
        *state = (*state & CAMEL_UUDECODE_STATE_MASK) | ((uulen & 0xff) << 8) | (i & 0xff);
-       
+
        return outptr - out;
 }
 
@@ -527,7 +527,7 @@ camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int
        unsigned char c;
        register int sofar = *save;  /* keeps track of how many chars on a line */
        register int last = *statep; /* keeps track if last char to end was a space cr etc */
-       
+
        inptr = in;
        inend = in + len;
        outptr = out;
@@ -562,14 +562,14 @@ camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int
                                        sofar += 3;
                                }
                        }
-                       
+
                        if (camel_mime_is_qpsafe(c)) {
                                if (sofar > 74) {
                                        *outptr++ = '=';
                                        *outptr++ = '\n';
                                        sofar = 0;
                                }
-                               
+
                                /* delay output of space char */
                                if (c==' ' || c=='\t') {
                                        last = c;
@@ -585,7 +585,7 @@ camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int
                                        sofar = 3;
                                } else
                                        sofar += 3;
-                               
+
                                *outptr++ = '=';
                                *outptr++ = tohex[(c >> 4) & 0xf];
                                *outptr++ = tohex[c & 0xf];
@@ -595,7 +595,7 @@ camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int
        }
        *save = sofar;
        *statep = last;
-       
+
        return (outptr - out);
 }
 
@@ -604,7 +604,7 @@ camel_quoted_encode_step (unsigned char *in, size_t len, unsigned char *out, int
   Should it also canonicalise the end of line to CR LF??
 
   Note: Trailing rubbish (at the end of input), like = or =x or =\r will be lost.
-*/ 
+*/
 
 /**
  * camel_quoted_decode_step:
@@ -639,7 +639,7 @@ camel_quoted_decode_step(unsigned char *in, size_t len, unsigned char *out, int
                case 0:
                        while (inptr<inend) {
                                c = *inptr++;
-                               if (c=='=') { 
+                               if (c=='=') {
                                        state = 1;
                                        break;
                                }
@@ -839,7 +839,7 @@ rfc2047_decode_word(const char *in, size_t len)
        size_t inlen, outlen;
        gboolean retried = FALSE;
        iconv_t ic;
-       
+
        d(printf("rfc2047: decoding '%.*s'\n", len, in));
 
        /* quick check to see if this could possibly be a real encoded word */
@@ -847,7 +847,7 @@ rfc2047_decode_word(const char *in, size_t len)
                d(printf("invalid\n"));
                return NULL;
        }
-       
+
        /* skip past the charset to the encoding type */
        inptr = memchr (inptr, '?', inend-inptr);
        if (inptr != NULL && inptr < inend + 2 && inptr[2] == '?') {
@@ -862,7 +862,7 @@ rfc2047_decode_word(const char *in, size_t len)
                case 'B': {
                        int state = 0;
                        unsigned int save = 0;
-                       
+
                        inlen = camel_base64_decode_step((char *)inptr+2, tmplen, decword, &state, &save);
                        /* if state != 0 then error? */
                        break;
@@ -878,27 +878,27 @@ rfc2047_decode_word(const char *in, size_t len)
                        encname = g_alloca (tmplen + 1);
                        memcpy (encname, in + 2, tmplen);
                        encname[tmplen] = '\0';
-                       
+
                        /* rfc2231 updates rfc2047 encoded words...
                         * The ABNF given in RFC 2047 for encoded-words is:
                         *   encoded-word := "=?" charset "?" encoding "?" encoded-text "?="
                         * This specification changes this ABNF to:
                         *   encoded-word := "=?" charset ["*" language] "?" encoding "?" encoded-text "?="
                         */
-                       
+
                        /* trim off the 'language' part if it's there... */
                        p = strchr (encname, '*');
                        if (p)
                                *p = '\0';
-                       
+
                        charset = e_iconv_charset_name (encname);
-                       
+
                        inbuf = decword;
-                       
+
                        outlen = inlen * 6 + 16;
                        outbase = g_alloca (outlen);
                        outbuf = outbase;
-                       
+
                retry:
                        ic = e_iconv_open ("UTF-8", charset);
                        if (ic != (iconv_t) -1) {
@@ -912,24 +912,24 @@ rfc2047_decode_word(const char *in, size_t len)
                        } else {
                                w(g_warning ("Cannot decode charset, header display may be corrupt: %s: %s",
                                             charset, strerror (errno)));
-                               
+
                                if (!retried) {
                                        charset = e_iconv_locale_charset ();
                                        if (!charset)
                                                charset = "iso-8859-1";
-                                       
+
                                        retried = TRUE;
                                        goto retry;
                                }
-                               
+
                                /* we return the encoded word here because we've got to return valid utf8 */
                                decoded = g_strndup (in, inlen);
                        }
                }
        }
-       
+
        d(printf("decoded '%s'\n", decoded));
-       
+
        return decoded;
 }
 
@@ -941,7 +941,7 @@ static GString *
 append_latin1 (GString *out, const char *in, size_t len)
 {
        unsigned int c;
-       
+
        while (len) {
                c = (unsigned int)*in++;
                len--;
@@ -961,30 +961,30 @@ append_8bit (GString *out, const char *inbuf, size_t inlen, const char *charset)
        char *outbase, *outbuf;
        size_t outlen;
        iconv_t ic;
-       
+
        ic = e_iconv_open ("UTF-8", charset);
        if (ic == (iconv_t) -1)
                return FALSE;
 
        outlen = inlen * 6 + 16;
        outbuf = outbase = g_malloc(outlen);
-       
+
        if (e_iconv (ic, &inbuf, &inlen, &outbuf, &outlen) == (size_t) -1) {
                w(g_warning("Conversion to '%s' failed: %s", charset, strerror (errno)));
                g_free(outbase);
                e_iconv_close (ic);
                return FALSE;
        }
-       
+
        e_iconv (ic, NULL, NULL, &outbuf, &outlen);
-       
+
        *outbuf = 0;
        g_string_append(out, outbase);
        g_free(outbase);
        e_iconv_close (ic);
 
        return TRUE;
-       
+
 }
 
 static GString *
@@ -993,7 +993,7 @@ append_quoted_pair (GString *str, const char *in, gssize inlen)
        register const char *inptr = in;
        const char *inend = in + inlen;
        char c;
-       
+
        while (inptr < inend) {
                c = *inptr++;
                if (c == '\\' && inptr < inend)
@@ -1014,9 +1014,9 @@ header_decode_text (const char *in, size_t inlen, int ctext, const char *default
        GString *(* append) (GString *, const char *, gssize);
        char *dword = NULL;
        guint32 mask;
-       
+
        locale_charset = e_iconv_locale_charset ();
-       
+
        if (ctext) {
                mask = (CAMEL_MIME_IS_SPECIAL | CAMEL_MIME_IS_SPACE | CAMEL_MIME_IS_CTRL);
                append = append_quoted_pair;
@@ -1024,7 +1024,7 @@ header_decode_text (const char *in, size_t inlen, int ctext, const char *default
                mask = (CAMEL_MIME_IS_LWSP);
                append = g_string_append_len;
        }
-       
+
        out = g_string_new ("");
        inptr = in;
        inend = inptr + inlen;
@@ -1055,18 +1055,18 @@ header_decode_text (const char *in, size_t inlen, int ctext, const char *default
                } else {
                        if (!chunk)
                                chunk = start;
-                       
+
                        if ((default_charset == NULL || !append_8bit (out, chunk, inptr-chunk, default_charset))
                            && (locale_charset == NULL || !append_8bit(out, chunk, inptr-chunk, locale_charset)))
                                append_latin1(out, chunk, inptr-chunk);
                }
-               
+
                chunk = NULL;
        }
 
        dword = out->str;
        g_string_free (out, FALSE);
-       
+
        return dword;
 }
 
@@ -1109,7 +1109,7 @@ camel_header_format_ctext (const char *in, const char *default_charset)
        return header_decode_text (in, strlen (in), TRUE, default_charset);
 }
 
-/* how long a sequence of pre-encoded words should be less than, to attempt to 
+/* how long a sequence of pre-encoded words should be less than, to attempt to
    fit into a properly folded word.  Only a guide. */
 #define CAMEL_FOLD_PREENCODED (24)
 
@@ -1130,16 +1130,16 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
        buffer = g_alloca (bufflen);
        inlen = len;
        inptr = in;
-       
+
        ascii = g_alloca (bufflen);
-       
+
        if (g_ascii_strcasecmp (type, "UTF-8") != 0)
                ic = e_iconv_open (type, "UTF-8");
-       
+
        while (inlen) {
                size_t convlen, proclen;
                int i;
-               
+
                /* break up words into smaller bits, what we really want is encoded + overhead < 75,
                   but we'll just guess what that means in terms of input chars, and assume its good enough */
 
@@ -1194,9 +1194,9 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
                        }
                        inlen -= (inptr - p);
                }
-               
+
                enclen = out-buffer;
-               
+
                if (enclen) {
                        /* create token */
                        out = ascii;
@@ -1207,13 +1207,13 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
                        out += sprintf (out, "=?%s?Q?", type);
                        out += quoted_encode (buffer, enclen, out, safemask);
                        sprintf (out, "?=");
-                       
+
                        d(printf("converted part = %s\n", ascii));
-                       
+
                        g_string_append (outstring, ascii);
                }
        }
-       
+
        if (ic != (iconv_t) -1)
                e_iconv_close (ic);
 }
@@ -1240,10 +1240,10 @@ camel_header_encode_string (const unsigned char *in)
        char *outstr;
 
        g_return_val_if_fail (g_utf8_validate (in, -1, NULL), NULL);
-       
+
        if (in == NULL)
                return NULL;
-       
+
        /* do a quick us-ascii check (the common case?) */
        while (*inptr) {
                if (*inptr > 127)
@@ -1252,7 +1252,7 @@ camel_header_encode_string (const unsigned char *in)
        }
        if (*inptr == '\0')
                return g_strdup (in);
-       
+
        /* This gets each word out of the input, and checks to see what charset
           can be used to encode it. */
        /* TODO: Work out when to merge subsequent words, or across word-parts */
@@ -1264,7 +1264,7 @@ camel_header_encode_string (const unsigned char *in)
        while (inptr && *inptr) {
                gunichar c;
                const char *newinptr;
-               
+
                newinptr = g_utf8_next_char (inptr);
                c = g_utf8_get_char (inptr);
                if (newinptr == NULL || !g_unichar_validate (c)) {
@@ -1273,7 +1273,7 @@ camel_header_encode_string (const unsigned char *in)
                        inptr++;
                        continue;
                }
-               
+
                if (c < 256 && camel_mime_is_lwsp (c) && !last_was_space) {
                        /* we've reached the end of a 'word' */
                        if (word && !(last_was_encoded && encoding)) {
@@ -1281,7 +1281,7 @@ camel_header_encode_string (const unsigned char *in)
                                g_string_append_len (out, start, word - start);
                                start = word;
                        }
-                       
+
                        switch (encoding) {
                        case 0:
                                g_string_append_len (out, start, inptr - start);
@@ -1290,21 +1290,21 @@ camel_header_encode_string (const unsigned char *in)
                        case 1:
                                if (last_was_encoded)
                                        g_string_append_c (out, ' ');
-                               
+
                                rfc2047_encode_word (out, start, inptr - start, "ISO-8859-1", CAMEL_MIME_IS_ESAFE);
                                last_was_encoded = TRUE;
                                break;
                        case 2:
                                if (last_was_encoded)
                                        g_string_append_c (out, ' ');
-                               
+
                                if (!(charset = camel_charset_best (start, inptr - start)))
                                        charset = "UTF-8";
                                rfc2047_encode_word (out, start, inptr - start, charset, CAMEL_MIME_IS_ESAFE);
                                last_was_encoded = TRUE;
                                break;
                        }
-                       
+
                        last_was_space = TRUE;
                        start = inptr;
                        word = NULL;
@@ -1318,19 +1318,19 @@ camel_header_encode_string (const unsigned char *in)
                } else if (!camel_mime_is_lwsp (c)) {
                        last_was_space = FALSE;
                }
-               
+
                if (!(c < 256 && camel_mime_is_lwsp (c)) && !word)
                        word = inptr;
-               
+
                inptr = newinptr;
        }
-       
+
        if (inptr - start) {
                if (word && !(last_was_encoded && encoding)) {
                        g_string_append_len (out, start, word - start);
                        start = word;
                }
-               
+
                switch (encoding) {
                case 0:
                        g_string_append_len (out, start, inptr - start);
@@ -1338,23 +1338,23 @@ camel_header_encode_string (const unsigned char *in)
                case 1:
                        if (last_was_encoded)
                                g_string_append_c (out, ' ');
-                       
+
                        rfc2047_encode_word (out, start, inptr - start, "ISO-8859-1", CAMEL_MIME_IS_ESAFE);
                        break;
                case 2:
                        if (last_was_encoded)
                                g_string_append_c (out, ' ');
-                       
+
                        if (!(charset = camel_charset_best (start, inptr - start)))
                                charset = "UTF-8";
                        rfc2047_encode_word (out, start, inptr - start, charset, CAMEL_MIME_IS_ESAFE);
                        break;
                }
        }
-       
+
        outstr = out->str;
        g_string_free (out, FALSE);
-       
+
        return outstr;
 }
 
@@ -1415,7 +1415,7 @@ header_encode_phrase_get_words (const unsigned char *in)
        enum _phrase_word_t type;
        int encoding, count = 0;
        GList *words = NULL;
-       
+
        /* break the input into words */
        type = WORD_ATOM;
        last = inptr;
@@ -1424,17 +1424,17 @@ header_encode_phrase_get_words (const unsigned char *in)
        while (inptr && *inptr) {
                gunichar c;
                const char *newinptr;
-               
+
                newinptr = g_utf8_next_char (inptr);
                c = g_utf8_get_char (inptr);
-               
+
                if (!g_unichar_validate (c)) {
                        w(g_warning ("Invalid UTF-8 sequence encountered (pos %d, char '%c'): %s",
                                     (inptr - in), inptr[0], in));
                        inptr++;
                        continue;
                }
-               
+
                inptr = newinptr;
                if (g_unichar_isspace (c)) {
                        if (count > 0) {
@@ -1446,7 +1446,7 @@ header_encode_phrase_get_words (const unsigned char *in)
                                words = g_list_append (words, word);
                                count = 0;
                        }
-                       
+
                        start = inptr;
                        type = WORD_ATOM;
                        encoding = 0;
@@ -1463,10 +1463,10 @@ header_encode_phrase_get_words (const unsigned char *in)
                                encoding = MAX (encoding, 2);
                        }
                }
-               
+
                last = inptr;
        }
-       
+
        if (count > 0) {
                word = g_new0 (struct _phrase_word, 1);
                word->start = start;
@@ -1475,7 +1475,7 @@ header_encode_phrase_get_words (const unsigned char *in)
                word->encoding = encoding;
                words = g_list_append (words, word);
        }
-       
+
        return words;
 }
 
@@ -1487,13 +1487,13 @@ header_encode_phrase_merge_words (GList **wordsp)
        GList *wordl, *nextl, *words = *wordsp;
        struct _phrase_word *word, *next;
        gboolean merged = FALSE;
-       
+
        /* scan the list, checking for words of similar types that can be merged */
        wordl = words;
        while (wordl) {
                word = wordl->data;
                nextl = g_list_next (wordl);
-               
+
                while (nextl) {
                        next = nextl->data;
                        /* merge nodes of the same type AND we are not creating too long a string */
@@ -1506,9 +1506,9 @@ header_encode_phrase_merge_words (GList **wordsp)
                                        words = g_list_remove_link (words, nextl);
                                        g_list_free_1 (nextl);
                                        g_free (next);
-                                       
+
                                        nextl = g_list_next (wordl);
-                                       
+
                                        merged = TRUE;
                                } else {
                                        /* if it is going to be too long, make sure we include the
@@ -1520,12 +1520,12 @@ header_encode_phrase_merge_words (GList **wordsp)
                                break;
                        }
                }
-               
+
                wordl = g_list_next (wordl);
        }
-       
+
        *wordsp = words;
-       
+
        return merged;
 }
 
@@ -1546,34 +1546,34 @@ camel_header_encode_phrase (const unsigned char *in)
        const char *charset;
        GString *out;
        char *outstr;
-       
+
        if (in == NULL)
                return NULL;
-       
+
        words = header_encode_phrase_get_words (in);
        if (!words)
                return NULL;
-       
+
        while (header_encode_phrase_merge_words (&words))
                ;
-       
+
        out = g_string_new ("");
-       
+
        /* output words now with spaces between them */
        wordl = words;
        while (wordl) {
                const char *start;
                size_t len;
-               
+
                word = wordl->data;
-               
+
                /* append correct number of spaces between words */
                if (last_word && !(last_word->type == WORD_2047 && word->type == WORD_2047)) {
                        /* one or both of the words are not encoded so we write the spaces out untouched */
                        len = word->start - last_word->end;
                        out = g_string_append_len (out, last_word->end, len);
                }
-               
+
                switch (word->type) {
                case WORD_ATOM:
                        out = g_string_append_len (out, word->start, word->end - word->start);
@@ -1587,14 +1587,14 @@ camel_header_encode_phrase (const unsigned char *in)
                                    resulting rfc2047 encoded word. */
                                len = word->end - last_word->end;
                                start = last_word->end;
-                               
+
                                /* encoded words need to be separated by linear whitespace */
                                g_string_append_c (out, ' ');
                        } else {
                                len = word->end - word->start;
                                start = word->start;
                        }
-                       
+
                        if (word->encoding == 1) {
                                rfc2047_encode_word (out, start, len, "ISO-8859-1", CAMEL_MIME_IS_PSAFE);
                        } else {
@@ -1604,20 +1604,20 @@ camel_header_encode_phrase (const unsigned char *in)
                        }
                        break;
                }
-               
+
                g_free (last_word);
                wordl = g_list_next (wordl);
-               
+
                last_word = word;
        }
-       
+
        /* and we no longer need the list */
        g_free (word);
        g_list_free (words);
-       
+
        outstr = out->str;
        g_string_free (out, FALSE);
-       
+
        return outstr;
 }
 
@@ -1629,7 +1629,7 @@ decode_token (const char **in)
 {
        const char *inptr = *in;
        const char *start;
-       
+
        header_decode_lwsp (&inptr);
        start = inptr;
        while (camel_mime_is_ttoken (*inptr))
@@ -1723,7 +1723,7 @@ static char *
 header_decode_word (const char **in)
 {
        const char *inptr = *in;
-       
+
        header_decode_lwsp (&inptr);
        if (*inptr == '"') {
                *in = inptr;
@@ -1785,9 +1785,9 @@ hex_decode (const char *in, size_t len)
        const unsigned char *inend = in + len;
        unsigned char *inptr, *outptr;
        char *outbuf;
-       
+
        outptr = outbuf = g_malloc (len + 1);
-       
+
        inptr = (unsigned char *) in;
        while (inptr < inend) {
                if (*inptr == '%') {
@@ -1799,9 +1799,9 @@ hex_decode (const char *in, size_t len)
                } else
                        *outptr++ = *inptr++;
        }
-       
+
        *outptr = '\0';
-       
+
        return outbuf;
 }
 
@@ -1819,7 +1819,7 @@ header_convert(const char *to, const char *from, const char *in, size_t inlen)
 
        outlen = inlen * 6 + 16;
        outbuf = outbase = g_malloc(outlen);
-                       
+
        ret = e_iconv(ic, &in, &inlen, &outbuf, &outlen);
        if (ret != (size_t) -1) {
                e_iconv(ic, NULL, 0, &outbuf, &outlen);
@@ -1843,7 +1843,7 @@ rfc2184_decode (const char *in, size_t len)
        const char *inend = in + len;
        const char *charset;
        char *decoded, *decword, *encoding;
-       
+
        inptr = memchr (inptr, '\'', len);
        if (!inptr)
                return NULL;
@@ -1852,7 +1852,7 @@ rfc2184_decode (const char *in, size_t len)
        memcpy(encoding, in, inptr-in);
        encoding[inptr-in] = 0;
        charset = e_iconv_charset_name (encoding);
-       
+
        inptr = memchr (inptr + 1, '\'', inend - inptr - 1);
        if (!inptr)
                return NULL;
@@ -1902,10 +1902,10 @@ struct _camel_header_param *
 camel_header_set_param (struct _camel_header_param **l, const char *name, const char *value)
 {
        struct _camel_header_param *p = (struct _camel_header_param *)l, *pn;
-       
+
        if (name == NULL)
                return NULL;
-       
+
        while (p->next) {
                pn = p->next;
                if (!g_ascii_strcasecmp (pn->name, name)) {
@@ -2231,7 +2231,7 @@ header_decode_mailbox(const char **in, const char *charset)
                        if (pre) {
                                size_t l = strlen (last);
                                size_t p = strlen (pre);
-                               
+
                                /* dont append ' ' between sucsessive encoded words */
                                if ((l>6 && last[l-2] == '?' && last[l-1] == '=')
                                    && (p>6 && pre[0] == '=' && pre[1] == '?')) {
@@ -2357,7 +2357,7 @@ header_decode_mailbox(const char **in, const char *charset)
                        inptr++;
                } else {
                        w(g_warning("invalid route address, no closing '>': %s", *in));
-               } 
+               }
        } else if (name == NULL && comment != NULL && inptr>comment) { /* check for comment after address */
                char *text, *tmp;
                const char *comstart, *comend;
@@ -2376,7 +2376,7 @@ header_decode_mailbox(const char **in, const char *charset)
                        comend = inptr-1;
                        while (comend > comstart && comend[0] != ')')
                                comend--;
-                       
+
                        if (comend > comstart) {
                                d(printf("  looking at subset '%.*s'\n", comend-comstart, comstart));
                                tmp = g_strndup (comstart, comend-comstart);
@@ -2387,36 +2387,36 @@ header_decode_mailbox(const char **in, const char *charset)
                        }
                }
        }
-       
+
        *in = inptr;
-       
+
        if (addr->len > 0) {
                if (!g_utf8_validate (addr->str, addr->len, NULL)) {
                        /* workaround for invalid addr-specs containing 8bit chars (see bug #42170 for details) */
                        const char *locale_charset;
                        GString *out;
-                       
+
                        locale_charset = e_iconv_locale_charset ();
-                       
+
                        out = g_string_new ("");
-                       
+
                        if ((charset == NULL || !append_8bit (out, addr->str, addr->len, charset))
                            && (locale_charset == NULL || !append_8bit (out, addr->str, addr->len, locale_charset)))
                                append_latin1 (out, addr->str, addr->len);
-                       
+
                        g_string_free (addr, TRUE);
                        addr = out;
                }
-               
+
                address = camel_header_address_new_name(name ? name->str : "", addr->str);
        }
-       
+
        d(printf("got mailbox: %s\n", addr->str));
-       
+
        g_string_free(addr, TRUE);
        if (name)
                g_string_free(name, TRUE);
-       
+
        return address;
 }
 
@@ -2538,22 +2538,22 @@ camel_header_contentid_decode (const char *in)
        gboolean at = FALSE;
        GString *addr;
        char *buf;
-       
+
        d(printf("decoding Content-ID: '%s'\n", in));
-       
+
        header_decode_lwsp (&inptr);
-       
+
        /* some lame mailers quote the Content-Id */
        if (*inptr == '"')
                inptr++;
-       
+
        /* make sure the content-id is not "" which can happen if we get a
         * content-id such as <.@> (which Eudora likes to use...) */
        if ((buf = camel_header_msgid_decode (inptr)) != NULL && *buf)
                return buf;
-       
+
        g_free (buf);
-       
+
        /* ugh, not a valid msg-id - try to get something useful out of it then? */
        inptr = in;
        header_decode_lwsp (&inptr);
@@ -2561,11 +2561,11 @@ camel_header_contentid_decode (const char *in)
                inptr++;
                header_decode_lwsp (&inptr);
        }
-       
+
        /* Eudora has been known to use <.@> as a content-id */
        if (!(buf = header_decode_word (&inptr)) && !strchr (".@", *inptr))
                return NULL;
-       
+
        addr = g_string_new ("");
        header_decode_lwsp (&inptr);
        while (buf != NULL || *inptr == '.' || (*inptr == '@' && !at)) {
@@ -2574,7 +2574,7 @@ camel_header_contentid_decode (const char *in)
                        g_free (buf);
                        buf = NULL;
                }
-               
+
                if (!at) {
                        if (*inptr == '.') {
                                g_string_append_c (addr, *inptr++);
@@ -2588,13 +2588,13 @@ camel_header_contentid_decode (const char *in)
                        g_string_append_c (addr, *inptr++);
                        buf = header_decode_atom (&inptr);
                }
-               
+
                header_decode_lwsp (&inptr);
        }
-       
+
        buf = addr->str;
        g_string_free (addr, FALSE);
-       
+
        return buf;
 }
 
@@ -2641,7 +2641,7 @@ header_references_decode_single (const char **in, struct _camel_header_reference
        struct _camel_header_references *ref;
        const char *inptr = *in;
        char *id, *word;
-       
+
        while (*inptr) {
                header_decode_lwsp (&inptr);
                if (*inptr == '<') {
@@ -2661,7 +2661,7 @@ header_references_decode_single (const char **in, struct _camel_header_reference
                                inptr++; /* Stupid mailer tricks */
                }
        }
-       
+
        *in = inptr;
 }
 
@@ -2670,12 +2670,12 @@ struct _camel_header_references *
 camel_header_references_inreplyto_decode (const char *in)
 {
        struct _camel_header_references *ref = NULL;
-       
+
        if (in == NULL || in[0] == '\0')
                return NULL;
-       
+
        header_references_decode_single (&in, &ref);
-       
+
        return ref;
 }
 
@@ -2684,13 +2684,13 @@ struct _camel_header_references *
 camel_header_references_decode (const char *in)
 {
        struct _camel_header_references *refs = NULL;
-       
+
        if (in == NULL || in[0] == '\0')
                return NULL;
-       
+
        while (*in)
                header_references_decode_single (&in, &refs);
-       
+
        return refs;
 }
 
@@ -2812,7 +2812,7 @@ camel_transfer_encoding_to_string (CamelTransferEncoding encoding)
 {
        if (encoding >= sizeof (encodings) / sizeof (encodings[0]))
                encoding = 0;
-       
+
        return encodings[encoding];
 }
 
@@ -2820,13 +2820,13 @@ CamelTransferEncoding
 camel_transfer_encoding_from_string (const char *string)
 {
        int i;
-       
+
        if (string != NULL) {
                for (i = 0; i < sizeof (encodings) / sizeof (encodings[0]); i++)
                        if (!g_ascii_strcasecmp (string, encodings[i]))
                                return i;
        }
-       
+
        return CAMEL_TRANSFER_ENCODING_DEFAULT;
 }
 
@@ -2879,7 +2879,7 @@ rfc2184_param_cmp(const void *ap, const void *bp)
                else if (a->index < b->index)
                        res = -1;
        }
-               
+
        return res;
 }
 
@@ -2902,7 +2902,7 @@ header_append_param(struct _camel_header_param *last, char *name, char *value)
                g_free(value);
        } else if (g_ascii_strcasecmp (name, "boundary") != 0 && !g_utf8_validate(value, -1, NULL)) {
                const char *charset = e_iconv_locale_charset();
-               
+
                if ((node->value = header_convert("UTF-8", charset?charset:"ISO-8859-1", value, strlen(value)))) {
                        g_free(value);
                } else {
@@ -3033,9 +3033,9 @@ header_encode_param (const unsigned char *in, gboolean *encoded)
        GString *out;
        guint32 c;
        char *str;
-       
+
        *encoded = FALSE;
-       
+
        g_return_val_if_fail (in != NULL, NULL);
 
        /* if we have really broken utf8 passed in, we just treat it as binary data */
@@ -3043,14 +3043,14 @@ header_encode_param (const unsigned char *in, gboolean *encoded)
        charset = camel_charset_best(in, strlen(in));
        if (charset == NULL)
                return g_strdup(in);
-       
+
        if (g_ascii_strcasecmp(charset, "UTF-8") != 0) {
                if ((outbuf = header_convert(charset, "UTF-8", in, strlen(in))))
                        inptr = outbuf;
                else
                        return g_strdup(in);
        }
-       
+
        /* FIXME: set the 'language' as well, assuming we can get that info...? */
        out = g_string_new (charset);
        g_string_append(out, "''");
@@ -3062,11 +3062,11 @@ header_encode_param (const unsigned char *in, gboolean *encoded)
                        g_string_append_printf (out, "%%%c%c", tohex[(c >> 4) & 0xf], tohex[c & 0xf]);
        }
        g_free (outbuf);
-       
+
        str = out->str;
        g_string_free (out, FALSE);
        *encoded = TRUE;
-       
+
        return str;
 }
 
@@ -3074,99 +3074,99 @@ void
 camel_header_param_list_format_append (GString *out, struct _camel_header_param *p)
 {
        int used = out->len;
-       
+
        while (p) {
                gboolean encoded = FALSE;
                gboolean quote = FALSE;
                int here = out->len;
                size_t nlen, vlen;
                char *value;
-               
+
                if (!p->value) {
                        p = p->next;
                        continue;
                }
-               
+
                value = header_encode_param (p->value, &encoded);
                if (!value) {
                        w(g_warning ("appending parameter %s=%s violates rfc2184", p->name, p->value));
                        value = g_strdup (p->value);
                }
-               
+
                if (!encoded) {
                        char *ch;
-                       
+
                        for (ch = value; *ch; ch++) {
                                if (camel_mime_is_tspecial (*ch) || camel_mime_is_lwsp (*ch))
                                        break;
                        }
-                       
+
                        quote = ch && *ch;
                }
-               
+
                nlen = strlen (p->name);
                vlen = strlen (value);
-               
+
                if (used + nlen + vlen > CAMEL_FOLD_SIZE - 8) {
                        out = g_string_append (out, ";\n\t");
                        here = out->len;
                        used = 0;
                } else
                        out = g_string_append (out, "; ");
-               
+
                if (nlen + vlen > CAMEL_FOLD_SIZE - 8) {
                        /* we need to do special rfc2184 parameter wrapping */
                        int maxlen = CAMEL_FOLD_SIZE - (nlen + 8);
                        char *inptr, *inend;
                        int i = 0;
-                       
+
                        inptr = value;
                        inend = value + vlen;
-                       
+
                        while (inptr < inend) {
                                char *ptr = inptr + MIN (inend - inptr, maxlen);
-                               
+
                                if (encoded && ptr < inend) {
                                        /* be careful not to break an encoded char (ie %20) */
                                        char *q = ptr;
                                        int j = 2;
-                                       
+
                                        for ( ; j > 0 && q > inptr && *q != '%'; j--, q--);
                                        if (*q == '%')
                                                ptr = q;
                                }
-                               
+
                                if (i != 0) {
                                        g_string_append (out, ";\n\t");
                                        here = out->len;
                                        used = 0;
                                }
-                               
+
                                g_string_append_printf (out, "%s*%d%s=", p->name, i++, encoded ? "*" : "");
                                if (encoded || !quote)
                                        g_string_append_len (out, inptr, ptr - inptr);
                                else
                                        quote_word (out, TRUE, inptr, ptr - inptr);
-                               
+
                                d(printf ("wrote: %s\n", out->str + here));
-                               
+
                                used += (out->len - here);
-                               
+
                                inptr = ptr;
                        }
                } else {
                        g_string_append_printf (out, "%s%s=", p->name, encoded ? "*" : "");
-                       
+
                        if (encoded || !quote)
                                g_string_append (out, value);
                        else
                                quote_word (out, TRUE, value, vlen);
-                       
+
                        used += (out->len - here);
                }
-               
+
                g_free (value);
-               
+
                p = p->next;
        }
 }
@@ -3245,10 +3245,10 @@ camel_content_type_format (CamelContentType *ct)
 {
        GString *out;
        char *ret;
-       
+
        if (ct == NULL)
                return NULL;
-       
+
        out = g_string_new ("");
        if (ct->type == NULL) {
                g_string_append_printf (out, "text/plain");
@@ -3263,10 +3263,10 @@ camel_content_type_format (CamelContentType *ct)
                g_string_append_printf (out, "%s/%s", ct->type, ct->subtype);
        }
        camel_header_param_list_format_append (out, ct->params);
-       
+
        ret = out->str;
        g_string_free (out, FALSE);
-       
+
        return ret;
 }
 
@@ -3291,7 +3291,7 @@ camel_content_transfer_encoding_decode (const char *in)
 {
        if (in)
                return decode_token (&in);
-       
+
        return NULL;
 }
 
@@ -3398,9 +3398,9 @@ camel_header_format_date(time_t time, int offset)
        time += ((offset / 100) * (60*60)) + (offset % 100)*60;
 
        d(printf("converting date %s", ctime(&time)));
-       
+
        gmtime_r (&time, &tm);
-       
+
        return g_strdup_printf("%s, %02d %s %04d %02d:%02d:%02d %+05d",
                               tz_days[tm.tm_wday],
                               tm.tm_mday, tz_months[tm.tm_mon],
@@ -3671,7 +3671,7 @@ camel_header_raw_append(struct _camel_header_raw **list, const char *name, const
                camel_header_to_decode(value);
        } else if (!g_ascii_strcasecmp(name, "Content-type")) {
                printf("- Decoding content-type\n");
-               camel_content_type_dump(camel_content_type_decode(value));              
+               camel_content_type_dump(camel_content_type_decode(value));
        } else if (!g_ascii_strcasecmp(name, "MIME-Version")) {
                printf("- Decoding mime version\n");
                camel_header_mime_decode(value);
@@ -3792,14 +3792,14 @@ camel_header_msgid_generate (void)
                        name = host;
        } else
                name = "localhost.localdomain";
-       
+
        COUNT_LOCK ();
        msgid = g_strdup_printf ("%d.%d.%d.camel@%s", (int) time (NULL), getpid (), count++, name);
        COUNT_UNLOCK ();
-       
+
        if (ai)
                camel_freeaddrinfo(ai);
-       
+
        return msgid;
 }
 
@@ -3830,7 +3830,7 @@ static struct {
        { "X-Loop", "[ \t]*([^@]+)@?([^ \n\t\r>]*)" },
        /* X-List: gnome-hackers */
        /* X-List: gnome-hackers@gnome.org */
-       { "X-List", "[ \t]*([^@]+)@?([^ \n\t\r>]*)" },  
+       { "X-List", "[ \t]*([^@]+)@?([^ \n\t\r>]*)" },
        /* Sender: owner-gnome-hackers@gnome.org */
        /* Sender: owner-gnome-hacekrs */
        { "Sender", "[ \t]*owner-([^@]+)@?([^ @\n\t\r>]*)" },
@@ -3865,11 +3865,11 @@ mailing_list_init(void)
                if (errcode != 0) {
                        char *errstr;
                        size_t len;
-               
+
                        len = regerror(errcode, &mail_list_magic[i].regex, NULL, 0);
                        errstr = g_malloc0(len + 1);
                        regerror(errcode, &mail_list_magic[i].regex, errstr, len);
-               
+
                        g_warning("Internal error, compiling regex failed: %s: %s", mail_list_magic[i].pattern, errstr);
                        g_free(errstr);
                        failed++;
@@ -3897,10 +3897,10 @@ camel_header_raw_check_mailing_list(struct _camel_header_raw **list)
                if (v != NULL && regexec (&mail_list_magic[i].regex, v, 3, match, 0) == 0 && match[1].rm_so != -1) {
                        int len1, len2;
                        char *mlist;
-                       
+
                        len1 = match[1].rm_eo - match[1].rm_so;
                        len2 = match[2].rm_eo - match[2].rm_so;
-                       
+
                        mlist = g_malloc (len1 + len2 + 2);
                        memcpy (mlist, v + match[1].rm_so, len1);
                        if (len2) {
@@ -3910,7 +3910,7 @@ camel_header_raw_check_mailing_list(struct _camel_header_raw **list)
                        } else {
                                mlist[len1] = '\0';
                        }
-                       
+
                        return mlist;
                }
        }
@@ -4024,7 +4024,7 @@ camel_header_address_add_member(struct _camel_header_address *h, struct _camel_h
                    || h->type == CAMEL_HEADER_ADDRESS_NONE) {
                        h->type = CAMEL_HEADER_ADDRESS_GROUP;
                        camel_header_address_list_append(&h->v.members, member);
-               }                   
+               }
        }
 }
 
@@ -4069,7 +4069,7 @@ static void
 header_address_list_encode_append (GString *out, int encode, struct _camel_header_address *a)
 {
        char *text;
-       
+
        while (a) {
                switch (a->type) {
                case CAMEL_HEADER_ADDRESS_NAME:
@@ -4110,15 +4110,15 @@ camel_header_address_list_encode (struct _camel_header_address *a)
 {
        GString *out;
        char *ret;
-       
+
        if (a == NULL)
                return NULL;
-       
+
        out = g_string_new ("");
        header_address_list_encode_append (out, TRUE, a);
        ret = out->str;
        g_string_free (out, FALSE);
-       
+
        return ret;
 }
 
@@ -4127,16 +4127,16 @@ camel_header_address_list_format (struct _camel_header_address *a)
 {
        GString *out;
        char *ret;
-       
+
        if (a == NULL)
                return NULL;
-       
+
        out = g_string_new ("");
-       
+
        header_address_list_encode_append (out, FALSE, a);
        ret = out->str;
        g_string_free (out, FALSE);
-       
+
        return ret;
 }
 
@@ -4148,10 +4148,10 @@ camel_header_address_fold (const char *in, size_t headerlen)
        GString *out;
        char *ret;
        int i, needunfold = FALSE;
-       
+
        if (in == NULL)
                return NULL;
-       
+
        /* first, check to see if we even need to fold */
        len = headerlen + 2;
        p = in;
@@ -4161,10 +4161,10 @@ camel_header_address_fold (const char *in, size_t headerlen)
                        len += strlen (p);
                        break;
                }
-               
+
                needunfold = TRUE;
                len += n-p;
-               
+
                if (len >= CAMEL_FOLD_SIZE)
                        break;
                len = 0;
@@ -4172,11 +4172,11 @@ camel_header_address_fold (const char *in, size_t headerlen)
        }
        if (len < CAMEL_FOLD_SIZE)
                return g_strdup (in);
-       
+
        /* we need to fold, so first unfold (if we need to), then process */
        if (needunfold)
                inptr = in = camel_header_unfold (in);
-       
+
        out = g_string_new ("");
        outlen = headerlen + 2;
        while (*inptr) {
@@ -4186,9 +4186,9 @@ camel_header_address_fold (const char *in, size_t headerlen)
                } else {
                        len = strlen (inptr);
                }
-               
+
                d(printf("next word '%.*s'\n", len, inptr));
-               
+
                if (outlen + len > CAMEL_FOLD_SIZE) {
                        d(printf("outlen = %d wordlen = %d\n", outlen, len));
                        /* strip trailing space */
@@ -4197,21 +4197,21 @@ camel_header_address_fold (const char *in, size_t headerlen)
                        g_string_append (out, "\n\t");
                        outlen = 1;
                }
-               
+
                outlen += len;
                for (i = 0; i < len; i++) {
                        g_string_append_c (out, inptr[i]);
                }
-               
+
                inptr += len;
        }
        ret = out->str;
        g_string_free (out, FALSE);
-       
+
        if (needunfold)
                g_free ((char *)in);
-       
-       return ret;     
+
+       return ret;
 }
 
 /* simple header folding */
@@ -4240,7 +4240,7 @@ camel_header_fold(const char *in, size_t headerlen)
 
                needunfold = TRUE;
                len += n-p;
-               
+
                if (len >= CAMEL_FOLD_SIZE)
                        break;
                len = 0;
@@ -4292,7 +4292,7 @@ camel_header_fold(const char *in, size_t headerlen)
        if (needunfold)
                g_free((char *)in);
 
-       return ret;     
+       return ret;
 }
 
 char *
index fd5b87f..edff1c4 100644 (file)
@@ -417,11 +417,11 @@ solaris_header_write(int fd, struct _camel_header_raw *header)
                        iv[0].iov_len = strlen(header->name);
                        iv[2].iov_base = header->value;
                        iv[2].iov_len = strlen(header->value);
-               
+
                        do {
                                len = writev(fd, iv, 4);
                        } while (len == -1 && errno == EINTR);
-                       
+
                        if (len == -1)
                                return -1;
                        outlen += len;
index bbbc9c2..79083dd 100644 (file)
@@ -1,8 +1,8 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-movemail.h: mbox copy function */
 
-/* 
- * Author: 
+/*
+ * Author:
  *  Dan Winship <danw@ximian.com>
  *
  * Copyright 2000 Ximian, Inc. (www.ximian.com)
index 232e473..6161d43 100644 (file)
@@ -53,7 +53,7 @@ CamelType
 camel_multipart_encrypted_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_multipart_get_type (),
                                            "CamelMultipartEncrypted",
@@ -64,7 +64,7 @@ camel_multipart_encrypted_get_type (void)
                                            (CamelObjectInitFunc) camel_multipart_encrypted_init,
                                            (CamelObjectFinalizeFunc) camel_multipart_encrypted_finalize);
        }
-       
+
        return type;
 }
 
@@ -73,9 +73,9 @@ static void
 camel_multipart_encrypted_class_init (CamelMultipartEncryptedClass *klass)
 {
        CamelDataWrapperClass *camel_data_wrapper_class = CAMEL_DATA_WRAPPER_CLASS (klass);
-       
+
        parent_class = (CamelMultipartClass *) camel_multipart_get_type ();
-       
+
        /* virtual method overload */
        camel_data_wrapper_class->set_mime_type_field = set_mime_type_field;
 }
@@ -84,9 +84,9 @@ static void
 camel_multipart_encrypted_init (gpointer object, gpointer klass)
 {
        CamelMultipartEncrypted *multipart = (CamelMultipartEncrypted *) object;
-       
+
        camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (multipart), "multipart/encrypted");
-       
+
        multipart->decrypted = NULL;
 }
 
@@ -94,9 +94,9 @@ static void
 camel_multipart_encrypted_finalize (CamelObject *object)
 {
        CamelMultipartEncrypted *mpe = (CamelMultipartEncrypted *) object;
-       
+
        g_free (mpe->protocol);
-       
+
        if (mpe->decrypted)
                camel_object_unref (mpe->decrypted);
 }
@@ -106,15 +106,15 @@ static void
 set_mime_type_field (CamelDataWrapper *data_wrapper, CamelContentType *mime_type)
 {
        CamelMultipartEncrypted *mpe = (CamelMultipartEncrypted *) data_wrapper;
-       
+
        if (mime_type) {
                const char *protocol;
-               
+
                protocol = camel_content_type_param (mime_type, "protocol");
                g_free (mpe->protocol);
                mpe->protocol = g_strdup (protocol);
        }
-       
+
        ((CamelDataWrapperClass *) parent_class)->set_mime_type_field (data_wrapper, mime_type);
 }
 
@@ -133,8 +133,8 @@ CamelMultipartEncrypted *
 camel_multipart_encrypted_new (void)
 {
        CamelMultipartEncrypted *multipart;
-       
+
        multipart = (CamelMultipartEncrypted *) camel_object_new (CAMEL_MULTIPART_ENCRYPTED_TYPE);
-       
+
        return multipart;
 }
index c897775..5d15a36 100644 (file)
@@ -44,17 +44,17 @@ enum {
 
 struct _CamelMultipartEncrypted {
        CamelMultipart parent_object;
-       
+
        CamelMimePart *version;
        CamelMimePart *content;
        CamelMimePart *decrypted;
-       
+
        char *protocol;
 };
 
 struct _CamelMultipartEncryptedClass {
        CamelMultipartClass parent_class;
-       
+
 };
 
 CamelType camel_multipart_encrypted_get_type (void);
index 4fa802e..7d9a42c 100644 (file)
@@ -1,5 +1,5 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 
- * camel-multipart.c : Abstract class for a multipart 
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ * camel-multipart.c : Abstract class for a multipart
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
@@ -284,7 +284,7 @@ parse_content(CamelMultipartSigned *mps)
 
        if (state == CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
                mps->end2 = camel_mime_parser_tell_start_boundary(cmp);
-               
+
                camel_multipart_set_preface(mp, camel_mime_parser_preface(cmp));
                camel_multipart_set_postface(mp, camel_mime_parser_postface(cmp));
        }
@@ -497,7 +497,7 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
        const char *boundary;
        ssize_t total = 0;
        ssize_t count;
-       
+
        /* we have 3 basic cases:
           1. constructed, we write out the data wrapper stream we got
           2. signed content, we create and write out a new stream
@@ -536,7 +536,7 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
        if (count == -1)
                return -1;
        total += count;
-       
+
        /* boundary */
        count = camel_stream_printf(stream, "\n--%s\n", boundary);
        if (count == -1)
@@ -563,7 +563,7 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
                total += count;
        }
 
-       return total;   
+       return total;
 }
 
 
@@ -600,7 +600,7 @@ camel_multipart_signed_get_content_stream(CamelMultipartSigned *mps, CamelExcept
                sub = camel_seekable_substream_new((CamelSeekableStream *)((CamelDataWrapper *)mps)->stream, mps->start1, mps->end1);
                constream = (CamelStream *)camel_stream_filter_new_with_stream(sub);
                camel_object_unref((CamelObject *)sub);
-               
+
                /* Note: see rfc2015 or rfc3156, section 5 */
                canon_filter = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF);
                camel_stream_filter_add((CamelStreamFilter *)constream, (CamelMimeFilter *)canon_filter);
index 1f6bfd3..b04a990 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * camel-signed--multipart.h : class for a signed-multipart 
+ * camel-signed--multipart.h : class for a signed-multipart
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
index cb3c8e0..6dae3f2 100644 (file)
@@ -447,10 +447,10 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
 
        /* get the bundary text */
        boundary = camel_multipart_get_boundary (multipart);
-       
+
        /* we cannot write a multipart without a boundary string */
        g_return_val_if_fail (boundary, -1);
-       
+
        /*
         * write the preface text (usually something like
         *   "This is a mime message, if you see this, then
@@ -502,7 +502,7 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
  * camel_multipart_set_preface:
  * @multipart: a #CamelMultipart object
  * @preface: the multipart preface
- * 
+ *
  * Set the preface text for this multipart.  Will be written out infront
  * of the multipart.  This text should only include US-ASCII strings, and
  * be relatively short, and will be ignored by any MIME mail client.
@@ -523,7 +523,7 @@ camel_multipart_set_preface(CamelMultipart *multipart, const char *preface)
  * camel_multipart_set_postface:
  * @multipart: a #CamelMultipart object
  * @postface: multipat postface
- * 
+ *
  * Set the postfix text for this multipart.  Will be written out after
  * the last boundary of the multipart, and ignored by any MIME mail
  * client.
@@ -550,16 +550,16 @@ construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
        CamelMimePart *bodypart;
        char *buf;
        size_t len;
-       
+
        g_assert(camel_mime_parser_state(mp) == CAMEL_MIME_PARSER_STATE_MULTIPART);
-       
+
        /* FIXME: we should use a came-mime-mutlipart, not jsut a camel-multipart, but who cares */
        d(printf("Creating multi-part\n"));
-               
+
        content_type = camel_mime_parser_content_type(mp);
        camel_multipart_set_boundary(multipart,
                                     camel_content_type_param(content_type, "boundary"));
-       
+
        while (camel_mime_parser_step(mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
                camel_mime_parser_unstep(mp);
                bodypart = camel_mime_part_new();
@@ -567,11 +567,11 @@ construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
                camel_multipart_add_part(multipart, bodypart);
                camel_object_unref((CamelObject *)bodypart);
        }
-       
+
        /* these are only return valid data in the MULTIPART_END state */
        camel_multipart_set_preface(multipart, camel_mime_parser_preface (mp));
        camel_multipart_set_postface(multipart, camel_mime_parser_postface (mp));
-       
+
        err = camel_mime_parser_errno(mp);
        if (err != 0) {
                errno = err;
index 36b2d7b..9b28b13 100644 (file)
@@ -6,8 +6,8 @@
  *
  * Copyright (C) 2004 Ximian Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -204,7 +204,7 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
        struct addrinfo hints, *res;
        int retval, len;
        char *addr;
-       
+
        memset (&hints, 0, sizeof (struct addrinfo));
 #ifdef HAVE_AI_ADDRCONFIG
        hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
@@ -214,49 +214,49 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
        hints.ai_family = PF_UNSPEC;
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_protocol = IPPROTO_TCP;
-       
+
        if ((retval = getaddrinfo (name, NULL, &hints, &res)) != 0) {
                *herr = ai_to_herr (retval);
                return -1;
        }
-       
+
        len = ALIGN (strlen (res->ai_canonname) + 1);
        if (buflen < IPv6_BUFLEN_MIN + len + res->ai_addrlen + sizeof (char *))
                return ERANGE;
-       
+
        /* h_name */
        strcpy (buf, res->ai_canonname);
        host->h_name = buf;
        buf += len;
-       
+
        /* h_aliases */
        ((char **) buf)[0] = NULL;
        host->h_aliases = (char **) buf;
        buf += sizeof (char *);
-       
+
        /* h_addrtype and h_length */
        host->h_length = res->ai_addrlen;
        if (res->ai_family == PF_INET6) {
                host->h_addrtype = AF_INET6;
-               
+
                addr = (char *) &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr;
        } else {
                host->h_addrtype = AF_INET;
-               
+
                addr = (char *) &((struct sockaddr_in *) res->ai_addr)->sin_addr;
        }
-       
+
        memcpy (buf, addr, host->h_length);
        addr = buf;
        buf += ALIGN (host->h_length);
-       
+
        /* h_addr_list */
        ((char **) buf)[0] = addr;
        ((char **) buf)[1] = NULL;
        host->h_addr_list = (char **) buf;
-       
+
        freeaddrinfo (res);
-       
+
        return 0;
 #else /* No support for IPv6 addresses */
 #ifdef HAVE_GETHOSTBYNAME_R
@@ -268,7 +268,7 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
 #else
        struct hostent *hp;
        int retval;
-       
+
        retval = gethostbyname_r (name, host, buf, buflen, &hp, herr);
        if (hp != NULL) {
                *herr = 0;
@@ -282,26 +282,26 @@ camel_gethostbyname_r (const char *name, struct hostent *host,
                 */
                retval = -1;
        }
-       
+
        return retval;
 #endif
 #else /* No support for gethostbyname_r */
        struct hostent *h;
-       
+
        G_LOCK (gethost_mutex);
-       
+
        h = gethostbyname (name);
-       
+
        if (!h) {
                *herr = h_errno;
                G_UNLOCK (gethost_mutex);
                return -1;
        }
-       
+
        GETHOST_PROCESS (h, host, buf, buflen, herr);
-       
+
        G_UNLOCK (gethost_mutex);
-       
+
        return 0;
 #endif /* HAVE_GETHOSTBYNAME_R */
 #endif /* ENABLE_IPv6 */
@@ -313,38 +313,38 @@ camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *
 {
 #ifdef ENABLE_IPv6
        int retval, len;
-       
+
        if ((retval = getnameinfo (addr, addrlen, buf, buflen, NULL, 0, NI_NAMEREQD)) != 0) {
                *herr = ai_to_herr (retval);
                return -1;
        }
-       
+
        len = ALIGN (strlen (buf) + 1);
        if (buflen < IPv6_BUFLEN_MIN + len + addrlen + sizeof (char *))
                return ERANGE;
-       
+
        /* h_name */
        host->h_name = buf;
        buf += len;
-       
+
        /* h_aliases */
        ((char **) buf)[0] = NULL;
        host->h_aliases = (char **) buf;
        buf += sizeof (char *);
-       
+
        /* h_addrtype and h_length */
        host->h_length = addrlen;
        host->h_addrtype = type;
-       
+
        memcpy (buf, addr, host->h_length);
        addr = buf;
        buf += ALIGN (host->h_length);
-       
+
        /* h_addr_list */
        ((char **) buf)[0] = addr;
        ((char **) buf)[1] = NULL;
        host->h_addr_list = (char **) buf;
-       
+
        return 0;
 #else /* No support for IPv6 addresses */
 #ifdef HAVE_GETHOSTBYADDR_R
@@ -356,7 +356,7 @@ camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *
 #else
        struct hostent *hp;
        int retval;
-       
+
        retval = gethostbyaddr_r (addr, addrlen, type, host, buf, buflen, &hp, herr);
        if (hp != NULL) {
                *herr = 0;
@@ -371,26 +371,26 @@ camel_gethostbyaddr_r (const char *addr, int addrlen, int type, struct hostent *
                 */
                retval = -1;
        }
-       
+
        return retval;
 #endif
 #else /* No support for gethostbyaddr_r */
        struct hostent *h;
-       
+
        G_LOCK (gethost_mutex);
-       
+
        h = gethostbyaddr (addr, addrlen, type);
-       
+
        if (!h) {
                *herr = h_errno;
                G_UNLOCK (gethost_mutex);
                return -1;
        }
-       
+
        GETHOST_PROCESS (h, host, buf, buflen, herr);
-       
+
        G_UNLOCK (gethost_mutex);
-       
+
        return 0;
 #endif /* HAVE_GETHOSTBYADDR_R */
 #endif /* ENABLE_IPv6 */
@@ -450,7 +450,7 @@ cs_waitinfo(void *(worker)(void *), struct _addrinfo_msg *msg, const char *error
                worker(msg);
                return 0;
        }
-       
+
        reply_port = msg->msg.reply_port = e_msgport_new();
        fd = e_msgport_fd(msg->msg.reply_port);
        if ((err = pthread_create(&id, NULL, worker, msg)) == 0) {
@@ -496,7 +496,7 @@ cs_waitinfo(void *(worker)(void *), struct _addrinfo_msg *msg, const char *error
                                                     );
                        else
                                camel_exception_setv(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Canceled"));
-                       
+
                        /* We cancel so if the thread impl is decent it causes immediate exit.
                           We detach so we dont need to wait for it to exit if it isn't.
                           We check the reply port incase we had a reply in the mean time, which we free later */
@@ -540,7 +540,7 @@ cs_getaddrinfo(void *data)
                 msg->hostbuflen *= 2;
                 msg->hostbufmem = g_realloc(msg->hostbufmem, msg->hostbuflen);
        }
-       
+
        /* If we got cancelled, dont reply, just free it */
        if (msg->cancelled)
                goto cancel;
@@ -635,13 +635,13 @@ cs_getaddrinfo(void *data)
        struct _addrinfo_msg *info = data;
 
        info->result = getaddrinfo(info->name, info->service, info->hints, info->res);
-       
+
        if (info->cancelled) {
                cs_freeinfo(info);
        } else {
                e_msgport_reply((EMsg *)info);
        }
-       
+
        return NULL;
 }
 #endif /* NEED_ADDRINFO */
@@ -655,7 +655,7 @@ camel_getaddrinfo(const char *name, const char *service, const struct addrinfo *
        struct addrinfo myhints;
 #endif
        g_return_val_if_fail(name != NULL, NULL);
-       
+
        if (camel_operation_cancel_check(NULL)) {
                camel_exception_set(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Canceled"));
                return NULL;
@@ -669,7 +669,7 @@ camel_getaddrinfo(const char *name, const char *service, const struct addrinfo *
                memset(&myhints, 0, sizeof(myhints));
        else
                memcpy (&myhints, hints, sizeof (myhints));
-       
+
        myhints.ai_family = AF_INET;
        hints = &myhints;
 #endif
@@ -682,16 +682,16 @@ camel_getaddrinfo(const char *name, const char *service, const struct addrinfo *
 #ifdef NEED_ADDRINFO
        msg->hostbuflen = 1024;
        msg->hostbufmem = g_malloc(msg->hostbuflen);
-#endif 
+#endif
        if (cs_waitinfo(cs_getaddrinfo, msg, _("Host lookup failed"), ex) == 0) {
                if (msg->result != 0)
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: %s: %s"),
                                              name, gai_strerror (msg->result));
-               
+
                cs_freeinfo(msg);
        } else
                res = NULL;
-       
+
        camel_operation_end(NULL);
 
        return res;
@@ -737,7 +737,7 @@ cs_getnameinfo(void *data)
                 msg->hostbuflen *= 2;
                 msg->hostbufmem = g_realloc(msg->hostbufmem, msg->hostbuflen);
        }
-       
+
        if (msg->cancelled)
                goto cancel;
 
@@ -747,7 +747,7 @@ cs_getnameinfo(void *data)
                        msg->host = g_strdup(h.h_name);
                } else {
                        unsigned char *in = (unsigned char *)&sin->sin_addr;
-                       
+
                        /* sin_addr is always network order which is big-endian */
                        msg->host = g_strdup_printf("%u.%u.%u.%u", in[0], in[1], in[2], in[3]);
                }
@@ -771,7 +771,7 @@ cs_getnameinfo(void *data)
 
        /* there doens't appear to be a return code which says host or serv buffers are too short, lengthen them */
        msg->result = getnameinfo(msg->addr, msg->addrlen, msg->host, msg->hostlen, msg->serv, msg->servlen, msg->flags);
-       
+
        if (msg->cancelled)
                cs_freeinfo(msg);
        else
index 1384059..e978830 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * 
+ *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *         Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright (C) 2004 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 42145ed..15aacce 100644 (file)
@@ -36,7 +36,7 @@ CamelType
 camel_news_address_get_type (void)
 {
        static guint type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_address_get_type (), "CamelNewsAddress",
                                            sizeof (CamelNewsAddress),
@@ -46,7 +46,7 @@ camel_news_address_get_type (void)
                                            NULL,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -54,7 +54,7 @@ camel_news_address_get_type (void)
  * camel_news_address_new:
  *
  * Create a new CamelNewsAddress object.
- * 
+ *
  * Return value: A new CamelNewsAddress widget.
  **/
 CamelNewsAddress *
index 834bf49..17b69ee 100644 (file)
@@ -65,7 +65,7 @@ CamelType
 camel_nntp_address_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_address_get_type(), "CamelNNTPAddress",
                                           sizeof (CamelNNTPAddress),
@@ -75,7 +75,7 @@ camel_nntp_address_get_type(void)
                                           (CamelObjectInitFunc) camel_nntp_address_init,
                                           NULL);
        }
-       
+
        return type;
 }
 
@@ -92,7 +92,7 @@ nntp_decode(CamelAddress *a, const char *raw)
                        camel_nntp_address_add((CamelNNTPAddress *)a, n->newsgroup);
                camel_header_newsgroups_free(ha);
        }
-       
+
        return a->addresses->len - count;
 }
 
@@ -103,22 +103,22 @@ nntp_encode(CamelAddress *a)
        int i;
        GString *out;
        char *ret;
-       
+
        if (a->addresses->len == 0)
                return NULL;
-       
+
        out = g_string_new("");
-       
+
        for (i = 0;i < a->addresses->len; i++) {
                if (i != 0)
                        g_string_append(out, ", ");
 
                g_string_append(out, g_ptr_array_index(a->addresses, i));
        }
-       
+
        ret = out->str;
        g_string_free(out, FALSE);
-       
+
        return ret;
 }
 
@@ -140,7 +140,7 @@ nntp_remove (CamelAddress *a, int index)
 {
        if (index < 0 || index >= a->addresses->len)
                return;
-       
+
        g_free(g_ptr_array_index(a->addresses, index));
        g_ptr_array_remove_index(a->addresses, index);
 }
@@ -149,7 +149,7 @@ nntp_remove (CamelAddress *a, int index)
  * camel_nntp_address_new:
  *
  * Create a new CamelNNTPAddress object.
- * 
+ *
  * Return value: A new CamelNNTPAddress object.
  **/
 CamelNNTPAddress *
@@ -162,10 +162,10 @@ camel_nntp_address_new (void)
 /**
  * camel_nntp_address_add:
  * @a: nntp address object
- * @name: 
- * 
+ * @name:
+ *
  * Add a new nntp address to the address object.  Duplicates are not added twice.
- * 
+ *
  * Return value: Index of added entry, or existing matching entry.
  **/
 int
@@ -190,9 +190,9 @@ camel_nntp_address_add (CamelNNTPAddress *a, const char *name)
  * @a: nntp address object
  * @index: address's array index
  * @addressp: Holder for the returned address, or NULL, if not required.
- * 
+ *
  * Get the address at @index.
- * 
+ *
  * Return value: TRUE if such an address exists, or FALSE otherwise.
  **/
 gboolean
index 9f12435..ced8f81 100644 (file)
@@ -352,7 +352,7 @@ cobject_meta_get(CamelObject *obj, const char * name)
                }
                camel_object_unget_hooks(obj);
        }
-       
+
        return res;
 }
 
@@ -436,7 +436,7 @@ cobject_state_read(CamelObject *obj, FILE *fp)
 
        for (i=0;i<count;i++) {
                char *name = NULL, *value = NULL;
-                       
+
                if (camel_file_util_decode_string(fp, &name) == 0
                    && camel_file_util_decode_string(fp, &value) == 0) {
                        camel_object_meta_set(obj, name, value);
@@ -460,13 +460,13 @@ cobject_state_read(CamelObject *obj, FILE *fp)
                }
 
                count = MIN(count, CAMEL_ARGV_MAX);
-               
+
                /* we batch up the properties and set them in one go */
                argv = g_try_malloc(sizeof(CamelArgV) -
                        ((CAMEL_ARGV_MAX - count) * sizeof(CamelArg)));
                if (argv == NULL)
                        return -1;
-               
+
                argv->argc = 0;
                for (i=0;i<count;i++) {
                        if (camel_file_util_decode_uint32(fp, &argv->argv[argv->argc].tag) == -1)
@@ -704,7 +704,7 @@ camel_object_get_type(void)
                                                           0, sizeof(CamelInterface),
                                                           cinterface_class_init, cinterface_class_finalise,
                                                           cinterface_init, NULL);
-                                                          
+
        }
 
        return camel_object_type;
@@ -777,7 +777,7 @@ co_type_register(CamelType parent, const char * name,
        klass->object_size = object_size;
        klass->lock = g_mutex_new();
        klass->instance_chunks = e_memchunk_new(8, object_size);
-       
+
        klass->parent = parent;
        if (parent) {
                klass->next = parent->child;
@@ -900,7 +900,7 @@ camel_object_unref(void *vo)
        CamelHookList *hooks = NULL;
 
        g_return_if_fail(CAMEL_IS_OBJECT(o));
-       
+
        klass = o->klass;
 
        if (o->hooks)
@@ -997,7 +997,7 @@ desc_data(CamelObject *o, guint32 ok)
                what = g_strdup_printf("finalised CLASS");
        else if (o->magic == CAMEL_INTERFACE_FINALISED_MAGIC)
                what = g_strdup_printf("finalised INTERFACE");
-       else 
+       else
                what = g_strdup_printf("junk data");
 
        return what;
@@ -1022,7 +1022,7 @@ check_magic_fail(void *o, CamelType ctype, guint32 omagic)
                                what = g_strdup_printf("OBJECT '%s'", ((CamelObject *)o)->klass->name);
                        else
                                what = g_strdup_printf("OBJECT '%s'", ((CamelObjectClass *)o)->name);
-               }               
+               }
                if (to == NULL)
                        to = g_strdup_printf("OBJECT '%s'", ctype->name);
                g_warning("Trying to check %s is %s", what, to);
@@ -1292,10 +1292,10 @@ camel_object_get_hooks(CamelObject *o)
                }
                pthread_mutex_unlock(&lock);
        }
-       
+
        g_static_rec_mutex_lock(&o->hooks->lock);
-       
-       return o->hooks;        
+
+       return o->hooks;
 }
 
 unsigned int
@@ -1468,7 +1468,7 @@ camel_object_trigger_event(void *vo, const char * name, void *event_data)
        pair = co_find_pair_ptr(obj->klass, interface_name);
        if (pair) {
                GPtrArray *interfaces = pair->data;
-               
+
                for (i=0;i<interfaces->len;i++) {
                        hook = co_find_pair(interfaces->pdata[i], name);
                        if (hook)
@@ -1493,7 +1493,7 @@ trigger_interface:
        /* lock the object for hook emission */
        camel_object_ref(obj);
        hooks = camel_object_get_hooks(obj);
-       
+
        if (hooks->list) {
                /* first, copy the items in the list, and say we're in an event */
                hooks->depth++;
@@ -1749,11 +1749,11 @@ co_metadata_free(CamelObject *obj, CamelObjectMeta *meta)
 
 /**
  * camel_object_meta_get:
- * @vo: 
- * @name: 
- * 
+ * @vo:
+ * @name:
+ *
  * Get a meta-data on an object.
- * 
+ *
  * Return value: NULL if the meta-data is not set.
  **/
 char *
@@ -1769,10 +1769,10 @@ camel_object_meta_get(void *vo, const char * name)
 
 /**
  * camel_object_meta_set:
- * @vo: 
+ * @vo:
  * @name: Name of meta-data.  Should be prefixed with class of setter.
  * @value: Value to set.  If NULL, then the meta-data is removed.
- * 
+ *
  * Set a meta-data item on an object.  If the object supports persistent
  * data, then the meta-data will be persistent across sessions.
  *
@@ -1801,10 +1801,10 @@ camel_object_meta_set(void *vo, const char * name, const char *value)
 
 /**
  * camel_object_state_read:
- * @vo: 
- * 
+ * @vo:
+ *
  * Read persistent object state from object_set(CAMEL_OBJECT_STATE_FILE).
- * 
+ *
  * Return value: -1 on error.
  **/
 int camel_object_state_read(void *vo)
@@ -1836,10 +1836,10 @@ int camel_object_state_read(void *vo)
 
 /**
  * camel_object_state_write:
- * @vo: 
- * 
+ * @vo:
+ *
  * Write persistent state to the file as set by object_set(CAMEL_OBJECT_STATE_FILE).
- * 
+ *
  * Return value: -1 on error.
  **/
 int camel_object_state_write(void *vo)
@@ -1887,7 +1887,7 @@ void camel_object_free(void *vo, guint32 tag, void *value)
 
           Add a 'const' bit to the arg type field,
           specifying that the object should not be freed.
-          
+
           And, add free handlers for any pointer objects which are
           not const.  The free handlers would be hookpairs off of the
           class.
@@ -1959,16 +1959,16 @@ camel_object_class_dump_tree(CamelType root)
 
 /**
  * camel_object_bag_new:
- * @hash: 
- * @equal: 
- * @keycopy: 
- * @keyfree: 
- * 
+ * @hash:
+ * @equal:
+ * @keycopy:
+ * @keyfree:
+ *
  * Allocate a new object bag.  Object bag's are key'd hash tables of
  * camel-objects which can be updated atomically using transaction
  * semantics.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 CamelObjectBag *
 camel_object_bag_new(GHashFunc hash, GEqualFunc equal, CamelCopyFunc keycopy, GFreeFunc keyfree)
@@ -2003,7 +2003,7 @@ camel_object_bag_destroy(CamelObjectBag *bag)
        g_hash_table_foreach(bag->object_table, (GHFunc)save_object, objects);
        for (i=0;i<objects->len;i++)
                camel_object_bag_remove(bag, objects->pdata[i]);
-       
+
        g_ptr_array_free(objects, TRUE);
        g_hash_table_destroy(bag->object_table);
        g_hash_table_destroy(bag->key_table);
@@ -2043,10 +2043,10 @@ co_bag_unreserve(CamelObjectBag *bag, const void *key)
 
 /**
  * camel_object_bag_add:
- * @bag: 
- * @key: 
- * @vo: 
- * 
+ * @bag:
+ * @key:
+ * @vo:
+ *
  * Add an object @vo to the object bag @bag.  The @key MUST have
  * previously been reserved using camel_object_bag_reserve().
  **/
@@ -2086,19 +2086,19 @@ camel_object_bag_add(CamelObjectBag *bag, const void *key, void *vo)
        g_hash_table_insert(bag->key_table, vo, k);
 
        co_bag_unreserve(bag, key);
-       
+
        REF_UNLOCK();
        camel_object_unget_hooks(o);
 }
 
 /**
  * camel_object_bag_get:
- * @bag: 
- * @key: 
- * 
+ * @bag:
+ * @key:
+ *
  * Lookup an object by @key.  If the key is currently reserved, then
  * wait until the key has been committed before continuing.
- * 
+ *
  * Return value: NULL if the object corresponding to @key is not
  * in the bag.  Otherwise a ref'd object pointer which the caller owns
  * the ref to.
@@ -2147,21 +2147,21 @@ camel_object_bag_get(CamelObjectBag *bag, const void *key)
                        co_bag_unreserve(bag, key);
                }
        }
-       
+
        REF_UNLOCK();
-       
+
        return o;
 }
 
 /**
  * camel_object_bag_peek:
- * @bag: 
- * @key: 
- * 
+ * @bag:
+ * @key:
+ *
  * Lookup the object @key in @bag, ignoring any reservations.  If it
  * isn't committed, then it isn't considered.  This should only be
  * used where reliable transactional-based state is not required.
- * 
+ *
  * Unlike other 'peek' operations, the object is still reffed if
  * found.
  *
@@ -2188,9 +2188,9 @@ camel_object_bag_peek(CamelObjectBag *bag, const void *key)
 
 /**
  * camel_object_bag_reserve:
- * @bag: 
- * @key: 
- * 
+ * @bag:
+ * @key:
+ *
  * Reserve a key in the object bag.  If the key is already reserved in
  * another thread, then wait until the reservation has been committed.
  *
@@ -2201,8 +2201,8 @@ camel_object_bag_peek(CamelObjectBag *bag, const void *key)
  *
  * You may reserve multiple keys from the same thread, but they should
  * always be reserved in the same order, to avoid deadlocks.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 void *
 camel_object_bag_reserve(CamelObjectBag *bag, const void *key)
@@ -2255,7 +2255,7 @@ camel_object_bag_reserve(CamelObjectBag *bag, const void *key)
                        bag->reserved = res;
                }
        }
-       
+
        REF_UNLOCK();
 
        return o;
@@ -2263,9 +2263,9 @@ camel_object_bag_reserve(CamelObjectBag *bag, const void *key)
 
 /**
  * camel_object_bag_abort:
- * @bag: 
- * @key: 
- * 
+ * @bag:
+ * @key:
+ *
  * Abort a key reservation.
  **/
 void
@@ -2280,10 +2280,10 @@ camel_object_bag_abort(CamelObjectBag *bag, const void *key)
 
 /**
  * camel_object_bag_rekey:
- * @bag: 
- * @o: 
- * @newkey: 
- * 
+ * @bag:
+ * @o:
+ * @newkey:
+ *
  * Re-key an object, atomically.  The key for object @o is set to
  * @newkey, in an atomic manner.
  *
@@ -2378,7 +2378,7 @@ camel_object_bag_remove(CamelObjectBag *inbag, void *vo)
        REF_LOCK();
 
        camel_object_bag_remove_unlocked(inbag, o, hooks);
-               
+
        REF_UNLOCK();
        camel_object_unget_hooks(o);
 }
@@ -2413,7 +2413,7 @@ int camel_iterator_length(void *it)
 {
        g_assert(it);
        g_return_val_if_fail(((CamelIterator *)it)->klass->length != NULL, 0);
-       
+
        return ((CamelIterator *)it)->klass->length(it);
 }
 
index 240386f..0c0b8f4 100644 (file)
@@ -57,7 +57,7 @@ CamelType
 camel_offline_folder_get_type (void)
 {
        static CamelType type = NULL;
-       
+
        if (!type) {
                type = camel_type_register (CAMEL_FOLDER_TYPE,
                                            "CamelOfflineFolder",
@@ -68,7 +68,7 @@ camel_offline_folder_get_type (void)
                                            (CamelObjectInitFunc) camel_offline_folder_init,
                                            (CamelObjectFinalizeFunc) camel_offline_folder_finalize);
        }
-       
+
        return type;
 }
 
@@ -77,26 +77,26 @@ static void
 camel_offline_folder_class_init (CamelOfflineFolderClass *klass)
 {
        int i;
-       
+
        parent_class = (CamelFolderClass *) camel_type_get_global_classfuncs (CAMEL_FOLDER_TYPE);
-       
+
        if (offline_folder_props == NULL) {
                for (i = 0; i < G_N_ELEMENTS (offline_prop_list); i++) {
                        offline_prop_list[i].description = _(offline_prop_list[i].description);
                        offline_folder_props = g_slist_prepend (offline_folder_props, &offline_prop_list[i]);
                }
        }
-       
+
        ((CamelObjectClass *) klass)->getv = offline_folder_getv;
        ((CamelObjectClass *) klass)->setv = offline_folder_setv;
-       
+
        klass->downsync = offline_folder_downsync;
 }
 
 
 struct _offline_downsync_msg {
        CamelSessionThreadMsg msg;
-       
+
        CamelFolder *folder;
        CamelFolderChangeInfo *changes;
 };
@@ -107,13 +107,13 @@ offline_downsync_sync (CamelSession *session, CamelSessionThreadMsg *mm)
        struct _offline_downsync_msg *m = (struct _offline_downsync_msg *) mm;
        CamelMimeMessage *message;
        int i;
-       
+
        camel_operation_start (NULL, _("Downloading new messages for offline mode"));
-       
+
        if (m->changes) {
                for (i = 0; i < m->changes->uid_added->len; i++) {
                        int pc = i * 100 / m->changes->uid_added->len;
-                       
+
                        camel_operation_progress (NULL, pc);
                        if ((message = camel_folder_get_message (m->folder, m->changes->uid_added->pdata[i], &mm->ex)))
                                camel_object_unref (message);
@@ -121,7 +121,7 @@ offline_downsync_sync (CamelSession *session, CamelSessionThreadMsg *mm)
        } else {
                camel_offline_folder_downsync ((CamelOfflineFolder *) m->folder, "(match-all)", &mm->ex);
        }
-       
+
        camel_operation_end (NULL);
 }
 
@@ -129,10 +129,10 @@ static void
 offline_downsync_free (CamelSession *session, CamelSessionThreadMsg *mm)
 {
        struct _offline_downsync_msg *m = (struct _offline_downsync_msg *) mm;
-       
+
        if (m->changes)
                camel_folder_change_info_free (m->changes);
-       
+
        camel_object_unref (m->folder);
 }
 
@@ -146,24 +146,24 @@ offline_folder_changed (CamelFolder *folder, CamelFolderChangeInfo *changes, voi
 {
        CamelOfflineFolder *offline = (CamelOfflineFolder *) folder;
        CamelService *service = (CamelService *) folder->parent_store;
-       
+
        if (changes->uid_added->len > 0 && (offline->sync_offline || camel_url_get_param (service->url, "sync_offline"))) {
                CamelSession *session = service->session;
                struct _offline_downsync_msg *m;
-               
+
                m = camel_session_thread_msg_new (session, &offline_downsync_ops, sizeof (*m));
                m->changes = camel_folder_change_info_new ();
                camel_folder_change_info_cat (m->changes, changes);
                camel_object_ref (folder);
                m->folder = folder;
-               
+
                camel_session_thread_queue (session, &m->msg, 0);
        }
 }
 
 static void
 camel_offline_folder_init (CamelOfflineFolder *folder, CamelOfflineFolderClass *klass)
-{       
+{
        camel_object_hook_event (folder, "folder_changed", (CamelObjectEventHookFunc) offline_folder_changed, NULL);
 }
 
@@ -179,12 +179,12 @@ offline_folder_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args
        CamelArgGetV props;
        int i, count = 0;
        guint32 tag;
-       
+
        for (i = 0; i < args->argc; i++) {
                CamelArgGet *arg = &args->argv[i];
-               
+
                tag = arg->tag;
-               
+
                switch (tag & CAMEL_ARG_TAG) {
                case CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES:
                case CAMEL_FOLDER_ARG_PROPERTIES:
@@ -200,13 +200,13 @@ offline_folder_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args
                        count++;
                        continue;
                }
-               
+
                arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
        }
-       
+
        if (count)
                return ((CamelObjectClass *) parent_class)->getv (object, ex, args);
-       
+
        return 0;
 }
 
@@ -217,12 +217,12 @@ offline_folder_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
        gboolean save = FALSE;
        guint32 tag;
        int i;
-       
+
        for (i = 0; i < args->argc; i++) {
                CamelArg *arg = &args->argv[i];
-               
+
                tag = arg->tag;
-               
+
                switch (tag & CAMEL_ARG_TAG) {
                case CAMEL_OFFLINE_FOLDER_ARG_SYNC_OFFLINE:
                        if (folder->sync_offline != arg->ca_int) {
@@ -233,13 +233,13 @@ offline_folder_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
                default:
                        continue;
                }
-               
+
                arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
        }
-       
+
        if (save)
                camel_object_state_write (object);
-       
+
        return ((CamelObjectClass *) parent_class)->setv (object, ex, args);
 }
 
@@ -250,35 +250,35 @@ offline_folder_downsync (CamelOfflineFolder *offline, const char *expression, Ca
        CamelMimeMessage *message;
        GPtrArray *uids;
        int i;
-       
+
        camel_operation_start (NULL, _("Syncing messages in folder '%s' to disk"), folder->full_name);
-       
+
        if (expression)
                uids = camel_folder_search_by_expression (folder, expression, ex);
        else
                uids = camel_folder_get_uids (folder);
-       
+
        if (!uids) {
                camel_operation_end (NULL);
                return;
        }
-       
+
        for (i = 0; i < uids->len; i++) {
                int pc = i * 100 / uids->len;
-               
+
                message = camel_folder_get_message (folder, uids->pdata[i], ex);
                camel_operation_progress (NULL, pc);
                if (message == NULL)
                        break;
-               
+
                camel_object_unref (message);
        }
-       
+
        if (expression)
                camel_folder_search_free (folder, uids);
        else
                camel_folder_free_uids (folder, uids);
-       
+
        camel_operation_end (NULL);
 }
 
@@ -296,6 +296,6 @@ void
 camel_offline_folder_downsync (CamelOfflineFolder *offline, const char *expression, CamelException *ex)
 {
        g_return_if_fail (CAMEL_IS_OFFLINE_FOLDER (offline));
-       
+
        CAMEL_OFFLINE_FOLDER_GET_CLASS (offline)->downsync (offline, expression, ex);
 }
index 2f82291..b0f6371 100644 (file)
@@ -47,13 +47,13 @@ enum {
 
 struct _CamelOfflineFolder {
        CamelFolder parent_object;
-       
+
        unsigned int sync_offline:1;
 };
 
 struct _CamelOfflineFolderClass {
        CamelFolderClass parent_class;
-       
+
        void (* downsync) (CamelOfflineFolder *folder, const char *expression, CamelException *ex);
 };
 
index bad6b1c..d4c29fb 100644 (file)
@@ -59,7 +59,7 @@ CamelType
 camel_offline_journal_get_type (void)
 {
        static CamelType type = NULL;
-       
+
        if (!type) {
                type = camel_type_register (camel_object_get_type (),
                                            "CamelOfflineJournal",
@@ -70,7 +70,7 @@ camel_offline_journal_get_type (void)
                                            (CamelObjectInitFunc) camel_offline_journal_init,
                                            (CamelObjectFinalizeFunc) camel_offline_journal_finalize);
        }
-       
+
        return type;
 }
 
@@ -93,9 +93,9 @@ camel_offline_journal_finalize (CamelObject *object)
 {
        CamelOfflineJournal *journal = (CamelOfflineJournal *) object;
        EDListNode *entry;
-       
+
        g_free (journal->filename);
-       
+
        while ((entry = e_dlist_remhead (&journal->queue)))
                CAMEL_OFFLINE_JOURNAL_GET_CLASS (journal)->entry_free (journal, entry);
 }
@@ -113,14 +113,14 @@ camel_offline_journal_construct (CamelOfflineJournal *journal, CamelFolder *fold
 {
        EDListNode *entry;
        FILE *fp;
-       
+
        journal->filename = g_strdup (filename);
        journal->folder = folder;
-       
+
        if ((fp = g_fopen (filename, "rb"))) {
                while ((entry = CAMEL_OFFLINE_JOURNAL_GET_CLASS (journal)->entry_load (journal, fp)))
                        e_dlist_addtail (&journal->queue, entry);
-               
+
                fclose (fp);
        }
 }
@@ -137,7 +137,7 @@ void
 camel_offline_journal_set_filename (CamelOfflineJournal *journal, const char *filename)
 {
        g_return_if_fail (CAMEL_IS_OFFLINE_JOURNAL (journal));
-       
+
        g_free (journal->filename);
        journal->filename = g_strdup (filename);
 }
@@ -158,14 +158,14 @@ camel_offline_journal_write (CamelOfflineJournal *journal, CamelException *ex)
        EDListNode *entry;
        FILE *fp;
        int fd;
-       
+
        if ((fd = g_open (journal->filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot write offline journal for folder `%s': %s"),
                                      journal->folder->full_name, g_strerror (errno));
                return -1;
        }
-       
+
        fp = fdopen (fd, "w");
        entry = journal->queue.head;
        while (entry->next) {
@@ -173,22 +173,22 @@ camel_offline_journal_write (CamelOfflineJournal *journal, CamelException *ex)
                        goto exception;
                entry = entry->next;
        }
-       
+
        if (fsync (fd) == -1)
                goto exception;
-       
+
        fclose (fp);
-       
+
        return 0;
-       
+
  exception:
-       
+
        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                              _("Cannot write offline journal for folder `%s': %s"),
                              journal->folder->full_name, g_strerror (errno));
-       
+
        fclose (fp);
-       
+
        return -1;
 }
 
@@ -208,9 +208,9 @@ camel_offline_journal_replay (CamelOfflineJournal *journal, CamelException *ex)
        EDListNode *entry, *next;
        CamelException lex;
        int failed = 0;
-       
+
        camel_exception_init (&lex);
-       
+
        entry = journal->queue.head;
        while (entry->next) {
                next = entry->next;
@@ -224,9 +224,9 @@ camel_offline_journal_replay (CamelOfflineJournal *journal, CamelException *ex)
                }
                entry = next;
        }
-       
+
        if (failed > 0)
                return -1;
-       
+
        return 0;
 }
index 77cd0cf..4d53a66 100644 (file)
@@ -49,7 +49,7 @@ struct _CamelFolder;
 
 struct _CamelOfflineJournal {
        CamelObject parent_object;
-       
+
        struct _CamelFolder *folder;
        char *filename;
        EDList queue;
@@ -57,10 +57,10 @@ struct _CamelOfflineJournal {
 
 struct _CamelOfflineJournalClass {
        CamelObjectClass parent_class;
-       
+
        /* entry methods */
        void (* entry_free) (CamelOfflineJournal *journal, EDListNode *entry);
-       
+
        EDListNode * (* entry_load) (CamelOfflineJournal *journal, FILE *in);
        int (* entry_write) (CamelOfflineJournal *journal, EDListNode *entry, FILE *out);
        int (* entry_play) (CamelOfflineJournal *journal, EDListNode *entry, CamelException *ex);
index ccf3383..2d0d0a0 100644 (file)
@@ -50,7 +50,7 @@ CamelType
 camel_offline_store_get_type (void)
 {
        static CamelType type = NULL;
-       
+
        if (!type) {
                type = camel_type_register (CAMEL_STORE_TYPE,
                                            "CamelOfflineStore",
@@ -61,7 +61,7 @@ camel_offline_store_get_type (void)
                                            (CamelObjectInitFunc) camel_offline_store_init,
                                            (CamelObjectFinalizeFunc) camel_offline_store_finalize);
        }
-       
+
        return type;
 }
 
@@ -70,7 +70,7 @@ static void
 camel_offline_store_class_init (CamelOfflineStoreClass *klass)
 {
        parent_class = (CamelStoreClass *) camel_type_get_global_classfuncs (CAMEL_STORE_TYPE);
-       
+
        ((CamelServiceClass *) klass)->construct = offline_store_construct;
 }
 
@@ -93,11 +93,11 @@ offline_store_construct (CamelService *service, CamelSession *session,
                          CamelException *ex)
 {
        CamelOfflineStore *store = CAMEL_OFFLINE_STORE (service);
-       
+
        CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
        if (camel_exception_is_set (ex))
                return;
-       
+
        store->state = camel_session_is_online (session) ?
                CAMEL_OFFLINE_STORE_NETWORK_AVAIL : CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL;
 }
@@ -121,7 +121,7 @@ camel_offline_store_set_network_state (CamelOfflineStore *store, int state, Came
 
        if (store->state == state)
                return;
-       
+
        camel_exception_init (&lex);
        if (store->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
                /* network available -> network unavailable */
@@ -130,25 +130,25 @@ camel_offline_store_set_network_state (CamelOfflineStore *store, int state, Came
                                GPtrArray *folders;
                                CamelFolder *folder;
                                int i, sync;
-                               
+
                                sync = camel_url_get_param (((CamelService *) store)->url, "sync_offline") != NULL;
-                               
+
                                folders = camel_object_bag_list (((CamelStore *) store)->folders);
                                for (i = 0; i < folders->len; i++) {
                                        folder = folders->pdata[i];
-                                       
+
                                        if (CAMEL_CHECK_TYPE (folder, CAMEL_OFFLINE_FOLDER_TYPE)
                                            && (sync || ((CamelOfflineFolder *) folder)->sync_offline)) {
                                                camel_offline_folder_downsync ((CamelOfflineFolder *) folder, NULL, &lex);
                                                camel_exception_clear (&lex);
                                        }
-                                       
+
                                        camel_object_unref (folder);
                                }
-                               
+
                                g_ptr_array_free (folders, TRUE);
                        }
-                       
+
                        camel_store_sync (CAMEL_STORE (store), FALSE, &lex);
                        camel_exception_clear (&lex);
                }
@@ -160,6 +160,6 @@ camel_offline_store_set_network_state (CamelOfflineStore *store, int state, Came
                if (!camel_service_connect (CAMEL_SERVICE (store), ex))
                        return;
        }
-       
+
        store->state = state;
 }
index 1cd95ba..8482b40 100644 (file)
@@ -49,13 +49,13 @@ enum {
 
 struct _CamelOfflineStore {
        CamelStore parent_object;
-       
+
        int state;
 };
 
 struct _CamelOfflineStoreClass {
        CamelStoreClass parent_class;
-       
+
        void (* set_network_state) (CamelOfflineStore *store, int state, CamelException *ex);
 };
 
index b70b039..ab769e3 100644 (file)
@@ -113,13 +113,13 @@ co_getcc(void)
  * @status: Callback for receiving status messages.  This will always
  * be called with an internal lock held.
  * @status_data: User data.
- * 
+ *
  * Create a new camel operation handle.  Camel operation handles can
  * be used in a multithreaded application (or a single operation
  * handle can be used in a non threaded appliation) to cancel running
  * operations and to obtain notification messages of the internal
  * status of messages.
- * 
+ *
  * Return value: A new operation handle.
  **/
 CamelOperation *
@@ -140,14 +140,14 @@ camel_operation_new (CamelOperationStatusFunc status, void *status_data)
        LOCK();
        e_dlist_addtail(&operation_list, (EDListNode *)cc);
        UNLOCK();
-       
+
        return cc;
 }
 
 /**
  * camel_operation_mute:
- * @cc: 
- * 
+ * @cc:
+ *
  * mutes a camel operation permanently.  from this point on you will never
  * receive operation updates, even if more are sent.
  **/
@@ -179,7 +179,7 @@ camel_operation_registered (void)
 /**
  * camel_operation_ref:
  * @cc: operation context
- * 
+ *
  * Add a reference to the CamelOperation @cc.
  **/
 void
@@ -195,7 +195,7 @@ camel_operation_ref (CamelOperation *cc)
 /**
  * camel_operation_unref:
  * @cc: operation context
- * 
+ *
  * Unref and potentially free @cc.
  **/
 void
@@ -208,14 +208,14 @@ camel_operation_unref (CamelOperation *cc)
        LOCK();
        if (cc->refcount == 1) {
                CamelOperationMsg *msg;
-               
+
                e_dlist_remove((EDListNode *)cc);
 
                while ((msg = (CamelOperationMsg *)e_msgport_get(cc->cancel_port)))
                        g_free(msg);
 
                e_msgport_destroy(cc->cancel_port);
-               
+
                n = cc->status_stack;
                while (n) {
                        g_warning("Camel operation status stack non empty: %s", (char *)n->data);
@@ -234,7 +234,7 @@ camel_operation_unref (CamelOperation *cc)
 /**
  * camel_operation_cancel_block:
  * @cc: operation context
- * 
+ *
  * Block cancellation for this operation.  If @cc is NULL, then the
  * current thread is blocked.
  **/
@@ -254,7 +254,7 @@ camel_operation_cancel_block (CamelOperation *cc)
 /**
  * camel_operation_cancel_unblock:
  * @cc: operation context
- * 
+ *
  * Unblock cancellation, when the unblock count reaches the block
  * count, then this operation can be cancelled.  If @cc is NULL, then
  * the current thread is unblocked.
@@ -275,7 +275,7 @@ camel_operation_cancel_unblock (CamelOperation *cc)
 /**
  * camel_operation_cancel:
  * @cc: operation context
- * 
+ *
  * Cancel a given operation.  If @cc is NULL then all outstanding
  * operations are cancelled.
  **/
@@ -283,7 +283,7 @@ void
 camel_operation_cancel (CamelOperation *cc)
 {
        CamelOperationMsg *msg;
-       
+
        LOCK();
 
        if (cc == NULL) {
@@ -312,7 +312,7 @@ camel_operation_cancel (CamelOperation *cc)
 /**
  * camel_operation_uncancel:
  * @cc: operation context
- * 
+ *
  * Uncancel a cancelled operation.  If @cc is NULL then the current
  * operation is uncancelled.
  *
@@ -341,7 +341,7 @@ camel_operation_uncancel(CamelOperation *cc)
 /**
  * camel_operation_register:
  * @cc: operation context
- * 
+ *
  * Register a thread or the main thread for cancellation through @cc.
  * If @cc is NULL, then a new cancellation is created for this thread.
  *
@@ -365,7 +365,7 @@ camel_operation_register (CamelOperation *cc)
 /**
  * camel_operation_unregister:
  * @cc: operation context
- * 
+ *
  * Unregister the current thread for all cancellations.
  **/
 void
@@ -378,10 +378,10 @@ camel_operation_unregister (CamelOperation *cc)
 /**
  * camel_operation_cancel_check:
  * @cc: operation context
- * 
+ *
  * Check if cancellation has been applied to @cc.  If @cc is NULL,
  * then the CamelOperation registered for the current thread is used.
- * 
+ *
  * Return value: TRUE if the operation has been cancelled.
  **/
 gboolean
@@ -421,10 +421,10 @@ camel_operation_cancel_check (CamelOperation *cc)
 /**
  * camel_operation_cancel_fd:
  * @cc: operation context
- * 
+ *
  * Retrieve a file descriptor that can be waited on (select, or poll)
  * for read, to asynchronously detect cancellation.
- * 
+ *
  * Return value: The fd, or -1 if cancellation is not available
  * (blocked, or has not been registered for this thread).
  **/
@@ -451,10 +451,10 @@ camel_operation_cancel_fd (CamelOperation *cc)
 /**
  * camel_operation_cancel_prfd:
  * @cc: operation context
- * 
+ *
  * Retrieve a file descriptor that can be waited on (select, or poll)
  * for read, to asynchronously detect cancellation.
- * 
+ *
  * Return value: The fd, or NULL if cancellation is not available
  * (blocked, or has not been registered for this thread).
  **/
@@ -483,7 +483,7 @@ camel_operation_cancel_prfd (CamelOperation *cc)
  * @cc: operation context
  * @what: action being performed (printf-style format string)
  * @Varargs: varargs
- * 
+ *
  * Report the start of an operation.  All start operations should have
  * similar end operations.
  **/
@@ -529,7 +529,7 @@ camel_operation_start (CamelOperation *cc, char *what, ...)
  * @cc: operation context
  * @what: printf-style format string describing the action being performed
  * @Varargs: varargs
- * 
+ *
  * Start a transient event.  We only update this to the display if it
  * takes very long to process, and if we do, we then go back to the
  * previous state when finished.
@@ -579,7 +579,7 @@ static unsigned int stamp(void)
  * camel_operation_progress:
  * @cc: Operation to report to.
  * @pc: Percent complete, 0 to 100.
- * 
+ *
  * Report progress on the current operation.  If @cc is NULL, then the
  * currently registered operation is used.  @pc reports the current
  * percentage of completion, which should be in the range of 0 to 100.
@@ -653,8 +653,8 @@ camel_operation_progress_count (CamelOperation *cc, int sofar)
  * camel_operation_end:
  * @cc: operation context
  * @what: Format string.
- * @Varargs: varargs 
- * 
+ * @Varargs: varargs
+ *
  * Report the end of an operation.  If @cc is NULL, then the currently
  * registered operation is notified.
  **/
index 7429060..39d0a6d 100644 (file)
@@ -87,9 +87,9 @@ camel_partition_table_finalise(CamelPartitionTable *cpi)
 
                camel_object_unref((CamelObject *)cpi->blocks);
        }
-       
+
        pthread_mutex_destroy(&p->lock);
-       
+
        g_free(p);
 
 }
@@ -98,7 +98,7 @@ CamelType
 camel_partition_table_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_object_get_type(), "CamelPartitionTable",
                                           sizeof (CamelPartitionTable),
@@ -108,7 +108,7 @@ camel_partition_table_get_type(void)
                                           (CamelObjectInitFunc) camel_partition_table_init,
                                           (CamelObjectFinalizeFunc) camel_partition_table_finalise);
        }
-       
+
        return type;
 }
 
@@ -250,9 +250,9 @@ camel_partition_table_sync(CamelPartitionTable *cpi)
 {
        CamelBlock *bl, *bn;
        int ret = 0;
-       
+
        CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
-       
+
        if (cpi->blocks) {
                bl = (CamelBlock *)cpi->partition.head;
                bn = bl->next;
@@ -308,7 +308,7 @@ camel_key_t camel_partition_table_lookup(CamelPartitionTable *cpi, const char *k
        }
 
        CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
-       
+
        camel_block_file_unref_block(cpi->blocks, block);
 
        return keyid;
@@ -325,7 +325,7 @@ void camel_partition_table_remove(CamelPartitionTable *cpi, const char *key)
        hashid = hash_key(key);
 
        CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
-       
+
        ptblock = find_partition(cpi, hashid, &index);
        if (ptblock == NULL) {
                CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
@@ -344,7 +344,7 @@ void camel_partition_table_remove(CamelPartitionTable *cpi, const char *key)
                if (pkb->keys[i].hashid == hashid) {
                        /* !! need to: lookup and compare string value */
                        /* get_key() if key == key ... */
-                       
+
                        /* remove this key */
                        pkb->used--;
                        for (;i<pkb->used;i++) {
@@ -357,7 +357,7 @@ void camel_partition_table_remove(CamelPartitionTable *cpi, const char *key)
        }
 
        CAMEL_PARTITION_TABLE_UNLOCK(cpi, lock);
-       
+
        camel_block_file_unref_block(cpi->blocks, block);
 }
 
@@ -626,9 +626,9 @@ camel_key_table_finalise(CamelKeyTable *ki)
                camel_block_file_sync(ki->blocks);
                camel_object_unref((CamelObject *)ki->blocks);
        }
-       
+
        pthread_mutex_destroy(&p->lock);
-       
+
        g_free(p);
 
 }
@@ -637,7 +637,7 @@ CamelType
 camel_key_table_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_object_get_type(), "CamelKeyTable",
                                           sizeof (CamelKeyTable),
@@ -647,7 +647,7 @@ camel_key_table_get_type(void)
                                           (CamelObjectInitFunc) camel_key_table_init,
                                           (CamelObjectFinalizeFunc) camel_key_table_finalise);
        }
-       
+
        return type;
 }
 
@@ -931,7 +931,7 @@ camel_key_table_next(CamelKeyTable *ki, camel_key_t next, char **keyp, unsigned
        do {
                blockid =  next & (~(CAMEL_BLOCK_SIZE-1));
                index = next & (CAMEL_BLOCK_SIZE-1);
-               
+
                bl = camel_block_file_get_block(ki->blocks, blockid);
                if (bl == NULL) {
                        CAMEL_KEY_TABLE_UNLOCK(ki, lock);
index 50ecd0d..c09b03c 100644 (file)
@@ -5,8 +5,8 @@
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -115,7 +115,7 @@ struct _CamelFolderSummaryPrivate {
        struct _CamelStreamFilter *filter_stream;
 
        struct _CamelIndex *index;
-       
+
        GMutex *summary_lock;   /* for the summary hashtable/array */
        GMutex *io_lock;        /* load/save lock, for access to saved_count, etc */
        GMutex *filter_lock;    /* for accessing any of the filtering/indexing stuff, since we share them */
@@ -141,7 +141,7 @@ struct _CamelStoreSummaryPrivate {
 struct _CamelVeeFolderPrivate {
        GList *folders;                 /* lock using subfolder_lock before changing/accessing */
        GList *folders_changed;         /* for list of folders that have changed between updates */
-       
+
        GMutex *summary_lock;           /* for locking vfolder summary */
        GMutex *subfolder_lock;         /* for locking the subfolder list */
        GMutex *changed_lock;           /* for locking the folders-changed list */
index 3682d44..26b0009 100644 (file)
@@ -37,83 +37,83 @@ camel_process_fork (const char *path, char **argv, int *infd, int *outfd, int *e
 {
        int errnosav, fd[6], i;
        pid_t pid;
-       
+
        for (i = 0; i < 6; i++)
                fds[i] = -1;
-       
+
        for (i = 0; i < 6; i += 2) {
                if (pipe (fd + i) == -1) {
                        errnosav = errno;
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                              _("Failed to create pipe to '%s': %s"),
                                              argv[0], strerror (errno));
-                       
+
                        for (i = 0; i < 6; i++) {
                                if (fd[i] == -1)
                                        break;
                                close (fd[i]);
                        }
-                       
+
                        errno = errnosav;
-                       
+
                        return -1;
                }
        }
-       
+
        if (!(pid = fork ())) {
                /* child process */
                int maxfd, nullfd = -1;
-               
+
                if (!outfd || !errfd)
                        nullfd = open ("/dev/null", O_WRONLY);
-               
+
                if (dup2 (fd[0], STDIN_FILENO) == -1)
                        _exit (255);
-               
+
                if (dup2 (outfd ? fd[3] : nullfd, STDOUT_FILENO) == -1)
                        _exit (255);
-               
+
                if (dup2 (errfd ? fd[5] : nullfd, STDERR_FILENO) == -1)
                        _exit (255);
-               
+
                setsid ();
-               
+
                if ((maxfd = sysconf (_SC_OPEN_MAX)) > 0) {
                        for (i = 3; i < maxfd; i++)
                                fcntl (i, F_SETFD, FD_CLOEXEC);
                }
-               
+
                execv (path, argv);
                _exit (255);
        } else if (pid == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to create child process '%s': %s"),
                                      argv[0], strerror (errno));
-               for (i = 0; i < 6; i++) 
+               for (i = 0; i < 6; i++)
                        close (fd[i]);
                return -1;
        }
-       
+
        /* parent process */
        close (fd[0]);
        close (fd[3]);
        close (fd[5]);
-       
+
        if (infd)
                *infd = fd[1];
        else
                close (fd[1]);
-       
+
        if (outfd)
                *outfd = fd[2];
        else
                close (fd[2]);
-       
+
        if (errfd)
                *errfd = fd[4];
        else
                close (fd[4]);
-       
+
        return pid;
 }
 
@@ -124,17 +124,17 @@ camel_process_wait (pid_t pid)
        sigset_t mask, omask;
        int status;
        pid_t r;
-       
+
        sigemptyset (&mask);
        sigaddset (&mask, SIGALRM);
        sigprocmask (SIG_BLOCK, &mask, &omask);
        alarm (1);
-       
+
        r = waitpid (pid, &status, 0);
-       
+
        alarm (0);
        sigprocmask (SIG_SETMASK, &omask, NULL);
-       
+
        if (r == (pid_t) -1 && errno == EINTR) {
                kill (pid, SIGTERM);
                sleep (1);
@@ -145,7 +145,7 @@ camel_process_wait (pid_t pid)
                        r = waitpid (pid, &status, WNOHANG);
                }
        }
-       
+
        if (r != (pid_t) -1 && WIFEXITED (status))
                return WEXITSTATUS (status);
        else
index 3a3fe44..e3d06fa 100644 (file)
@@ -60,14 +60,14 @@ static GStaticRecMutex provider_lock = G_STATIC_REC_MUTEX_INIT;
 static CamelProvider vee_provider = {
        "vfolder",
        N_("Virtual folder email provider"),
-       
+
        N_("For reading mail as a query of another set of folders"),
-       
+
        "vfolder",
-       
+
        CAMEL_PROVIDER_IS_STORAGE,
        CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH,
-       
+
        /* ... */
 };
 
@@ -121,14 +121,14 @@ camel_provider_init (void)
                          CAMEL_PROVIDERDIR, g_strerror (errno));
                return;
        }
-       
+
        while ((entry = g_dir_read_name (dir))) {
                FILE *fp;
-               
+
                p = strrchr (entry, '.');
                if (!p || strcmp (p, ".urls") != 0)
                        continue;
-               
+
                name = g_strdup_printf ("%s/%s", CAMEL_PROVIDERDIR, entry);
                fp = g_fopen (name, "r");
                if (!fp) {
@@ -137,7 +137,7 @@ camel_provider_init (void)
                        g_free (name);
                        continue;
                }
-               
+
                p = strrchr (name, '.');
                strcpy (p, "." G_MODULE_SUFFIX);
 
@@ -149,7 +149,7 @@ camel_provider_init (void)
                        p = strchr (buf, '\n');
                        if (p)
                                *p = '\0';
-                       
+
                        if (*buf) {
                                char *protocol = g_strdup(buf);
 
@@ -173,7 +173,7 @@ camel_provider_init (void)
  * Loads the provider at @path, and calls its initialization function,
  * passing @session as an argument. The provider should then register
  * itself with @session.
- **/ 
+ **/
 void
 camel_provider_load(const char *path, CamelException *ex)
 {
@@ -234,7 +234,7 @@ camel_provider_register(CamelProvider *provider)
                UNLOCK();
                return;
        }
-       
+
        for (i = 0; i < CAMEL_NUM_PROVIDER_TYPES; i++) {
                if (provider->object_types[i])
                        provider->service_cache[i] = camel_object_bag_new (provider->url_hash, provider->url_equal,
index 8400e4b..eb8d329 100644 (file)
@@ -148,10 +148,10 @@ typedef int (*CamelProviderAutoDetectFunc) (CamelURL *url, GHashTable **auto_det
 typedef struct {
        /* Provider name used in CamelURLs. */
        char *protocol;
-       
+
        /* Provider name as used by people. (May be the same as protocol) */
        char *name;
-       
+
        /* Description of the provider. A novice user should be able
         * to read this description, and the information provided by
         * an ISP, IS department, etc, and determine whether or not
@@ -159,19 +159,19 @@ typedef struct {
         * information goes with it.
         */
        char *description;
-       
+
        /* The category of message that this provider works with.
         * (evolution-mail will only list a provider in the store/transport
         * config dialogs if its domain is "mail".)
         */
        char *domain;
-       
+
        /* Flags describing the provider, flags describing its URLs */
        int flags, url_flags;
 
        /* The ConfEntry and AutoDetect functions will probably be
         * DEPRECATED in a future release */
-       
+
        /* Extra configuration information */
        CamelProviderConfEntry *extra_conf;
 
@@ -184,12 +184,12 @@ typedef struct {
         * uses the store type (eg, Exchange or NNTP).
         */
        CamelType object_types[CAMEL_NUM_PROVIDER_TYPES];
-       
+
        /* GList of CamelServiceAuthTypes the provider supports */
        GList *authtypes;
-       
+
        CamelObjectBag *service_cache[CAMEL_NUM_PROVIDER_TYPES];
-       
+
        GHashFunc url_hash;
        GCompareFunc url_equal;
 
@@ -201,14 +201,14 @@ typedef struct {
        /* This string points to the provider's gconf key value
         */
        const char *license;
-       
+
        /* This holds the license file name [ ascii text format ] containing
-        * the license agreement. This should be the absolute file path. This 
+        * the license agreement. This should be the absolute file path. This
         * is read only when the HAS_LICENSE flag is set
         */
        const char *license_file;
 
-       /* Private to the provider */   
+       /* Private to the provider */
        void *priv;
 } CamelProvider;
 
index dd97c2a..2f31e8f 100644 (file)
@@ -35,9 +35,9 @@
 
 CamelServiceAuthType camel_sasl_anonymous_authtype = {
        N_("Anonymous"),
-       
+
        N_("This option will connect to the server using an anonymous login."),
-       
+
        "ANONYMOUS",
        FALSE
 };
@@ -53,9 +53,9 @@ static void
 camel_sasl_anonymous_class_init (CamelSaslAnonymousClass *camel_sasl_anonymous_class)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_anonymous_class);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = anon_challenge;
 }
@@ -64,7 +64,7 @@ static void
 camel_sasl_anonymous_finalize (CamelObject *object)
 {
        CamelSaslAnonymous *sasl = CAMEL_SASL_ANONYMOUS (object);
-       
+
        g_free (sasl->trace_info);
 }
 
@@ -73,7 +73,7 @@ CamelType
 camel_sasl_anonymous_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_sasl_get_type (),
                                            "CamelSaslAnonymous",
@@ -84,7 +84,7 @@ camel_sasl_anonymous_get_type (void)
                                            NULL,
                                            (CamelObjectFinalizeFunc) camel_sasl_anonymous_finalize);
        }
-       
+
        return type;
 }
 
@@ -102,13 +102,13 @@ CamelSasl *
 camel_sasl_anonymous_new (CamelSaslAnonTraceType type, const char *trace_info)
 {
        CamelSaslAnonymous *sasl_anon;
-       
+
        if (!trace_info && type != CAMEL_SASL_ANON_TRACE_EMPTY) return NULL;
-       
+
        sasl_anon = CAMEL_SASL_ANONYMOUS (camel_object_new (camel_sasl_anonymous_get_type ()));
        sasl_anon->trace_info = g_strdup (trace_info);
        sasl_anon->type = type;
-       
+
        return CAMEL_SASL (sasl_anon);
 }
 
index d81c3d8..535c0b7 100644 (file)
@@ -40,7 +40,7 @@ typedef enum {
 
 typedef struct _CamelSaslAnonymous {
        CamelSasl parent_object;
-       
+
        char *trace_info;
        CamelSaslAnonTraceType type;
 } CamelSaslAnonymous;
@@ -48,7 +48,7 @@ typedef struct _CamelSaslAnonymous {
 
 typedef struct _CamelSaslAnonymousClass {
        CamelSaslClass parent_class;
-       
+
 } CamelSaslAnonymousClass;
 
 
index eb80bf4..3c26b8c 100644 (file)
@@ -57,9 +57,9 @@ static void
 camel_sasl_cram_md5_class_init (CamelSaslCramMd5Class *camel_sasl_cram_md5_class)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_cram_md5_class);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = cram_md5_challenge;
 }
@@ -68,7 +68,7 @@ CamelType
 camel_sasl_cram_md5_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_sasl_get_type (),
                                            "CamelSaslCramMd5",
@@ -79,7 +79,7 @@ camel_sasl_cram_md5_get_type (void)
                                            NULL,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -97,16 +97,16 @@ cram_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
        guchar opad[64];
        MD5Context ctx;
        int i, pw_len;
-       
+
        /* Need to wait for the server */
        if (!token)
                return NULL;
-       
+
        g_return_val_if_fail (sasl->service->url->passwd != NULL, NULL);
-       
+
        memset (ipad, 0, sizeof (ipad));
        memset (opad, 0, sizeof (opad));
-       
+
        passwd = sasl->service->url->passwd;
        pw_len = strlen (passwd);
        if (pw_len <= 64) {
@@ -116,32 +116,32 @@ cram_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                md5_get_digest (passwd, pw_len, ipad);
                memcpy (opad, ipad, 16);
        }
-       
+
        for (i = 0; i < 64; i++) {
                ipad[i] ^= 0x36;
                opad[i] ^= 0x5c;
        }
-       
+
        md5_init (&ctx);
        md5_update (&ctx, ipad, 64);
        md5_update (&ctx, token->data, token->len);
        md5_final (&ctx, digest);
-       
+
        md5_init (&ctx);
        md5_update (&ctx, opad, 64);
        md5_update (&ctx, digest, 16);
        md5_final (&ctx, digest);
-       
+
        /* lowercase hexify that bad-boy... */
        for (s = digest, p = md5asc; p < md5asc + 32; s++, p += 2)
                sprintf (p, "%.2x", *s);
-       
+
        ret = g_byte_array_new ();
        g_byte_array_append (ret, sasl->service->url->user, strlen (sasl->service->url->user));
        g_byte_array_append (ret, " ", 1);
        g_byte_array_append (ret, md5asc, 32);
-       
+
        sasl->authenticated = TRUE;
-       
+
        return ret;
 }
index 4138402..5f4441f 100644 (file)
@@ -40,7 +40,7 @@ typedef struct _CamelSaslCramMd5 {
 
 typedef struct _CamelSaslCramMd5Class {
        CamelSaslClass parent_class;
-       
+
 } CamelSaslCramMd5Class;
 
 
index c30e109..00bf813 100644 (file)
@@ -174,9 +174,9 @@ static void
 camel_sasl_digest_md5_class_init (CamelSaslDigestMd5Class *camel_sasl_digest_md5_class)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_digest_md5_class);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = digest_md5_challenge;
 }
@@ -185,7 +185,7 @@ static void
 camel_sasl_digest_md5_init (gpointer object, gpointer klass)
 {
        CamelSaslDigestMd5 *sasl_digest = CAMEL_SASL_DIGEST_MD5 (object);
-       
+
        sasl_digest->priv = g_new0 (struct _CamelSaslDigestMd5Private, 1);
 }
 
@@ -197,18 +197,18 @@ camel_sasl_digest_md5_finalize (CamelObject *object)
        struct _DigestResponse *r = sasl->priv->response;
        GList *p;
        int i;
-       
+
        if (c != NULL) {
                for (i = 0; i < c->realms->len; i++)
                        g_free (c->realms->pdata[i]);
                g_ptr_array_free (c->realms, TRUE);
-               
+
                g_free (c->nonce);
                g_free (c->charset);
                g_free (c->algorithm);
                for (p = c->params; p; p = p->next) {
                        struct _param *param = p->data;
-                       
+
                        g_free (param->name);
                        g_free (param->value);
                        g_free (param);
@@ -216,7 +216,7 @@ camel_sasl_digest_md5_finalize (CamelObject *object)
                g_list_free (c->params);
                g_free (c);
        }
-       
+
        if (r != NULL) {
                g_free (r->username);
                g_free (r->realm);
@@ -232,7 +232,7 @@ camel_sasl_digest_md5_finalize (CamelObject *object)
                g_free (r->param);
                g_free (r);
        }
-       
+
        g_free (sasl->priv);
 }
 
@@ -241,7 +241,7 @@ CamelType
 camel_sasl_digest_md5_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_sasl_get_type (),
                                            "CamelSaslDigestMd5",
@@ -252,7 +252,7 @@ camel_sasl_digest_md5_get_type (void)
                                            (CamelObjectInitFunc) camel_sasl_digest_md5_init,
                                            (CamelObjectFinalizeFunc) camel_sasl_digest_md5_finalize);
        }
-       
+
        return type;
 }
 
@@ -260,10 +260,10 @@ static void
 decode_lwsp (const char **in)
 {
        const char *inptr = *in;
-       
+
        while (isspace (*inptr))
                inptr++;
-       
+
        *in = inptr;
 }
 
@@ -274,12 +274,12 @@ decode_quoted_string (const char **in)
        char *out = NULL, *outptr;
        int outlen;
        int c;
-       
+
        decode_lwsp (&inptr);
        if (*inptr == '"') {
                const char *intmp;
                int skip = 0;
-               
+
                /* first, calc length */
                inptr++;
                intmp = inptr;
@@ -289,10 +289,10 @@ decode_quoted_string (const char **in)
                                skip++;
                        }
                }
-               
+
                outlen = intmp - inptr - skip;
                out = outptr = g_malloc (outlen + 1);
-               
+
                while ((c = *inptr++) && c != '"') {
                        if (c == '\\' && *inptr) {
                                c = *inptr++;
@@ -301,9 +301,9 @@ decode_quoted_string (const char **in)
                }
                *outptr = '\0';
        }
-       
+
        *in = inptr;
-       
+
        return out;
 }
 
@@ -312,13 +312,13 @@ decode_token (const char **in)
 {
        const char *inptr = *in;
        const char *start;
-       
+
        decode_lwsp (&inptr);
        start = inptr;
-       
+
        while (*inptr && *inptr != '=' && *inptr != ',')
                inptr++;
-       
+
        if (inptr > start) {
                *in = inptr;
                return g_strndup (start, inptr - start);
@@ -331,7 +331,7 @@ static char *
 decode_value (const char **in)
 {
        const char *inptr = *in;
-       
+
        decode_lwsp (&inptr);
        if (*inptr == '"') {
                d(printf ("decoding quoted string token\n"));
@@ -348,7 +348,7 @@ parse_param_list (const char *tokens)
        GList *params = NULL;
        struct _param *param;
        const char *ptr;
-       
+
        for (ptr = tokens; ptr && *ptr; ) {
                param = g_new0 (struct _param, 1);
                param->name = decode_token (&ptr);
@@ -356,13 +356,13 @@ parse_param_list (const char *tokens)
                        ptr++;
                        param->value = decode_value (&ptr);
                }
-               
+
                params = g_list_prepend (params, param);
-               
+
                if (*ptr == ',')
                        ptr++;
        }
-       
+
        return params;
 }
 
@@ -370,12 +370,12 @@ static guint
 decode_data_type (DataType *dtype, const char *name)
 {
        int i;
-       
+
        for (i = 0; dtype[i].name; i++) {
                if (!g_ascii_strcasecmp (dtype[i].name, name))
                        break;
        }
-       
+
        return dtype[i].type;
 }
 
@@ -387,12 +387,12 @@ static const char *
 type_to_string (DataType *dtype, guint type)
 {
        int i;
-       
+
        for (i = 0; dtype[i].name; i++) {
                if (dtype[i].type == type)
                        break;
        }
-       
+
        return dtype[i].name;
 }
 
@@ -419,33 +419,33 @@ parse_server_challenge (const char *tokens, gboolean *abort)
        gboolean got_maxbuf = FALSE;
        gboolean got_charset = FALSE;
 #endif /* PARANOID */
-       
+
        params = parse_param_list (tokens);
        if (!params) {
                *abort = TRUE;
                return NULL;
        }
-       
+
        *abort = FALSE;
-       
+
        challenge = g_new0 (struct _DigestChallenge, 1);
        challenge->realms = g_ptr_array_new ();
        challenge->maxbuf = 65536;
-       
+
        for (p = params; p; p = p->next) {
                struct _param *param = p->data;
                int type;
-               
+
                type = get_digest_arg (param->name);
                switch (type) {
                case DIGEST_REALM:
                        for (ptr = param->value; ptr && *ptr; ) {
                                char *token;
-                               
+
                                token = decode_token (&ptr);
                                if (token)
                                        g_ptr_array_add (challenge->realms, token);
-                               
+
                                if (*ptr == ',')
                                        ptr++;
                        }
@@ -462,15 +462,15 @@ parse_server_challenge (const char *tokens, gboolean *abort)
                case DIGEST_QOP:
                        for (ptr = param->value; ptr && *ptr; ) {
                                char *token;
-                               
+
                                token = decode_token (&ptr);
                                if (token)
                                        challenge->qop |= decode_qop (token);
-                               
+
                                if (*ptr == ',')
                                        ptr++;
                        }
-                       
+
                        if (challenge->qop & QOP_INVALID)
                                challenge->qop = QOP_INVALID;
                        g_free (param->value);
@@ -514,11 +514,11 @@ parse_server_challenge (const char *tokens, gboolean *abort)
                case DIGEST_CIPHER:
                        for (ptr = param->value; ptr && *ptr; ) {
                                char *token;
-                               
+
                                token = decode_token (&ptr);
                                if (token)
                                        challenge->cipher |= decode_cipher (token);
-                               
+
                                if (*ptr == ',')
                                        ptr++;
                        }
@@ -533,9 +533,9 @@ parse_server_challenge (const char *tokens, gboolean *abort)
                        break;
                }
        }
-       
+
        g_list_free (params);
-       
+
        return challenge;
 }
 
@@ -543,7 +543,7 @@ static void
 digest_hex (guchar *digest, guchar hex[33])
 {
        guchar *s, *p;
-       
+
        /* lowercase hexify that bad-boy... */
        for (s = digest, p = hex; p < hex + 32; s++, p += 2)
                sprintf (p, "%.2x", *s);
@@ -565,7 +565,7 @@ compute_response (struct _DigestResponse *resp, const char *passwd, gboolean cli
        guchar digest[16];
        MD5Context ctx;
        char *buf;
-       
+
        /* compute A1 */
        md5_init (&ctx);
        md5_update (&ctx, resp->username, strlen (resp->username));
@@ -574,7 +574,7 @@ compute_response (struct _DigestResponse *resp, const char *passwd, gboolean cli
        md5_update (&ctx, ":", 1);
        md5_update (&ctx, passwd, strlen (passwd));
        md5_final (&ctx, digest);
-       
+
        md5_init (&ctx);
        md5_update (&ctx, digest, 16);
        md5_update (&ctx, ":", 1);
@@ -585,11 +585,11 @@ compute_response (struct _DigestResponse *resp, const char *passwd, gboolean cli
                md5_update (&ctx, ":", 1);
                md5_update (&ctx, resp->authzid, strlen (resp->authzid));
        }
-       
+
        /* hexify A1 */
        md5_final (&ctx, digest);
        digest_hex (digest, hex_a1);
-       
+
        /* compute A2 */
        md5_init (&ctx);
        if (client) {
@@ -599,18 +599,18 @@ compute_response (struct _DigestResponse *resp, const char *passwd, gboolean cli
                /* we are calculating the server rspauth */
                md5_update (&ctx, ":", 1);
        }
-       
+
        buf = digest_uri_to_string (resp->uri);
        md5_update (&ctx, buf, strlen (buf));
        g_free (buf);
-       
+
        if (resp->qop == QOP_AUTH_INT || resp->qop == QOP_AUTH_CONF)
                md5_update (&ctx, ":00000000000000000000000000000000", 33);
-       
+
        /* now hexify A2 */
        md5_final (&ctx, digest);
        digest_hex (digest, hex_a2);
-       
+
        /* compute KD */
        md5_init (&ctx);
        md5_update (&ctx, hex_a1, 32);
@@ -625,7 +625,7 @@ compute_response (struct _DigestResponse *resp, const char *passwd, gboolean cli
        md5_update (&ctx, ":", 1);
        md5_update (&ctx, hex_a2, 32);
        md5_final (&ctx, digest);
-       
+
        digest_hex (digest, out);
 }
 
@@ -636,7 +636,7 @@ generate_response (struct _DigestChallenge *challenge, const char *host,
        struct _DigestResponse *resp;
        struct _DigestURI *uri;
        char *bgen, digest[16];
-       
+
        resp = g_new0 (struct _DigestResponse, 1);
        resp->username = g_strdup (user);
        /* FIXME: we should use the preferred realm */
@@ -644,9 +644,9 @@ generate_response (struct _DigestChallenge *challenge, const char *host,
                resp->realm = g_strdup (challenge->realms->pdata[0]);
        else
                resp->realm = g_strdup ("");
-       
+
        resp->nonce = g_strdup (challenge->nonce);
-       
+
        /* generate the cnonce */
        bgen = g_strdup_printf ("%p:%lu:%lu", resp,
                                (unsigned long) getpid (),
@@ -655,21 +655,21 @@ generate_response (struct _DigestChallenge *challenge, const char *host,
        g_free (bgen);
        /* take our recommended 64 bits of entropy */
        resp->cnonce = g_base64_encode (digest, 8);
-       
+
        /* we don't support re-auth so the nonce count is always 1 */
        strcpy (resp->nc, "00000001");
-       
+
        /* choose the QOP */
        /* FIXME: choose - probably choose "auth" ??? */
        resp->qop = QOP_AUTH;
-       
+
        /* create the URI */
        uri = g_new0 (struct _DigestURI, 1);
        uri->type = g_strdup (protocol);
        uri->host = g_strdup (host);
        uri->name = NULL;
        resp->uri = uri;
-       
+
        /* charsets... yay */
        if (challenge->charset) {
                /* I believe that this is only ever allowed to be
@@ -678,18 +678,18 @@ generate_response (struct _DigestChallenge *challenge, const char *host,
                 */
                resp->charset = g_strdup (challenge->charset);
        }
-       
+
        resp->cipher = CIPHER_INVALID;
        if (resp->qop == QOP_AUTH_CONF) {
                /* FIXME: choose a cipher? */
                resp->cipher = CIPHER_INVALID;
        }
-       
+
        /* we don't really care about this... */
        resp->authzid = NULL;
-       
+
        compute_response (resp, passwd, TRUE, resp->resp);
-       
+
        return resp;
 }
 
@@ -699,7 +699,7 @@ digest_response (struct _DigestResponse *resp)
        GByteArray *buffer;
        const char *str;
        char *buf;
-       
+
        buffer = g_byte_array_new ();
        g_byte_array_append (buffer, "username=\"", 10);
        if (resp->charset) {
@@ -709,73 +709,73 @@ digest_response (struct _DigestResponse *resp)
                size_t len, outlen;
                const char *inbuf;
                iconv_t cd;
-               
+
                charset = e_iconv_locale_charset ();
                if (!charset)
                        charset = "iso-8859-1";
-               
+
                cd = e_iconv_open (resp->charset, charset);
-               
+
                len = strlen (resp->username);
                outlen = 2 * len; /* plenty of space */
-               
+
                outbuf = username = g_malloc0 (outlen + 1);
                inbuf = resp->username;
                if (cd == (iconv_t) -1 || e_iconv (cd, &inbuf, &len, &outbuf, &outlen) == (size_t) -1) {
                        /* We can't convert to UTF-8 - pretend we never got a charset param? */
                        g_free (resp->charset);
                        resp->charset = NULL;
-                       
+
                        /* Set the username to the non-UTF-8 version */
                        g_free (username);
                        username = g_strdup (resp->username);
                }
-               
+
                if (cd != (iconv_t) -1)
                        e_iconv_close (cd);
-               
+
                g_byte_array_append (buffer, username, strlen (username));
                g_free (username);
        } else {
                g_byte_array_append (buffer, resp->username, strlen (resp->username));
        }
-       
+
        g_byte_array_append (buffer, "\",realm=\"", 9);
        g_byte_array_append (buffer, resp->realm, strlen (resp->realm));
-       
+
        g_byte_array_append (buffer, "\",nonce=\"", 9);
        g_byte_array_append (buffer, resp->nonce, strlen (resp->nonce));
-       
+
        g_byte_array_append (buffer, "\",cnonce=\"", 10);
        g_byte_array_append (buffer, resp->cnonce, strlen (resp->cnonce));
-       
+
        g_byte_array_append (buffer, "\",nc=", 5);
        g_byte_array_append (buffer, resp->nc, 8);
-       
+
        g_byte_array_append (buffer, ",qop=", 5);
        str = qop_to_string (resp->qop);
        g_byte_array_append (buffer, str, strlen (str));
-       
+
        g_byte_array_append (buffer, ",digest-uri=\"", 13);
        buf = digest_uri_to_string (resp->uri);
        g_byte_array_append (buffer, buf, strlen (buf));
        g_free (buf);
-       
+
        g_byte_array_append (buffer, "\",response=", 11);
        g_byte_array_append (buffer, resp->resp, 32);
-       
+
        if (resp->maxbuf > 0) {
                g_byte_array_append (buffer, ",maxbuf=", 8);
                buf = g_strdup_printf ("%u", resp->maxbuf);
                g_byte_array_append (buffer, buf, strlen (buf));
                g_free (buf);
        }
-       
+
        if (resp->charset) {
                g_byte_array_append (buffer, ",charset=", 9);
                g_byte_array_append (buffer, resp->charset, strlen (resp->charset));
        }
-       
+
        if (resp->cipher != CIPHER_INVALID) {
                str = cipher_to_string (resp->cipher);
                if (str) {
@@ -784,13 +784,13 @@ digest_response (struct _DigestResponse *resp)
                        g_byte_array_append (buffer, "\"", 1);
                }
        }
-       
+
        if (resp->authzid) {
                g_byte_array_append (buffer, ",authzid=\"", 10);
                g_byte_array_append (buffer, resp->authzid, strlen (resp->authzid));
                g_byte_array_append (buffer, "\"", 1);
        }
-       
+
        return buffer;
 }
 
@@ -806,13 +806,13 @@ digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
        guchar out[33];
        char *tokens;
        struct addrinfo *ai, hints;
-       
+
        /* Need to wait for the server */
        if (!token)
                return NULL;
-       
+
        g_return_val_if_fail (sasl->service->url->passwd != NULL, NULL);
-       
+
        switch (priv->state) {
        case STATE_AUTH:
                if (token->len > 2048) {
@@ -820,7 +820,7 @@ digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                                              _("Server challenge too long (>2048 octets)"));
                        return NULL;
                }
-               
+
                tokens = g_strndup (token->data, token->len);
                priv->challenge = parse_server_challenge (tokens, &abort);
                g_free (tokens);
@@ -829,7 +829,7 @@ digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                                              _("Server challenge invalid\n"));
                        return NULL;
                }
-               
+
                if (priv->challenge->qop == QOP_INVALID) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                              _("Server challenge contained invalid "
@@ -851,23 +851,23 @@ digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                if (ai)
                        camel_freeaddrinfo(ai);
                ret = digest_response (priv->response);
-               
+
                break;
        case STATE_FINAL:
                if (token->len)
                        tokens = g_strndup (token->data, token->len);
                else
                        tokens = NULL;
-               
+
                if (!tokens || !*tokens) {
                        g_free (tokens);
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                              _("Server response did not contain authorization data"));
                        return NULL;
                }
-               
+
                rspauth = g_new0 (struct _param, 1);
-               
+
                ptr = tokens;
                rspauth->name = decode_token (&ptr);
                if (*ptr == '=') {
@@ -875,7 +875,7 @@ digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                        rspauth->value = decode_value (&ptr);
                }
                g_free (tokens);
-               
+
                if (!rspauth->value) {
                        g_free (rspauth->name);
                        g_free (rspauth);
@@ -883,7 +883,7 @@ digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                                              _("Server response contained incomplete authorization data"));
                        return NULL;
                }
-               
+
                compute_response (priv->response, sasl->service->url->passwd, FALSE, out);
                if (memcmp (out, rspauth->value, 32) != 0) {
                        g_free (rspauth->name);
@@ -892,22 +892,22 @@ digest_md5_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                              _("Server response does not match"));
                        sasl->authenticated = TRUE;
-                       
+
                        return NULL;
                }
-               
+
                g_free (rspauth->name);
                g_free (rspauth->value);
                g_free (rspauth);
-               
+
                ret = g_byte_array_new ();
-               
+
                sasl->authenticated = TRUE;
        default:
                break;
        }
-       
+
        priv->state++;
-       
+
        return ret;
 }
index 5cd29ff..1c8c5f5 100644 (file)
@@ -36,13 +36,13 @@ G_BEGIN_DECLS
 typedef struct _CamelSaslDigestMd5 {
        CamelSasl parent_object;
        struct _CamelSaslDigestMd5Private *priv;
-       
+
 } CamelSaslDigestMd5;
 
 
 typedef struct _CamelSaslDigestMd5Class {
        CamelSaslClass parent_class;
-       
+
 } CamelSaslDigestMd5Class;
 
 
index bd4a670..dab0340 100644 (file)
@@ -44,7 +44,7 @@
 #ifdef HAVE_HEIMDAL_KRB5
 #include <gssapi.h>
 #else
-#ifdef  HAVE_SUN_KRB5 
+#ifdef  HAVE_SUN_KRB5
 #include <gssapi/gssapi.h>
 #include <gssapi/gssapi_ext.h>
 extern gss_OID gss_nt_service_name;
@@ -62,10 +62,10 @@ extern gss_OID gss_nt_service_name;
 
 CamelServiceAuthType camel_sasl_gssapi_authtype = {
        N_("GSSAPI"),
-       
+
        N_("This option will connect to the server using "
           "Kerberos 5 authentication."),
-       
+
        "GSSAPI",
        FALSE
 };
@@ -100,9 +100,9 @@ static void
 camel_sasl_gssapi_class_init (CamelSaslGssapiClass *klass)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (klass);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = gssapi_challenge;
 }
@@ -111,7 +111,7 @@ static void
 camel_sasl_gssapi_init (gpointer object, gpointer klass)
 {
        CamelSaslGssapi *gssapi = CAMEL_SASL_GSSAPI (object);
-       
+
        gssapi->priv = g_new (struct _CamelSaslGssapiPrivate, 1);
        gssapi->priv->state = GSSAPI_STATE_INIT;
        gssapi->priv->ctx = GSS_C_NO_CONTEXT;
@@ -123,13 +123,13 @@ camel_sasl_gssapi_finalize (CamelObject *object)
 {
        CamelSaslGssapi *gssapi = CAMEL_SASL_GSSAPI (object);
        guint32 status;
-       
+
        if (gssapi->priv->ctx != GSS_C_NO_CONTEXT)
                gss_delete_sec_context (&status, &gssapi->priv->ctx, GSS_C_NO_BUFFER);
-       
+
        if (gssapi->priv->target != GSS_C_NO_NAME)
                gss_release_name (&status, &gssapi->priv->target);
-       
+
        g_free (gssapi->priv);
 }
 
@@ -138,7 +138,7 @@ CamelType
 camel_sasl_gssapi_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (
                        camel_sasl_get_type (),
@@ -150,7 +150,7 @@ camel_sasl_gssapi_get_type (void)
                        (CamelObjectInitFunc) camel_sasl_gssapi_init,
                        (CamelObjectFinalizeFunc) camel_sasl_gssapi_finalize);
        }
-       
+
        return type;
 }
 
@@ -158,7 +158,7 @@ static void
 gssapi_set_exception (OM_uint32 major, OM_uint32 minor, CamelException *ex)
 {
        const char *str;
-       
+
        switch (major) {
        case GSS_S_BAD_MECH:
                str = _("The specified mechanism is not supported by the "
@@ -204,7 +204,7 @@ gssapi_set_exception (OM_uint32 major, OM_uint32 minor, CamelException *ex)
        default:
                str = _("Bad authentication response from server.");
        }
-       
+
        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, str);
 }
 
@@ -221,7 +221,7 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
        gss_OID mech;
        char *str;
        struct addrinfo *ai, hints;
-       
+
        switch (priv->state) {
        case GSSAPI_STATE_INIT:
                memset(&hints, 0, sizeof(hints));
@@ -229,22 +229,22 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                ai = camel_getaddrinfo(sasl->service->url->host?sasl->service->url->host:"localhost", NULL, &hints, ex);
                if (ai == NULL)
                        return NULL;
-               
+
                str = g_strdup_printf("%s@%s", sasl->service_name, ai->ai_canonname);
                camel_freeaddrinfo(ai);
-               
+
                inbuf.value = str;
                inbuf.length = strlen (str);
                major = gss_import_name (&minor, &inbuf, GSS_C_NT_HOSTBASED_SERVICE, &priv->target);
                g_free (str);
-               
+
                if (major != GSS_S_COMPLETE) {
                        gssapi_set_exception (major, minor, ex);
                        return NULL;
                }
-               
+
                input_token = GSS_C_NO_BUFFER;
-               
+
                goto challenge;
                break;
        case GSSAPI_STATE_CONTINUE_NEEDED:
@@ -253,18 +253,18 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                                             _("Bad authentication response from server."));
                        return NULL;
                }
-               
+
                inbuf.value = token->data;
                inbuf.length = token->len;
                input_token = &inbuf;
-               
+
        challenge:
                major = gss_init_sec_context (&minor, GSS_C_NO_CREDENTIAL, &priv->ctx, priv->target,
                                              GSS_C_OID_KRBV5_DES, GSS_C_MUTUAL_FLAG |
                                              GSS_C_REPLAY_FLAG | GSS_C_SEQUENCE_FLAG,
                                              0, GSS_C_NO_CHANNEL_BINDINGS,
                                              input_token, &mech, &outbuf, &flags, &time);
-               
+
                switch (major) {
                case GSS_S_COMPLETE:
                        priv->state = GSSAPI_STATE_COMPLETE;
@@ -276,7 +276,7 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                        gssapi_set_exception (major, minor, ex);
                        return NULL;
                }
-               
+
                challenge = g_byte_array_new ();
                g_byte_array_append (challenge, outbuf.value, outbuf.length);
 #ifndef HAVE_HEIMDAL_KRB5
@@ -289,16 +289,16 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                                             _("Bad authentication response from server."));
                        return NULL;
                }
-               
+
                inbuf.value = token->data;
                inbuf.length = token->len;
-               
+
                major = gss_unwrap (&minor, priv->ctx, &inbuf, &outbuf, &conf_state, &qop);
                if (major != GSS_S_COMPLETE) {
                        gssapi_set_exception (major, minor, ex);
                        return NULL;
                }
-               
+
                if (outbuf.length < 4) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                             _("Bad authentication response from server."));
@@ -307,7 +307,7 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
 #endif
                        return NULL;
                }
-               
+
                /* check that our desired security layer is supported */
                if ((((unsigned char *) outbuf.value)[0] & DESIRED_SECURITY_LAYER) != DESIRED_SECURITY_LAYER) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
@@ -317,40 +317,40 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
 #endif
                        return NULL;
                }
-               
+
                inbuf.length = 4 + strlen (sasl->service->url->user);
                inbuf.value = str = g_malloc (inbuf.length);
                memcpy (inbuf.value, outbuf.value, 4);
                str[0] = DESIRED_SECURITY_LAYER;
                memcpy (str + 4, sasl->service->url->user, inbuf.length - 4);
-               
+
 #ifndef HAVE_HEIMDAL_KRB5
                gss_release_buffer (&minor, &outbuf);
 #endif
-               
+
                major = gss_wrap (&minor, priv->ctx, FALSE, qop, &inbuf, &conf_state, &outbuf);
                if (major != GSS_S_COMPLETE) {
                        gssapi_set_exception (major, minor, ex);
                        g_free (str);
                        return NULL;
                }
-               
+
                g_free (str);
                challenge = g_byte_array_new ();
                g_byte_array_append (challenge, outbuf.value, outbuf.length);
-               
+
 #ifndef HAVE_HEIMDAL_KRB5
                gss_release_buffer (&minor, &outbuf);
 #endif
-               
+
                priv->state = GSSAPI_STATE_AUTHENTICATED;
-               
+
                sasl->authenticated = TRUE;
                break;
        default:
                return NULL;
        }
-       
+
        return challenge;
 }
 
index 70523d0..ff70b99 100644 (file)
@@ -39,14 +39,14 @@ typedef struct _CamelSaslGssapiClass CamelSaslGssapiClass;
 
 struct _CamelSaslGssapi {
        CamelSasl parent_object;
-       
+
        struct _CamelSaslGssapiPrivate *priv;
-       
+
 };
 
 struct _CamelSaslGssapiClass {
        CamelSaslClass parent_class;
-       
+
 };
 
 /* Standard Camel function */
index 30c96d0..fcd67fd 100644 (file)
@@ -66,10 +66,10 @@ static GByteArray *krb4_challenge (CamelSasl *sasl, GByteArray *token, CamelExce
 
 struct _CamelSaslKerberos4Private {
        int state;
-       
+
        guint32 nonce_n;
        guint32 nonce_h;
-       
+
        des_cblock session;
        des_key_schedule schedule;
 };
@@ -78,9 +78,9 @@ static void
 camel_sasl_kerberos4_class_init (CamelSaslKerberos4Class *camel_sasl_kerberos4_class)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_kerberos4_class);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = krb4_challenge;
 }
@@ -89,7 +89,7 @@ static void
 camel_sasl_kerberos4_init (gpointer object, gpointer klass)
 {
        CamelSaslKerberos4 *sasl_krb4 = CAMEL_SASL_KERBEROS4 (object);
-       
+
        sasl_krb4->priv = g_new0 (struct _CamelSaslKerberos4Private, 1);
 }
 
@@ -109,7 +109,7 @@ CamelType
 camel_sasl_kerberos4_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_sasl_get_type (),
                                            "CamelSaslKerberos4",
@@ -120,7 +120,7 @@ camel_sasl_kerberos4_get_type (void)
                                            (CamelObjectInitFunc) camel_sasl_kerberos4_init,
                                            (CamelObjectFinalizeFunc) camel_sasl_kerberos4_finalize);
        }
-       
+
        return type;
 }
 
index d4a836d..b6b1df3 100644 (file)
@@ -42,7 +42,7 @@ typedef struct _CamelSaslKerberos4 {
 
 typedef struct _CamelSaslKerberos4Class {
        CamelSaslClass parent_class;
-       
+
 } CamelSaslKerberos4Class;
 
 
index 16a94c2..9a9deb4 100644 (file)
 
 CamelServiceAuthType camel_sasl_login_authtype = {
        N_("Login"),
-       
+
        N_("This option will connect to the server using a "
           "simple password."),
-       
+
        "LOGIN",
        TRUE
 };
@@ -62,9 +62,9 @@ static void
 camel_sasl_login_class_init (CamelSaslLoginClass *camel_sasl_login_class)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_login_class);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = login_challenge;
 }
@@ -73,7 +73,7 @@ static void
 camel_sasl_login_init (gpointer object, gpointer klass)
 {
        CamelSaslLogin *sasl_login = CAMEL_SASL_LOGIN (object);
-       
+
        sasl_login->priv = g_new0 (struct _CamelSaslLoginPrivate, 1);
 }
 
@@ -81,7 +81,7 @@ static void
 camel_sasl_login_finalize (CamelObject *object)
 {
        CamelSaslLogin *sasl = CAMEL_SASL_LOGIN (object);
-       
+
        g_free (sasl->priv);
 }
 
@@ -90,7 +90,7 @@ CamelType
 camel_sasl_login_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_sasl_get_type (),
                                            "CamelSaslLogin",
@@ -101,7 +101,7 @@ camel_sasl_login_get_type (void)
                                            (CamelObjectInitFunc) camel_sasl_login_init,
                                            (CamelObjectFinalizeFunc) camel_sasl_login_finalize);
        }
-       
+
        return type;
 }
 
@@ -111,13 +111,13 @@ login_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
        struct _CamelSaslLoginPrivate *priv = CAMEL_SASL_LOGIN (sasl)->priv;
        GByteArray *buf = NULL;
        CamelURL *url = sasl->service->url;
-       
+
        g_return_val_if_fail (url->passwd != NULL, NULL);
 
        /* Need to wait for the server */
        if (!token)
                return NULL;
-       
+
        switch (priv->state) {
        case LOGIN_USER:
                buf = g_byte_array_new ();
@@ -126,7 +126,7 @@ login_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
        case LOGIN_PASSWD:
                buf = g_byte_array_new ();
                g_byte_array_append (buf, url->passwd, strlen (url->passwd));
-               
+
                sasl->authenticated = TRUE;
                break;
        default:
@@ -135,8 +135,8 @@ login_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                                             _("Unknown authentication state."));
                }
        }
-       
+
        priv->state++;
-       
+
        return buf;
 }
index 47c2168..188a0e5 100644 (file)
@@ -34,15 +34,15 @@ G_BEGIN_DECLS
 
 typedef struct _CamelSaslLogin {
        CamelSasl parent_object;
-       
+
        struct _CamelSaslLoginPrivate *priv;
-       
+
 } CamelSaslLogin;
 
 
 typedef struct _CamelSaslLoginClass {
        CamelSaslClass parent_class;
-       
+
 } CamelSaslLoginClass;
 
 
index e6fcd37..9fe1853 100644 (file)
@@ -48,9 +48,9 @@ static void
 camel_sasl_ntlm_class_init (CamelSaslNTLMClass *camel_sasl_ntlm_class)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_ntlm_class);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = ntlm_challenge;
 }
@@ -142,8 +142,8 @@ ntlm_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
 }
 
 /* MD4 */
-static void md4sum                (const unsigned char *in, 
-                                  int                  nbytes, 
+static void md4sum                (const unsigned char *in,
+                                  int                  nbytes,
                                   unsigned char        digest[16]);
 
 /* DES */
@@ -258,7 +258,7 @@ ntlm_calc_response (const guchar key[21], const guchar plaintext[8],
 }
 
 
-/* 
+/*
  * MD4 encoder. (The one everyone else uses is not GPL-compatible;
  * this is a reimplementation from spec.) This doesn't need to be
  * efficient for our purposes, although it would be nice to fix
@@ -532,7 +532,7 @@ static void
 des (guint32 ks[16][2], unsigned char block[8])
 {
        guint32 left, right, work;
-       
+
        /* Read input block and place in left/right in big-endian order */
        left = ((guint32)block[0] << 24)
         | ((guint32)block[1] << 16)
@@ -544,11 +544,11 @@ des (guint32 ks[16][2], unsigned char block[8])
         | (guint32)block[7];
 
        /* Hoey's clever initial permutation algorithm, from Outerbridge
-        * (see Schneier p 478) 
+        * (see Schneier p 478)
         *
         * The convention here is the same as Outerbridge: rotate each
         * register left by 1 bit, i.e., so that "left" contains permuted
-        * input bits 2, 3, 4, ... 1 and "right" contains 33, 34, 35, ... 32    
+        * input bits 2, 3, 4, ... 1 and "right" contains 33, 34, 35, ... 32
         * (using origin-1 numbering as in the FIPS). This allows us to avoid
         * one of the two rotates that would otherwise be required in each of
         * the 16 rounds.
index 7a92863..77be904 100644 (file)
@@ -38,7 +38,7 @@ typedef struct _CamelSaslNTLM {
 
 typedef struct _CamelSaslNTLMClass {
        CamelSaslClass parent_class;
-       
+
 } CamelSaslNTLMClass;
 
 
index 5ec7bb3..5d5ae87 100644 (file)
@@ -53,9 +53,9 @@ static void
 camel_sasl_plain_class_init (CamelSaslPlainClass *camel_sasl_plain_class)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_plain_class);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = plain_challenge;
 }
@@ -64,7 +64,7 @@ CamelType
 camel_sasl_plain_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_sasl_get_type (),
                                            "CamelSaslPlain",
@@ -75,7 +75,7 @@ camel_sasl_plain_get_type (void)
                                            NULL,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -92,17 +92,17 @@ plain_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                return NULL;
        }
 #endif
-       
+
        g_return_val_if_fail (url->passwd != NULL, NULL);
-       
+
        /* FIXME: make sure these are "UTF8-SAFE" */
        buf = g_byte_array_new ();
        g_byte_array_append (buf, "", 1);
        g_byte_array_append (buf, url->user, strlen (url->user));
        g_byte_array_append (buf, "", 1);
        g_byte_array_append (buf, url->passwd, strlen (url->passwd));
-       
+
        sasl->authenticated = TRUE;
-       
+
        return buf;
 }
index 22f17fc..6ba537d 100644 (file)
@@ -40,7 +40,7 @@ typedef struct _CamelSaslPlain {
 
 typedef struct _CamelSaslPlainClass {
        CamelSaslClass parent_class;
-       
+
 } CamelSaslPlainClass;
 
 
index 9615896..6cc9c24 100644 (file)
@@ -65,9 +65,9 @@ static void
 camel_sasl_popb4smtp_class_init (CamelSaslPOPB4SMTPClass *camel_sasl_popb4smtp_class)
 {
        CamelSaslClass *camel_sasl_class = CAMEL_SASL_CLASS (camel_sasl_popb4smtp_class);
-       
+
        parent_class = CAMEL_SASL_CLASS (camel_type_get_global_classfuncs (camel_sasl_get_type ()));
-       
+
        /* virtual method overload */
        camel_sasl_class->challenge = popb4smtp_challenge;
 
@@ -78,7 +78,7 @@ CamelType
 camel_sasl_popb4smtp_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_sasl_get_type (),
                                            "CamelSaslPOPB4SMTP",
@@ -89,7 +89,7 @@ camel_sasl_popb4smtp_get_type (void)
                                            NULL,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -148,6 +148,6 @@ popb4smtp_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
        POPB4SMTP_UNLOCK(lock);
 
        g_free(popuri);
-       
+
        return NULL;
 }
index 46b256c..76591eb 100644 (file)
@@ -40,7 +40,7 @@ typedef struct _CamelSaslPOPB4SMTP {
 
 typedef struct _CamelSaslPOPB4SMTPClass {
        CamelSaslClass parent_class;
-       
+
 } CamelSaslPOPB4SMTPClass;
 
 
index ff106cf..f61f001 100644 (file)
@@ -53,7 +53,7 @@ static void
 camel_sasl_class_init (CamelSaslClass *camel_sasl_class)
 {
        parent_class = camel_type_get_global_classfuncs (CAMEL_OBJECT_TYPE);
-       
+
        /* virtual method definition */
        camel_sasl_class->challenge = sasl_challenge;
 }
@@ -70,7 +70,7 @@ CamelType
 camel_sasl_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (CAMEL_OBJECT_TYPE,
                                            "CamelSasl",
@@ -81,7 +81,7 @@ camel_sasl_get_type (void)
                                            NULL,
                                            (CamelObjectFinalizeFunc) camel_sasl_finalize);
        }
-       
+
        return type;
 }
 
@@ -111,7 +111,7 @@ GByteArray *
 camel_sasl_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
 {
        g_return_val_if_fail (CAMEL_IS_SASL (sasl), NULL);
-       
+
        return CS_CLASS (sasl)->challenge (sasl, token, ex);
 }
 
@@ -131,9 +131,9 @@ camel_sasl_challenge_base64 (CamelSasl *sasl, const char *token, CamelException
 {
        GByteArray *token_binary, *ret_binary;
        char *ret;
-       
+
        g_return_val_if_fail (CAMEL_IS_SASL (sasl), NULL);
-       
+
        if (token) {
                guchar *data;
                gsize length;
@@ -144,13 +144,13 @@ camel_sasl_challenge_base64 (CamelSasl *sasl, const char *token, CamelException
                g_free (data);
        } else
                token_binary = NULL;
-       
+
        ret_binary = camel_sasl_challenge (sasl, token_binary, ex);
        if (token_binary)
                g_byte_array_free (token_binary, TRUE);
        if (!ret_binary)
                return NULL;
-       
+
        ret = g_base64_encode (ret_binary->data, ret_binary->len);
        g_byte_array_free (ret_binary, TRUE);
 
@@ -187,13 +187,13 @@ CamelSasl *
 camel_sasl_new (const char *service_name, const char *mechanism, CamelService *service)
 {
        CamelSasl *sasl;
-       
+
        g_return_val_if_fail (service_name != NULL, NULL);
        g_return_val_if_fail (mechanism != NULL, NULL);
        g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
-       
+
        /* We don't do ANONYMOUS here, because it's a little bit weird. */
-       
+
        if (!strcmp (mechanism, "CRAM-MD5"))
                sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_CRAM_MD5_TYPE);
        else if (!strcmp (mechanism, "DIGEST-MD5"))
@@ -221,7 +221,7 @@ camel_sasl_new (const char *service_name, const char *mechanism, CamelService *s
        sasl->service_name = g_strdup (service_name);
        sasl->service = service;
        camel_object_ref (service);
-       
+
        return sasl;
 }
 
@@ -236,7 +236,7 @@ GList *
 camel_sasl_authtype_list (gboolean include_plain)
 {
        GList *types = NULL;
-       
+
        types = g_list_prepend (types, &camel_sasl_cram_md5_authtype);
        types = g_list_prepend (types, &camel_sasl_digest_md5_authtype);
 #ifdef HAVE_KRB5
@@ -248,7 +248,7 @@ camel_sasl_authtype_list (gboolean include_plain)
        types = g_list_prepend (types, &camel_sasl_ntlm_authtype);
        if (include_plain)
                types = g_list_prepend (types, &camel_sasl_plain_authtype);
-       
+
        return types;
 }
 
index 9bf020a..c5a867e 100644 (file)
@@ -37,7 +37,7 @@ G_BEGIN_DECLS
 
 typedef struct _CamelSasl {
        CamelObject parent_object;
-       
+
        char *service_name;
        char *mech;             /* mechanism */
        CamelService *service;
@@ -47,7 +47,7 @@ typedef struct _CamelSasl {
 
 typedef struct _CamelSaslClass {
        CamelObjectClass parent_class;
-       
+
        GByteArray *    (*challenge)   (CamelSasl *sasl, GByteArray *token, CamelException *ex);
 
 } CamelSaslClass;
index bef313e..92e6a0a 100644 (file)
@@ -73,7 +73,7 @@ loop:
                        r<<=1;
                        m<<=5;
                } while (r & 0x40);
-               
+
                *ptr = p;
 
                v &= ~m;
@@ -100,7 +100,7 @@ camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, int
        int c, i, count=0, err;
        char *word;
        int flags;
-       
+
        /* build a regex pattern we can use to match the words, we OR them together */
        if (argc>1)
                g_string_append_c (match, '(');
@@ -108,7 +108,7 @@ camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, int
                if (argv[i]->type == ESEXP_RES_STRING) {
                        if (count > 0)
                                g_string_append_c (match, '|');
-                       
+
                        word = argv[i]->value.string;
                        if (type & CAMEL_SEARCH_MATCH_REGEX) {
                                /* no need to escape because this should already be a valid regex */
@@ -140,21 +140,21 @@ camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, int
                flags |= REG_NEWLINE;
        err = regcomp (pattern, match->str, flags);
        if (err != 0) {
-               /* regerror gets called twice to get the full error string 
+               /* regerror gets called twice to get the full error string
                   length to do proper posix error reporting */
                int len = regerror (err, pattern, 0, 0);
                char *buffer = g_malloc0 (len + 1);
-               
+
                regerror (err, pattern, buffer, len);
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Regular expression compilation failed: %s: %s"),
                                      match->str, buffer);
-               
+
                regfree (pattern);
        }
        d(printf("Built regex: '%s'\n", match->str));
        g_string_free (match, TRUE);
-       
+
        return err;
 }
 
@@ -182,13 +182,13 @@ soundexify (const gchar *sound, gchar code[5])
 {
        guchar *c, last = '\0';
        gint n;
-       
+
        for (c = (guchar *) sound; *c && !isalpha (*c); c++);
        code[0] = toupper (*c);
        memset (code + 1, '0', 3);
        for (n = 1; *c && n < 5; c++) {
                guchar ch = soundex_table[*c];
-               
+
                if (ch && ch != last) {
                        code[n++] = ch;
                        last = ch;
@@ -205,13 +205,13 @@ header_soundex (const char *header, const char *match)
        char c;
        GString *word;
        int truth = FALSE;
-       
+
        soundexify (match, mcode);
-       
+
        /* split the header into words, and soundexify and compare each one */
        /* FIXME: Should this convert to utf8, and split based on that, and what not?
           soundex only makes sense for us-ascii though ... */
-       
+
        word = g_string_new("");
        p = header;
        do {
@@ -227,7 +227,7 @@ header_soundex (const char *header, const char *match)
                        g_string_append_c (word, c);
        } while (c && !truth);
        g_string_free (word, TRUE);
-       
+
        return truth;
 }
 
@@ -237,52 +237,52 @@ camel_ustrstrcase (const char *haystack, const char *needle)
        gunichar *nuni, *puni;
        gunichar u;
        const unsigned char *p;
-       
+
        g_return_val_if_fail (haystack != NULL, NULL);
        g_return_val_if_fail (needle != NULL, NULL);
-       
+
        if (strlen (needle) == 0)
                return haystack;
        if (strlen (haystack) == 0)
                return NULL;
-       
+
        puni = nuni = g_alloca (sizeof (gunichar) * strlen (needle));
-       
+
        p = (const unsigned char *) needle;
        while ((u = camel_utf8_getc(&p)))
                *puni++ = g_unichar_tolower (u);
-       
+
        /* NULL means there was illegal utf-8 sequence */
        if (!p)
                return NULL;
-       
+
        p = (const unsigned char *)haystack;
        while ((u = camel_utf8_getc(&p))) {
                gunichar c;
-               
+
                c = g_unichar_tolower (u);
                /* We have valid stripped char */
                if (c == nuni[0]) {
                        const unsigned char *q = p;
                        gint npos = 1;
-                       
+
                        while (nuni + npos < puni) {
                                u = camel_utf8_getc(&q);
                                if (!q || !u)
                                        return NULL;
-                               
-                               c = g_unichar_tolower (u);                              
+
+                               c = g_unichar_tolower (u);
                                if (c != nuni[npos])
                                        break;
-                               
+
                                npos++;
                        }
-                       
+
                        if (nuni + npos == puni)
                                return (const char *) p;
                }
        }
-       
+
        return NULL;
 }
 
@@ -302,9 +302,9 @@ camel_ustrcasecmp (const char *ps1, const char *ps2)
        gunichar u1, u2 = 0;
        const unsigned char *s1 = (const unsigned char *)ps1;
        const unsigned char *s2 = (const unsigned char *)ps2;
-       
+
        CAMEL_SEARCH_COMPARE (s1, s2, NULL);
-       
+
        u1 = camel_utf8_getc(&s1);
        u2 = camel_utf8_getc(&s2);
        while (u1 && u2) {
@@ -314,17 +314,17 @@ camel_ustrcasecmp (const char *ps1, const char *ps2)
                        return -1;
                else if (u1 > u2)
                        return 1;
-               
+
                u1 = camel_utf8_getc(&s1);
                u2 = camel_utf8_getc(&s2);
        }
-       
+
        /* end of one of the strings ? */
        CAMEL_SEARCH_COMPARE (u1, u2, 0);
-       
+
        /* if we have invalid utf8 sequence ?  */
        CAMEL_SEARCH_COMPARE (s1, s2, NULL);
-       
+
        return 0;
 }
 
@@ -334,9 +334,9 @@ camel_ustrncasecmp (const char *ps1, const char *ps2, size_t len)
        gunichar u1, u2 = 0;
        const unsigned char *s1 = (const unsigned char *)ps1;
        const unsigned char *s2 = (const unsigned char *)ps2;
-       
+
        CAMEL_SEARCH_COMPARE (s1, s2, NULL);
-       
+
        u1 = camel_utf8_getc(&s1);
        u2 = camel_utf8_getc(&s2);
        while (len > 0 && u1 && u2) {
@@ -346,21 +346,21 @@ camel_ustrncasecmp (const char *ps1, const char *ps2, size_t len)
                        return -1;
                else if (u1 > u2)
                        return 1;
-               
+
                len--;
                u1 = camel_utf8_getc(&s1);
                u2 = camel_utf8_getc(&s2);
        }
-       
+
        if (len == 0)
                return 0;
-       
+
        /* end of one of the strings ? */
        CAMEL_SEARCH_COMPARE (u1, u2, 0);
-       
+
        /* if we have invalid utf8 sequence ?  */
        CAMEL_SEARCH_COMPARE (s1, s2, NULL);
-       
+
        return 0;
 }
 
@@ -371,7 +371,7 @@ header_match(const char *value, const char *match, camel_search_match_t how)
        const unsigned char *p;
        int vlen, mlen;
        gunichar c;
-       
+
        if (how == CAMEL_SEARCH_MATCH_SOUNDEX)
                return header_soundex (value, match);
 
@@ -379,7 +379,7 @@ header_match(const char *value, const char *match, camel_search_match_t how)
        mlen = strlen(match);
        if (vlen < mlen)
                return FALSE;
-       
+
        /* from dan the man, if we have mixed case, perform a case-sensitive match,
           otherwise not */
        p = (const unsigned char *)match;
@@ -400,7 +400,7 @@ header_match(const char *value, const char *match, camel_search_match_t how)
                        return FALSE;
                }
        }
-       
+
        switch (how) {
        case CAMEL_SEARCH_MATCH_EXACT:
                return camel_ustrcasecmp(value, match) == 0;
@@ -413,7 +413,7 @@ header_match(const char *value, const char *match, camel_search_match_t how)
        default:
                break;
        }
-       
+
        return FALSE;
 }
 
@@ -476,7 +476,7 @@ camel_search_header_match (const char *value, const char *match, camel_search_ma
 
                for (i=0; !truth && camel_internet_address_get(cia, i, &name, &addr);i++)
                        truth = (name && header_match(name, match, how)) || (addr && header_match(addr, match, how));
-               
+
                camel_object_unref (cia);
                break;
        }
@@ -492,12 +492,12 @@ camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
        CamelDataWrapper *containee;
        int truth = FALSE;
        int parts, i;
-       
+
        containee = camel_medium_get_content_object (CAMEL_MEDIUM (object));
-       
+
        if (containee == NULL)
                return FALSE;
-       
+
        /* using the object types is more accurate than using the mime/types */
        if (CAMEL_IS_MULTIPART (containee)) {
                parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
@@ -512,13 +512,13 @@ camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
        } else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
                /* for all other text parts, we look inside, otherwise we dont care */
                CamelStreamMem *mem = (CamelStreamMem *)camel_stream_mem_new ();
-               
+
                camel_data_wrapper_write_to_stream (containee, CAMEL_STREAM (mem));
                camel_stream_write (CAMEL_STREAM (mem), "", 1);
                truth = regexec (pattern, (char *) mem->buffer->data, 0, NULL, 0) == 0;
                camel_object_unref (mem);
        }
-       
+
        return truth;
 }
 
@@ -566,7 +566,7 @@ camel_search_words_split(const unsigned char *in)
        guint32 c;
        int inquote = 0;
 
-       words = g_malloc0(sizeof(*words));      
+       words = g_malloc0(sizeof(*words));
        w = g_string_new("");
 
        do {
@@ -618,7 +618,7 @@ camel_search_words_simple(struct _camel_search_words *wordin)
        struct _camel_search_words *words;
        guint32 c;
 
-       words = g_malloc0(sizeof(*words));      
+       words = g_malloc0(sizeof(*words));
 
        for (i=0;i<wordin->len;i++) {
                if ((wordin->words[i]->type & CAMEL_SEARCH_WORD_COMPLEX) == 0) {
index 18c8193..11c1317 100644 (file)
@@ -72,13 +72,13 @@ static void
 camel_service_class_init (CamelServiceClass *camel_service_class)
 {
        CamelObjectClass *object_class = CAMEL_OBJECT_CLASS (camel_service_class);
-       
+
        parent_class = camel_type_get_global_classfuncs (CAMEL_OBJECT_TYPE);
-       
+
        /* virtual method overloading */
        object_class->setv = service_setv;
        object_class->getv = service_getv;
-       
+
        /* virtual method definition */
        camel_service_class->construct = construct;
        camel_service_class->connect = service_connect;
@@ -93,7 +93,7 @@ static void
 camel_service_init (void *o, void *k)
 {
        CamelService *service = o;
-       
+
        service->priv = g_malloc0(sizeof(*service->priv));
        g_static_rec_mutex_init(&service->priv->connect_lock);
        g_static_mutex_init(&service->priv->connect_op_lock);
@@ -106,7 +106,7 @@ camel_service_finalize (CamelObject *object)
 
        if (service->status == CAMEL_SERVICE_CONNECTED) {
                CamelException ex;
-               
+
                camel_exception_init (&ex);
                CSERV_CLASS (service)->disconnect (service, TRUE, &ex);
                if (camel_exception_is_set (&ex)) {
@@ -115,15 +115,15 @@ camel_service_finalize (CamelObject *object)
                }
                camel_exception_clear (&ex);
        }
-       
+
        if (service->url)
                camel_url_free (service->url);
        if (service->session)
                camel_object_unref (service->session);
-       
+
        g_static_rec_mutex_free (&service->priv->connect_lock);
        g_static_mutex_free (&service->priv->connect_op_lock);
-       
+
        g_free (service->priv);
 }
 
@@ -133,7 +133,7 @@ CamelType
 camel_service_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type =
                        camel_type_register (CAMEL_OBJECT_TYPE,
@@ -145,7 +145,7 @@ camel_service_get_type (void)
                                             (CamelObjectInitFunc) camel_service_init,
                                             camel_service_finalize );
        }
-       
+
        return type;
 }
 
@@ -158,15 +158,15 @@ service_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
        gboolean reconnect = FALSE;
        guint32 tag;
        int i;
-       
+
        for (i = 0; i < args->argc; i++) {
                tag = args->argv[i].tag;
-               
+
                /* make sure this is an arg we're supposed to handle */
                if ((tag & CAMEL_ARG_TAG) <= CAMEL_SERVICE_ARG_FIRST ||
                    (tag & CAMEL_ARG_TAG) >= CAMEL_SERVICE_ARG_FIRST + 100)
                        continue;
-               
+
                if (tag == CAMEL_SERVICE_USERNAME) {
                        /* set the username */
                        if (strcmp (url->user, args->argv[i].ca_str) != 0) {
@@ -201,18 +201,18 @@ service_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
                        /* error? */
                        continue;
                }
-               
+
                /* let our parent know that we've handled this arg */
                camel_argv_ignore (args, i);
        }
-       
+
        /* FIXME: what if we are in the process of connecting? */
        if (reconnect && service->status == CAMEL_SERVICE_CONNECTED) {
                /* reconnect the service using the new URL */
                if (camel_service_disconnect (service, TRUE, ex))
                        camel_service_connect (service, ex);
        }
-       
+
        return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
 }
 
@@ -223,15 +223,15 @@ service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
        CamelURL *url = service->url;
        guint32 tag;
        int i;
-       
+
        for (i = 0; i < args->argc; i++) {
                tag = args->argv[i].tag;
-               
+
                /* make sure this is an arg we're supposed to handle */
                if ((tag & CAMEL_ARG_TAG) <= CAMEL_SERVICE_ARG_FIRST ||
                    (tag & CAMEL_ARG_TAG) >= CAMEL_SERVICE_ARG_FIRST + 100)
                        continue;
-               
+
                switch (tag) {
                case CAMEL_SERVICE_USERNAME:
                        /* get the username */
@@ -258,7 +258,7 @@ service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
                        break;
                }
        }
-       
+
        return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
 }
 
@@ -266,7 +266,7 @@ static void
 construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex)
 {
        char *err, *url_string;
-       
+
        if (CAMEL_PROVIDER_NEEDS (provider, CAMEL_URL_PART_USER) &&
            (url->user == NULL || url->user[0] == '\0')) {
                err = _("URL '%s' needs a username component");
@@ -280,12 +280,12 @@ construct (CamelService *service, CamelSession *session, CamelProvider *provider
                err = _("URL '%s' needs a path component");
                goto fail;
        }
-       
+
        service->provider = provider;
        service->url = camel_url_copy(url);
        service->session = session;
        camel_object_ref (session);
-       
+
        service->status = CAMEL_SERVICE_DISCONNECTED;
 
        return;
@@ -313,7 +313,7 @@ camel_service_construct (CamelService *service, CamelSession *session,
 {
        g_return_if_fail (CAMEL_IS_SERVICE (service));
        g_return_if_fail (CAMEL_IS_SESSION (session));
-       
+
        CSERV_CLASS (service)->construct (service, session, provider, url, ex);
 }
 
@@ -343,13 +343,13 @@ camel_service_connect (CamelService *service, CamelException *ex)
 {
        gboolean ret = FALSE;
        gboolean unreg = FALSE;
-       
+
        g_return_val_if_fail (CAMEL_IS_SERVICE (service), FALSE);
        g_return_val_if_fail (service->session != NULL, FALSE);
        g_return_val_if_fail (service->url != NULL, FALSE);
-       
+
        CAMEL_SERVICE_REC_LOCK (service, connect_lock);
-       
+
        if (service->status == CAMEL_SERVICE_CONNECTED) {
                CAMEL_SERVICE_REC_UNLOCK (service, connect_lock);
                return TRUE;
@@ -375,14 +375,14 @@ camel_service_connect (CamelService *service, CamelException *ex)
        if (service->connect_op) {
                if (unreg)
                        camel_operation_unregister (service->connect_op);
-               
+
                camel_operation_unref (service->connect_op);
                service->connect_op = NULL;
        }
        CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
 
        CAMEL_SERVICE_REC_UNLOCK (service, connect_lock);
-       
+
        return ret;
 }
 
@@ -392,9 +392,9 @@ service_disconnect (CamelService *service, gboolean clean, CamelException *ex)
        /*service->connect_level--;*/
 
        /* We let people get away with not having a disconnect
-        * function -- CamelMboxStore, for example. 
+        * function -- CamelMboxStore, for example.
         */
-       
+
        return TRUE;
 }
 
@@ -418,7 +418,7 @@ camel_service_disconnect (CamelService *service, gboolean clean,
        int unreg = FALSE;
 
        CAMEL_SERVICE_REC_LOCK (service, connect_lock);
-       
+
        if (service->status != CAMEL_SERVICE_DISCONNECTED
            && service->status != CAMEL_SERVICE_DISCONNECTING) {
                CAMEL_SERVICE_LOCK (service, connect_op_lock);
@@ -442,9 +442,9 @@ camel_service_disconnect (CamelService *service, gboolean clean,
                service->connect_op = NULL;
                CAMEL_SERVICE_UNLOCK (service, connect_op_lock);
        }
-       
+
        CAMEL_SERVICE_REC_UNLOCK (service, connect_lock);
-       
+
                service->status = CAMEL_SERVICE_DISCONNECTED;
        return res;
 }
@@ -495,7 +495,7 @@ get_name (CamelService *service, gboolean brief)
        w(g_warning ("CamelService::get_name not implemented for `%s'",
                     camel_type_to_name (CAMEL_OBJECT_GET_TYPE (service))));
        return g_strdup ("???");
-}              
+}
 
 
 /**
@@ -515,7 +515,7 @@ camel_service_get_name (CamelService *service, gboolean brief)
 {
        g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
        g_return_val_if_fail (service->url, NULL);
-       
+
        return CSERV_CLASS (service)->get_name (service, brief);
 }
 
@@ -527,18 +527,18 @@ get_path (CamelService *service)
        CamelURL *url = service->url;
        GString *gpath;
        char *path;
-       
+
        /* A sort of ad-hoc default implementation that works for our
         * current set of services.
         */
-       
+
        gpath = g_string_new (service->provider->protocol);
        if (CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_USER)) {
                if (CAMEL_PROVIDER_ALLOWS (prov, CAMEL_URL_PART_HOST)) {
                        g_string_append_printf (gpath, "/%s@%s",
                                                url->user ? url->user : "",
                                                url->host ? url->host : "");
-                       
+
                        if (url->port)
                                g_string_append_printf (gpath, ":%d", url->port);
                } else {
@@ -549,19 +549,19 @@ get_path (CamelService *service)
                g_string_append_printf (gpath, "/%s%s",
                                        CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_HOST) ? "" : "@",
                                        url->host ? url->host : "");
-               
+
                if (url->port)
                        g_string_append_printf (gpath, ":%d", url->port);
        }
-       
+
        if (CAMEL_PROVIDER_NEEDS (prov, CAMEL_URL_PART_PATH))
                g_string_append_printf (gpath, "%s%s", *url->path == '/' ? "" : "/", url->path);
-       
+
        path = gpath->str;
        g_string_free (gpath, FALSE);
-       
+
        return path;
-}              
+}
 
 /**
  * camel_service_get_path:
@@ -580,7 +580,7 @@ camel_service_get_path (CamelService *service)
 {
        g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
        g_return_val_if_fail (service->url, NULL);
-       
+
        return CSERV_CLASS (service)->get_path (service);
 }
 
@@ -637,12 +637,12 @@ GList *
 camel_service_query_auth_types (CamelService *service, CamelException *ex)
 {
        GList *ret;
-       
+
        /* note that we get the connect lock here, which means the callee
           must not call the connect functions itself */
        CAMEL_SERVICE_REC_LOCK (service, connect_lock);
        ret = CSERV_CLASS (service)->query_auth_types (service, ex);
        CAMEL_SERVICE_REC_UNLOCK (service, connect_lock);
-       
+
        return ret;
 }
index 400cdd1..4202d9e 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-service.h : Abstract class for an email service */
-/* 
+/*
  *
  * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
  *          Michael Zucchi <notzed@ximian.com>
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -79,7 +79,7 @@ typedef struct {
                                        CamelURL *url,
                                        CamelException *ex);
 
-       gboolean  (*connect)           (CamelService *service, 
+       gboolean  (*connect)           (CamelService *service,
                                        CamelException *ex);
        gboolean  (*disconnect)        (CamelService *service,
                                        gboolean clean,
@@ -100,7 +100,7 @@ typedef struct {
        char *name;               /* user-friendly name */
        char *description;
        char *authproto;
-       
+
        gboolean need_password;   /* needs a password to authenticate */
 } CamelServiceAuthType;
 
@@ -108,9 +108,9 @@ typedef struct {
 void                camel_service_construct          (CamelService *service,
                                                      CamelSession *session,
                                                      CamelProvider *provider,
-                                                     CamelURL *url, 
+                                                     CamelURL *url,
                                                      CamelException *ex);
-gboolean            camel_service_connect            (CamelService *service, 
+gboolean            camel_service_connect            (CamelService *service,
                                                      CamelException *ex);
 gboolean            camel_service_disconnect         (CamelService *service,
                                                      gboolean clean,
index 0f1b3a7..a988df0 100644 (file)
@@ -73,7 +73,7 @@ camel_session_init (CamelSession *session)
        session->online = TRUE;
        session->network_state = TRUE;
        session->priv = g_malloc0(sizeof(*session->priv));
-       
+
        session->priv->lock = g_mutex_new();
        session->priv->thread_lock = g_mutex_new();
        session->priv->thread_id = 1;
@@ -86,7 +86,7 @@ camel_session_finalise (CamelObject *o)
 {
        CamelSession *session = (CamelSession *)o;
        GThreadPool *thread_pool = session->priv->thread_pool;
-       
+
        g_hash_table_destroy(session->priv->thread_active);
 
        if (thread_pool != NULL) {
@@ -96,10 +96,10 @@ camel_session_finalise (CamelObject *o)
        }
 
        g_free(session->storage_path);
-       
+
        g_mutex_free(session->priv->lock);
        g_mutex_free(session->priv->thread_lock);
-       
+
        g_free(session->priv);
 }
 
@@ -109,7 +109,7 @@ camel_session_class_init (CamelSessionClass *camel_session_class)
        /* virtual method definition */
        camel_session_class->get_service = get_service;
        camel_session_class->get_storage_path = get_storage_path;
-       
+
        camel_session_class->thread_msg_new = session_thread_msg_new;
        camel_session_class->thread_msg_free = session_thread_msg_free;
        camel_session_class->thread_queue = session_thread_queue;
@@ -160,7 +160,7 @@ get_service (CamelSession *session, const char *url_string,
        CamelProvider *provider;
        CamelService *service;
        CamelException internal_ex;
-       
+
        url = camel_url_new (url_string, ex);
        if (!url)
                return NULL;
@@ -174,7 +174,7 @@ get_service (CamelSession *session, const char *url_string,
                                      url->protocol);
                provider = NULL;
        }
-       
+
        if (!provider) {
                camel_url_free (url);
                return NULL;
@@ -185,7 +185,7 @@ get_service (CamelSession *session, const char *url_string,
         */
        if (url->path && !CAMEL_PROVIDER_ALLOWS (provider, CAMEL_URL_PART_PATH))
                camel_url_set_path (url, NULL);
-       
+
        /* Now look up the service in the provider's cache */
        service = camel_object_bag_reserve(provider->service_cache[type], url);
        if (service == NULL) {
@@ -287,7 +287,7 @@ get_storage_path (CamelSession *session, CamelService *service, CamelException *
        path = g_strdup_printf ("%s/%s", session->storage_path, p);
        g_free (p);
 
-#ifdef G_OS_WIN32 
+#ifdef G_OS_WIN32
        if (g_access (path, F_OK) == 0)
 #else
        if (access (path, F_OK) == 0)
@@ -356,7 +356,7 @@ camel_session_get_storage_path (CamelSession *session, CamelService *service,
  * If #CAMEL_SESSION_PASSWORD_STATIC is set, it means the password returned
  * will be stored statically by the caller automatically, for the current
  * session.
- * 
+ *
  * The authenticator should set @ex to #CAMEL_EXCEPTION_USER_CANCEL if
  * the user did not provide the information. The caller must #g_free
  * the information returned when it is done with it.
@@ -372,7 +372,7 @@ camel_session_get_password (CamelSession *session, CamelService *service,
        g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
        g_return_val_if_fail (prompt != NULL, NULL);
        g_return_val_if_fail (item != NULL, NULL);
-       
+
        return CS_CLASS (session)->get_password (session, service, domain, prompt, item, flags, ex);
 }
 
@@ -512,7 +512,7 @@ static void session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg
        CAMEL_SESSION_UNLOCK(session, thread_lock);
 
        d(printf("free msg, ops->free = %p\n", msg->ops->free));
-       
+
        if (msg->ops->free)
                msg->ops->free(session, msg);
        if (msg->op)
@@ -581,7 +581,7 @@ static void session_thread_status(CamelSession *session, CamelSessionThreadMsg *
  * @session: a #CamelSession object
  * @ops: thread operations
  * @size: number of bytes
- * 
+ *
  * Create a new thread message, using ops as the receive/reply/free
  * ops, of @size bytes.
  *
@@ -596,7 +596,7 @@ camel_session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops,
        g_assert(CAMEL_IS_SESSION(session));
        g_assert(ops != NULL);
        g_assert(size >= sizeof(CamelSessionThreadMsg));
-                
+
        return CS_CLASS (session)->thread_msg_new(session, ops, size);
 }
 
@@ -604,7 +604,7 @@ camel_session_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops,
  * camel_session_thread_msg_free:
  * @session: a #CamelSession object
  * @msg: a #CamelSessionThreadMsg
- * 
+ *
  * Free a @msg.  Note that the message must have been allocated using
  * msg_new, and must nto have been submitted to any queue function.
  **/
@@ -623,11 +623,11 @@ camel_session_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *msg)
  * @session: a #CamelSession object
  * @msg: a #CamelSessionThreadMsg
  * @flags: queue type flags, currently 0.
- * 
+ *
  * Queue a thread message in another thread for processing.
  * The operation should be (but needn't) run in a queued manner
  * with other operations queued in this manner.
- * 
+ *
  * Returns the id of the operation queued
  **/
 int
@@ -643,14 +643,14 @@ camel_session_thread_queue(CamelSession *session, CamelSessionThreadMsg *msg, in
  * camel_session_thread_wait:
  * @session: a #CamelSession object
  * @id: id of the operation to wait on
- * 
+ *
  * Wait on an operation to complete (by id).
  **/
 void
 camel_session_thread_wait(CamelSession *session, int id)
 {
        g_assert(CAMEL_IS_SESSION(session));
-       
+
        if (id == -1)
                return;
 
@@ -660,7 +660,7 @@ camel_session_thread_wait(CamelSession *session, int id)
 /**
  * camel_session_check_junk:
  * @session: a #CamelSession object
- * 
+ *
  * Do we have to check incoming messages to be junk?
  *
  * Returns whether or not we are checking incoming messages for junk
@@ -677,7 +677,7 @@ camel_session_check_junk (CamelSession *session)
  * camel_session_set_check_junk:
  * @session: a #CamelSession object
  * @check_junk: state
- * 
+ *
  * Set check_junk flag, if set, incoming mail will be checked for being junk.
  **/
 void
@@ -692,7 +692,7 @@ gboolean
 camel_session_get_network_state (CamelSession *session)
 {
        g_return_val_if_fail (CAMEL_IS_SESSION(session), FALSE);
-       
+
        return session->network_state;
 }
 
@@ -700,6 +700,6 @@ void
 camel_session_set_network_state (CamelSession *session, gboolean network_state)
 {
        g_return_if_fail (CAMEL_IS_SESSION(session));
-       
+
        session->network_state = network_state;
 }
index 183c597..704ec46 100644 (file)
@@ -101,7 +101,7 @@ typedef struct {
        CamelFilterDriver * (*get_filter_driver) (CamelSession *session,
                                                  const char *type,
                                                  CamelException *ex);
-       
+
        /* mechanism for creating and maintaining multiple threads of control */
        void *(*thread_msg_new)(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size);
        void (*thread_msg_free)(CamelSession *session, CamelSessionThreadMsg *msg);
@@ -124,9 +124,9 @@ CamelService *  camel_session_get_service           (CamelSession *session,
                                                     const char *url_string,
                                                     CamelProviderType type,
                                                     CamelException *ex);
-CamelService *  camel_session_get_service_connected (CamelSession *session, 
+CamelService *  camel_session_get_service_connected (CamelSession *session,
                                                     const char *url_string,
-                                                    CamelProviderType type, 
+                                                    CamelProviderType type,
                                                     CamelException *ex);
 
 #define camel_session_get_store(session, url_string, ex) \
index 4213e6d..50347bb 100644 (file)
@@ -4,7 +4,7 @@
  *           Michael Zucchi <notzed@ximian.com>
  *
  *  The Initial Developer of the Original Code is Netscape
- *  Communications Corporation.  Portions created by Netscape are 
+ *  Communications Corporation.  Portions created by Netscape are
  *  Copyright (C) 1994-2000 Netscape Communications Corporation.  All
  *  Rights Reserved.
  *
@@ -99,15 +99,15 @@ camel_smime_context_new(CamelSession *session)
 {
        CamelCipherContext *cipher;
        CamelSMIMEContext *ctx;
-       
+
        g_return_val_if_fail(CAMEL_IS_SESSION(session), NULL);
-       
+
        ctx =(CamelSMIMEContext *) camel_object_new(camel_smime_context_get_type());
-       
+
        cipher =(CamelCipherContext *) ctx;
        cipher->session = session;
        camel_object_ref(session);
-       
+
        return cipher;
 }
 
@@ -155,21 +155,21 @@ camel_smime_context_describe_part(CamelSMIMEContext *context, CamelMimePart *par
                camel_data_wrapper_decode_to_stream(camel_medium_get_content_object((CamelMedium *)part), (CamelStream *)istream);
                camel_stream_reset((CamelStream *)istream);
 
-               dec = NSS_CMSDecoder_Start(NULL, 
+               dec = NSS_CMSDecoder_Start(NULL,
                                           NULL, NULL,
                                           NULL, NULL,  /* password callback    */
                                           NULL, NULL); /* decrypt key callback */
-               
+
                NSS_CMSDecoder_Update(dec, istream->buffer->data, istream->buffer->len);
                camel_object_unref(istream);
-               
+
                cmsg = NSS_CMSDecoder_Finish(dec);
                if (cmsg) {
                        if (NSS_CMSMessage_IsSigned(cmsg)) {
                                printf("message is signed\n");
                                flags |= CAMEL_SMIME_SIGNED;
                        }
-                       
+
                        if (NSS_CMSMessage_IsEncrypted(cmsg)) {
                                printf("message is encrypted\n");
                                flags |= CAMEL_SMIME_ENCRYPTED;
@@ -212,7 +212,7 @@ sm_id_to_hash(CamelCipherContext *context, const char *id)
                else if (!strcmp(id, "sha1"))
                        return CAMEL_CIPHER_HASH_SHA1;
        }
-       
+
        return CAMEL_CIPHER_HASH_DEFAULT;
 }
 
@@ -393,7 +393,7 @@ sm_sign(CamelCipherContext *context, const char *userid, CamelCipherHash hash, C
                goto fail;
        }
 
-       enc = NSS_CMSEncoder_Start(cmsg, 
+       enc = NSS_CMSEncoder_Start(cmsg,
                                   sm_write_stream, ostream, /* DER output callback  */
                                   NULL, NULL,     /* destination storage  */
                                   NULL, NULL,     /* password callback    */
@@ -450,7 +450,7 @@ sm_sign(CamelCipherContext *context, const char *userid, CamelCipherHash hash, C
                mps->contentraw = istream;
                camel_stream_reset(istream);
                camel_object_ref(istream);
-               
+
                camel_medium_set_content_object((CamelMedium *)opart, (CamelDataWrapper *)mps);
        } else {
                ct = camel_content_type_new("application", "x-pkcs7-mime");
@@ -458,7 +458,7 @@ sm_sign(CamelCipherContext *context, const char *userid, CamelCipherHash hash, C
                camel_content_type_set_param(ct, "smime-type", "signed-data");
                camel_data_wrapper_set_mime_type_field(dw, ct);
                camel_content_type_unref(ct);
-               
+
                camel_medium_set_content_object((CamelMedium *)opart, dw);
 
                camel_mime_part_set_filename(opart, "smime.p7m");
@@ -466,9 +466,9 @@ sm_sign(CamelCipherContext *context, const char *userid, CamelCipherHash hash, C
                camel_mime_part_set_disposition(opart, "attachment");
                camel_mime_part_set_encoding(opart, CAMEL_TRANSFER_ENCODING_BASE64);
        }
-       
+
        camel_object_unref(dw);
-fail:  
+fail:
        camel_object_unref(ostream);
        camel_object_unref(istream);
 
@@ -556,7 +556,7 @@ sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *ex
                                }
 
                                digestalgs = NSS_CMSSignedData_GetDigestAlgs(sigd);
-                               
+
                                digcx = NSS_CMSDigestContext_StartMultiple(digestalgs);
                                if (digcx == NULL) {
                                        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot calculate digests"));
@@ -596,7 +596,7 @@ sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *ex
                        /* check for certs-only message */
                        nsigners = NSS_CMSSignedData_SignerInfoCount(sigd);
                        if (nsigners == 0) {
-                                                          
+
                                /* already imported certs above, not sure what usage we should use here or if this isn't handled above */
                                if (NSS_CMSSignedData_VerifyCertsOnly(sigd, p->certdb, certUsageEmailSigner) != SECSuccess) {
                                        g_string_printf(description, _("Certificate is the only message, cannot verify certificates"));
@@ -613,26 +613,26 @@ sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *ex
                                for (j = 0; j < nsigners; j++) {
                                        NSSCMSSignerInfo *si;
                                        char *cn, *em;
-                                       
+
                                        si = NSS_CMSSignedData_GetSignerInfo(sigd, j);
                                        NSS_CMSSignedData_VerifySignerInfo(sigd, j, p->certdb, certUsageEmailSigner);
-                                       
+
                                        status = NSS_CMSSignerInfo_GetVerificationStatus(si);
-                                       
+
                                        cn = NSS_CMSSignerInfo_GetSignerCommonName(si);
                                        em = NSS_CMSSignerInfo_GetSignerEmailAddress(si);
-                                       
+
                                        g_string_append_printf(description, _("Signer: %s <%s>: %s\n"),
                                                               cn?cn:"<unknown>", em?em:"<unknown>",
                                                               sm_status_description(status));
-                                       
+
                                        camel_cipher_validity_add_certinfo(valid, CAMEL_CIPHER_VALIDITY_SIGN, cn, em);
 
                                        if (cn)
                                                PORT_Free(cn);
                                        if (em)
                                                PORT_Free(em);
-                                       
+
                                        if (status != NSSCMSVS_GoodSignature)
                                                camel_cipher_validity_set_valid(valid, FALSE);
                                }
@@ -682,7 +682,7 @@ sm_verify(CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
 
        /* FIXME: we should stream this to the decoder */
        mem = (CamelStreamMem *)camel_stream_mem_new();
-       
+
        if (camel_content_type_is(ct, "multipart", "signed")) {
                CamelMultipart *mps = (CamelMultipart *)dw;
 
@@ -714,7 +714,7 @@ sm_verify(CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
                goto fail;
        }
 
-       dec = NSS_CMSDecoder_Start(NULL, 
+       dec = NSS_CMSDecoder_Start(NULL,
                                   NULL, NULL, /* content callback     */
                                   NULL, NULL,  /* password callback    */
                                   NULL, NULL); /* decrypt key callback */
@@ -726,9 +726,9 @@ sm_verify(CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Decoder failed"));
                goto fail;
        }
-       
+
        valid = sm_verify_cmsg(context, cmsg, constream, ex);
-       
+
        NSS_CMSMessage_Destroy(cmsg);
 fail:
        camel_object_unref(mem);
@@ -874,7 +874,7 @@ sm_encrypt(CamelCipherContext *context, const char *userid, GPtrArray *recipient
        for (i=0;recipient_certs[i];i++)
                CERT_DestroyCertificate(recipient_certs[i]);
        PORT_FreeArena(poolp, PR_FALSE);
-       
+
        dw = camel_data_wrapper_new();
        camel_data_wrapper_construct_from_stream(dw, ostream);
        camel_object_unref(ostream);
@@ -934,7 +934,7 @@ sm_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *opa
        camel_data_wrapper_decode_to_stream(camel_medium_get_content_object((CamelMedium *)ipart), (CamelStream *)istream);
        camel_stream_reset((CamelStream *)istream);
 
-       dec = NSS_CMSDecoder_Start(NULL, 
+       dec = NSS_CMSDecoder_Start(NULL,
                                   sm_write_stream, ostream, /* content callback     */
                                   NULL, NULL,
                                   NULL, NULL); /* decrypt key callback */
@@ -981,7 +981,7 @@ static int
 sm_import_keys(CamelCipherContext *context, CamelStream *istream, CamelException *ex)
 {
        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("import keys: unimplemented"));
-       
+
        return -1;
 }
 
@@ -989,7 +989,7 @@ static int
 sm_export_keys(CamelCipherContext *context, GPtrArray *keys, CamelStream *ostream, CamelException *ex)
 {
        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("export keys: unimplemented"));
-       
+
        return -1;
 }
 
@@ -999,9 +999,9 @@ static void
 camel_smime_context_class_init(CamelSMIMEContextClass *klass)
 {
        CamelCipherContextClass *cipher_class = CAMEL_CIPHER_CONTEXT_CLASS(klass);
-       
+
        parent_class = CAMEL_CIPHER_CONTEXT_CLASS(camel_type_get_global_classfuncs(camel_cipher_context_get_type()));
-       
+
        cipher_class->hash_to_id = sm_hash_to_id;
        cipher_class->id_to_hash = sm_id_to_hash;
        cipher_class->sign = sm_sign;
@@ -1016,7 +1016,7 @@ static void
 camel_smime_context_init(CamelSMIMEContext *context)
 {
        CamelCipherContext *cipher =(CamelCipherContext *) context;
-       
+
        cipher->sign_protocol = "application/x-pkcs7-signature";
        cipher->encrypt_protocol = "application/x-pkcs7-mime";
        cipher->key_protocol = "application/x-pkcs7-signature";
@@ -1041,7 +1041,7 @@ CamelType
 camel_smime_context_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_cipher_context_get_type(),
                                           "CamelSMIMEContext",
@@ -1052,7 +1052,7 @@ camel_smime_context_get_type(void)
                                           (CamelObjectInitFunc) camel_smime_context_init,
                                           (CamelObjectFinalizeFunc) camel_smime_context_finalise);
        }
-       
+
        return type;
 }
 
index 8ff9a78..8bd8983 100644 (file)
@@ -107,7 +107,7 @@ camel_store_summary_init (CamelStoreSummary *s)
 
        s->folders = g_ptr_array_new();
        s->folders_path = g_hash_table_new(g_str_hash, g_str_equal);
-       
+
        p->summary_lock = g_mutex_new();
        p->io_lock = g_mutex_new();
        p->alloc_lock = g_mutex_new();
@@ -130,12 +130,12 @@ camel_store_summary_finalise (CamelObject *obj)
 
        if (s->store_info_chunks)
                e_memchunk_destroy(s->store_info_chunks);
-       
+
        g_mutex_free(p->summary_lock);
        g_mutex_free(p->io_lock);
        g_mutex_free(p->alloc_lock);
        g_mutex_free(p->ref_lock);
-       
+
        g_free(p);
 }
 
@@ -143,7 +143,7 @@ CamelType
 camel_store_summary_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_object_get_type (), "CamelStoreSummary",
                                            sizeof (CamelStoreSummary),
@@ -153,7 +153,7 @@ camel_store_summary_get_type (void)
                                            (CamelObjectInitFunc) camel_store_summary_init,
                                            (CamelObjectFinalizeFunc) camel_store_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -162,7 +162,7 @@ camel_store_summary_get_type (void)
  * camel_store_summary_new:
  *
  * Create a new #CamelStoreSummary object.
- * 
+ *
  * Returns a new #CamelStoreSummary object
  **/
 CamelStoreSummary *
@@ -176,7 +176,7 @@ camel_store_summary_new (void)
  * camel_store_summary_set_filename:
  * @summary: a #CamelStoreSummary
  * @filename: a filename
- * 
+ *
  * Set the filename where the summary will be loaded to/saved from.
  **/
 void
@@ -214,9 +214,9 @@ camel_store_summary_set_uri_base(CamelStoreSummary *s, CamelURL *base)
 /**
  * camel_store_summary_count:
  * @summary: a #CamelStoreSummary object
- * 
+ *
  * Get the number of summary items stored in this summary.
- * 
+ *
  * Returns the number of items int he summary.
  **/
 int
@@ -230,14 +230,14 @@ camel_store_summary_count(CamelStoreSummary *s)
  * camel_store_summary_index:
  * @summary: a #CamelStoreSummary object
  * @index: record index
- * 
+ *
  * Retrieve a summary item by index number.
  *
  * A referenced to the summary item is returned, which may be ref'd or
  * free'd as appropriate.
  *
  * It must be freed using #camel_store_summary_info_free.
- * 
+ *
  * Returns the summary item, or %NULL if @index is out of range
  **/
 CamelStoreInfo *
@@ -265,7 +265,7 @@ camel_store_summary_index(CamelStoreSummary *s, int i)
 /**
  * camel_store_summary_array:
  * @summary: a #CamelStoreSummary object
- * 
+ *
  * Obtain a copy of the summary array.  This is done atomically,
  * so cannot contain empty entries.
  *
@@ -279,7 +279,7 @@ camel_store_summary_array(CamelStoreSummary *s)
        CamelStoreInfo *info;
        GPtrArray *res = g_ptr_array_new();
        int i;
-       
+
        CAMEL_STORE_SUMMARY_LOCK(s, ref_lock);
        CAMEL_STORE_SUMMARY_LOCK(s, summary_lock);
 
@@ -300,7 +300,7 @@ camel_store_summary_array(CamelStoreSummary *s)
  * camel_store_summary_array_free:
  * @summary: a #CamelStoreSummary object
  * @array: the summary array as gotten from #camel_store_summary_array
- * 
+ *
  * Free the folder summary array.
  **/
 void
@@ -319,7 +319,7 @@ camel_store_summary_array_free(CamelStoreSummary *s, GPtrArray *array)
  * camel_store_summary_path:
  * @summary: a #CamelStoreSummary object
  * @path: path to the item
- * 
+ *
  * Retrieve a summary item by path name.
  *
  * A referenced to the summary item is returned, which may be ref'd or
@@ -386,7 +386,7 @@ camel_store_summary_load(CamelStoreSummary *s)
        }
 
        CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
-       
+
        if (fclose (in) != 0)
                return -1;
 
@@ -401,7 +401,7 @@ error:
        fclose (in);
        s->flags |= ~CAMEL_STORE_SUMMARY_DIRTY;
        errno = i;
-       
+
        return -1;
 }
 
@@ -409,10 +409,10 @@ error:
 /**
  * camel_store_summary_save:
  * @summary: a #CamelStoreSummary object
- * 
+ *
  * Writes the summary to disk.  The summary is only written if changes
  * have occured.
- * 
+ *
  * Returns %0 on succes or %-1 on fail
  **/
 int
@@ -470,14 +470,14 @@ camel_store_summary_save(CamelStoreSummary *s)
        }
 
        CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
-       
+
        if (fflush (out) != 0 || fsync (fileno (out)) == -1) {
                i = errno;
                fclose (out);
                errno = i;
                return -1;
        }
-       
+
        if (fclose (out) != 0)
                return -1;
 
@@ -489,11 +489,11 @@ camel_store_summary_save(CamelStoreSummary *s)
 /**
  * camel_store_summary_header_load:
  * @summary: a #CamelStoreSummary object
- * 
+ *
  * Only load the header information from the summary,
  * keep the rest on disk.  This should only be done on
  * a fresh summary object.
- * 
+ *
  * Returns %0 on success or %-1 on fail
  **/
 int
@@ -511,7 +511,7 @@ camel_store_summary_header_load(CamelStoreSummary *s)
        CAMEL_STORE_SUMMARY_LOCK(s, io_lock);
        ret = ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in);
        CAMEL_STORE_SUMMARY_UNLOCK(s, io_lock);
-       
+
        fclose(in);
        s->flags &= ~CAMEL_STORE_SUMMARY_DIRTY;
        return ret;
@@ -522,7 +522,7 @@ camel_store_summary_header_load(CamelStoreSummary *s)
  * camel_store_summary_add:
  * @summary: a #CamelStoreSummary object
  * @info: a #CamelStoreInfo
- * 
+ *
  * Adds a new @info record to the summary.  If @info->uid is %NULL,
  * then a new uid is automatically re-assigned by calling
  * #camel_store_summary_next_uid_string.
@@ -556,7 +556,7 @@ camel_store_summary_add(CamelStoreSummary *s, CamelStoreInfo *info)
  * camel_store_summary_add_from_path:
  * @summary: a #CamelStoreSummary object
  * @path: item path
- * 
+ *
  * Build a new info record based on the name, and add it to the summary.
  *
  * Returns the newly added record
@@ -589,7 +589,7 @@ camel_store_summary_add_from_path(CamelStoreSummary *s, const char *path)
  * camel_store_summary_info_new_from_path:
  * @summary: a #CamelStoreSummary object
  * @path: item path
- * 
+ *
  * Create a new info record from a name.
  *
  * This info record MUST be freed using
@@ -609,7 +609,7 @@ camel_store_summary_info_new_from_path(CamelStoreSummary *s, const char *path)
  * camel_store_summary_info_free:
  * @summary: a #CamelStoreSummary object
  * @info: a #CamelStoreInfo
- * 
+ *
  * Unref and potentially free @info, and all associated memory.
  **/
 void
@@ -630,7 +630,7 @@ camel_store_summary_info_free(CamelStoreSummary *s, CamelStoreInfo *info)
 
        CAMEL_STORE_SUMMARY_UNLOCK(s, ref_lock);
 
-       ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_free(s, info);              
+       ((CamelStoreSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->store_info_free(s, info);
 }
 
 
@@ -638,7 +638,7 @@ camel_store_summary_info_free(CamelStoreSummary *s, CamelStoreInfo *info)
  * camel_store_summary_info_ref:
  * @summary: a #CamelStoreSummary object
  * @info: a #CamelStoreInfo
- * 
+ *
  * Add an extra reference to @info.
  **/
 void
@@ -657,7 +657,7 @@ camel_store_summary_info_ref(CamelStoreSummary *s, CamelStoreInfo *info)
 /**
  * camel_store_summary_touch:
  * @summary: a #CamelStoreSummary object
- * 
+ *
  * Mark the summary as changed, so that a save will force it to be
  * written back to disk.
  **/
@@ -673,7 +673,7 @@ camel_store_summary_touch(CamelStoreSummary *s)
 /**
  * camel_store_summary_clear:
  * @summary: a #CamelStoreSummary object
- * 
+ *
  * Empty the summary contents.
  **/
 void
@@ -702,7 +702,7 @@ camel_store_summary_clear(CamelStoreSummary *s)
  * camel_store_summary_remove:
  * @summary: a #CamelStoreSummary object
  * @info: a #CamelStoreInfo
- * 
+ *
  * Remove a specific @info record from the summary.
  **/
 void
@@ -722,7 +722,7 @@ camel_store_summary_remove(CamelStoreSummary *s, CamelStoreInfo *info)
  * camel_store_summary_remove_path:
  * @summary: a #CamelStoreSummary object
  * @path: item path
- * 
+ *
  * Remove a specific info record from the summary, by @path.
  **/
 void
@@ -751,7 +751,7 @@ camel_store_summary_remove_path(CamelStoreSummary *s, const char *path)
  * camel_store_summary_remove_index:
  * @summary: a #CamelStoreSummary object
  * @index: item index
- * 
+ *
  * Remove a specific info record from the summary, by index.
  **/
 void
@@ -820,10 +820,10 @@ summary_header_save(CamelStoreSummary *s, FILE *out)
 /**
  * camel_store_summary_info_new:
  * @summary: a #CamelStoreSummary object
- * 
+ *
  * Allocate a new #CamelStoreInfo, suitable for adding to this
  * summary.
- * 
+ *
  * Returns the newly allocated #CamelStoreInfo
  **/
 CamelStoreInfo *
index 0548cc5..284d7b9 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-store.c : Abstract class for an email store */
 
-/* 
+/*
  * Authors:
  *  Bertrand Guiheneuf <bertrand@helixcode.com>
  *  Dan Winship <danw@ximian.com>
  *
  * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -89,9 +89,9 @@ camel_store_class_init (CamelStoreClass *camel_store_class)
 {
        CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (camel_store_class);
        CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(camel_store_class);
-       
+
        parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
-       
+
        /* virtual method definition */
        camel_store_class->hash_folder_name = g_str_hash;
        camel_store_class->compare_folder_name = g_str_equal;
@@ -109,13 +109,13 @@ camel_store_class_init (CamelStoreClass *camel_store_class)
        camel_store_class->subscribe_folder = subscribe_folder;
        camel_store_class->unsubscribe_folder = unsubscribe_folder;
        camel_store_class->noop = noop;
-       
+
        /* virtual method overload */
        camel_service_class->construct = construct;
-       
+
        camel_object_class->setv = store_setv;
        camel_object_class->getv = store_getv;
-       
+
        camel_object_class_add_event(camel_object_class, "folder_opened", NULL);
        camel_object_class_add_event(camel_object_class, "folder_created", NULL);
        camel_object_class_add_event(camel_object_class, "folder_deleted", NULL);
@@ -136,7 +136,7 @@ camel_store_init (void *o)
                                                      (CamelCopyFunc)g_strdup, g_free);
        } else
                store->folders = NULL;
-       
+
        /* set vtrash and vjunk on by default */
        store->flags = CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK;
        store->mode = CAMEL_STORE_READ|CAMEL_STORE_WRITE;
@@ -152,9 +152,9 @@ camel_store_finalize (CamelObject *object)
 
        if (store->folders)
                camel_object_bag_destroy(store->folders);
-       
+
        g_static_rec_mutex_free (&store->priv->folder_lock);
-       
+
        g_free (store->priv);
 }
 
@@ -211,14 +211,14 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
 {
        w(g_warning ("CamelStore::get_folder not implemented for `%s'",
                     camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-       
+
        camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_INVALID,
                              _("Cannot get folder: Invalid operation on this store"));
-       
+
        return NULL;
 }
 
-/** 
+/**
  * camel_store_get_folder:
  * @store: a #CamelStore object
  * @folder_name: name of the folder to get
@@ -226,20 +226,20 @@ get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelExce
  * @ex: a #CamelException
  *
  * Get a specific folder object from the store by name.
- * 
+ *
  * Returns the folder corresponding to the path @folder_name.
  **/
 CamelFolder *
 camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
 {
        CamelFolder *folder = NULL;
-       
+
        g_return_val_if_fail (folder_name != NULL, NULL);
-       
+
        /* O_EXCL doesn't make sense if we aren't requesting to also create the folder if it doesn't exist */
        if (!(flags & CAMEL_STORE_FOLDER_CREATE))
                flags &= ~CAMEL_STORE_FOLDER_EXCL;
-       
+
        if (store->folders) {
                /* Try cache first. */
                folder = camel_object_bag_reserve(store->folders, folder_name);
@@ -247,12 +247,12 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                              _("Cannot create folder `%s': folder exists"),
                                              folder_name);
-                       
+
                        camel_object_unref (folder);
                        return NULL;
                }
        }
-       
+
        if (!folder) {
                if ((store->flags & CAMEL_STORE_VTRASH) && strcmp(folder_name, CAMEL_VTRASH_NAME) == 0) {
                        folder = CS_CLASS(store)->get_trash(store, ex);
@@ -262,7 +262,7 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag
                        folder = CS_CLASS (store)->get_folder(store, folder_name, flags, ex);
                        if (folder) {
                                CamelVeeFolder *vfolder;
-                               
+
                                if ((store->flags & CAMEL_STORE_VTRASH)
                                    && (vfolder = camel_object_bag_get(store->folders, CAMEL_VTRASH_NAME))) {
                                        camel_vee_folder_add_folder(vfolder, folder);
@@ -307,20 +307,20 @@ create_folder (CamelStore *store, const char *parent_name,
 {
        w(g_warning ("CamelStore::create_folder not implemented for `%s'",
                     camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-       
+
        camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_INVALID,
                              _("Cannot create folder: Invalid operation on this store"));
-       
+
        return NULL;
 }
 
-/** 
+/**
  * camel_store_create_folder:
  * @store: a #CamelStore object
  * @parent_name: name of the new folder's parent, or %NULL
  * @folder_name: name of the folder to create
  * @ex: a #CamelException
- * 
+ *
  * Creates a new folder as a child of an existing folder.
  * @parent_name can be %NULL to create a new top-level folder.
  *
@@ -357,7 +357,7 @@ cs_delete_cached_folder(CamelStore *store, const char *folder_name)
        if (store->folders
            && (folder = camel_object_bag_get(store->folders, folder_name))) {
                CamelVeeFolder *vfolder;
-                       
+
                if ((store->flags & CAMEL_STORE_VTRASH)
                    && (vfolder = camel_object_bag_get(store->folders, CAMEL_VTRASH_NAME))) {
                        camel_vee_folder_remove_folder(vfolder, folder);
@@ -384,12 +384,12 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
                     camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
 }
 
-/** 
+/**
  * camel_store_delete_folder:
  * @store: a #CamelStore object
  * @folder_name: name of the folder to delete
  * @ex: a #CamelException
- * 
+ *
  * Deletes the named folder. The folder must be empty.
  **/
 void
@@ -415,7 +415,7 @@ camel_store_delete_folder (CamelStore *store, const char *folder_name, CamelExce
                cs_delete_cached_folder(store, folder_name);
        else
                camel_exception_xfer(ex, &local);
-       
+
        CAMEL_STORE_UNLOCK(store, folder_lock);
 }
 
@@ -432,7 +432,7 @@ rename_folder (CamelStore *store, const char *old_name, const char *new_name, Ca
  * @old_namein: the current name of the folder
  * @new_name: the new name of the folder
  * @ex: a #CamelException
- * 
+ *
  * Rename a named folder to a new name.
  **/
 void
@@ -508,7 +508,7 @@ camel_store_rename_folder (CamelStore *store, const char *old_namein, const char
                /* Emit renamed signal */
                if (store->flags & CAMEL_STORE_SUBSCRIPTIONS)
                        flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
-               
+
                reninfo.old_base = (char *)old_name;
                reninfo.new = ((CamelStoreClass *)((CamelObject *)store)->klass)->get_folder_info(store, new_name, flags, ex);
                if (reninfo.new != NULL) {
@@ -540,7 +540,7 @@ get_inbox (CamelStore *store, CamelException *ex)
        return CS_CLASS (store)->get_folder (store, "inbox", 0, ex);
 }
 
-/** 
+/**
  * camel_store_get_inbox:
  * @store: a #CamelStore object
  * @ex: a #CamelException
@@ -591,7 +591,7 @@ get_junk(CamelStore *store, CamelException *ex)
        return get_special(store, CAMEL_VTRASH_FOLDER_JUNK);
 }
 
-/** 
+/**
  * camel_store_get_trash:
  * @store: a #CamelStore object
  * @ex: a #CamelException
@@ -608,7 +608,7 @@ camel_store_get_trash (CamelStore *store, CamelException *ex)
                return camel_store_get_folder(store, CAMEL_VTRASH_NAME, 0, ex);
 }
 
-/** 
+/**
  * camel_store_get_junk:
  * @store: a #CamelStore object
  * @ex: a #CamelException
@@ -672,7 +672,7 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti
 {
        w(g_warning ("CamelStore::get_folder_info not implemented for `%s'",
                     camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-       
+
        return NULL;
 }
 
@@ -682,16 +682,16 @@ add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, co
        CamelFolderInfo *fi, *vinfo, *parent;
        char *uri, *path;
        CamelURL *url;
-       
+
        g_return_if_fail (info != NULL);
-       
+
        parent = NULL;
        for (fi = info; fi; fi = fi->next) {
                if (!strcmp (fi->full_name, name))
                        break;
                parent = fi;
        }
-       
+
        /* create our vTrash/vJunk URL */
        url = camel_url_new (info->uri, NULL);
        if (((CamelService *) store)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) {
@@ -701,10 +701,10 @@ add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, co
                camel_url_set_path (url, path);
                g_free (path);
        }
-       
+
        uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
        camel_url_free (url);
-       
+
        if (fi) {
                /* We're going to replace the physical Trash/Junk folder with our vTrash/vJunk folder */
                vinfo = fi;
@@ -714,16 +714,16 @@ add_special_info (CamelStore *store, CamelFolderInfo *info, const char *name, co
        } else {
                /* There wasn't a Trash/Junk folder so create a new folder entry */
                vinfo = g_new0 (CamelFolderInfo, 1);
-               
+
                g_assert(parent != NULL);
-               
+
                vinfo->flags |= CAMEL_FOLDER_NOINFERIORS | CAMEL_FOLDER_SUBSCRIBED;
-               
+
                /* link it into the right spot */
                vinfo->next = parent->next;
                parent->next = vinfo;
        }
-       
+
        /* Fill in the new fields */
        vinfo->flags |= flags;
        vinfo->full_name = g_strdup (name);
@@ -771,7 +771,7 @@ dump_fi(CamelFolderInfo *fi, int depth)
  * determine that information quickly.  If @flags includes
  * #CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, don't include special virtual
  * folders (such as vTrash or vJunk).
- * 
+ *
  * The CAMEL_STORE_FOLDER_INFO_FAST flag should be considered
  * deprecated; most backends will behave the same whether it is
  * supplied or not.  The only guaranteed way to get updated folder
@@ -784,11 +784,11 @@ CamelFolderInfo *
 camel_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelException *ex)
 {
        CamelFolderInfo *info;
-       
+
        g_return_val_if_fail (CAMEL_IS_STORE (store), NULL);
 
        info = CS_CLASS (store)->get_folder_info (store, top, flags, ex);
-       
+
        if (info && (top == NULL || *top == '\0') && (flags & CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL) == 0) {
                if (info->uri && (store->flags & CAMEL_STORE_VTRASH))
                        /* the name of the Trash folder, used for deleted messages */
@@ -805,7 +805,7 @@ camel_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, C
                dump_fi(info, 2);
                camel_debug_end();
        }
-       
+
        return info;
 }
 
@@ -882,7 +882,7 @@ folder_info_cmp (const void *ap, const void *bp)
 {
        const CamelFolderInfo *a = ((CamelFolderInfo **)ap)[0];
        const CamelFolderInfo *b = ((CamelFolderInfo **)bp)[0];
-       
+
        return strcmp (a->full_name, b->full_name);
 }
 
@@ -921,14 +921,14 @@ camel_folder_info_build (GPtrArray *folders, const char *namespace,
        nlen = strlen (namespace);
 
        qsort (folders->pdata, folders->len, sizeof (folders->pdata[0]), folder_info_cmp);
-       
+
        /* Hash the folders. */
        hash = g_hash_table_new (g_str_hash, g_str_equal);
        for (i = 0; i < folders->len; i++) {
                fi = folders->pdata[i];
                g_hash_table_insert (hash, fi->full_name, fi);
        }
-       
+
        /* Now find parents. */
        for (i = 0; i < folders->len; i++) {
                fi = folders->pdata[i];
@@ -954,21 +954,21 @@ camel_folder_info_build (GPtrArray *folders, const char *namespace,
                                                pfi->name = g_strdup (pname);
                                } else
                                        pfi->name = g_strdup (pname);
-                               
+
                                url = camel_url_new (fi->uri, NULL);
                                if (url->fragment)
                                        path = url->fragment;
                                else
                                        path = url->path + 1;
-                               
+
                                sep = strrchr (path, separator);
                                if (sep)
                                        *sep = '\0';
                                else
                                        d(g_warning ("huh, no \"%c\" in \"%s\"?", separator, fi->uri));
-                               
+
                                pfi->full_name = g_strdup (path);
-                               
+
                                /* since this is a "fake" folder node, it is not selectable */
                                camel_url_set_param (url, "noselect", "yes");
                                pfi->uri = camel_url_to_string (url, 0);
@@ -1005,7 +1005,7 @@ camel_folder_info_build (GPtrArray *folders, const char *namespace,
                        tail = fi;
                }
        }
-       
+
        return top;
 }
 
@@ -1021,7 +1021,7 @@ folder_info_clone_rec(CamelFolderInfo *fi, CamelFolderInfo *parent)
        info->full_name = g_strdup(fi->full_name);
        info->unread = fi->unread;
        info->flags = fi->flags;
-       
+
        if (fi->next)
                info->next = folder_info_clone_rec(fi->next, parent);
        else
@@ -1073,7 +1073,7 @@ folder_subscribed(CamelStore *store, const char *folder_name)
 {
        w(g_warning ("CamelStore::folder_subscribed not implemented for `%s'",
                     camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))));
-       
+
        return FALSE;
 }
 
@@ -1206,23 +1206,23 @@ camel_store_folder_uri_equal (CamelStore *store, const char *uri0, const char *u
        CamelProvider *provider;
        CamelURL *url0, *url1;
        int equal;
-       
+
        g_return_val_if_fail (CAMEL_IS_STORE (store), FALSE);
        g_return_val_if_fail (uri0 && uri1, FALSE);
-       
+
        provider = ((CamelService *) store)->provider;
-       
+
        if (!(url0 = camel_url_new (uri0, NULL)))
                return FALSE;
-       
+
        if (!(url1 = camel_url_new (uri1, NULL))) {
                camel_url_free (url0);
                return FALSE;
        }
-       
+
        if ((equal = provider->url_equal (url0, url1))) {
                const char *name0, *name1;
-               
+
                if (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) {
                        name0 = url0->fragment;
                        name1 = url1->fragment;
@@ -1236,13 +1236,13 @@ camel_store_folder_uri_equal (CamelStore *store, const char *uri0, const char *u
 
                if (name1 == NULL)
                        g_warning("URI is badly formed, missing folder name: %s", uri1);
-               
+
                equal = name0 && name1 && CS_CLASS (store)->compare_folder_name (name0, name1);
        }
-       
+
        camel_url_free (url0);
        camel_url_free (url1);
-       
+
        return equal;
 }
 
index 5a0c6bb..783d557 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-store.h : Abstract class for an email store */
 
-/* 
+/*
  *
  * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
  *          Michael Zucchi <NotZed@ximian.com>
@@ -9,8 +9,8 @@
  *
  * Copyright 1999, 2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -119,7 +119,7 @@ typedef struct _CamelRenameInfo {
 struct _CamelStore {
        CamelService parent_object;
        struct _CamelStorePrivate *priv;
-       
+
        CamelObjectBag *folders;
 
        guint32 flags;
@@ -150,10 +150,10 @@ typedef struct {
                                                     guint32 flags,
                                                     CamelException *ex);
 
-       CamelFolder *   (*get_inbox)                (CamelStore *store, CamelException *ex);    
+       CamelFolder *   (*get_inbox)                (CamelStore *store, CamelException *ex);
        CamelFolder *   (*get_trash)                (CamelStore *store, CamelException *ex);
        CamelFolder *   (*get_junk)                 (CamelStore *store, CamelException *ex);
-       
+
        CamelFolderInfo *(*create_folder)           (CamelStore *store,
                                                     const char *parent_name,
                                                     const char *folder_name,
@@ -165,16 +165,16 @@ typedef struct {
                                                     const char *old_name,
                                                     const char *new_name,
                                                     CamelException *ex);
-       
+
        void            (*sync)                     (CamelStore *store, int expunge, CamelException *ex);
-       
+
        CamelFolderInfo *(*get_folder_info)         (CamelStore *store,
                                                     const char *top,
                                                     guint32 flags,
                                                     CamelException *ex);
        void            (*free_folder_info)         (CamelStore *store,
                                                     CamelFolderInfo *fi);
-       
+
        gboolean        (*folder_subscribed)        (CamelStore *store,
                                                     const char *folder_name);
        void            (*subscribe_folder)         (CamelStore *store,
index 2a0baa0..d8b183d 100644 (file)
@@ -132,7 +132,7 @@ set_vbuf(CamelStreamBuffer *sbf, char *buf, CamelStreamBufferMode mode, int size
                sbf->buf = g_malloc(size);
                sbf->flags &= ~BUF_USER;
        }
-       
+
        sbf->ptr = sbf->buf;
        sbf->end = sbf->buf;
        sbf->size = size;
@@ -339,10 +339,10 @@ stream_flush (CamelStream *stream)
 
        if ((sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
                size_t len = sbf->ptr - sbf->buf;
-               
+
                if (camel_stream_write (sbf->stream, sbf->buf, len) == -1)
                        return -1;
-               
+
                sbf->ptr = sbf->buf;
        } else {
                /* nothing to do for read mode 'flush' */
index 3d78e0c..3837e2c 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "camel-stream-filter.h"
 
-#define d(x) 
+#define d(x)
 
 /* use my malloc debugger? */
 /*extern void g_check(void *mp);*/
@@ -44,7 +44,7 @@ struct _filter {
 struct _CamelStreamFilterPrivate {
        struct _filter *filters;
        int filterid;           /* next filter id */
-       
+
        char *realbuffer;       /* buffer - READ_PAD */
        char *buffer;           /* READ_SIZE bytes */
 
@@ -83,7 +83,7 @@ camel_stream_filter_class_init (CamelStreamFilterClass *klass)
        camel_stream_class->write = do_write;
        camel_stream_class->flush = do_flush;
        camel_stream_class->close = do_close;
-       camel_stream_class->eos = do_eos; 
+       camel_stream_class->eos = do_eos;
        camel_stream_class->reset = do_reset;
 
 }
@@ -92,7 +92,7 @@ static void
 camel_stream_filter_init (CamelStreamFilter *obj)
 {
        struct _CamelStreamFilterPrivate *p;
-       
+
        _PRIVATE(obj) = p = g_malloc0(sizeof(*p));
        p->realbuffer = g_malloc(READ_SIZE + READ_PAD);
        p->buffer = p->realbuffer + READ_PAD;
@@ -123,7 +123,7 @@ CamelType
 camel_stream_filter_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (CAMEL_STREAM_TYPE, "CamelStreamFilter",
                                            sizeof (CamelStreamFilter),
@@ -133,7 +133,7 @@ camel_stream_filter_get_type (void)
                                            (CamelObjectInitFunc) camel_stream_filter_init,
                                            (CamelObjectFinalizeFunc) camel_stream_filter_finalize);
        }
-       
+
        return type;
 }
 
@@ -141,7 +141,7 @@ camel_stream_filter_get_type (void)
  * camel_stream_filter_new:
  *
  * Create a new #CamelStreamFilter object.
- * 
+ *
  * Returns a new #CamelStreamFilter object.
  **/
 CamelStreamFilter *
@@ -159,13 +159,13 @@ camel_stream_filter_new_with_stream(CamelStream *stream)
  * camel_stream_filter_add:
  * @stream: a #CamelStreamFilter object
  * @filter: a #CamelMimeFilter object
- * 
+ *
  * Add a new #CamelMimeFilter to execute during the processing of this
  * stream.  Each filter added is processed after the previous one.
  *
  * Note that a filter should only be added to a single stream
  * at a time, otherwise unpredictable results may occur.
- * 
+ *
  * Returns a filter id for the added @filter.
  **/
 int
@@ -192,7 +192,7 @@ camel_stream_filter_add (CamelStreamFilter *stream, CamelMimeFilter *filter)
  * camel_stream_filter_remove:
  * @stream: a #CamelStreamFilter object
  * @id: Filter id, as returned from #camel_stream_filter_add
- * 
+ *
  * Remove a processing filter from the stream by id.
  **/
 void
@@ -339,15 +339,15 @@ do_flush (CamelStream *stream)
        char *buffer;
        size_t presize;
        size_t len;
-       
+
        if (p->last_was_read)
                return 0;
-       
+
        buffer = "";
        len = 0;
        presize = 0;
        f = p->filters;
-       
+
        d(printf ("\n\nFlushing: Original content (%s): '", ((CamelObject *)filter->source)->klass->name));
        d(fwrite(buffer, sizeof(char), len, stdout));
        d(printf("'\n"));
@@ -383,13 +383,13 @@ do_eos (CamelStream *stream)
 {
        CamelStreamFilter *filter = (CamelStreamFilter *)stream;
        struct _CamelStreamFilterPrivate *p = _PRIVATE(filter);
-       
+
        if (p->filteredlen > 0)
                return FALSE;
-       
+
        if (!p->flushed)
                return FALSE;
-       
+
        return camel_stream_eos(filter->source);
 }
 
@@ -402,7 +402,7 @@ do_reset (CamelStream *stream)
 
        p->filteredlen = 0;
        p->flushed = FALSE;
-       
+
        /* and reset filters */
        f = p->filters;
        while (f) {
index 9b65995..44d01d4 100644 (file)
@@ -218,15 +218,15 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
        CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
        CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
        ssize_t nread;
-       
+
        if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
                n = MIN (seekable->bound_end - seekable->position, n);
-       
+
        if ((nread = camel_read (stream_fs->fd, buffer, n)) > 0)
                seekable->position += nread;
        else if (nread == 0)
                stream->eos = TRUE;
-       
+
        return nread;
 }
 
@@ -236,13 +236,13 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
        CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
        CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
        ssize_t nwritten;
-       
+
        if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
                n = MIN (seekable->bound_end - seekable->position, n);
-       
+
        if ((nwritten = camel_write (stream_fs->fd, buffer, n)) > 0)
                seekable->position += nwritten;
-       
+
        return nwritten;
 }
 
@@ -257,7 +257,7 @@ stream_close (CamelStream *stream)
 {
        if (close (((CamelStreamFs *)stream)->fd) == -1)
                return -1;
-       
+
        ((CamelStreamFs *)stream)->fd = -1;
        return 0;
 }
index 56d940d..e92995e 100644 (file)
@@ -176,7 +176,7 @@ camel_stream_mem_new_with_byte_array (GByteArray *buffer)
 /**
  * camel_stream_mem_set_secure:
  * @mem: a #CamelStreamMem object
- * 
+ *
  * Mark the memory stream as secure.  At the very least this means the
  * data in the buffer will be cleared when the buffer is finalised.
  * This only applies to buffers owned by the stream.
@@ -277,7 +277,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
        CamelStreamMem *stream_mem = CAMEL_STREAM_MEM (stream);
        CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
        ssize_t nwrite = n;
-       
+
        if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
                nwrite = MIN(seekable->bound_end - seekable->position, n);
 
index 1c96859..549b0a0 100644 (file)
@@ -35,7 +35,7 @@ typedef struct _CamelStreamNullClass CamelStreamNullClass;
 
 struct _CamelStreamNull {
        CamelStream parent;
-       
+
        size_t written;
 };
 
index ca49aad..416507b 100644 (file)
@@ -6,7 +6,7 @@
  *
  *  Authors: David Woodhouse <dwmw2@infradead.org>,
  *          Jeffrey Stedfast <fejj@ximian.com>
- *  
+ *
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
@@ -67,9 +67,9 @@ static void
 camel_stream_process_class_init (CamelStreamProcessClass *camel_stream_process_class)
 {
        CamelStreamClass *camel_stream_class = (CamelStreamClass *) camel_stream_process_class;
-       
+
        parent_class = camel_type_get_global_classfuncs (CAMEL_OBJECT_TYPE);
-       
+
        /* virtual method definition */
        camel_stream_class->read = stream_read;
        camel_stream_class->write = stream_write;
@@ -81,7 +81,7 @@ static void
 camel_stream_process_init (gpointer object, gpointer klass)
 {
         CamelStreamProcess *stream = CAMEL_STREAM_PROCESS (object);
-       
+
         stream->sockfd = -1;
        stream->childpid = 0;
 }
@@ -91,7 +91,7 @@ CamelType
 camel_stream_process_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type =  camel_type_register (camel_stream_get_type (),
                                             "CamelStreamProcess",
@@ -102,7 +102,7 @@ camel_stream_process_get_type (void)
                                             (CamelObjectInitFunc) camel_stream_process_init,
                                             (CamelObjectFinalizeFunc) camel_stream_process_finalise);
        }
-       
+
        return type;
 }
 
@@ -124,7 +124,7 @@ static ssize_t
 stream_read (CamelStream *stream, char *buffer, size_t n)
 {
        CamelStreamProcess *stream_process = CAMEL_STREAM_PROCESS (stream);
-       
+
        return camel_read (stream_process->sockfd, buffer, n);
 }
 
@@ -132,7 +132,7 @@ static ssize_t
 stream_write (CamelStream *stream, const char *buffer, size_t n)
 {
        CamelStreamProcess *stream_process = CAMEL_STREAM_PROCESS (stream);
-       
+
        return camel_write (stream_process->sockfd, buffer, n);
 }
 
@@ -146,16 +146,16 @@ static int
 stream_close (CamelStream *object)
 {
        CamelStreamProcess *stream = CAMEL_STREAM_PROCESS (object);
-       
+
        if (camel_verbose_debug)
                fprintf (stderr, "Process stream close. sockfd %d, childpid %d\n",
                         stream->sockfd, stream->childpid);
-       
+
        if (stream->sockfd != -1) {
                close (stream->sockfd);
                stream->sockfd = -1;
        }
-       
+
        if (stream->childpid) {
                int ret, i;
                for (i = 0; i < 4; i++) {
@@ -184,10 +184,10 @@ stream_close (CamelStream *object)
                                break;
                        }
                }
-               
+
                stream->childpid = 0;
        }
-       
+
        return 0;
 }
 
@@ -195,44 +195,44 @@ static void
 do_exec_command (int fd, const char *command, char **env)
 {
        int i, maxopen;
-       
+
        /* Not a lot we can do if there's an error other than bail. */
        if (dup2 (fd, 0) == -1)
                exit (1);
        if (dup2 (fd, 1) == -1)
                exit (1);
-       
+
        /* What to do with stderr? Possibly put it through a separate pipe
           and bring up a dialog box with its output if anything does get
           spewed to it? It'd help the user understand what was going wrong
           with their command, but it's hard to do cleanly. For now we just
           leave it as it is. Perhaps we should close it and reopen /dev/null? */
-       
+
        maxopen = sysconf (_SC_OPEN_MAX);
        for (i = 3; i < maxopen; i++)
                fcntl (i, F_SETFD, FD_CLOEXEC);
-       
+
        setsid ();
 #ifdef TIOCNOTTY
-       /* Detach from the controlling tty if we have one. Otherwise, 
-          SSH might do something stupid like trying to use it instead 
+       /* Detach from the controlling tty if we have one. Otherwise,
+          SSH might do something stupid like trying to use it instead
           of running $SSH_ASKPASS. Doh. */
        if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
                ioctl (fd, TIOCNOTTY, NULL);
                close (fd);
        }
 #endif /* TIOCNOTTY */
-       
-       /* Set up child's environment. We _add_ to it, don't use execle, 
+
+       /* Set up child's environment. We _add_ to it, don't use execle,
           because otherwise we'd destroy stuff like SSH_AUTH_SOCK etc. */
        for ( ; env && *env; env++)
                putenv(*env);
-       
+
        execl ("/bin/sh", "/bin/sh", "-c", command, NULL);
-       
+
        if (camel_verbose_debug)
                fprintf (stderr, "exec failed %d\n", errno);
-       
+
        exit (1);
 }
 
@@ -240,13 +240,13 @@ int
 camel_stream_process_connect (CamelStreamProcess *stream, const char *command, const char **env)
 {
        int sockfds[2];
-       
+
        if (stream->sockfd != -1 || stream->childpid)
                stream_close (CAMEL_STREAM (stream));
-       
+
        if (socketpair (AF_UNIX, SOCK_STREAM, 0, sockfds))
                return -1;
-       
+
        stream->childpid = fork ();
        if (!stream->childpid) {
                do_exec_command (sockfds[1], command, (char **)env);
@@ -256,9 +256,9 @@ camel_stream_process_connect (CamelStreamProcess *stream, const char *command, c
                stream->sockfd = -1;
                return -1;
        }
-       
+
        close (sockfds[1]);
        stream->sockfd = sockfds[0];
-       
+
        return 0;
 }
index 76fd6f7..8b391e1 100644 (file)
@@ -36,7 +36,7 @@ typedef struct _CamelStreamProcess CamelStreamProcess;
 
 struct _CamelStreamProcess {
        CamelStream parent;
-       
+
        int sockfd;
        pid_t childpid;
 };
index ad1d1fc..7a53462 100644 (file)
@@ -122,7 +122,7 @@ camel_stream_vfs_new_with_handle (GnomeVFSHandle *handle)
 {
        CamelStreamVFS *stream_vfs;
        off_t offset;
-       
+
        if (!handle)
                return NULL;
 
@@ -152,19 +152,19 @@ camel_stream_vfs_new_with_uri (const char *name, int flags, mode_t mode)
        GnomeVFSResult result;
        GnomeVFSHandle *handle;
        int vfs_flag = 0;
-       
+
        if (flags & O_WRONLY)
                vfs_flag = vfs_flag | GNOME_VFS_OPEN_WRITE;
        if (flags & O_RDONLY)
                vfs_flag = vfs_flag | GNOME_VFS_OPEN_READ;
        if (flags & O_RDWR)
                vfs_flag = vfs_flag | GNOME_VFS_OPEN_READ |GNOME_VFS_OPEN_WRITE;
-       
+
        if (flags & O_CREAT)
                result = gnome_vfs_create (&handle, name, vfs_flag, FALSE, mode);
        else
                result = gnome_vfs_open (&handle, name, vfs_flag);
-       
+
        if (result != GNOME_VFS_OK) {
                return NULL;
        }
@@ -179,17 +179,17 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
        CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
        GnomeVFSFileSize nread = 0;
        GnomeVFSResult result;
-       
+
        if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
                n = MIN (seekable->bound_end - seekable->position, n);
 
        result = gnome_vfs_read (stream_vfs->handle, buffer, n, &nread);
-       
+
        if (nread > 0 && result == GNOME_VFS_OK)
                seekable->position += nread;
        else if (nread == 0)
                stream->eos = TRUE;
-       
+
        return nread;
 }
 
@@ -200,15 +200,15 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
        CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
        GnomeVFSFileSize nwritten = 0;
        GnomeVFSResult result;
-       
+
        if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
                n = MIN (seekable->bound_end - seekable->position, n);
 
        result = gnome_vfs_write (stream_vfs->handle, buffer, n, &nwritten);
-       
+
        if (nwritten > 0 && result == GNOME_VFS_OK)
                seekable->position += nwritten;
-       
+
        return nwritten;
 }
 
@@ -224,10 +224,10 @@ stream_close (CamelStream *stream)
        GnomeVFSResult result;
 
        result = gnome_vfs_close(((CamelStreamVFS *)stream)->handle);
-       
+
        if (result != GNOME_VFS_OK)
                return -1;
-       
+
        ((CamelStreamVFS *)stream)->handle = NULL;
        return 0;
 }
@@ -239,7 +239,7 @@ stream_seek (CamelSeekableStream *stream, off_t offset, CamelStreamSeekPolicy po
        GnomeVFSFileSize real = 0;
        GnomeVFSResult result;
        GnomeVFSHandle *handle = stream_vfs->handle;
-       
+
        switch (policy) {
        case CAMEL_STREAM_SET:
                real = offset;
index b5960b4..59ae85c 100644 (file)
@@ -94,7 +94,7 @@ camel_stream_read (CamelStream *stream, char *buffer, size_t n)
 {
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
        g_return_val_if_fail (n == 0 || buffer, -1);
-       
+
        return (CS_CLASS (stream)->read) (stream, buffer, n);
 }
 
@@ -141,16 +141,16 @@ camel_stream_flush (CamelStream *stream)
 /**
  * camel_stream_close:
  * @stream: a #CamelStream object
- * 
+ *
  * Closes the stream.
- * 
+ *
  * Returns %0 on success or %-1 on error.
  **/
 int
 camel_stream_close (CamelStream *stream)
 {
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-       
+
        return CS_CLASS (stream)->close (stream);
 }
 
@@ -167,7 +167,7 @@ gboolean
 camel_stream_eos (CamelStream *stream)
 {
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), TRUE);
-       
+
        return CS_CLASS (stream)->eos (stream);
 }
 
@@ -186,7 +186,7 @@ int
 camel_stream_reset (CamelStream *stream)
 {
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-       
+
        return CS_CLASS (stream)->reset (stream);
 }
 
@@ -223,16 +223,16 @@ camel_stream_printf (CamelStream *stream, const char *fmt, ... )
        va_list args;
        char *string;
        ssize_t ret;
-       
+
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-       
+
        va_start (args, fmt);
        string = g_strdup_vprintf (fmt, args);
        va_end (args);
-       
+
        if (!string)
                return -1;
-       
+
        ret = camel_stream_write (stream, string, strlen (string));
        g_free (string);
        return ret;
index 8da39fb..fa79809 100644 (file)
@@ -41,7 +41,7 @@ camel_strcase_hash (gconstpointer v)
 {
        const char *p = (char *) v;
        guint h = 0, g;
-       
+
        for ( ; *p != '\0'; p++) {
                h = (h << 4) + g_ascii_toupper (*p);
                if ((g = h & 0xf0000000)) {
@@ -49,7 +49,7 @@ camel_strcase_hash (gconstpointer v)
                        h = h ^ g;
                }
        }
-       
+
        return h;
 }
 
@@ -64,8 +64,8 @@ void
 camel_string_list_free (GList *string_list)
 {
        if (string_list == NULL)
-               return; 
-       
+               return;
+
        g_list_foreach (string_list, free_string, NULL);
        g_list_free (string_list);
 }
@@ -76,21 +76,21 @@ camel_strstrcase (const char *haystack, const char *needle)
        /* find the needle in the haystack neglecting case */
        const char *ptr;
        guint len;
-       
+
        g_return_val_if_fail (haystack != NULL, NULL);
        g_return_val_if_fail (needle != NULL, NULL);
-       
+
        len = strlen (needle);
        if (len > strlen (haystack))
                return NULL;
-       
+
        if (len == 0)
                return (char *) haystack;
-       
+
        for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++)
                if (!g_ascii_strncasecmp (ptr, needle, len))
                        return (char *) ptr;
-       
+
        return NULL;
 }
 
@@ -99,23 +99,23 @@ const char *
 camel_strdown (char *str)
 {
        register char *s = str;
-       
+
        while (*s) {
                if (*s >= 'A' && *s <= 'Z')
                        *s += 0x20;
                s++;
        }
-       
+
        return str;
 }
 
 /**
  * camel_tolower:
- * @c: 
- * 
+ * @c:
+ *
  * ASCII to-lower function.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 char camel_tolower(char c)
 {
@@ -127,11 +127,11 @@ char camel_tolower(char c)
 
 /**
  * camel_toupper:
- * @c: 
- * 
+ * @c:
+ *
  * ASCII to-upper function.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 char camel_toupper(char c)
 {
@@ -163,20 +163,20 @@ camel_pstring_add (char *str, gboolean own)
        void *pcount;
        char *pstr;
        int count;
-       
+
        if (str == NULL)
                return NULL;
-       
+
        if (str[0] == '\0') {
                if (own)
                        g_free (str);
                return "";
        }
-       
+
        pthread_mutex_lock (&pstring_lock);
        if (pstring_table == NULL)
                pstring_table = g_hash_table_new (g_str_hash, g_str_equal);
-       
+
        if (g_hash_table_lookup_extended (pstring_table, str, (void **) &pstr, &pcount)) {
                count = GPOINTER_TO_INT (pcount) + 1;
                g_hash_table_insert (pstring_table, pstr, GINT_TO_POINTER (count));
@@ -186,9 +186,9 @@ camel_pstring_add (char *str, gboolean own)
                pstr = own ? str : g_strdup (str);
                g_hash_table_insert (pstring_table, pstr, GINT_TO_POINTER (1));
        }
-       
+
        pthread_mutex_unlock (&pstring_lock);
-       
+
        return pstr;
 }
 
@@ -196,12 +196,12 @@ camel_pstring_add (char *str, gboolean own)
 /**
  * camel_pstring_strdup:
  * @s: String to copy.
- * 
+ *
  * Create a new pooled string entry for the string @s.  A pooled
  * string is a table where common strings are uniquified to the same
  * pointer value.  They are also refcounted, so freed when no longer
  * in use.  In a thread-safe manner.
- * 
+ *
  * The NULL and empty strings are special cased to constant values.
  *
  * Return value: A pointer to an equivalent string of @s.  Use
@@ -217,7 +217,7 @@ camel_pstring_strdup (const char *s)
 /**
  * camel_pstring_free:
  * @s: String to free.
- * 
+ *
  * De-ref a pooled string. If no more refs exist to this string, it will be deallocated.
  *
  * NULL and the empty string are special cased.
index 76c54ea..2d599a0 100644 (file)
@@ -71,7 +71,7 @@ static SSL *open_ssl_connection (CamelService *service, int sockfd, CamelTcpStre
 struct _CamelTcpStreamSSLPrivate {
        int sockfd;
        SSL *ssl;
-       
+
        CamelService *service;
        char *expected_host;
        gboolean ssl_mode;
@@ -85,21 +85,21 @@ camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *camel_tcp_stream_ssl_cl
                CAMEL_TCP_STREAM_CLASS (camel_tcp_stream_ssl_class);
        CamelStreamClass *camel_stream_class =
                CAMEL_STREAM_CLASS (camel_tcp_stream_ssl_class);
-       
+
        parent_class = CAMEL_TCP_STREAM_CLASS (camel_type_get_global_classfuncs (camel_tcp_stream_get_type ()));
-       
+
        /* virtual method overload */
        camel_stream_class->read = stream_read;
        camel_stream_class->write = stream_write;
        camel_stream_class->flush = stream_flush;
        camel_stream_class->close = stream_close;
-       
+
        camel_tcp_stream_class->connect = stream_connect;
        camel_tcp_stream_class->getsockopt = stream_getsockopt;
        camel_tcp_stream_class->setsockopt = stream_setsockopt;
        camel_tcp_stream_class->get_local_address  = stream_get_local_address;
        camel_tcp_stream_class->get_remote_address = stream_get_remote_address;
-       
+
        /* init OpenSSL stuff */
        SSLeay_add_ssl_algorithms ();
        SSL_load_error_strings ();
@@ -109,7 +109,7 @@ static void
 camel_tcp_stream_ssl_init (gpointer object, gpointer klass)
 {
        CamelTcpStreamSSL *stream = CAMEL_TCP_STREAM_SSL (object);
-       
+
        stream->priv = g_new0 (struct _CamelTcpStreamSSLPrivate, 1);
        stream->priv->sockfd = -1;
 }
@@ -118,22 +118,22 @@ static void
 camel_tcp_stream_ssl_finalize (CamelObject *object)
 {
        CamelTcpStreamSSL *stream = CAMEL_TCP_STREAM_SSL (object);
-       
+
        if (stream->priv->ssl) {
                SSL_shutdown (stream->priv->ssl);
-               
+
                if (stream->priv->ssl->ctx) {
                        SSL_CTX_free (stream->priv->ssl->ctx);
                }
-               
+
                SSL_free (stream->priv->ssl);
        }
-       
+
        if (stream->priv->sockfd != -1)
                close (stream->priv->sockfd);
-       
+
        g_free (stream->priv->expected_host);
-       
+
        g_free (stream->priv);
 }
 
@@ -142,7 +142,7 @@ CamelType
 camel_tcp_stream_ssl_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_tcp_stream_get_type (),
                                            "CamelTcpStreamSSL",
@@ -153,7 +153,7 @@ camel_tcp_stream_ssl_get_type (void)
                                            (CamelObjectInitFunc) camel_tcp_stream_ssl_init,
                                            (CamelObjectFinalizeFunc) camel_tcp_stream_ssl_finalize);
        }
-       
+
        return type;
 }
 
@@ -174,14 +174,14 @@ CamelStream *
 camel_tcp_stream_ssl_new (CamelService *service, const char *expected_host, guint32 flags)
 {
        CamelTcpStreamSSL *stream;
-       
+
        stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-       
+
        stream->priv->service = service;
        stream->priv->expected_host = g_strdup (expected_host);
        stream->priv->ssl_mode = TRUE;
        stream->priv->flags = flags;
-       
+
        return CAMEL_STREAM (stream);
 }
 
@@ -202,14 +202,14 @@ CamelStream *
 camel_tcp_stream_ssl_new_raw (CamelService *service, const char *expected_host, guint32 flags)
 {
        CamelTcpStreamSSL *stream;
-       
+
        stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-       
+
        stream->priv->service = service;
        stream->priv->expected_host = g_strdup (expected_host);
        stream->priv->ssl_mode = FALSE;
        stream->priv->flags = flags;
-       
+
        return CAMEL_STREAM (stream);
 }
 
@@ -253,21 +253,21 @@ int
 camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *stream)
 {
        SSL *ssl;
-       
+
        g_return_val_if_fail (CAMEL_IS_TCP_STREAM_SSL (stream), -1);
-       
+
        if (stream->priv->sockfd != -1 && !stream->priv->ssl_mode) {
                ssl = open_ssl_connection (stream->priv->service, stream->priv->sockfd, stream);
                if (ssl == NULL) {
                        stream->priv->sockfd = -1;
                        return -1;
                }
-               
+
                stream->priv->ssl = ssl;
        }
-       
+
        stream->priv->ssl_mode = TRUE;
-       
+
        return 0;
 }
 
@@ -279,12 +279,12 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
        SSL *ssl = openssl->priv->ssl;
        ssize_t nread;
        int cancel_fd;
-       
+
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
        }
-       
+
        cancel_fd = camel_operation_cancel_fd (NULL);
        if (cancel_fd == -1) {
                do {
@@ -300,17 +300,17 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                int error, flags, fdmax;
                struct timeval timeout;
                fd_set rdset;
-               
+
                flags = fcntl (openssl->priv->sockfd, F_GETFL);
                fcntl (openssl->priv->sockfd, F_SETFL, flags | O_NONBLOCK);
-               
+
                fdmax = MAX (openssl->priv->sockfd, cancel_fd) + 1;
-               
+
                do {
                        FD_ZERO (&rdset);
                        FD_SET (openssl->priv->sockfd, &rdset);
                        FD_SET (cancel_fd, &rdset);
-                       
+
                        timeout.tv_sec = 0;
                        timeout.tv_usec = TIMEOUT_USEC;
                        select (fdmax, &rdset, 0, 0, &timeout);
@@ -319,7 +319,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                                errno = EINTR;
                                return -1;
                        }
-                       
+
                        do {
                                if (ssl) {
                                        nread = SSL_read (ssl, buffer, n);
@@ -330,12 +330,12 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                                }
                        } while (nread < 0 && errno == EINTR);
                } while (nread < 0 && (errno == EAGAIN || errno == EWOULDBLOCK));
-               
+
                error = errno;
                fcntl (openssl->priv->sockfd, F_SETFL, flags);
                errno = error;
        }
-       
+
        return nread;
 }
 
@@ -346,12 +346,12 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
        SSL *ssl = openssl->priv->ssl;
        ssize_t w, written = 0;
        int cancel_fd;
-       
+
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
        }
-       
+
        cancel_fd = camel_operation_cancel_fd (NULL);
        if (cancel_fd == -1) {
                do {
@@ -364,7 +364,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                                        w = write (openssl->priv->sockfd, buffer + written, n - written);
                                }
                        } while (w < 0 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
-                       
+
                        if (w > 0)
                                written += w;
                } while (w != -1 && written < n);
@@ -372,17 +372,17 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                int error, flags, fdmax;
                struct timeval timeout;
                fd_set rdset, wrset;
-               
+
                flags = fcntl (openssl->priv->sockfd, F_GETFL);
                fcntl (openssl->priv->sockfd, F_SETFL, flags | O_NONBLOCK);
-               
+
                fdmax = MAX (openssl->priv->sockfd, cancel_fd) + 1;
                do {
                        FD_ZERO (&rdset);
                        FD_ZERO (&wrset);
                        FD_SET (openssl->priv->sockfd, &wrset);
                        FD_SET (cancel_fd, &rdset);
-                       
+
                        timeout.tv_sec = 0;
                        timeout.tv_usec = TIMEOUT_USEC;
                        select (fdmax, &rdset, &wrset, 0, &timeout);
@@ -391,7 +391,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                                errno = EINTR;
                                return -1;
                        }
-                       
+
                        do {
                                if (ssl) {
                                        w = SSL_write (ssl, buffer + written, n - written);
@@ -401,7 +401,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                                        w = write (openssl->priv->sockfd, buffer + written, n - written);
                                }
                        } while (w < 0 && errno == EINTR);
-                       
+
                        if (w < 0) {
                                if (errno == EAGAIN || errno == EWOULDBLOCK) {
                                        w = 0;
@@ -414,10 +414,10 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                        } else
                                written += w;
                } while (w >= 0 && written < n);
-               
+
                fcntl (openssl->priv->sockfd, F_SETFL, flags);
        }
-       
+
        return written;
 }
 
@@ -433,10 +433,10 @@ close_ssl_connection (SSL *ssl)
 {
        if (ssl) {
                SSL_shutdown (ssl);
-               
+
                if (ssl->ctx)
                        SSL_CTX_free (ssl->ctx);
-               
+
                SSL_free (ssl);
        }
 }
@@ -446,10 +446,10 @@ stream_close (CamelStream *stream)
 {
        close_ssl_connection (((CamelTcpStreamSSL *)stream)->priv->ssl);
        ((CamelTcpStreamSSL *)stream)->priv->ssl = NULL;
-       
+
        if (close (((CamelTcpStreamSSL *)stream)->priv->sockfd) == -1)
                return -1;
-       
+
        ((CamelTcpStreamSSL *)stream)->priv->sockfd = -1;
        return 0;
 }
@@ -468,13 +468,13 @@ socket_connect (struct hostent *h, int port)
        socklen_t len;
        int cancel_fd;
        int ret, fd;
-       
+
        /* see if we're cancelled yet */
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
        }
-       
+
        /* setup connect, we do it using a nonblocking socket so we can poll it */
 #ifdef ENABLE_IPv6
        if (h->h_addrtype == AF_INET6) {
@@ -493,9 +493,9 @@ socket_connect (struct hostent *h, int port)
 #ifdef ENABLE_IPv6
        }
 #endif
-       
+
        fd = socket (h->h_addrtype, SOCK_STREAM, 0);
-       
+
        cancel_fd = camel_operation_cancel_fd (NULL);
        if (cancel_fd == -1) {
                ret = connect (fd, saddr, len);
@@ -503,26 +503,26 @@ socket_connect (struct hostent *h, int port)
                        close (fd);
                        return -1;
                }
-               
+
                return fd;
        } else {
                fd_set rdset, wrset;
                int flags, fdmax;
-               
+
                flags = fcntl (fd, F_GETFL);
                fcntl (fd, F_SETFL, flags | O_NONBLOCK);
-               
+
                ret = connect (fd, saddr, len);
                if (ret == 0) {
                        fcntl (fd, F_SETFL, flags);
                        return fd;
                }
-               
+
                if (errno != EINPROGRESS) {
                        close (fd);
                        return -1;
                }
-               
+
                FD_ZERO (&rdset);
                FD_ZERO (&wrset);
                FD_SET (fd, &wrset);
@@ -530,35 +530,35 @@ socket_connect (struct hostent *h, int port)
                fdmax = MAX (fd, cancel_fd) + 1;
                tv.tv_usec = 0;
                tv.tv_sec = 60 * 4;
-               
+
                if (select (fdmax, &rdset, &wrset, 0, &tv) == 0) {
                        close (fd);
                        errno = ETIMEDOUT;
                        return -1;
                }
-               
+
                if (cancel_fd != -1 && FD_ISSET (cancel_fd, &rdset)) {
                        close (fd);
                        errno = EINTR;
                        return -1;
                } else {
                        len = sizeof (int);
-                       
+
                        if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &len) == -1) {
                                close (fd);
                                return -1;
                        }
-                       
+
                        if (ret != 0) {
                                close (fd);
                                errno = ret;
                                return -1;
                        }
                }
-               
+
                fcntl (fd, F_SETFL, flags);
        }
-       
+
        return fd;
 }
 
@@ -647,29 +647,29 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
        char buf[257];
        X509 *cert;
        SSL *ssl;
-       
+
        if (ok)
                return TRUE;
-       
+
        ssl = X509_STORE_CTX_get_ex_data (ctx, SSL_get_ex_data_X509_STORE_CTX_idx ());
-       
+
        stream = SSL_CTX_get_app_data (ssl->ctx);
        if (!stream)
                return FALSE;
-       
+
        service = stream->priv->service;
-       
+
        cert = X509_STORE_CTX_get_current_cert (ctx);
        err = X509_STORE_CTX_get_error (ctx);
-       
+
        /* calculate the MD5 hash of the raw certificate */
        md5len = sizeof (md5sum);
        X509_digest (cert, EVP_md5 (), md5sum, &md5len);
        for (i = 0, f = fingerprint; i < 16; i++, f += 3)
                sprintf (f, "%.2x%c", md5sum[i], i != 15 ? ':' : '\0');
-       
+
 #define GET_STRING(name) X509_NAME_oneline (name, buf, 256)
-       
+
        certdb = camel_certdb_get_default ();
        if (certdb) {
                ccert = camel_certdb_get_cert (certdb, fingerprint);
@@ -678,7 +678,7 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
                                ok = ccert->trust != CAMEL_CERT_TRUST_NEVER;
                                camel_certdb_cert_unref (certdb, ccert);
                                camel_object_unref (certdb);
-                               
+
                                return ok;
                        }
                } else {
@@ -689,12 +689,12 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
                        camel_cert_set_hostname (certdb, ccert, stream->priv->expected_host);
                        camel_cert_set_fingerprint (certdb, ccert, fingerprint);
                        camel_cert_set_trust (certdb, ccert, CAMEL_CERT_TRUST_UNKNOWN);
-                       
+
                        /* Add the certificate to our db */
                        camel_certdb_add (certdb, ccert);
                }
        }
-       
+
        cert_str = g_strdup_printf (_("Issuer:            %s\n"
                                      "Subject:           %s\n"
                                      "Fingerprint:       %s\n"
@@ -702,24 +702,24 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
                                    GET_STRING (X509_get_issuer_name (cert)),
                                    GET_STRING (X509_get_subject_name (cert)),
                                    fingerprint, cert->valid ? _("GOOD") : _("BAD"));
-       
+
        prompt = g_strdup_printf (_("Bad certificate from %s:\n\n%s\n\n%s\n\n"
                                    "Do you wish to accept anyway?"),
                                  service->url->host, cert_str, x509_strerror (err));
-       
+
        ok = camel_session_alert_user (service->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE);
        g_free (prompt);
-       
+
        if (ok && ccert) {
                camel_cert_set_trust (certdb, ccert, CAMEL_CERT_TRUST_FULLY);
                camel_certdb_touch (certdb);
        }
-       
+
        if (certdb) {
                camel_certdb_cert_unref (certdb, ccert);
                camel_object_unref (certdb);
        }
-       
+
        return ok;
 }
 
@@ -729,35 +729,35 @@ open_ssl_connection (CamelService *service, int sockfd, CamelTcpStreamSSL *opens
        SSL_CTX *ssl_ctx = NULL;
        SSL *ssl = NULL;
        int n;
-       
+
        /* SSLv23_client_method will negotiate with SSL v2, v3, or TLS v1 */
        ssl_ctx = SSL_CTX_new (SSLv23_client_method ());
        g_return_val_if_fail (ssl_ctx != NULL, NULL);
-       
+
        SSL_CTX_set_default_verify_paths (ssl_ctx);
        SSL_CTX_set_verify (ssl_ctx, SSL_VERIFY_PEER, &ssl_verify);
        ssl = SSL_new (ssl_ctx);
        SSL_set_fd (ssl, sockfd);
-       
+
        SSL_CTX_set_app_data (ssl_ctx, openssl);
-       
+
        n = SSL_connect (ssl);
        if (n != 1) {
                int errnosave = ssl_errno (ssl, n);
-               
+
                SSL_shutdown (ssl);
-               
+
                if (ssl->ctx)
                        SSL_CTX_free (ssl->ctx);
-               
+
                SSL_free (ssl);
                ssl = NULL;
-               
+
                close (sockfd);
-               
+
                errno = errnosave;
        }
-       
+
        return ssl;
 }
 
@@ -767,22 +767,22 @@ stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
        CamelTcpStreamSSL *openssl = CAMEL_TCP_STREAM_SSL (stream);
        SSL *ssl = NULL;
        int fd;
-       
+
        g_return_val_if_fail (host != NULL, -1);
-       
+
        fd = socket_connect (host, port);
        if (fd == -1)
                return -1;
-       
+
        if (openssl->priv->ssl_mode) {
                ssl = open_ssl_connection (openssl->priv->service, fd, openssl);
                if (!ssl)
                        return -1;
        }
-       
+
        openssl->priv->sockfd = fd;
        openssl->priv->ssl = ssl;
-       
+
        return 0;
 }
 
@@ -830,22 +830,22 @@ static int
 stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
 {
        int optname, optlen;
-       
+
        if ((optname = get_sockopt_optname (data)) == -1)
                return -1;
-       
+
        if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
                int flags;
-               
+
                flags = fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_GETFL);
                if (flags == -1)
                        return -1;
-               
+
                data->value.non_blocking = flags & O_NONBLOCK ? TRUE : FALSE;
-               
+
                return 0;
        }
-       
+
        return getsockopt (((CamelTcpStreamSSL *) stream)->priv->sockfd,
                           get_sockopt_level (data),
                           optname,
@@ -857,26 +857,26 @@ static int
 stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
 {
        int optname;
-       
+
        if ((optname = get_sockopt_optname (data)) == -1)
                return -1;
-       
+
        if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
                int flags, set;
-               
+
                flags = fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_GETFL);
                if (flags == -1)
                        return -1;
-               
+
                set = data->value.non_blocking ? O_NONBLOCK : 0;
                flags = (flags & ~O_NONBLOCK) | set;
-               
+
                if (fcntl (((CamelTcpStreamSSL *) stream)->priv->sockfd, F_SETFL, flags) == -1)
                        return -1;
-               
+
                return 0;
        }
-       
+
        return setsockopt (((CamelTcpStreamSSL *) stream)->priv->sockfd,
                           get_sockopt_level (data),
                           optname,
@@ -902,12 +902,12 @@ stream_get_local_address (CamelTcpStream *stream)
        gpointer address;
        socklen_t len;
        int family;
-       
+
        len = MIN_SOCKADDR_BUFLEN;
-       
+
        if (getsockname (CAMEL_TCP_STREAM_SSL (stream)->priv->sockfd, saddr, &len) == -1)
                return NULL;
-       
+
        if (saddr->sa_family == AF_INET) {
                family = CAMEL_TCP_ADDRESS_IPv4;
                address = &sin->sin_addr;
@@ -918,7 +918,7 @@ stream_get_local_address (CamelTcpStream *stream)
 #endif
        } else
                return NULL;
-       
+
        return camel_tcp_address_new (family, sin->sin_port, len, address);
 }
 
@@ -934,12 +934,12 @@ stream_get_remote_address (CamelTcpStream *stream)
        gpointer address;
        socklen_t len;
        int family;
-       
+
        len = MIN_SOCKADDR_BUFLEN;
-       
+
        if (getpeername (CAMEL_TCP_STREAM_SSL (stream)->priv->sockfd, saddr, &len) == -1)
                return NULL;
-       
+
        if (saddr->sa_family == AF_INET) {
                family = CAMEL_TCP_ADDRESS_IPv4;
                address = &sin->sin_addr;
@@ -950,7 +950,7 @@ stream_get_remote_address (CamelTcpStream *stream)
 #endif
        } else
                return NULL;
-       
+
        return camel_tcp_address_new (family, sin->sin_port, len, address);
 }
 
index 41459cc..6b3562a 100644 (file)
@@ -71,15 +71,15 @@ camel_tcp_stream_raw_class_init (CamelTcpStreamRawClass *camel_tcp_stream_raw_cl
                CAMEL_TCP_STREAM_CLASS (camel_tcp_stream_raw_class);
        CamelStreamClass *camel_stream_class =
                CAMEL_STREAM_CLASS (camel_tcp_stream_raw_class);
-       
+
        parent_class = CAMEL_TCP_STREAM_CLASS (camel_type_get_global_classfuncs (camel_tcp_stream_get_type ()));
-       
+
        /* virtual method overload */
        camel_stream_class->read = stream_read;
        camel_stream_class->write = stream_write;
        camel_stream_class->flush = stream_flush;
        camel_stream_class->close = stream_close;
-       
+
        camel_tcp_stream_class->connect = stream_connect;
        camel_tcp_stream_class->getsockopt = stream_getsockopt;
        camel_tcp_stream_class->setsockopt  = stream_setsockopt;
@@ -91,7 +91,7 @@ static void
 camel_tcp_stream_raw_init (gpointer object, gpointer klass)
 {
        CamelTcpStreamRaw *stream = CAMEL_TCP_STREAM_RAW (object);
-       
+
        stream->sockfd = -1;
 }
 
@@ -99,7 +99,7 @@ static void
 camel_tcp_stream_raw_finalize (CamelObject *object)
 {
        CamelTcpStreamRaw *stream = CAMEL_TCP_STREAM_RAW (object);
-       
+
        if (stream->sockfd != -1)
                SOCKET_CLOSE (stream->sockfd);
 }
@@ -109,7 +109,7 @@ CamelType
 camel_tcp_stream_raw_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_tcp_stream_get_type (),
                                            "CamelTcpStreamRaw",
@@ -120,7 +120,7 @@ camel_tcp_stream_raw_get_type (void)
                                            (CamelObjectInitFunc) camel_tcp_stream_raw_init,
                                            (CamelObjectFinalizeFunc) camel_tcp_stream_raw_finalize);
        }
-       
+
        return type;
 }
 
@@ -131,12 +131,12 @@ flaky_tcp_write (int fd, const char *buffer, size_t buflen)
        size_t len = buflen;
        ssize_t nwritten;
        int val;
-       
+
        if (buflen == 0)
                return 0;
-       
+
        val = 1 + (int) (10.0 * rand () / (RAND_MAX + 1.0));
-       
+
        switch (val) {
        case 1:
                printf ("flaky_tcp_write (%d, ..., %d): (-1) EINTR\n", fd, buflen);
@@ -165,7 +165,7 @@ flaky_tcp_write (int fd, const char *buffer, size_t buflen)
                        printf (" only wrote %d bytes\n", nwritten);
                else
                        printf ("\n");
-               
+
                return nwritten;
        }
 }
@@ -178,12 +178,12 @@ flaky_tcp_read (int fd, char *buffer, size_t buflen)
        size_t len = buflen;
        ssize_t nread;
        int val;
-       
+
        if (buflen == 0)
                return 0;
-       
+
        val = 1 + (int) (10.0 * rand () / (RAND_MAX + 1.0));
-       
+
        switch (val) {
        case 1:
                printf ("flaky_tcp_read (%d, ..., %d): (-1) EINTR\n", fd, buflen);
@@ -216,7 +216,7 @@ flaky_tcp_read (int fd, char *buffer, size_t buflen)
                        printf (" only read %d bytes\n", nread);
                else
                        printf ("\n");
-               
+
                return nread;
        }
 }
@@ -238,9 +238,9 @@ CamelStream *
 camel_tcp_stream_raw_new (void)
 {
        CamelTcpStreamRaw *stream;
-       
+
        stream = CAMEL_TCP_STREAM_RAW (camel_object_new (camel_tcp_stream_raw_get_type ()));
-       
+
        return CAMEL_STREAM (stream);
 }
 
@@ -248,7 +248,7 @@ static ssize_t
 stream_read (CamelStream *stream, char *buffer, size_t n)
 {
        CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
-       
+
        return camel_read_socket (raw->sockfd, buffer, n);
 }
 
@@ -256,7 +256,7 @@ static ssize_t
 stream_write (CamelStream *stream, const char *buffer, size_t n)
 {
        CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
-       
+
        return camel_write_socket (raw->sockfd, buffer, n);
 }
 
@@ -271,7 +271,7 @@ stream_close (CamelStream *stream)
 {
        if (SOCKET_CLOSE (((CamelTcpStreamRaw *)stream)->sockfd) == -1)
                return -1;
-       
+
        ((CamelTcpStreamRaw *)stream)->sockfd = -1;
        return 0;
 }
@@ -286,13 +286,13 @@ socket_connect(struct addrinfo *h)
        int cancel_fd;
        int errnosav;
        int ret, fd;
-       
+
        /* see if we're cancelled yet */
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
        }
-       
+
        if (h->ai_socktype != SOCK_STREAM) {
                errno = EINVAL;
                return -1;
@@ -300,7 +300,7 @@ socket_connect(struct addrinfo *h)
 
        if ((fd = socket (h->ai_family, SOCK_STREAM, 0)) == -1)
                return -1;
-       
+
        cancel_fd = camel_operation_cancel_fd (NULL);
        if (cancel_fd == -1) {
                if (connect (fd, h->ai_addr, h->ai_addrlen) == -1) {
@@ -313,7 +313,7 @@ socket_connect(struct addrinfo *h)
                        errno = errnosav;
                        return -1;
                }
-               
+
                return fd;
        } else {
 #ifndef G_OS_WIN32
@@ -321,7 +321,7 @@ socket_connect(struct addrinfo *h)
 #endif
                int fdmax, status;
                fd_set rdset, wrset;
-               
+
 #ifndef G_OS_WIN32
                flags = fcntl (fd, F_GETFL);
                fcntl (fd, F_SETFL, flags | O_NONBLOCK);
@@ -342,14 +342,14 @@ socket_connect(struct addrinfo *h)
 #endif
                        return fd;
                }
-               
+
                if (!SOCKET_ERROR_IS_EINPROGRESS ()) {
                        errnosav = errno;
                        SOCKET_CLOSE (fd);
                        errno = errnosav;
                        return -1;
                }
-                       
+
                do {
                        FD_ZERO (&rdset);
                        FD_ZERO (&wrset);
@@ -358,30 +358,30 @@ socket_connect(struct addrinfo *h)
                        fdmax = MAX (fd, cancel_fd) + 1;
                        tv.tv_sec = 60 * 4;
                        tv.tv_usec = 0;
-                       
+
                        status = select (fdmax, &rdset, &wrset, NULL, &tv);
                } while (status == -1 && SOCKET_ERROR_IS_EINTR ());
-               
+
                if (status <= 0) {
                        SOCKET_CLOSE (fd);
                        errno = ETIMEDOUT;
                        return -1;
                }
-               
+
                if (cancel_fd != -1 && FD_ISSET (cancel_fd, &rdset)) {
                        SOCKET_CLOSE (fd);
                        errno = EINTR;
                        return -1;
                } else {
                        len = sizeof (int);
-                       
+
                        if (getsockopt (fd, SOL_SOCKET, SO_ERROR, (char *) &ret, &len) == -1) {
                                errnosav = errno;
                                SOCKET_CLOSE (fd);
                                errno = errnosav;
                                return -1;
                        }
-                       
+
                        if (ret != 0) {
                                SOCKET_CLOSE (fd);
                                errno = ret;
@@ -397,7 +397,7 @@ socket_connect(struct addrinfo *h)
                }
 #endif
        }
-       
+
        return fd;
 }
 
@@ -405,7 +405,7 @@ static int
 stream_connect (CamelTcpStream *stream, struct addrinfo *host)
 {
        CamelTcpStreamRaw *raw = CAMEL_TCP_STREAM_RAW (stream);
-       
+
        g_return_val_if_fail (host != NULL, -1);
 
        while (host) {
@@ -464,25 +464,25 @@ static int
 stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
 {
        int optname, optlen;
-       
+
        if ((optname = get_sockopt_optname (data)) == -1)
                return -1;
-       
+
        if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
 #ifndef G_OS_WIN32
                int flags;
-               
+
                flags = fcntl (((CamelTcpStreamRaw *)stream)->sockfd, F_GETFL);
                if (flags == -1)
                        return -1;
-               
+
                data->value.non_blocking = flags & O_NONBLOCK ? TRUE : FALSE;
 #else
                data->value.non_blocking = ((CamelTcpStreamRaw *)stream)->is_nonblocking;
 #endif
                return 0;
        }
-       
+
        return getsockopt (((CamelTcpStreamRaw *)stream)->sockfd,
                           get_sockopt_level (data),
                           optname,
@@ -494,21 +494,21 @@ static int
 stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
 {
        int optname;
-       
+
        if ((optname = get_sockopt_optname (data)) == -1)
                return -1;
-       
+
        if (data->option == CAMEL_SOCKOPT_NONBLOCKING) {
 #ifndef G_OS_WIN32
                int flags, set;
-               
+
                flags = fcntl (((CamelTcpStreamRaw *)stream)->sockfd, F_GETFL);
                if (flags == -1)
                        return -1;
-               
+
                set = data->value.non_blocking ? O_NONBLOCK : 0;
                flags = (flags & ~O_NONBLOCK) | set;
-               
+
                if (fcntl (((CamelTcpStreamRaw *)stream)->sockfd, F_SETFL, flags) == -1)
                        return -1;
 #else
@@ -519,7 +519,7 @@ stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
 #endif
                return 0;
        }
-       
+
        return setsockopt (((CamelTcpStreamRaw *)stream)->sockfd,
                           get_sockopt_level (data),
                           optname,
index b5859c7..ef8a184 100644 (file)
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
 struct _CamelTcpStreamRaw
 {
        CamelTcpStream parent_object;
-       
+
        int sockfd;
 #ifdef G_OS_WIN32
        int is_nonblocking;
@@ -45,9 +45,9 @@ struct _CamelTcpStreamRaw
 
 typedef struct {
        CamelTcpStreamClass parent_class;
-       
+
        /* virtual functions */
-       
+
 } CamelTcpStreamRawClass;
 
 /* Standard Camel function */
index ae22ec0..09658d4 100644 (file)
@@ -89,7 +89,7 @@ static struct sockaddr *stream_get_remote_address (CamelTcpStream *stream, sockl
 
 struct _CamelTcpStreamSSLPrivate {
        PRFileDesc *sockfd;
-       
+
        struct _CamelSession *session;
        char *expected_host;
        gboolean ssl_mode;
@@ -103,15 +103,15 @@ camel_tcp_stream_ssl_class_init (CamelTcpStreamSSLClass *camel_tcp_stream_ssl_cl
                CAMEL_TCP_STREAM_CLASS (camel_tcp_stream_ssl_class);
        CamelStreamClass *camel_stream_class =
                CAMEL_STREAM_CLASS (camel_tcp_stream_ssl_class);
-       
+
        parent_class = CAMEL_TCP_STREAM_CLASS (camel_type_get_global_classfuncs (camel_tcp_stream_get_type ()));
-       
+
        /* virtual method overload */
        camel_stream_class->read = stream_read;
        camel_stream_class->write = stream_write;
        camel_stream_class->flush = stream_flush;
        camel_stream_class->close = stream_close;
-       
+
        camel_tcp_stream_class->connect = stream_connect;
        camel_tcp_stream_class->getsockopt = stream_getsockopt;
        camel_tcp_stream_class->setsockopt = stream_setsockopt;
@@ -123,7 +123,7 @@ static void
 camel_tcp_stream_ssl_init (gpointer object, gpointer klass)
 {
        CamelTcpStreamSSL *stream = CAMEL_TCP_STREAM_SSL (object);
-       
+
        stream->priv = g_new0 (struct _CamelTcpStreamSSLPrivate, 1);
 }
 
@@ -131,7 +131,7 @@ static void
 camel_tcp_stream_ssl_finalize (CamelObject *object)
 {
        CamelTcpStreamSSL *stream = CAMEL_TCP_STREAM_SSL (object);
-       
+
        if (stream->priv->sockfd != NULL)
                PR_Close (stream->priv->sockfd);
 
@@ -139,7 +139,7 @@ camel_tcp_stream_ssl_finalize (CamelObject *object)
                camel_object_unref(stream->priv->session);
 
        g_free (stream->priv->expected_host);
-       
+
        g_free (stream->priv);
 }
 
@@ -148,7 +148,7 @@ CamelType
 camel_tcp_stream_ssl_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_tcp_stream_get_type (),
                                            "CamelTcpStreamSSL",
@@ -159,7 +159,7 @@ camel_tcp_stream_ssl_get_type (void)
                                            (CamelObjectInitFunc) camel_tcp_stream_ssl_init,
                                            (CamelObjectFinalizeFunc) camel_tcp_stream_ssl_finalize);
        }
-       
+
        return type;
 }
 
@@ -187,13 +187,13 @@ camel_tcp_stream_ssl_new (CamelSession *session, const char *expected_host, guin
        g_assert(CAMEL_IS_SESSION(session));
 
        stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-       
+
        stream->priv->session = session;
        camel_object_ref(session);
        stream->priv->expected_host = g_strdup (expected_host);
        stream->priv->ssl_mode = TRUE;
        stream->priv->flags = flags;
-       
+
        return CAMEL_STREAM (stream);
 }
 
@@ -219,15 +219,15 @@ camel_tcp_stream_ssl_new_raw (CamelSession *session, const char *expected_host,
        CamelTcpStreamSSL *stream;
 
        g_assert(CAMEL_IS_SESSION(session));
-       
+
        stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-       
+
        stream->priv->session = session;
        camel_object_ref(session);
        stream->priv->expected_host = g_strdup (expected_host);
        stream->priv->ssl_mode = FALSE;
        stream->priv->flags = flags;
-       
+
        return CAMEL_STREAM (stream);
 }
 
@@ -307,30 +307,30 @@ int
 camel_tcp_stream_ssl_enable_ssl (CamelTcpStreamSSL *ssl)
 {
        PRFileDesc *fd;
-       
+
        g_return_val_if_fail (CAMEL_IS_TCP_STREAM_SSL (ssl), -1);
-       
+
        if (ssl->priv->sockfd && !ssl->priv->ssl_mode) {
                if (!(fd = enable_ssl (ssl, NULL))) {
                        set_errno (PR_GetError ());
                        return -1;
                }
-               
+
                ssl->priv->sockfd = fd;
-               
+
                if (SSL_ResetHandshake (fd, FALSE) == SECFailure) {
                        set_errno (PR_GetError ());
                        return -1;
                }
-               
+
                if (SSL_ForceHandshake (fd) == -1) {
                        set_errno (PR_GetError ());
                        return -1;
                }
        }
-       
+
        ssl->priv->ssl_mode = TRUE;
-       
+
        return 0;
 }
 
@@ -341,12 +341,12 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
        CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
        PRFileDesc *cancel_fd;
        ssize_t nread;
-       
+
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
        }
-       
+
        cancel_fd = camel_operation_cancel_prfd (NULL);
        if (cancel_fd == NULL) {
                do {
@@ -361,7 +361,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                PRPollDesc pollfds[2];
                gboolean nonblock;
                int error;
-               
+
                /* get O_NONBLOCK options */
                sockopts.option = PR_SockOpt_Nonblocking;
                PR_GetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
@@ -374,7 +374,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                pollfds[0].in_flags = PR_POLL_READ;
                pollfds[1].fd = cancel_fd;
                pollfds[1].in_flags = PR_POLL_READ;
-               
+
                do {
                        PRInt32 res;
 
@@ -404,7 +404,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                } while (nread == -1 && (PR_GetError () == PR_PENDING_INTERRUPT_ERROR ||
                                         PR_GetError () == PR_IO_PENDING_ERROR ||
                                         PR_GetError () == PR_WOULD_BLOCK_ERROR));
-               
+
                /* restore O_NONBLOCK options */
        failed:
                error = errno;
@@ -413,7 +413,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
                errno = error;
        }
-       
+
        return nread;
 }
 
@@ -423,12 +423,12 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
        CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
        ssize_t w, written = 0;
        PRFileDesc *cancel_fd;
-       
+
        if (camel_operation_cancel_check (NULL)) {
                errno = EINTR;
                return -1;
        }
-       
+
        cancel_fd = camel_operation_cancel_prfd (NULL);
        if (cancel_fd == NULL) {
                do {
@@ -439,7 +439,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                        } while (w == -1 && (PR_GetError () == PR_PENDING_INTERRUPT_ERROR ||
                                             PR_GetError () == PR_IO_PENDING_ERROR ||
                                             PR_GetError () == PR_WOULD_BLOCK_ERROR));
-                       
+
                        if (w > 0)
                                written += w;
                } while (w != -1 && written < n);
@@ -448,7 +448,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                PRPollDesc pollfds[2];
                gboolean nonblock;
                int error;
-               
+
                /* get O_NONBLOCK options */
                sockopts.option = PR_SockOpt_Nonblocking;
                PR_GetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
@@ -456,12 +456,12 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                nonblock = sockopts.value.non_blocking;
                sockopts.value.non_blocking = TRUE;
                PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
-               
+
                pollfds[0].fd = tcp_stream_ssl->priv->sockfd;
                pollfds[0].in_flags = PR_POLL_WRITE;
                pollfds[1].fd = cancel_fd;
                pollfds[1].in_flags = PR_POLL_READ;
-               
+
                do {
                        PRInt32 res;
 
@@ -488,7 +488,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                                        if (w == -1)
                                                set_errno (PR_GetError ());
                                } while (w == -1 && PR_GetError () == PR_PENDING_INTERRUPT_ERROR);
-                               
+
                                if (w == -1) {
                                        if (PR_GetError () == PR_IO_PENDING_ERROR ||
                                            PR_GetError () == PR_WOULD_BLOCK_ERROR)
@@ -497,7 +497,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                                        written += w;
                        }
                } while (w != -1 && written < n);
-               
+
                /* restore O_NONBLOCK options */
                error = errno;
                sockopts.option = PR_SockOpt_Nonblocking;
@@ -505,10 +505,10 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
                PR_SetSocketOption (tcp_stream_ssl->priv->sockfd, &sockopts);
                errno = error;
        }
-       
+
        if (w == -1)
                return -1;
-       
+
        return written;
 }
 
@@ -529,9 +529,9 @@ stream_close (CamelStream *stream)
 
        if (PR_Close (((CamelTcpStreamSSL *)stream)->priv->sockfd) == PR_FAILURE)
                return -1;
-       
+
        ((CamelTcpStreamSSL *)stream)->priv->sockfd = NULL;
-       
+
        return 0;
 }
 
@@ -541,15 +541,15 @@ static SECStatus
 ssl_get_client_auth (void *data, PRFileDesc *sockfd,
                     struct CERTDistNamesStr *caNames,
                     struct CERTCertificateStr **pRetCert,
-                    struct SECKEYPrivateKeyStr **pRetKey) 
+                    struct SECKEYPrivateKeyStr **pRetKey)
 {
        SECStatus status = SECFailure;
        SECKEYPrivateKey *privkey;
        CERTCertificate *cert;
        void *proto_win;
-       
+
        proto_win = SSL_RevealPinArg (sockfd);
-       
+
        if ((char *) data) {
                cert = PK11_FindCertFromNickname ((char *) data, proto_win);
                if (cert) {
@@ -564,44 +564,44 @@ ssl_get_client_auth (void *data, PRFileDesc *sockfd,
                /* no nickname given, automatically find the right cert */
                CERTCertNicknames *names;
                int i;
-               
-               names = CERT_GetCertNicknames (CERT_GetDefaultCertDB (), 
+
+               names = CERT_GetCertNicknames (CERT_GetDefaultCertDB (),
                                               SEC_CERT_NICKNAMES_USER,
                                               proto_win);
-               
+
                if (names != NULL) {
                        for (i = 0; i < names->numnicknames; i++) {
-                               cert = PK11_FindCertFromNickname (names->nicknames[i], 
+                               cert = PK11_FindCertFromNickname (names->nicknames[i],
                                                                  proto_win);
                                if (!cert)
                                        continue;
-                               
+
                                /* Only check unexpired certs */
                                if (CERT_CheckCertValidTimes (cert, PR_Now (), PR_FALSE) != secCertTimeValid) {
                                        CERT_DestroyCertificate (cert);
                                        continue;
                                }
-                               
+
                                status = NSS_CmpCertChainWCANames (cert, caNames);
                                if (status == SECSuccess) {
                                        privkey = PK11_FindKeyByAnyCert (cert, proto_win);
                                        if (privkey)
                                                break;
-                                       
+
                                        status = SECFailure;
                                        break;
                                }
-                               
+
                                CERT_FreeNicknames (names);
                        }
                }
        }
-       
+
        if (status == SECSuccess) {
                *pRetCert = cert;
                *pRetKey  = privkey;
        }
-       
+
        return status;
 }
 #endif
@@ -615,34 +615,34 @@ ssl_auth_cert (void *data, PRFileDesc *sockfd, PRBool checksig, PRBool is_server
        SECStatus status;
        void *pinarg;
        char *host;
-       
+
        cert = SSL_PeerCertificate (sockfd);
        pinarg = SSL_RevealPinArg (sockfd);
        status = CERT_VerifyCertNow ((CERTCertDBHandle *)data, cert,
                                     checksig, certUsageSSLClient, pinarg);
-       
+
        if (status != SECSuccess)
                return SECFailure;
-       
+
        /* Certificate is OK.  Since this is the client side of an SSL
         * connection, we need to verify that the name field in the cert
         * matches the desired hostname.  This is our defense against
         * man-in-the-middle attacks.
         */
-       
+
        /* SSL_RevealURL returns a hostname, not a URL. */
        host = SSL_RevealURL (sockfd);
-       
+
        if (host && *host) {
                status = CERT_VerifyCertName (cert, host);
        } else {
                PR_SetError (SSL_ERROR_BAD_CERT_DOMAIN, 0);
                status = SECFailure;
        }
-       
+
        if (host)
                PR_Free (host);
-       
+
        return secStatus;
 }
 #endif
@@ -769,15 +769,15 @@ camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate
        char *dir, *path, *fingerprint;
        CamelStream *stream;
        struct stat st;
-       
+
        fingerprint = ccert->fingerprint;
-       
+
        if (ccert->rawcert == NULL)
                ccert->rawcert = g_byte_array_new ();
-       
+
        g_byte_array_set_size (ccert->rawcert, cert->derCert.len);
        memcpy (ccert->rawcert->data, cert->derCert.data, cert->derCert.len);
-       
+
 #ifndef G_OS_WIN32
        dir = g_strdup_printf ("%s/.camel_certs", getenv ("HOME"));
 #else
@@ -788,10 +788,10 @@ camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate
                g_free (dir);
                return;
        }
-       
+
        path = g_strdup_printf ("%s/%s", dir, fingerprint);
        g_free (dir);
-       
+
        stream = camel_stream_fs_new_with_name (path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
        if (stream != NULL) {
                if (camel_stream_write (stream, ccert->rawcert->data, ccert->rawcert->len) == -1) {
@@ -803,7 +803,7 @@ camel_certdb_nss_cert_set(CamelCertDB *certdb, CamelCert *ccert, CERTCertificate
        } else {
                g_warning ("Could not save cert: %s: %s", path, strerror (errno));
        }
-       
+
        g_free (path);
 }
 
@@ -850,7 +850,7 @@ ssl_bad_cert (void *data, PRFileDesc *sockfd)
        g_return_val_if_fail (CAMEL_IS_TCP_STREAM_SSL (data), SECFailure);
 
        ssl = data;
-       
+
        cert = SSL_PeerCertificate (sockfd);
        if (cert == NULL)
                return SECFailure;
@@ -878,7 +878,7 @@ ssl_bad_cert (void *data, PRFileDesc *sockfd)
                prompt = g_strdup_printf (_("SSL Certificate check for %s:\n\n%s\n\nDo you wish to accept?"),
                                          ssl->priv->expected_host, cert_str);
                g_free (cert_str);
-       
+
                /* query the user to find out if we want to accept this certificate */
                accept = camel_session_alert_user (ssl->priv->session, CAMEL_SESSION_ALERT_WARNING, prompt, TRUE);
                g_free(prompt);
@@ -936,7 +936,7 @@ ssl_bad_cert (void *data, PRFileDesc *sockfd)
                                        cert->trust = (CERTCertTrust*)PORT_ArenaZAlloc(cert->arena, sizeof(CERTCertTrust));
                                        CERT_DecodeTrustString(cert->trust, "P");
                                }
-               
+
                                certs[0] = &cert->derCert;
                                /*CERT_ImportCerts (cert->dbhandle, certUsageSSLServer, 1, certs, NULL, TRUE, FALSE, nick);*/
                                CERT_ImportCerts(cert->dbhandle, certUsageUserCertImport, 1, certs, NULL, TRUE, FALSE, nick);
@@ -985,7 +985,7 @@ ssl_bad_cert (void *data, PRFileDesc *sockfd)
                        }
 
                        break;
-                       
+
                case SEC_ERROR_EXPIRED_CERTIFICATE:
                        printf("expired\n");
 
@@ -1035,11 +1035,11 @@ static PRFileDesc *
 enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd)
 {
        PRFileDesc *ssl_fd;
-       
+
        ssl_fd = SSL_ImportFD (NULL, fd ? fd : ssl->priv->sockfd);
        if (!ssl_fd)
                return NULL;
-       
+
        SSL_OptionSet (ssl_fd, SSL_SECURITY, PR_TRUE);
        if (ssl->priv->flags & CAMEL_TCP_STREAM_SSL_ENABLE_SSL2) {
                SSL_OptionSet (ssl_fd, SSL_ENABLE_SSL2, PR_TRUE);
@@ -1056,15 +1056,15 @@ enable_ssl (CamelTcpStreamSSL *ssl, PRFileDesc *fd)
                SSL_OptionSet (ssl_fd, SSL_ENABLE_TLS, PR_TRUE);
        else
                SSL_OptionSet (ssl_fd, SSL_ENABLE_TLS, PR_FALSE);
-       
+
        SSL_SetURL (ssl_fd, ssl->priv->expected_host);
-       
+
        /*SSL_GetClientAuthDataHook (sslSocket, ssl_get_client_auth, (void *) certNickname);*/
        /*SSL_AuthCertificateHook (ssl_fd, ssl_auth_cert, (void *) CERT_GetDefaultCertDB ());*/
        SSL_BadCertHook (ssl_fd, ssl_bad_cert, ssl);
-       
+
        ssl->priv->ssl_mode = TRUE;
-       
+
        return ssl_fd;
 }
 
@@ -1119,28 +1119,28 @@ socket_connect(CamelTcpStream *stream, struct addrinfo *host)
                errno = EINVAL;
                return -1;
        }
-       
+
        fd = PR_OpenTCPSocket(netaddr.raw.family);
        if (fd == NULL) {
                set_errno (PR_GetError ());
                return -1;
        }
-       
+
        if (ssl->priv->ssl_mode) {
                PRFileDesc *ssl_fd;
-               
+
                ssl_fd = enable_ssl (ssl, fd);
                if (ssl_fd == NULL) {
                        int errnosave;
-                       
+
                        set_errno (PR_GetError ());
                        errnosave = errno;
                        PR_Close (fd);
                        errno = errnosave;
-                       
+
                        return -1;
                }
-               
+
                fd = ssl_fd;
        }
 
@@ -1148,7 +1148,7 @@ socket_connect(CamelTcpStream *stream, struct addrinfo *host)
 
        if (PR_Connect (fd, &netaddr, cancel_fd?0:CONNECT_TIMEOUT) == PR_FAILURE) {
                int errnosave;
-               
+
                set_errno (PR_GetError ());
                if (PR_GetError () == PR_IN_PROGRESS_ERROR ||
                    (cancel_fd && (PR_GetError () == PR_CONNECT_TIMEOUT_ERROR ||
@@ -1160,7 +1160,7 @@ socket_connect(CamelTcpStream *stream, struct addrinfo *host)
                        poll[0].in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
                        poll[1].fd = cancel_fd;
                        poll[1].in_flags = PR_POLL_READ;
-                       
+
                        do {
                                poll[0].out_flags = 0;
                                poll[1].out_flags = 0;
@@ -1169,7 +1169,7 @@ socket_connect(CamelTcpStream *stream, struct addrinfo *host)
                                        set_errno (PR_GetError ());
                                        goto exception;
                                }
-                               
+
                                if (poll[1].out_flags == PR_POLL_READ) {
                                        errno = EINTR;
                                        goto exception;
@@ -1189,13 +1189,13 @@ socket_connect(CamelTcpStream *stream, struct addrinfo *host)
                        PR_Close (fd);
                        ssl->priv->sockfd = NULL;
                        errno = errnosave;
-                       
+
                        return -1;
                }
-               
+
                errno = 0;
        }
-       
+
        ssl->priv->sockfd = fd;
 
        return 0;
@@ -1217,15 +1217,15 @@ static int
 stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
 {
        PRSocketOptionData sodata;
-       
+
        memset ((void *) &sodata, 0, sizeof (sodata));
        memcpy ((void *) &sodata, (void *) data, sizeof (CamelSockOptData));
-       
+
        if (PR_GetSocketOption (((CamelTcpStreamSSL *)stream)->priv->sockfd, &sodata) == PR_FAILURE)
                return -1;
-       
+
        memcpy ((void *) data, (void *) &sodata, sizeof (CamelSockOptData));
-       
+
        return 0;
 }
 
@@ -1233,13 +1233,13 @@ static int
 stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
 {
        PRSocketOptionData sodata;
-       
+
        memset ((void *) &sodata, 0, sizeof (sodata));
        memcpy ((void *) &sodata, (void *) data, sizeof (CamelSockOptData));
-       
+
        if (PR_SetSocketOption (((CamelTcpStreamSSL *)stream)->priv->sockfd, &sodata) == PR_FAILURE)
                return -1;
-       
+
        return 0;
 }
 
@@ -1269,7 +1269,7 @@ sockaddr_from_praddr(PRNetAddr *addr, socklen_t *len)
                sin->sin6_scope_id = addr->ipv6.scope_id;
                *len = sizeof(*sin);
 
-               return (struct sockaddr *)sin;          
+               return (struct sockaddr *)sin;
        }
 #endif
 
@@ -1281,7 +1281,7 @@ stream_get_local_address(CamelTcpStream *stream, socklen_t *len)
 {
        PRFileDesc *sockfd = CAMEL_TCP_STREAM_SSL (stream)->priv->sockfd;
        PRNetAddr addr;
-       
+
        if (PR_GetSockName(sockfd, &addr) != PR_SUCCESS)
                return NULL;
 
@@ -1293,7 +1293,7 @@ stream_get_remote_address (CamelTcpStream *stream, socklen_t *len)
 {
        PRFileDesc *sockfd = CAMEL_TCP_STREAM_SSL (stream)->priv->sockfd;
        PRNetAddr addr;
-       
+
        if (PR_GetPeerName(sockfd, &addr) != PR_SUCCESS)
                return NULL;
 
index bb89751..55c092e 100644 (file)
@@ -41,15 +41,15 @@ struct _CamelSession;
 
 struct _CamelTcpStreamSSL {
        CamelTcpStream parent_object;
-       
+
        struct _CamelTcpStreamSSLPrivate *priv;
 };
 
 typedef struct {
        CamelTcpStreamClass parent_class;
-       
+
        /* virtual functions */
-       
+
 } CamelTcpStreamSSLClass;
 
 /* Standard Camel function */
index 82b70a0..3f30734 100644 (file)
@@ -45,9 +45,9 @@ static void
 camel_tcp_stream_class_init (CamelTcpStreamClass *camel_tcp_stream_class)
 {
        /*CamelStreamClass *camel_stream_class = CAMEL_STREAM_CLASS (camel_tcp_stream_class);*/
-       
+
        parent_class = CAMEL_STREAM_CLASS (camel_type_get_global_classfuncs (CAMEL_STREAM_TYPE));
-       
+
        /* tcp stream methods */
        camel_tcp_stream_class->connect            = tcp_connect;
        camel_tcp_stream_class->getsockopt         = tcp_getsockopt;
@@ -66,7 +66,7 @@ CamelType
 camel_tcp_stream_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (CAMEL_STREAM_TYPE,
                                            "CamelTcpStream",
@@ -103,7 +103,7 @@ int
 camel_tcp_stream_connect (CamelTcpStream *stream, struct addrinfo *host)
 {
        g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
-       
+
        return CTS_CLASS (stream)->connect (stream, host);
 }
 
@@ -127,7 +127,7 @@ int
 camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data)
 {
        g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
-       
+
        return CTS_CLASS (stream)->getsockopt (stream, data);
 }
 
@@ -151,7 +151,7 @@ int
 camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
 {
        g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), -1);
-       
+
        return CTS_CLASS (stream)->setsockopt (stream, data);
 }
 
@@ -177,7 +177,7 @@ camel_tcp_stream_get_local_address (CamelTcpStream *stream, socklen_t *len)
 {
        g_return_val_if_fail (CAMEL_IS_TCP_STREAM (stream), NULL);
        g_return_val_if_fail(len != NULL, NULL);
-       
+
        return CTS_CLASS (stream)->get_local_address (stream, len);
 }
 
index 5e395ca..fb25d30 100644 (file)
@@ -54,16 +54,16 @@ typedef enum {
        CAMEL_SOCKOPT_KEEPALIVE,       /* keep connections alive */
        CAMEL_SOCKOPT_RECVBUFFERSIZE,  /* receive buffer size */
        CAMEL_SOCKOPT_SENDBUFFERSIZE,  /* send buffer size */
-       
+
        CAMEL_SOCKOPT_IPTIMETOLIVE,    /* time to live */
        CAMEL_SOCKOPT_IPTYPEOFSERVICE, /* type of service and precedence */
-       
+
        CAMEL_SOCKOPT_ADDMEMBER,       /* add an IP group membership */
        CAMEL_SOCKOPT_DROPMEMBER,      /* drop an IP group membership */
        CAMEL_SOCKOPT_MCASTINTERFACE,  /* multicast interface address */
        CAMEL_SOCKOPT_MCASTTIMETOLIVE, /* multicast timetolive */
        CAMEL_SOCKOPT_MCASTLOOPBACK,   /* multicast loopback */
-       
+
        CAMEL_SOCKOPT_NODELAY,         /* don't delay send to coalesce packets */
        CAMEL_SOCKOPT_MAXSEGMENT,      /* maximum segment size */
        CAMEL_SOCKOPT_BROADCAST,       /* enable broadcast */
@@ -93,7 +93,7 @@ typedef struct _CamelSockOptData {
 
 struct _CamelTcpStream {
        CamelStream parent_object;
-       
+
 };
 
 typedef struct {
@@ -103,7 +103,7 @@ typedef struct {
        int (*connect)    (CamelTcpStream *stream, struct addrinfo *host);
        int (*getsockopt) (CamelTcpStream *stream, CamelSockOptData *data);
        int (*setsockopt) (CamelTcpStream *stream, const CamelSockOptData *data);
-       
+
        struct sockaddr * (*get_local_address)  (CamelTcpStream *stream, socklen_t *len);
        struct sockaddr * (*get_remote_address) (CamelTcpStream *stream, socklen_t *len);
 } CamelTcpStreamClass;
index 9a7a0fd..f261613 100644 (file)
@@ -47,7 +47,7 @@
 
 
 #define w(x)
-#define io(x) 
+#define io(x)
 #define d(x) /*(printf("%s(%d):%s: ",  __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
 
 /* cursor debug */
@@ -204,7 +204,7 @@ text_index_add_name_to_word(CamelIndex *idx, const char *word, camel_key_t namei
                                return;
                        }
                }
-               
+
                w = g_malloc0(sizeof(*w));
                w->word = g_strdup(word);
                w->wordid = wordid;
@@ -295,7 +295,7 @@ text_index_sync(CamelIndex *idx)
                g_hash_table_remove(p->words, ww->word);
                g_free(ww->word);
                g_free(ww);
-       }       
+       }
 
        if (camel_key_table_sync(p->word_index) == -1
            || camel_key_table_sync(p->name_index) == -1
@@ -462,7 +462,7 @@ text_index_compress_nosync(CamelIndex *idx)
                        }
                        g_free(records);
                }
-               
+
                if (newcount > 0) {
                        if (camel_key_file_write(newp->links, &newdata, newcount, newrecords) == -1)
                                goto fail;
@@ -479,7 +479,7 @@ text_index_compress_nosync(CamelIndex *idx)
        }
 
        camel_block_file_touch_block(newp->blocks, newp->blocks->root_block);
-       
+
        if (camel_index_sync((CamelIndex *)newidx) == -1)
                goto fail;
 
@@ -606,7 +606,7 @@ text_index_add_name(CamelIndex *idx, const char *name)
                camel_key_table_set_flags(p->name_index, keyid, 1, 1);
                camel_partition_table_remove(p->name_hash, name);
        }
-       
+
        keyid = camel_key_table_add(p->name_index, name, 0, 0);
        if (keyid != 0) {
                camel_partition_table_add(p->name_hash, name, keyid);
@@ -643,9 +643,9 @@ text_index_write_name(CamelIndex *idx, CamelIndexName *idn)
        /* see text_index_add_name for when this can be 0 */
        if (((CamelTextIndexName *)idn)->priv->nameid != 0) {
                CAMEL_TEXT_INDEX_LOCK(idx, lock);
-               
+
                g_hash_table_foreach(idn->words, (GHFunc)hash_write_word, idn);
-               
+
                CAMEL_TEXT_INDEX_UNLOCK(idx, lock);
        }
 
@@ -761,7 +761,7 @@ camel_text_index_init(CamelTextIndex *idx)
        /* this cache size and the block cache size have been tuned for about the best
           with moderate memory usage.  Doubling the memory usage barely affects performance. */
        p->word_cache_limit = 4096; /* 1024 = 128K */
-       
+
        g_static_rec_mutex_init(&p->lock);
 }
 
@@ -790,9 +790,9 @@ camel_text_index_finalise(CamelTextIndex *idx)
                camel_object_unref((CamelObject *)p->blocks);
        if (p->links)
                camel_object_unref((CamelObject *)p->links);
-       
+
        g_static_rec_mutex_free(&p->lock);
-       
+
        g_free(p);
 }
 
@@ -800,7 +800,7 @@ CamelType
 camel_text_index_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_index_get_type(), "CamelTextIndex",
                                           sizeof (CamelTextIndex),
@@ -810,7 +810,7 @@ camel_text_index_get_type(void)
                                           (CamelObjectInitFunc) camel_text_index_init,
                                           (CamelObjectFinalizeFunc) camel_text_index_finalise);
        }
-       
+
        return type;
 }
 
@@ -857,7 +857,7 @@ camel_text_index_new(const char *path, int flags)
                rb->word_index_root = bl->id;
                camel_block_file_unref_block(p->blocks, bl);
                camel_block_file_touch_block(p->blocks, p->blocks->root_block);
-       }       
+       }
 
        if (rb->word_hash_root == 0) {
                bl = camel_block_file_new_block(p->blocks);
@@ -868,7 +868,7 @@ camel_text_index_new(const char *path, int flags)
                rb->word_hash_root = bl->id;
                camel_block_file_unref_block(p->blocks, bl);
                camel_block_file_touch_block(p->blocks, p->blocks->root_block);
-       }       
+       }
 
        if (rb->name_index_root == 0) {
                bl = camel_block_file_new_block(p->blocks);
@@ -879,7 +879,7 @@ camel_text_index_new(const char *path, int flags)
                rb->name_index_root = bl->id;
                camel_block_file_unref_block(p->blocks, bl);
                camel_block_file_touch_block(p->blocks, p->blocks->root_block);
-       }       
+       }
 
        if (rb->name_hash_root == 0) {
                bl = camel_block_file_new_block(p->blocks);
@@ -890,7 +890,7 @@ camel_text_index_new(const char *path, int flags)
                rb->name_hash_root = bl->id;
                camel_block_file_unref_block(p->blocks, bl);
                camel_block_file_touch_block(p->blocks, p->blocks->root_block);
-       }       
+       }
 
        p->word_index = camel_key_table_new(p->blocks, rb->word_index_root);
        p->word_hash = camel_partition_table_new(p->blocks, rb->word_hash_root);
@@ -1226,7 +1226,7 @@ camel_text_index_dump(CamelTextIndex *idx)
                CamelIndexCursor *idc;
 
                printf("Word: '%s':\n", word);
-               
+
                idc = camel_index_find((CamelIndex *)idx, word);
                while ( (name = camel_index_cursor_next(idc)) ) {
                        printf(" %s", name);
@@ -1492,7 +1492,7 @@ text_index_name_add_buffer(CamelIndexName *idn, const char *buffer, size_t len)
                                text_index_name_add_word(idn, p->buffer->str);
                                /*camel_index_name_add_word(idn, p->buffer->str);*/
                        }
-                       
+
                        g_string_truncate (p->buffer, 0);
                }
        }
@@ -1527,7 +1527,7 @@ static void
 camel_text_index_name_finalise(CamelTextIndexName *idn)
 {
        CamelTextIndexNamePrivate *p = CIN_PRIVATE(idn);
-       
+
        g_hash_table_destroy(idn->parent.words);
 
        g_string_free(p->buffer, TRUE);
@@ -1540,7 +1540,7 @@ CamelType
 camel_text_index_name_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_index_name_get_type(), "CamelTextIndexName",
                                           sizeof (CamelTextIndexName),
@@ -1550,7 +1550,7 @@ camel_text_index_name_get_type(void)
                                           (CamelObjectInitFunc) camel_text_index_name_init,
                                           (CamelObjectFinalizeFunc) camel_text_index_name_finalise);
        }
-       
+
        return type;
 }
 
@@ -1604,7 +1604,7 @@ text_index_cursor_next(CamelIndexCursor *idc)
                if (flags & 1) {
                        g_free(p->current);
                        p->current = NULL;
-               }               
+               }
                p->record_index++;
        } while (p->current == NULL);
 
@@ -1656,7 +1656,7 @@ CamelType
 camel_text_index_cursor_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_index_cursor_get_type(), "CamelTextIndexCursor",
                                           sizeof (CamelTextIndexCursor),
@@ -1666,7 +1666,7 @@ camel_text_index_cursor_get_type(void)
                                           (CamelObjectInitFunc) camel_text_index_cursor_init,
                                           (CamelObjectFinalizeFunc) camel_text_index_cursor_finalise);
        }
-       
+
        return type;
 }
 
@@ -1768,7 +1768,7 @@ CamelType
 camel_text_index_key_cursor_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_index_cursor_get_type(), "CamelTextIndexKeyCursor",
                                           sizeof (CamelTextIndexKeyCursor),
@@ -1778,7 +1778,7 @@ camel_text_index_key_cursor_get_type(void)
                                           (CamelObjectInitFunc) camel_text_index_key_cursor_init,
                                           (CamelObjectFinalizeFunc) camel_text_index_key_cursor_finalise);
        }
-       
+
        return type;
 }
 
@@ -1909,7 +1909,7 @@ int main(int argc, char **argv)
                line[strlen(line)-1] = 0;
 
                /* see if its already there */
-               keyid = camel_partition_table_lookup(cpi, line);                
+               keyid = camel_partition_table_lookup(cpi, line);
                if (keyid == 0) {
                        m(printf("Adding word '%s' %d\n", line, index));
 
@@ -1919,7 +1919,7 @@ int main(int argc, char **argv)
                        camel_partition_table_add(cpi, line, keyid);
 
                        m(printf("Lookup word '%s'\n", line));
-                       keyid = camel_partition_table_lookup(cpi, line);                
+                       keyid = camel_partition_table_lookup(cpi, line);
                        m(printf(" key = %08x\n", keyid));
                }
 
@@ -1943,7 +1943,7 @@ int main(int argc, char **argv)
        while (fgets(line, sizeof(line), fp) != NULL) {
                line[strlen(line)-1] = 0;
                m(printf("Lookup word '%s' %d\n", line, index));
-               keyid = camel_partition_table_lookup(cpi, line);                
+               keyid = camel_partition_table_lookup(cpi, line);
                m(printf(" key = %08d\n", keyid));
 
                m(printf("Lookup key %08x\n", keyid));
index 2b005b9..5160d54 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-transport.c : Abstract class for an email transport */
 
-/* 
+/*
  *
- * Author : 
+ * Author :
  *  Dan Winship <danw@ximian.com>
  *
  * Copyright 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -45,9 +45,9 @@ static void
 camel_transport_class_init (CamelTransportClass *camel_transport_class)
 {
        CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (camel_transport_class);
-       
+
        parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
-       
+
        /* virtual method overload */
        camel_object_class->setv = transport_setv;
        camel_object_class->getv = transport_getv;
@@ -57,7 +57,7 @@ static void
 camel_transport_init (gpointer object, gpointer klass)
 {
        CamelTransport *xport = object;
-       
+
        xport->priv = g_malloc0 (sizeof (struct _CamelTransportPrivate));
        xport->priv->send_lock = g_mutex_new ();
 }
@@ -66,7 +66,7 @@ static void
 camel_transport_finalize (CamelObject *object)
 {
        CamelTransport *xport = CAMEL_TRANSPORT (object);
-       
+
        g_mutex_free (xport->priv->send_lock);
        g_free (xport->priv);
 }
@@ -75,7 +75,7 @@ CamelType
 camel_transport_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (CAMEL_SERVICE_TYPE,
                                            "CamelTransport",
@@ -86,7 +86,7 @@ camel_transport_get_type (void)
                                            (CamelObjectInitFunc) camel_transport_init,
                                            (CamelObjectFinalizeFunc) camel_transport_finalize);
        }
-       
+
        return type;
 }
 
@@ -126,16 +126,16 @@ camel_transport_send_to (CamelTransport *transport, CamelMimeMessage *message,
                         CamelException *ex)
 {
        gboolean sent;
-       
+
        g_return_val_if_fail (CAMEL_IS_TRANSPORT (transport), FALSE);
        g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), FALSE);
        g_return_val_if_fail (CAMEL_IS_ADDRESS (from), FALSE);
        g_return_val_if_fail (CAMEL_IS_ADDRESS (recipients), FALSE);
-       
+
        CAMEL_TRANSPORT_LOCK (transport, send_lock);
        sent = CT_CLASS (transport)->send_to (transport, message,
                                              from, recipients, ex);
        CAMEL_TRANSPORT_UNLOCK (transport, send_lock);
-       
+
        return sent;
 }
index 1b3169f..90c1d25 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-transport.h : Abstract class for an email transport */
 
-/* 
+/*
  *
- * Author : 
+ * Author :
  *  Dan Winship <danw@ximian.com>
  *
  * Copyright 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -44,7 +44,7 @@ enum {
 struct _CamelTransport
 {
        CamelService parent_object;
-       
+
        struct _CamelTransportPrivate *priv;
 };
 
index 87ea842..cac2f2a 100644 (file)
@@ -1,10 +1,10 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
-/* 
+/*
  * Copyright 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 56e33ce..6c13125 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-uid-cache.c: UID caching code. */
 
-/* 
+/*
  * Authors:
  *  Dan Winship <danw@ximian.com>
  *
  * Copyright 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -64,35 +64,35 @@ camel_uid_cache_new (const char *filename)
        struct stat st;
        char *dirname, *buf, **uids;
        int fd, i;
-       
+
        dirname = g_path_get_dirname (filename);
        if (g_mkdir_with_parents (dirname, 0777) == -1) {
                g_free (dirname);
                return NULL;
        }
-       
+
        g_free (dirname);
-       
+
        if ((fd = g_open (filename, O_RDONLY | O_CREAT | O_BINARY, 0666)) == -1)
                return NULL;
-       
+
        if (fstat (fd, &st) == -1) {
                close (fd);
                return NULL;
        }
-       
+
        buf = g_malloc (st.st_size + 1);
-       
+
        if (st.st_size > 0 && camel_read (fd, buf, st.st_size) == -1) {
                close (fd);
                g_free (buf);
                return NULL;
        }
-       
+
        buf[st.st_size] = '\0';
-       
+
        close (fd);
-       
+
        cache = g_new (CamelUIDCache, 1);
        cache->uids = g_hash_table_new (g_str_hash, g_str_equal);
        cache->filename = g_strdup (filename);
@@ -100,21 +100,21 @@ camel_uid_cache_new (const char *filename)
        cache->expired = 0;
        cache->size = 0;
        cache->fd = -1;
-       
+
        uids = g_strsplit (buf, "\n", 0);
        g_free (buf);
        for (i = 0; uids[i]; i++) {
                struct _uid_state *state;
-               
+
                state = g_new (struct _uid_state, 1);
                state->level = cache->level;
                state->save = TRUE;
-               
+
                g_hash_table_insert (cache->uids, uids[i], state);
        }
-       
+
        g_free (uids);
-       
+
        return cache;
 }
 
@@ -124,12 +124,12 @@ maybe_write_uid (gpointer key, gpointer value, gpointer data)
 {
        CamelUIDCache *cache = data;
        struct _uid_state *state = value;
-       
+
        if (cache->fd == -1)
                return;
-       
+
        if (state && state->level == cache->level && state->save) {
-               if (camel_write (cache->fd, key, strlen (key)) == -1 || 
+               if (camel_write (cache->fd, key, strlen (key)) == -1 ||
                    camel_write (cache->fd, "\n", 1) == -1) {
                        cache->fd = -1;
                } else {
@@ -157,36 +157,36 @@ camel_uid_cache_save (CamelUIDCache *cache)
        char *filename;
        int errnosav;
        int fd;
-       
+
        filename = g_strdup_printf ("%s~", cache->filename);
        if ((fd = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666)) == -1) {
                g_free (filename);
                return FALSE;
        }
-       
+
        cache->fd = fd;
        cache->size = 0;
        cache->expired = 0;
        g_hash_table_foreach (cache->uids, maybe_write_uid, cache);
-       
+
        if (fsync (fd) == -1)
                goto exception;
-       
+
        close (fd);
        fd = -1;
        cache->fd = -1;
 
        if (g_rename (filename, cache->filename) == -1)
                goto exception;
-       
+
        g_free (filename);
-       
+
        return TRUE;
-       
+
  exception:
-       
+
        errnosav = errno;
-       
+
 #ifdef ENABLE_SPASMOLYTIC
        if (fd != -1) {
                /*
@@ -203,7 +203,7 @@ camel_uid_cache_save (CamelUIDCache *cache)
                 * more), then we should replace the old cache with
                 * the new cache as well.
                 */
-               
+
                if (g_stat (cache->filename, &st) == 0 &&
                    (cache->size > st.st_size || cache->size + cache->expired > st.st_size)) {
                        if (ftruncate (fd, (off_t) cache->size) != -1) {
@@ -211,7 +211,7 @@ camel_uid_cache_save (CamelUIDCache *cache)
                                cache->expired = 0;
                                goto overwrite; /* FIXME: no such label */
                        }
-               }               
+               }
        }
 #endif
        if (fd != -1) {
@@ -221,9 +221,9 @@ camel_uid_cache_save (CamelUIDCache *cache)
 
        g_unlink (filename);
        g_free (filename);
-       
+
        errno = errnosav;
-       
+
        return FALSE;
 }
 
@@ -270,13 +270,13 @@ camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids)
        gpointer old_uid;
        char *uid;
        int i;
-       
+
        new_uids = g_ptr_array_new ();
        cache->level++;
 
        for (i = 0; i < uids->len; i++) {
                struct _uid_state *state;
-               
+
                uid = uids->pdata[i];
                if (g_hash_table_lookup_extended (cache->uids, uid, (void **)&old_uid, (void **)&state)) {
                        g_hash_table_remove (cache->uids, uid);
@@ -286,11 +286,11 @@ camel_uid_cache_get_new_uids (CamelUIDCache *cache, GPtrArray *uids)
                        state = g_new (struct _uid_state, 1);
                        state->save = FALSE;
                }
-               
+
                state->level = cache->level;
                g_hash_table_insert (cache->uids, g_strdup (uid), state);
        }
-       
+
        return new_uids;
 }
 
@@ -307,7 +307,7 @@ camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid)
 {
        struct _uid_state *state;
        gpointer old_uid;
-       
+
        g_return_if_fail (uid != NULL);
 
        if (g_hash_table_lookup_extended (cache->uids, uid, (void **)&old_uid, (void **)&state)) {
@@ -333,7 +333,7 @@ void
 camel_uid_cache_free_uids (GPtrArray *uids)
 {
        int i;
-       
+
        for (i = 0; i < uids->len; i++)
                g_free (uids->pdata[i]);
        g_ptr_array_free (uids, TRUE);
index 12a0dfc..0b0a339 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-uid-cache.h: UID caching code. */
 
-/* 
+/*
  * Authors:
  *  Bertrand Guiheneuf <bertrand@helixcode.com>
  *
  * Copyright 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 2f5c035..45182f3 100644 (file)
@@ -44,11 +44,11 @@ CamelUrlScanner *
 camel_url_scanner_new (void)
 {
        CamelUrlScanner *scanner;
-       
+
        scanner = g_new (CamelUrlScanner, 1);
        scanner->patterns = g_ptr_array_new ();
        scanner->trie = e_trie_new (TRUE);
-       
+
        return scanner;
 }
 
@@ -57,7 +57,7 @@ void
 camel_url_scanner_free (CamelUrlScanner *scanner)
 {
        g_return_if_fail (scanner != NULL);
-       
+
        g_ptr_array_free (scanner->patterns, TRUE);
        e_trie_free (scanner->trie);
        g_free (scanner);
@@ -68,7 +68,7 @@ void
 camel_url_scanner_add (CamelUrlScanner *scanner, urlpattern_t *pattern)
 {
        g_return_if_fail (scanner != NULL);
-       
+
        e_trie_add (scanner->trie, pattern->pattern, scanner->patterns->len);
        g_ptr_array_add (scanner->patterns, pattern);
 }
@@ -81,32 +81,32 @@ camel_url_scanner_scan (CamelUrlScanner *scanner, const char *in, size_t inlen,
        const unsigned char *inptr, *inend;
        urlpattern_t *pat;
        int pattern;
-       
+
        g_return_val_if_fail (scanner != NULL, FALSE);
        g_return_val_if_fail (in != NULL, FALSE);
-       
+
        inptr = (const unsigned char *) in;
        inend = inptr + inlen;
-       
+
        do {
                if (!(pos = e_trie_search (scanner->trie, (const char *)inptr, inlen, &pattern)))
                        return FALSE;
-               
+
                pat = g_ptr_array_index (scanner->patterns, pattern);
-               
+
                match->pattern = pat->pattern;
                match->prefix = pat->prefix;
-               
+
                if (pat->start (in, pos, (const char *)inend, match) && pat->end (in, pos, (const char *)inend, match))
                        return TRUE;
-               
+
                inptr = (const unsigned char *) pos;
                if (camel_utf8_getc_limit (&inptr, inend) == 0xffff)
                        break;
-               
+
                inlen = inend - inptr;
        } while (inptr < inend);
-       
+
        return FALSE;
 }
 
@@ -166,12 +166,12 @@ static gboolean
 is_open_brace (char c)
 {
        int i;
-       
+
        for (i = 0; i < G_N_ELEMENTS (url_braces); i++) {
                if (c == url_braces[i].open)
                        return TRUE;
        }
-       
+
        return FALSE;
 }
 
@@ -186,13 +186,13 @@ url_stop_at_brace (const char *in, size_t so, char *open_brace)
        if (so > 0) {
                for (i = 0; i < G_N_ELEMENTS (url_braces); i++) {
                        if (in[so - 1] == url_braces[i].open) {
-                               if (open_brace != NULL) 
+                               if (open_brace != NULL)
                                        *open_brace = url_braces[i].open;
                                return url_braces[i].close;
                        }
                }
        }
-       
+
        return '\0';
 }
 
@@ -201,33 +201,33 @@ gboolean
 camel_url_addrspec_start (const char *in, const char *pos, const char *inend, urlmatch_t *match)
 {
        register const char *inptr = pos;
-       
+
        g_assert (*inptr == '@');
-       
+
        if (inptr > in)
                inptr--;
-       
+
        while (inptr > in) {
                if (is_atom (*inptr))
                        inptr--;
                else
                        break;
-               
+
                while (inptr > in && is_atom (*inptr))
                        inptr--;
-               
+
                if (inptr > in && *inptr == '.')
                        inptr--;
        }
-       
+
        while (!is_atom (*inptr) || is_open_brace (*inptr))
                inptr++;
-       
+
        if (inptr >= pos)
                return FALSE;
-       
+
        match->um_so = (inptr - in);
-       
+
        return TRUE;
 }
 
@@ -237,33 +237,33 @@ camel_url_addrspec_end (const char *in, const char *pos, const char *inend, urlm
        const char *inptr = pos;
        int parts = 0, digits;
        gboolean got_dot = FALSE;
-       
+
        g_assert (*inptr == '@');
-       
+
        inptr++;
-       
+
        if (*inptr == '[') {
                /* domain literal */
                do {
                        inptr++;
-                       
+
                        digits = 0;
                        while (inptr < inend && is_digit (*inptr) && digits < 3) {
                                inptr++;
                                digits++;
                        }
-                       
+
                        parts++;
-                       
+
                        if (*inptr != '.' && parts != 4)
                                return FALSE;
                } while (parts < 4);
-               
+
                if (*inptr == ']')
                        inptr++;
                else
                        return FALSE;
-               
+
                got_dot = TRUE;
        } else {
                while (inptr < inend) {
@@ -271,10 +271,10 @@ camel_url_addrspec_end (const char *in, const char *pos, const char *inend, urlm
                                inptr++;
                        else
                                break;
-                       
+
                        while (inptr < inend && is_domain (*inptr))
                                inptr++;
-                       
+
                        if (inptr < inend && *inptr == '.' && is_domain (inptr[1])) {
                                if (*inptr == '.')
                                        got_dot = TRUE;
@@ -282,13 +282,13 @@ camel_url_addrspec_end (const char *in, const char *pos, const char *inend, urlm
                        }
                }
        }
-       
+
        /* don't allow toplevel domains */
        if (inptr == pos + 1 || !got_dot)
                return FALSE;
-       
+
        match->um_eo = (inptr - in);
-       
+
        return TRUE;
 }
 
@@ -296,7 +296,7 @@ gboolean
 camel_url_file_start (const char *in, const char *pos, const char *inend, urlmatch_t *match)
 {
        match->um_so = (pos - in);
-       
+
        return TRUE;
 }
 
@@ -305,22 +305,22 @@ camel_url_file_end (const char *in, const char *pos, const char *inend, urlmatch
 {
        register const char *inptr = pos;
        char close_brace;
-       
+
        inptr += strlen (match->pattern);
-       
+
        if (*inptr == '/')
                inptr++;
-       
+
        close_brace = url_stop_at_brace (in, match->um_so, NULL);
-       
+
        while (inptr < inend && is_urlsafe (*inptr) && *inptr != close_brace)
                inptr++;
-       
+
        if (inptr == pos)
                return FALSE;
-       
+
        match->um_eo = (inptr - in);
-       
+
        return TRUE;
 }
 
@@ -332,9 +332,9 @@ camel_url_web_start (const char *in, const char *pos, const char *inend, urlmatc
                if (!is_open_brace (pos[-1]) && !isspace (pos[-1]))
                        return FALSE;
        }
-       
+
        match->um_so = (pos - in);
-       
+
        return TRUE;
 }
 
@@ -349,7 +349,7 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_
        int port;
 
        inptr += strlen (match->pattern);
-       
+
        close_brace = url_stop_at_brace (in, match->um_so, &open_brace);
 
        /* find the end of the domain */
@@ -359,81 +359,81 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_
                while (inptr < inend) {
                        if (!is_atom (*inptr))
                                break;
-                       
+
                        inptr++;
-                       
+
                        while (inptr < inend && is_atom (*inptr))
                                inptr++;
-                       
-                       if ((inptr + 1) < inend && *inptr == '.' && (is_atom (inptr[1]) || inptr[1] == '/')) 
+
+                       if ((inptr + 1) < inend && *inptr == '.' && (is_atom (inptr[1]) || inptr[1] == '/'))
                                        inptr++;
                }
-               
+
                if (*inptr != '@')
                        inptr = save;
                else
                        inptr++;
-               
+
                goto domain;
        } else if (is_domain (*inptr)) {
        domain:
                while (inptr < inend) {
                        if (!is_domain (*inptr))
                                break;
-                       
+
                        inptr++;
-                       
+
                        while (inptr < inend && is_domain (*inptr))
                                inptr++;
-                       
-                       if ((inptr + 1) < inend && *inptr == '.' && (is_domain (inptr[1]) || inptr[1] == '/')) 
+
+                       if ((inptr + 1) < inend && *inptr == '.' && (is_domain (inptr[1]) || inptr[1] == '/'))
                                        inptr++;
                }
        } else {
                return FALSE;
        }
-       
+
        if (inptr < inend) {
                switch (*inptr) {
                case ':': /* we either have a port or a password */
                        inptr++;
-                       
+
                        if (is_digit (*inptr) || passwd) {
                                port = (*inptr++ - '0');
-                               
+
                                while (inptr < inend && is_digit (*inptr) && port < 65536)
                                        port = (port * 10) + (*inptr++ - '0');
-                               
+
                                if (!passwd && (port >= 65536 || *inptr == '@')) {
                                        if (inptr < inend) {
                                                /* this must be a password? */
                                                goto passwd;
                                        }
-                                       
+
                                        inptr--;
                                }
                        } else {
                        passwd:
                                passwd = TRUE;
                                save = inptr;
-                               
+
                                while (inptr < inend && is_atom (*inptr))
                                        inptr++;
-                               
+
                                if ((inptr + 2) < inend) {
                                        if (*inptr == '@') {
                                                inptr++;
                                                if (is_domain (*inptr))
                                                        goto domain;
                                        }
-                                       
+
                                        return FALSE;
                                }
                        }
-                       
+
                        if (inptr >= inend || *inptr != '/')
                                break;
-                       
+
                        /* we have a '/' so there could be a path - fall through */
                case '/': /* we've detected a path component to our url */
                        inptr++;
@@ -466,7 +466,7 @@ camel_url_web_end (const char *in, const char *pos, const char *inend, urlmatch_
 
 
        match->um_eo = (inptr - in);
-       
+
        return TRUE;
 }
 
@@ -488,7 +488,7 @@ static void
 table_init_bits (unsigned int mask, const unsigned char *vals)
 {
        int i;
-       
+
        for (i = 0; vals[i] != '\0'; i++)
                url_scanner_table[vals[i]] |= mask;
 }
@@ -497,7 +497,7 @@ static void
 url_scanner_table_init (void)
 {
        int i;
-       
+
        for (i = 0; i < 256; i++) {
                url_scanner_table[i] = 0;
                if (i < 32)
@@ -509,16 +509,16 @@ url_scanner_table_init (void)
                if (i >= 127)
                        url_scanner_table[i] |= IS_CTRL;
        }
-       
+
        url_scanner_table[' '] |= IS_SPACE;
        url_scanner_table['-'] |= IS_DOMAIN;
-       
+
        /* not defined to be special in rfc0822, but when scanning
            backwards to find the beginning of the email address we do
            not want to include this char if we come accross it - so
            this is kind of a hack */
        url_scanner_table['/'] |= IS_SPECIAL;
-       
+
        table_init_bits (IS_LWSP, CHARS_LWSP);
        table_init_bits (IS_SPECIAL, CHARS_SPECIAL);
        table_init_bits (IS_URLSAFE, CHARS_URLSAFE);
@@ -527,16 +527,16 @@ url_scanner_table_init (void)
 int main (int argc, char **argv)
 {
        int i;
-       
+
        url_scanner_table_init ();
-       
+
        printf ("static unsigned char url_scanner_table[256] = {");
        for (i = 0; i < 256; i++) {
                printf ("%s%3d%s", (i % 16) ? "" : "\n\t",
                        url_scanner_table[i], i != 255 ? "," : "\n");
        }
        printf ("};\n\n");
-       
+
        return 0;
 }
 
index 4daa6e9..457ab05 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-url.c : utility functions to parse URLs */
 
-/* 
+/*
  * Authors:
  *  Dan Winship <danw@ximian.com>
  *  Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright 1999-2001 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -334,17 +334,17 @@ camel_url_to_string (CamelURL *url, guint32 flags)
        /* IF YOU CHANGE ANYTHING IN THIS FUNCTION, RUN
         * tests/misc/url AFTERWARD.
         */
-       
+
 #ifdef G_OS_WIN32
        if (url->protocol && !strcmp(url->protocol, "file"))
                return g_filename_to_uri(url->path, url->host, NULL);
 #endif
-       
+
        str = g_string_sized_new (20);
-       
+
        if (url->protocol)
                g_string_append_printf (str, "%s:", url->protocol);
-       
+
        if (url->host) {
                g_string_append (str, "//");
                if (url->user) {
@@ -365,7 +365,7 @@ camel_url_to_string (CamelURL *url, guint32 flags)
                if (!url->path && (url->params || url->query || url->fragment))
                        g_string_append_c (str, '/');
        }
-       
+
        if (url->path)
                append_url_encoded (str, url->path, ";?");
        if (url->params && !(flags & CAMEL_URL_HIDE_PARAMS))
@@ -378,10 +378,10 @@ camel_url_to_string (CamelURL *url, guint32 flags)
                g_string_append_c (str, '#');
                append_url_encoded (str, url->fragment, NULL);
        }
-       
+
        return_result = str->str;
        g_string_free (str, FALSE);
-       
+
        return return_result;
 }
 
@@ -423,7 +423,7 @@ camel_url_free (CamelURL *url)
                g_datalist_clear (&url->params);
                g_free (url->query);
                g_free (url->fragment);
-               
+
                g_free (url);
        }
 }
@@ -677,7 +677,7 @@ camel_url_hash (const void *v)
        ADD_HASH (u->path);
        ADD_HASH (u->query);
        hash ^= u->port;
-       
+
        return hash;
 }
 
@@ -690,7 +690,7 @@ check_equal (char *s1, char *s2)
                else
                        return FALSE;
        }
-       
+
        if (s2 == NULL)
                return FALSE;
 
index f398cfa..3f05d53 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-url.h : utility functions to parse URLs */
 
-/* 
+/*
  * Authors:
  *  Bertrand Guiheneuf <bertrand@helixcode.com>
  *  Dan Winship <danw@ximian.com>
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index b3abfce..a972631 100644 (file)
@@ -34,9 +34,9 @@
 
 /**
  * camel_utf8_putc:
- * @ptr: 
- * @c: 
- * 
+ * @ptr:
+ * @c:
+ *
  * Output a 32 bit unicode character as utf8 octets.  At most 4 octets will
  * be written to @ptr.  @ptr will be advanced to the next character position.
  **/
@@ -67,12 +67,12 @@ camel_utf8_putc(unsigned char **ptr, guint32 c)
 
 /**
  * camel_utf8_getc:
- * @ptr: 
- * 
+ * @ptr:
+ *
  * Get a Unicode character from a utf8 stream.  @ptr will be advanced
  * to the next character position.  Invalid utf8 characters will be
  * silently skipped.  @ptr should point to a NUL terminated array.
- * 
+ *
  * Return value: The next Unicode character.  @ptr will be advanced to
  * the next character always.
  **/
@@ -102,7 +102,7 @@ loop:
                        r<<=1;
                        m<<=5;
                } while (r & 0x40);
-               
+
                *ptr = p;
 
                v &= ~m;
@@ -115,15 +115,15 @@ loop:
 
 /**
  * camel_utf8_getc_limit:
- * @ptr: 
+ * @ptr:
  * @end: must not be NULL.
- * 
+ *
  * Get the next utf8 char at @ptr, and return it, advancing @ptr to
  * the next character.  If @end is reached before a full utf8
  * character can be read, then the invalid Unicode char 0xffff is
  * returned as a sentinel (Unicode 3.1, section 2.7), and @ptr is not
  * advanced.
- * 
+ *
  * Return value: The next utf8 char, or 0xffff.
  **/
 guint32
@@ -146,7 +146,7 @@ loop:
                        do {
                                if (p >= end)
                                        return 0xffff;
-                               
+
                                c = *p++;
                                if ((c & 0xc0) != 0x80) {
                                        r = c;
@@ -156,9 +156,9 @@ loop:
                                r<<=1;
                                m<<=5;
                        } while (r & 0x40);
-                       
+
                        *ptr = p;
-                       
+
                        v &= ~m;
                        return v;
                } else {
@@ -204,11 +204,11 @@ static const unsigned char utf7_rank[256] = {
 
 /**
  * camel_utf7_utf8:
- * @ptr: 
- * 
+ * @ptr:
+ *
  * Convert a modified utf7 string to utf8.  If the utf7 string
  * contains 8 bit characters, they are treated as iso-8859-1.
- * 
+ *
  * The IMAP rules [rfc2060] are used in the utf7 encoding.
  *
  * Return value: The converted string.
@@ -286,13 +286,13 @@ static void utf7_closeb64(GString *out, guint32 v, guint32 i)
 
 /**
  * camel_utf8_utf7:
- * @ptr: 
- * 
+ * @ptr:
+ *
  * Convert a utf8 string to a modified utf7 format.
  *
  * The IMAP rules [rfc2060] are used in the utf7 encoding.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 char *
 camel_utf8_utf7(const char *ptr)
@@ -344,12 +344,12 @@ camel_utf8_utf7(const char *ptr)
 
 /**
  * camel_utf8_ucs2:
- * @ptr: 
- * 
+ * @ptr:
+ *
  * Convert a utf8 string into a ucs2 one.  The ucs string will be in
  * network byte order, and terminated with a 16 bit NULL.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 char *
 camel_utf8_ucs2(const char *pptr)
@@ -377,12 +377,12 @@ camel_utf8_ucs2(const char *pptr)
 
 /**
  * camel_ucs2_utf8:
- * @ptr: 
- * 
+ * @ptr:
+ *
  * Convert a ucs2 string into a utf8 one.  The ucs2 string is treated
  * as network byte ordered, and terminated with a 16 bit NUL.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 char *camel_ucs2_utf8(const char *ptr)
 {
index c61e768..5380200 100644 (file)
@@ -46,7 +46,7 @@
 #include "camel-vee-store.h"   /* for open flags */
 #include "camel-vee-summary.h"
 
-#define d(x) 
+#define d(x)
 #define dd(x) (camel_debug("vfolder")?(x):0)
 
 #define _PRIVATE(o) (((CamelVeeFolder *)(o))->priv)
@@ -89,7 +89,7 @@ CamelType
 camel_vee_folder_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_folder_get_type (), "CamelVeeFolder",
                                            sizeof (CamelVeeFolder),
@@ -99,7 +99,7 @@ camel_vee_folder_get_type (void)
                                            (CamelObjectInitFunc) camel_vee_folder_init,
                                            (CamelObjectFinalizeFunc) camel_vee_folder_finalise);
        }
-       
+
        return type;
 }
 
@@ -132,7 +132,7 @@ camel_vee_folder_new(CamelStore *parent_store, const char *full, guint32 flags)
 {
        CamelVeeFolder *vf;
        char *tmp;
-       
+
        if (CAMEL_IS_VEE_STORE(parent_store) && strcmp(full, CAMEL_UNMATCHED_NAME) == 0) {
                vf = ((CamelVeeStore *)parent_store)->folder_unmatched;
                camel_object_ref(vf);
@@ -178,7 +178,7 @@ camel_vee_folder_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
        struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
        int i;
        CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
-       
+
        if (vf == (CamelVeeFolder *)sub) {
                g_warning("Adding a virtual folder to itself as source, ignored");
                return;
@@ -190,7 +190,7 @@ camel_vee_folder_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
        if (g_list_find(p->folders, sub) == NULL) {
                camel_object_ref((CamelObject *)sub);
                p->folders = g_list_append(p->folders, sub);
-               
+
                CAMEL_FOLDER_LOCK(vf, change_lock);
 
                /* update the freeze state of 'sub' to match our freeze state */
@@ -238,7 +238,7 @@ camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
        struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
        int i;
        CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
-       
+
        CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
 
        CAMEL_VEE_FOLDER_LOCK(vf, changed_lock);
@@ -249,19 +249,19 @@ camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
                CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
                return;
        }
-       
+
        camel_object_unhook_event((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
        camel_object_unhook_event((CamelObject *)sub, "deleted", (CamelObjectEventHookFunc) subfolder_deleted, vf);
        camel_object_unhook_event((CamelObject *)sub, "renamed", (CamelObjectEventHookFunc) folder_renamed, vf);
 
        p->folders = g_list_remove(p->folders, sub);
-       
+
        /* undo the freeze state that we have imposed on this source folder */
        CAMEL_FOLDER_LOCK(vf, change_lock);
        for (i = 0; i < ((CamelFolder *)vf)->priv->frozen; i++)
                camel_folder_thaw(sub);
        CAMEL_FOLDER_UNLOCK(vf, change_lock);
-       
+
        CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
 
        if (folder_unmatched != NULL) {
@@ -273,7 +273,7 @@ camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
                        while (g_list_find(up->folders, sub)) {
                                up->folders = g_list_remove(up->folders, sub);
                                camel_object_unref((CamelObject *)sub);
-                               
+
                                /* undo the freeze state that Unmatched has imposed on this source folder */
                                CAMEL_FOLDER_LOCK(folder_unmatched, change_lock);
                                for (i = 0; i < ((CamelFolder *)folder_unmatched)->priv->frozen; i++)
@@ -284,7 +284,7 @@ camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
                        if (g_list_find(up->folders, sub) != NULL) {
                                up->folders = g_list_remove(up->folders, sub);
                                camel_object_unref((CamelObject *)sub);
-                               
+
                                /* undo the freeze state that Unmatched has imposed on this source folder */
                                CAMEL_FOLDER_LOCK(folder_unmatched, change_lock);
                                for (i = 0; i < ((CamelFolder *)folder_unmatched)->priv->frozen; i++)
@@ -299,7 +299,7 @@ camel_vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *sub)
 
        if (CAMEL_IS_VEE_FOLDER(sub))
                return;
-                       
+
        camel_object_unref((CamelObject *)sub);
 }
 
@@ -326,9 +326,9 @@ remove_folders(CamelFolder *folder, CamelFolder *foldercopy, CamelVeeFolder *vf)
 
 /**
  * camel_vee_folder_set_folders:
- * @vf: 
- * @folders: 
- * 
+ * @vf:
+ * @folders:
+ *
  * Set the whole list of folder sources on a vee folder.
  **/
 void
@@ -368,9 +368,9 @@ camel_vee_folder_set_folders(CamelVeeFolder *vf, GList *folders)
 
 /**
  * camel_vee_folder_hash_folder:
- * @folder: 
- * @: 
- * 
+ * @folder:
+ * @:
+ *
  * Create a hash string representing the folder name, which should be
  * unique, and remain static for a given folder.
  **/
@@ -402,14 +402,14 @@ camel_vee_folder_hash_folder(CamelFolder *folder, char buffer[8])
 
 /**
  * camel_vee_folder_get_location:
- * @vf: 
- * @vinfo: 
+ * @vf:
+ * @vinfo:
  * @realuid: if not NULL, set to the uid of the real message, must be
  * g_free'd by caller.
- * 
+ *
  * Find the real folder (and uid)
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 CamelFolder *
 camel_vee_folder_get_location(CamelVeeFolder *vf, const CamelVeeMessageInfo *vinfo, char **realuid)
@@ -537,20 +537,20 @@ vee_search_by_expression(CamelFolder *folder, const char *expression, CamelExcep
        struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
        GHashTable *searched = g_hash_table_new(NULL, NULL);
        CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
-       
+
        CAMEL_VEE_FOLDER_LOCK(vf, subfolder_lock);
-       
+
        if (vf != folder_unmatched)
                expr = g_strdup_printf ("(and %s %s)", vf->expression ? vf->expression : "", expression);
        else
                expr = g_strdup (expression);
-       
+
        node = p->folders;
        while (node) {
                CamelFolder *f = node->data;
                int i;
                char hash[8];
-               
+
                /* make sure we only search each folder once - for unmatched folder to work right */
                if (g_hash_table_lookup(searched, f) == NULL) {
                        camel_vee_folder_hash_folder(f, hash);
@@ -599,7 +599,7 @@ vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids,
                CamelFolder *f = node->data;
                int i;
                char hash[8];
-               
+
                /* make sure we only search each folder once - for unmatched folder to work right */
                if (g_hash_table_lookup(searched, f) == NULL) {
                        camel_vee_folder_hash_folder(f, hash);
@@ -617,7 +617,7 @@ vee_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids,
                                if (matches) {
                                        for (i = 0; i < matches->len; i++) {
                                                char *uid = matches->pdata[i], *vuid;
-                               
+
                                                vuid = g_malloc(strlen(uid)+9);
                                                memcpy(vuid, hash, 8);
                                                strcpy(vuid+8, uid);
@@ -742,7 +742,7 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source)
                        count = camel_folder_summary_count(((CamelFolder *)folder_unmatched)->summary);
                        for (i=0;i<count;i++) {
                                CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index(((CamelFolder *)folder_unmatched)->summary, i);
-                               
+
                                if (mi) {
                                        if (mi->real->summary == ssummary) {
                                                camel_folder_change_info_remove_uid(folder_unmatched->changes, camel_message_info_uid(mi));
@@ -953,7 +953,7 @@ vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex)
                        if (mi->real->summary == ssummary) {
                                char *uid = (char *)camel_message_info_uid(mi), *oldkey;
                                void *oldval;
-                               
+
                                if (g_hash_table_lookup(matchhash, uid+8) == NULL) {
                                        if (last == -1) {
                                                last = start = i;
@@ -1076,7 +1076,7 @@ folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], Ca
        vinfo = vee_folder_add_uid(vf, sub, uid, hash);
        if (vinfo == NULL)
                return;
-       
+
        vuid = camel_message_info_uid(vinfo);
        camel_folder_change_info_add_uid(vf->changes,  vuid);
 
@@ -1304,7 +1304,7 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
                                }
                                memcpy(vuid, hash, 8);
                                strcpy(vuid+8, uid);
-                               
+
                                if (!CAMEL_IS_VEE_FOLDER(sub) && folder_unmatched != NULL && g_hash_table_lookup(unmatched_uids, vuid) == NULL) {
                                        dd(printf("  adding uid '%s' to Unmatched [newly unmatched]\n", (char *)uid));
                                        vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info((CamelFolder *)folder_unmatched, vuid);
@@ -1381,7 +1381,7 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
                        unmatched_changes = folder_unmatched->changes;
                        folder_unmatched->changes = camel_folder_change_info_new();
                }
-               
+
                CAMEL_VEE_FOLDER_UNLOCK(folder_unmatched, summary_lock);
        }
 
@@ -1406,12 +1406,12 @@ folder_changed_change(CamelSession *session, CamelSessionThreadMsg *msg)
                g_ptr_array_free(newchanged, TRUE);
 
        g_free(vuid);
-       
+
        if (unmatched_changes) {
                camel_object_trigger_event((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
                camel_folder_change_info_free(unmatched_changes);
        }
-       
+
        if (vf_changes) {
                /* If not auto-updating, keep track of changed folders for later re-sync */
                if ((vf->flags & CAMEL_STORE_VEE_FOLDER_AUTO) == 0) {
@@ -1446,7 +1446,7 @@ folder_changed_base(CamelVeeFolder *vf, CamelFolder *sub, CamelFolderChangeInfo
 {
        struct _folder_changed_msg *m;
        CamelSession *session = ((CamelService *)((CamelFolder *)vf)->parent_store)->session;
-       
+
        m = camel_session_thread_msg_new(session, &folder_changed_ops, sizeof(*m));
        m->changes = camel_folder_change_info_new();
        camel_folder_change_info_cat(m->changes, changes);
@@ -1560,19 +1560,19 @@ vee_freeze (CamelFolder *folder)
        CamelVeeFolder *vfolder = (CamelVeeFolder *)folder;
        struct _CamelVeeFolderPrivate *p = _PRIVATE(vfolder);
        GList *node;
-       
+
        CAMEL_VEE_FOLDER_LOCK(vfolder, subfolder_lock);
-       
+
        node = p->folders;
        while (node) {
                CamelFolder *f = node->data;
-               
+
                camel_folder_freeze(f);
                node = node->next;
        }
-       
+
        CAMEL_VEE_FOLDER_UNLOCK(vfolder, subfolder_lock);
-       
+
        /* call parent implementation */
        CAMEL_FOLDER_CLASS (camel_vee_folder_parent)->freeze(folder);
 }
@@ -1583,19 +1583,19 @@ vee_thaw(CamelFolder *folder)
        CamelVeeFolder *vfolder = (CamelVeeFolder *)folder;
        struct _CamelVeeFolderPrivate *p = _PRIVATE(vfolder);
        GList *node;
-       
+
        CAMEL_VEE_FOLDER_LOCK(vfolder, subfolder_lock);
-       
+
        node = p->folders;
        while (node) {
                CamelFolder *f = node->data;
-               
+
                camel_folder_thaw(f);
                node = node->next;
        }
-       
+
        CAMEL_VEE_FOLDER_UNLOCK(vfolder, subfolder_lock);
-       
+
        /* call parent implementation */
        CAMEL_FOLDER_CLASS (camel_vee_folder_parent)->thaw(folder);
 }
@@ -1702,7 +1702,7 @@ camel_vee_folder_init (CamelVeeFolder *obj)
 
        obj->changes = camel_folder_change_info_new();
        obj->search = camel_folder_search_new();
-       
+
        p->summary_lock = g_mutex_new();
        p->subfolder_lock = g_mutex_new();
        p->changed_lock = g_mutex_new();
@@ -1730,16 +1730,16 @@ camel_vee_folder_finalise (CamelObject *obj)
        }
 
        g_free(vf->expression);
-       
+
        g_list_free(p->folders);
        g_list_free(p->folders_changed);
 
        camel_folder_change_info_free(vf->changes);
        camel_object_unref((CamelObject *)vf->search);
-       
+
        g_mutex_free(p->summary_lock);
        g_mutex_free(p->subfolder_lock);
        g_mutex_free(p->changed_lock);
-       
+
        g_free(p);
 }
index 8eaf77c..8143358 100644 (file)
@@ -55,7 +55,7 @@ CamelType
 camel_vee_store_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_store_get_type (), "CamelVeeStore",
                                            sizeof (CamelVeeStore),
@@ -65,7 +65,7 @@ camel_vee_store_get_type (void)
                                            (CamelObjectInitFunc) camel_vee_store_init,
                                            (CamelObjectFinalizeFunc) camel_vee_store_finalise);
        }
-       
+
        return type;
 }
 
@@ -73,7 +73,7 @@ static void
 camel_vee_store_class_init (CamelVeeStoreClass *klass)
 {
        CamelStoreClass *store_class = (CamelStoreClass *) klass;
-       
+
        camel_vee_store_parent = (CamelStoreClass *)camel_store_get_type();
 
        /* virtual method overload */
@@ -94,7 +94,7 @@ camel_vee_store_init (CamelVeeStore *obj)
        CamelStore *store = (CamelStore *)obj;
 
        /* we dont want a vtrash/vjunk on this one */
-       store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);      
+       store->flags &= ~(CAMEL_STORE_VTRASH | CAMEL_STORE_VJUNK);
 
        /* Set up unmatched folder */
        obj->unmatched_uids = g_hash_table_new (g_str_hash, g_str_equal);
@@ -122,7 +122,7 @@ camel_vee_store_finalise (CamelObject *obj)
  * camel_vee_store_new:
  *
  * Create a new #CamelVeeStore object.
- * 
+ *
  * Returns new #CamelVeeStore object
  **/
 CamelVeeStore *
index ee23711..085c5ec 100644 (file)
@@ -69,7 +69,7 @@ CamelType
 camel_vtrash_folder_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_vee_folder_get_type (),
                                            "CamelVTrashFolder",
@@ -80,7 +80,7 @@ camel_vtrash_folder_get_type (void)
                                            (CamelObjectInitFunc) camel_vtrash_folder_init,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -98,7 +98,7 @@ CamelFolder *
 camel_vtrash_folder_new (CamelStore *parent_store, camel_vtrash_folder_t type)
 {
        CamelVTrashFolder *vtrash;
-       
+
        g_assert(type < CAMEL_VTRASH_FOLDER_LAST);
 
        vtrash = (CamelVTrashFolder *)camel_object_new(camel_vtrash_folder_get_type());
@@ -189,7 +189,7 @@ vtrash_append_message (CamelFolder *folder, CamelMimeMessage *message,
                       const CamelMessageInfo *info, char **appended_uid,
                       CamelException *ex)
 {
-       camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, 
+       camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                             _(vdata[((CamelVTrashFolder *)folder)->type].error_copy));
 }
 
@@ -238,7 +238,7 @@ vtrash_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
        if (CAMEL_IS_VTRASH_FOLDER (dest)) {
                /* Copy to trash is meaningless. */
                if (!delete_originals) {
-                       camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, 
+                       camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                             _(vdata[((CamelVTrashFolder *)dest)->type].error_copy));
                        return;
                }
@@ -261,7 +261,7 @@ vtrash_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
                        g_warning ("Cannot find uid %s in source folder during transfer", (char *) uids->pdata[i]);
                        continue;
                }
-               
+
                if (dest == mi->real->summary->folder) {
                        /* Just unset the flag on the original message */
                        camel_folder_set_message_flags (source, uids->pdata[i], sbit, 0);
@@ -347,7 +347,7 @@ vtrash_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *ui
        GList *node;
        GPtrArray *matches, *result = g_ptr_array_new(), *folder_uids = g_ptr_array_new();
        struct _CamelVeeFolderPrivate *p = ((CamelVeeFolder *)folder)->priv;
-       
+
        CAMEL_VEE_FOLDER_LOCK(folder, subfolder_lock);
 
        node = p->folders;
@@ -355,14 +355,14 @@ vtrash_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *ui
                CamelFolder *f = node->data;
                int i;
                char hash[8];
-               
+
                camel_vee_folder_hash_folder(f, hash);
 
                /* map the vfolder uid's to the source folder uid's first */
                g_ptr_array_set_size(uids, 0);
                for (i=0;i<uids->len;i++) {
                        char *uid = uids->pdata[i];
-                       
+
                        if (strlen(uid) >= 8 && strncmp(uid, hash, 8) == 0) {
                                CamelMessageInfo *mi;
 
@@ -379,7 +379,7 @@ vtrash_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *ui
                    && (matches = camel_folder_search_by_uids(f, expression, folder_uids, ex))) {
                        for (i = 0; i < matches->len; i++) {
                                char *uid = matches->pdata[i], *vuid;
-                               
+
                                vuid = g_malloc(strlen(uid)+9);
                                memcpy(vuid, hash, 8);
                                strcpy(vuid+8, uid);
@@ -485,7 +485,7 @@ vtrash_folder_changed(CamelVeeFolder *vf, CamelFolder *sub, CamelFolderChangeInf
        }
 
        CAMEL_VEE_FOLDER_UNLOCK(vf, summary_lock);
-       
+
        if (vf_changes) {
                camel_object_trigger_event(vf, "folder_changed", vf_changes);
                camel_folder_change_info_free(vf_changes);
@@ -594,11 +594,11 @@ static void
 camel_vtrash_folder_class_init (CamelVTrashFolderClass *klass)
 {
        CamelFolderClass *folder_class = (CamelFolderClass *) klass;
-       
+
        camel_vtrash_folder_parent = CAMEL_VEE_FOLDER_CLASS(camel_vee_folder_get_type());
 
        ((CamelObjectClass *)klass)->getv = vtrash_getv;
-       
+
        folder_class->append_message = vtrash_append_message;
        folder_class->transfer_messages_to = vtrash_transfer_messages_to;
        folder_class->search_by_expression = vtrash_search_by_expression;
index cab4588..f24fb5d 100644 (file)
@@ -54,7 +54,7 @@ struct _CamelVTrashFolder {
 
 struct _CamelVTrashFolderClass {
        CamelVeeFolderClass parent_class;
-       
+
 };
 
 CamelType       camel_vtrash_folder_get_type    (void);
index d5e259f..49d79f1 100644 (file)
@@ -50,25 +50,25 @@ static void
 camel_shutdown (void)
 {
        CamelCertDB *certdb;
-       
+
        if (!initialised)
                return;
-       
+
 #if defined (HAVE_NSS) && !defined (G_OS_WIN32)
        /* For some reason we get into trouble on Win32 if we call these.
         * But they shouldn't be necessary as the process is exiting anywy?
         */
        NSS_Shutdown ();
-       
+
        PR_Cleanup ();
 #endif /* HAVE_NSS */
-       
+
        certdb = camel_certdb_get_default ();
        if (certdb) {
                camel_certdb_save (certdb);
                camel_object_unref (certdb);
        }
-       
+
        initialised = FALSE;
 }
 
@@ -77,7 +77,7 @@ camel_init (const char *configdir, gboolean nss_init)
 {
        CamelCertDB *certdb;
        char *path;
-       
+
        if (initialised)
                return 0;
 
@@ -95,7 +95,7 @@ camel_init (const char *configdir, gboolean nss_init)
                PRUint16 indx;
 
                PR_Init (PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 10);
-               
+
 #ifndef G_OS_WIN32
                nss_configdir = g_strdup (configdir);
 #else
@@ -115,31 +115,31 @@ camel_init (const char *configdir, gboolean nss_init)
                for (indx = 0; indx < SSL_NumImplementedCiphers; indx++) {
                        if (!SSL_IS_SSL2_CIPHER(SSL_ImplementedCiphers[indx]))
                                SSL_CipherPrefSetDefault (SSL_ImplementedCiphers[indx], PR_TRUE);
-               }       
-               
+               }
+
                SSL_OptionSetDefault (SSL_ENABLE_SSL2, PR_TRUE);
                SSL_OptionSetDefault (SSL_ENABLE_SSL3, PR_TRUE);
                SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE);
                SSL_OptionSetDefault (SSL_V2_COMPATIBLE_HELLO, PR_TRUE /* maybe? */);
        }
 #endif /* HAVE_NSS */
-       
+
        path = g_strdup_printf ("%s/camel-cert.db", configdir);
        certdb = camel_certdb_new ();
        camel_certdb_set_filename (certdb, path);
        g_free (path);
-       
+
        /* if we fail to load, who cares? it'll just be a volatile certdb */
        camel_certdb_load (certdb);
-       
+
        /* set this certdb as the default db */
        camel_certdb_set_default (certdb);
-       
+
        camel_object_unref (certdb);
-       
+
        g_atexit (camel_shutdown);
-       
+
        initialised = TRUE;
-       
+
        return 0;
 }
index 6582772..12a692c 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
-/* 
+/*
  *
- * Author : 
+ * Author :
  *  Bertrand Guiheneuf <bertrand@helixcode.com>
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index dfbff35..ea28c6c 100644 (file)
@@ -1,17 +1,17 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-groupwise-folder.c: class for an groupwise folder */
 
-/* 
+/*
  * Authors:
  *  Sivaiah Nallagatla <snallagatla@novell.com>
  *  parthasarathi susarla <sparthasarathi@novell.com>
  *  Sankar P <psankar@novell.com>
- *   
+ *
  *
  * Copyright (C) 2004, Novell Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
 
 
 #ifdef HAVE_CONFIG_H
-#include <config.h> 
+#include <config.h>
 #endif
 
 #include <errno.h>
@@ -95,7 +95,7 @@ static void gw_update_cache ( CamelFolder *folder, GList *item_list, CamelExcept
 static CamelMimeMessage *groupwise_folder_item_to_msg ( CamelFolder *folder, EGwItem *item, CamelException *ex );
 
 
-#define d(x)  
+#define d(x)
 
 static CamelMimeMessage *
 groupwise_folder_get_message( CamelFolder *folder, const char *uid, CamelException *ex )
@@ -246,8 +246,8 @@ groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multi
                if(!temp_body){
                        int len = 0;
                        EGwConnectionStatus status;
-                       status = e_gw_connection_get_attachment (cnc, 
-                                       e_gw_item_get_msg_body_id (item), 0, -1, 
+                       status = e_gw_connection_get_attachment (cnc,
+                                       e_gw_item_get_msg_body_id (item), 0, -1,
                                        (const char **)&temp_body, &len);
                        if (status != E_GW_CONNECTION_STATUS_OK) {
                                g_warning ("Could not get Messagebody\n");
@@ -268,7 +268,7 @@ groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multi
                                        convert_to_calendar (item, &cal_buffer, &len);
                                else if (type == E_GW_ITEM_TYPE_TASK)
                                        convert_to_task (item, &cal_buffer, &len);
-                               else 
+                               else
                                        convert_to_note (item, &cal_buffer, &len);
 
                                camel_mime_part_set_content(part, cal_buffer, len, "text/calendar");
@@ -277,7 +277,7 @@ groupwise_populate_msg_body_from_item (EGwConnection *cnc, CamelMultipart *multi
                        }
                case E_GW_ITEM_TYPE_NOTIFICATION:
                case E_GW_ITEM_TYPE_MAIL:
-                       if (body) 
+                       if (body)
                                camel_mime_part_set_content(part, body, strlen(body), "text/html");
                        else if (temp_body)
                                camel_mime_part_set_content(part, temp_body, strlen(temp_body), e_gw_item_get_msg_content_type (item));
@@ -323,32 +323,32 @@ groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item)
                        }
 
                        if (recp->type == E_GW_ITEM_RECIPIENT_TO) {
-                               if (recp->status_enabled) 
+                               if (recp->status_enabled)
                                        status_opt = g_strconcat (status_opt ? status_opt : "" , "TO", ";",NULL);
                                camel_header_address_list_append(&to_list, ha);
                        } else if (recp->type == E_GW_ITEM_RECIPIENT_CC) {
-                               if (recp->status_enabled) 
+                               if (recp->status_enabled)
                                        status_opt = g_strconcat (status_opt ? status_opt : "", "CC", ";",NULL);
                                camel_header_address_list_append(&cc_list,ha);
 
                        } else if (recp->type == E_GW_ITEM_RECIPIENT_BC) {
-                               if (recp->status_enabled) 
+                               if (recp->status_enabled)
                                        status_opt = g_strconcat (status_opt ? status_opt : "", "BCC", ";",NULL);
                                camel_header_address_list_append(&bcc_list,ha);
                        } else {
                                camel_header_address_unref(ha);
                        }
                        if (recp->status_enabled) {
-                               status_opt = g_strconcat (status_opt, 
+                               status_opt = g_strconcat (status_opt,
                                                recp->display_name,";",
                                                recp->email,";",
                                                recp->delivered_date ? recp->delivered_date :  "", ";",
-                                               recp->opened_date ? recp->opened_date : "", ";", 
+                                               recp->opened_date ? recp->opened_date : "", ";",
                                                recp->accepted_date ? recp->accepted_date : "", ";",
-                                               recp->deleted_date ? recp->deleted_date : "", ";", 
+                                               recp->deleted_date ? recp->deleted_date : "", ";",
                                                recp->declined_date ? recp->declined_date : "", ";",
                                                recp->completed_date ? recp->completed_date : "", ";",
-                                               recp->undelivered_date ? recp->undelivered_date : "", ";", 
+                                               recp->undelivered_date ? recp->undelivered_date : "", ";",
                                                "::", NULL);
 
                        }
@@ -361,21 +361,21 @@ groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item)
                }
        }
 
-       if(to_list) { 
+       if(to_list) {
                subs_email=camel_header_address_list_encode(to_list);
                camel_medium_set_header( CAMEL_MEDIUM(msg), "To", subs_email);
                g_free(subs_email);
                camel_header_address_list_clear(&to_list);
        }
 
-       if(cc_list) { 
+       if(cc_list) {
                subs_email=camel_header_address_list_encode(cc_list);
                camel_medium_set_header( CAMEL_MEDIUM(msg), "Cc", subs_email);
                g_free(subs_email);
                camel_header_address_list_clear(&cc_list);
        }
 
-       if(bcc_list) { 
+       if(bcc_list) {
                subs_email=camel_header_address_list_encode(bcc_list);
                camel_medium_set_header( CAMEL_MEDIUM(msg), "Bcc", subs_email);
                g_free(subs_email);
@@ -385,13 +385,13 @@ groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item)
        if (org) {
                if (org->display_name && org->display_name[0] && org->email != NULL && org->email[0] != '\0') {
                                int i;
-                               for (i = 0; org->display_name[i] != '<' && 
+                               for (i = 0; org->display_name[i] != '<' &&
                                                org->display_name[i] != '\0';
                                                i++);
 
                                org->display_name[i] = '\0';
                }
-               if (org->display_name && org->email) 
+               if (org->display_name && org->email)
                        ha=camel_header_address_new_name(org->display_name, org->email);
                else if (org->display_name)
                        ha=camel_header_address_new_group(org->display_name);
@@ -399,7 +399,7 @@ groupwise_msg_set_recipient_list (CamelMimeMessage *msg, EGwItem *item)
                        ha = NULL;
 
                if (ha) {
-                       subs_email = camel_header_address_list_encode (ha);     
+                       subs_email = camel_header_address_list_encode (ha);
                        camel_medium_set_header (CAMEL_MEDIUM (msg), "From", subs_email);
                        camel_header_address_unref (ha);
                        g_free (subs_email);
@@ -488,7 +488,7 @@ groupwise_folder_search_free (CamelFolder *folder, GPtrArray *uids)
 }
 
 /******************* functions specific to Junk Mail Handling**************/
-static void 
+static void
 free_node (EGwJunkEntry *entry)
 {
        if (entry) {
@@ -504,7 +504,7 @@ free_node (EGwJunkEntry *entry)
 static void
 update_junk_list (CamelStore *store, CamelMessageInfo *info, int flag)
 {
-       gchar **email = NULL, *from = NULL;     
+       gchar **email = NULL, *from = NULL;
        CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(store);
        CamelGroupwiseStorePrivate  *priv = gw_store->priv;
        EGwConnection *cnc = cnc_lookup (priv);
@@ -525,7 +525,7 @@ update_junk_list (CamelStore *store, CamelMessageInfo *info, int flag)
                if (e_gw_connection_get_junk_entries (cnc, &list)== E_GW_CONNECTION_STATUS_OK){
                        while (list) {
                                entry = list->data;
-                               if (!g_ascii_strcasecmp (entry->match, email[1])) { 
+                               if (!g_ascii_strcasecmp (entry->match, email[1])) {
                                        e_gw_connection_remove_junk_entry (cnc, entry->id);
                                }
                                list = list->next;
@@ -539,7 +539,7 @@ error:
        g_strfreev (email);
 }
 
-static void 
+static void
 move_to_mailbox (CamelFolder *folder, CamelMessageInfo *info, CamelException *ex)
 {
        CamelFolder *dest;
@@ -559,7 +559,7 @@ move_to_mailbox (CamelFolder *folder, CamelMessageInfo *info, CamelException *ex
        update_junk_list (folder->parent_store, info, REMOVE_JUNK_ENTRY);
 }
 
-static void 
+static void
 move_to_junk (CamelFolder *folder, CamelMessageInfo *info, CamelException *ex)
 {
        CamelFolder *dest;
@@ -571,7 +571,7 @@ move_to_junk (CamelFolder *folder, CamelMessageInfo *info, CamelException *ex)
        g_ptr_array_add (uids, (gpointer) uid);
 
        dest = camel_store_get_folder (folder->parent_store, JUNK_FOLDER, 0, ex);
-       
+
        if (dest)
                groupwise_transfer_messages_to (folder, uids, dest, NULL, TRUE, ex);
        else {
@@ -587,7 +587,7 @@ move_to_junk (CamelFolder *folder, CamelMessageInfo *info, CamelException *ex)
 
 /********************* back to folder functions*************************/
 
-static void 
+static void
 groupwise_sync_summary (CamelFolder *folder, CamelException *ex)
 {
        camel_folder_summary_save (folder->summary);
@@ -613,7 +613,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 
        deleted_items = deleted_head = NULL;
 
-       if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL || 
+       if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL ||
                        ((CamelService *)gw_store)->status == CAMEL_SERVICE_DISCONNECTED) {
                groupwise_sync_summary (folder, ex);
                return;
@@ -640,9 +640,9 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
                /**Junk Mail handling**/
                if(!info)
                        continue;
-               flags = camel_message_info_flags (info);        
+               flags = camel_message_info_flags (info);
 
-               if ((flags & CAMEL_MESSAGE_JUNK) && strcmp(camel_folder_get_name(folder), JUNK_FOLDER)) { 
+               if ((flags & CAMEL_MESSAGE_JUNK) && strcmp(camel_folder_get_name(folder), JUNK_FOLDER)) {
                        /*marked a message junk*/
                        move_to_junk (folder, info, ex);
                        camel_folder_summary_remove_uid (folder->summary, camel_message_info_uid(info));
@@ -651,7 +651,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
                }
 
                if ((flags & CAMEL_GW_MESSAGE_NOJUNK) && !strcmp(camel_folder_get_name(folder), JUNK_FOLDER)) {
-                       /*message was marked as junk, now unjunk*/ 
+                       /*message was marked as junk, now unjunk*/
                        move_to_mailbox (folder, info, ex);
                        camel_folder_summary_remove_uid (folder->summary, camel_message_info_uid(info));
                        camel_data_cache_remove (gw_folder->cache, "cache", camel_message_info_uid(info), NULL);
@@ -661,7 +661,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
                if (gw_info && (gw_info->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
                        do_flags_diff (&diff, gw_info->server_flags, gw_info->info.flags);
                        do_flags_diff (&unset_flags, flags, gw_info->server_flags);
-                       
+
                        diff.changed &= folder->permanent_flags;
 
                        /* weed out flag changes that we can't sync to the server */
@@ -691,14 +691,14 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
                                        if (g_list_length (deleted_items) == GROUPWISE_BULK_DELETE_LIMIT ) {
                                                CAMEL_SERVICE_REC_LOCK (gw_store, connect_lock);
 
-                                               /* 
-                                                       Sync up the READ changes before deleting the message. 
+                                               /*
+                                                       Sync up the READ changes before deleting the message.
                                                        Note that if a message is marked as unread and then deleted,
                                                        Evo doesnt not take care of it, as I find that scenario to be impractical.
                                                */
 
                                                if (deleted_read_items) {
-                                                       
+
                                                        /* FIXME: As in many places, we need to handle the return value
                                                        and do some error handling. But, we do not have all error codes also
                                                        and errors are not returned always either */
@@ -734,7 +734,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
                }
                camel_message_info_free (info);
        }
-       
+
        CAMEL_GROUPWISE_FOLDER_REC_UNLOCK (folder, cache_lock);
 
        if (deleted_items) {
@@ -790,7 +790,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 }
 
 CamelFolder *
-camel_gw_folder_new(CamelStore *store, const char *folder_name, const char *folder_dir, CamelException *ex) 
+camel_gw_folder_new(CamelStore *store, const char *folder_name, const char *folder_dir, CamelException *ex)
 {
        CamelFolder *folder;
        CamelGroupwiseFolder *gw_folder;
@@ -898,8 +898,8 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg)
                else {
 
                        /* item_list is prepended to items_full_list and not the other way
-                          because when we have a large number of items say 50000, 
-                          for each iteration there will be more elements in items_full_list 
+                          because when we have a large number of items say 50000,
+                          for each iteration there will be more elements in items_full_list
                           and less elements in item_list */
 
                        last_element = g_list_last (item_list);
@@ -927,7 +927,7 @@ update_update (CamelSession *session, CamelSessionThreadMsg *msg)
          item_list = item_list->next;
          }
 
-         i = 0;        
+         i = 0;
          while (((const char *)item_list->data)[i++]!='@');
          ((char *)item_list->data)[i-1] = '\0';
          }*/
@@ -1025,7 +1025,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
                return;
        }
 
-       if (!cnc) 
+       if (!cnc)
                return;
 
        if (camel_folder_is_frozen (folder) ) {
@@ -1034,7 +1034,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
 
        CAMEL_SERVICE_REC_LOCK (gw_store, connect_lock);
 
-       if (!camel_groupwise_store_connected (gw_store, ex)) 
+       if (!camel_groupwise_store_connected (gw_store, ex))
                goto end1;
 
        if (!strcmp (folder->full_name, "Trash")) {
@@ -1063,7 +1063,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
        }
 
        time_string =  g_strdup (((CamelGroupwiseSummary *) folder->summary)->time_string);
-       t_str = g_strdup (time_string); 
+       t_str = g_strdup (time_string);
 
        /*Get the New Items*/
        if (!is_proxy) {
@@ -1084,7 +1084,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
                }
 
                /*
-                * The value in t_str is the one that has to be used for the next set of calls. 
+                * The value in t_str is the one that has to be used for the next set of calls.
                 * so store this value in the summary.
                 */
                if (summary->time_string)
@@ -1095,11 +1095,11 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
                ((CamelGroupwiseSummary *) folder->summary)->time_string = g_strdup (t_str);
                camel_folder_summary_touch (folder->summary);
                groupwise_sync_summary (folder, ex);
-               g_free (t_str); 
+               g_free (t_str);
                t_str = NULL;
 
                /*
-                  for ( sl = slist ; sl != NULL; sl = sl->next) 
+                  for ( sl = slist ; sl != NULL; sl = sl->next)
                   list = g_list_append (list, sl->data);*/
 
                if (slist && g_slist_length(slist) != 0)
@@ -1121,7 +1121,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
                        goto end3;
                }
 
-               /* The storing of time-stamp to summary code below should be commented if the 
+               /* The storing of time-stamp to summary code below should be commented if the
                   above commented code is uncommented */
 
                /*      if (summary->time_string)
@@ -1131,7 +1131,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
 
                        g_free (t_str), t_str = NULL;*/
 
-               for ( sl = slist ; sl != NULL; sl = sl->next) 
+               for ( sl = slist ; sl != NULL; sl = sl->next)
                        list = g_list_prepend (list, sl->data);
 
                if (!check_all && slist && g_slist_length(slist) != 0)
@@ -1154,9 +1154,9 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
        is_locked = FALSE;
 
        /*
-        * The New and Modified items in the server have been updated in the summary. 
+        * The New and Modified items in the server have been updated in the summary.
         * Now we have to make sure that all the delted items in the server are deleted
-        * from Evolution as well. So we get the id's of all the items on the sever in 
+        * from Evolution as well. So we get the id's of all the items on the sever in
         * this folder, and update the summary.
         */
        /*create a new session thread for the update all operation*/
@@ -1172,7 +1172,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex)
                /*thread creation and queueing done*/
        }
 
-end3: 
+end3:
        g_list_foreach (list, (GFunc) g_object_unref, NULL);
        g_list_free (list);
        list = NULL;
@@ -1187,7 +1187,7 @@ end1:
 }
 
 static void
-gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean uid_flag) 
+gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean uid_flag)
 {
        CamelGroupwiseMessageInfo *mi = NULL;
        CamelMessageInfo *pmi = NULL;
@@ -1241,7 +1241,7 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
                if (uid_flag == FALSE) {
                        temp_item = (EGwItem *)item_list->data;
                        id = e_gw_item_get_id (temp_item);
-               } else 
+               } else
                        id = (char *) item_list->data;
 
                camel_operation_progress (NULL, (100*i)/total_items);
@@ -1269,18 +1269,18 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
                                continue;
                        }
 
-                       mi = (CamelGroupwiseMessageInfo *)camel_message_info_new (folder->summary); 
+                       mi = (CamelGroupwiseMessageInfo *)camel_message_info_new (folder->summary);
                        if (mi->info.content == NULL) {
                                mi->info.content = camel_folder_summary_content_info_new (folder->summary);
-                               mi->info.content->type = camel_content_type_new ("multipart", "mixed"); 
+                               mi->info.content->type = camel_content_type_new ("multipart", "mixed");
                        }
                }
-               
+
                rk = e_gw_item_get_recurrence_key (item);
                if (rk > 0) {
-                       recurrence_key = g_strdup_printf("%d", rk); 
+                       recurrence_key = g_strdup_printf("%d", rk);
                        camel_message_info_set_user_tag ((CamelMessageInfo*)mi, "recurrence-key", recurrence_key);
-               } 
+               }
 
                /*all items in the Junk Mail folder should have this flag set*/
                if (is_junk)
@@ -1289,14 +1289,14 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
                item_status = e_gw_item_get_item_status (item);
                if (item_status & E_GW_ITEM_STAT_READ)
                        status_flags |= CAMEL_MESSAGE_SEEN;
-               else 
+               else
                        mi->info.flags &= ~CAMEL_MESSAGE_SEEN;
 
                if (item_status & E_GW_ITEM_STAT_REPLIED)
                        status_flags |= CAMEL_MESSAGE_ANSWERED;
-               if (exists) 
+               if (exists)
                        mi->info.flags |= status_flags;
-               else 
+               else
                        mi->info.flags = status_flags;
 
                priority = e_gw_item_get_priority (item);
@@ -1308,16 +1308,16 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
                        mi->info.flags |= CAMEL_MESSAGE_ATTACHMENTS;
                 if (is_proxy)
                         mi->info.flags |= CAMEL_MESSAGE_USER_NOT_DELETABLE;
-               
+
                mi->server_flags = mi->info.flags;
 
-               org = e_gw_item_get_organizer (item); 
+               org = e_gw_item_get_organizer (item);
                if (org) {
                        GString *str;
                        int i;
                        str = g_string_new ("");
                        if (org->display_name && org->display_name[0] && org->email != NULL && org->email[0] != '\0') {
-                               for (i = 0; org->display_name[i] != '<' && 
+                               for (i = 0; org->display_name[i] != '<' &&
                                                org->display_name[i] != '\0';
                                                i++);
 
@@ -1326,12 +1326,12 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
                                str = g_string_append (str, " ");
                        }
 
-                        if (org->display_name[0] == '\0') { 
+                        if (org->display_name[0] == '\0') {
 
                                str = g_string_append (str, org->email);
                                str = g_string_append (str, " ");
                        }
-                       if (org->email && org->email[0]) { 
+                       if (org->email && org->email[0]) {
                                g_string_append (str, "<");
                                str = g_string_append (str, org->email);
                                g_string_append (str, ">");
@@ -1360,7 +1360,7 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
                }
 
                if (type == E_GW_ITEM_TYPE_APPOINTMENT
-                               || type ==  E_GW_ITEM_TYPE_NOTE 
+                               || type ==  E_GW_ITEM_TYPE_NOTE
                                || type ==  E_GW_ITEM_TYPE_TASK ) {
                        temp_date = e_gw_item_get_start_date (item);
                        if (temp_date) {
@@ -1386,7 +1386,7 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
 
                if (!exists) {
                        mi->info.uid = g_strdup (e_gw_item_get_id(item));
-                       mi->info.size = e_gw_item_get_mail_size (item); 
+                       mi->info.size = e_gw_item_get_mail_size (item);
                        mi->info.subject = camel_pstring_strdup(e_gw_item_get_subject(item));
                }
 
@@ -1435,7 +1435,7 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
 }
 
 void
-gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex) 
+gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
 {
        CamelGroupwiseMessageInfo *mi = NULL;
        CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store);
@@ -1477,7 +1477,7 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
                id = e_gw_item_get_id (item);
 
                mi = (CamelGroupwiseMessageInfo *)camel_folder_summary_uid (folder->summary, id);
-               if (mi) 
+               if (mi)
                        exists = TRUE;
 
                if (!exists) {
@@ -1487,18 +1487,18 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
                                continue;
                        }
 
-                       mi = camel_message_info_new (folder->summary); 
+                       mi = camel_message_info_new (folder->summary);
                        if (mi->info.content == NULL) {
                                mi->info.content = camel_folder_summary_content_info_new (folder->summary);
                                mi->info.content->type = camel_content_type_new ("multipart", "mixed");
                        }
                }
-               
+
                rk = e_gw_item_get_recurrence_key (item);
                if (rk > 0) {
-                       recurrence_key = g_strdup_printf("%d", rk); 
+                       recurrence_key = g_strdup_printf("%d", rk);
                        camel_message_info_set_user_tag ((CamelMessageInfo*)mi, "recurrence-key", recurrence_key);
-               } 
+               }
 
                /*all items in the Junk Mail folder should have this flag set*/
                if (is_junk)
@@ -1520,23 +1520,23 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
                if (priority && !(g_ascii_strcasecmp (priority,"High"))) {
                        mi->info.flags |= CAMEL_MESSAGE_FLAGGED;
                }
-               
+
                if (e_gw_item_has_attachment (item))
                        mi->info.flags |= CAMEL_MESSAGE_ATTACHMENTS;
 
-               if (is_proxy) 
+               if (is_proxy)
                        mi->info.flags |= CAMEL_MESSAGE_USER_NOT_DELETABLE;
 
                mi->server_flags = mi->info.flags;
 
-               org = e_gw_item_get_organizer (item); 
+               org = e_gw_item_get_organizer (item);
                if (org) {
                        GString *str;
                        int i;
                        str = g_string_new ("");
                        if (org->display_name && org->display_name[0] && org->email != NULL && org->email[0] != '\0') {
-                               for (i = 0; org->display_name[i] != '<' && 
-                                               org->display_name[i] != '\0'; 
+                               for (i = 0; org->display_name[i] != '<' &&
+                                               org->display_name[i] != '\0';
                                                i++);
 
                                org->display_name[i] = '\0';
@@ -1544,13 +1544,13 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
                                str = g_string_append (str, " ");
                        }
 
-                        if (org->display_name[0] == '\0') { 
-                               
+                        if (org->display_name[0] == '\0') {
+
                                 str = g_string_append (str, org->email);
                                str = g_string_append (str, " ");
                        }
 
-                       if (org->email && org->email[0]) { 
+                       if (org->email && org->email[0]) {
                                g_string_append (str, "<");
                                str = g_string_append (str, org->email);
                                g_string_append (str, ">");
@@ -1584,7 +1584,7 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
                                time_t time = e_gw_connection_get_date_from_string (temp_date);
                                time_t actual_time = camel_header_decode_date (ctime(&time), NULL);
                                mi->info.date_sent = mi->info.date_received = actual_time;
-                       } 
+                       }
                } else {
                        temp_date = e_gw_item_get_delivered_date(item);
                        if (temp_date) {
@@ -1603,7 +1603,7 @@ gw_update_summary ( CamelFolder *folder, GList *list,CamelException *ex)
 
                mi->info.uid = g_strdup(e_gw_item_get_id(item));
                if (!exists)
-                       mi->info.size = e_gw_item_get_mail_size (item); 
+                       mi->info.size = e_gw_item_get_mail_size (item);
                mi->info.subject = camel_pstring_strdup(e_gw_item_get_subject(item));
 
                if (exists) {
@@ -1676,7 +1676,7 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
                                        body = g_strdup (attachment);
                                        g_free (attachment);
                                        is_text_html = TRUE;
-                               } 
+                               }
                        }//if attachment and len
                } // if Mime.822 or TEXT.htm
 
@@ -1687,15 +1687,15 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
                                        int len_iter = 0, t_len , offset = 0, t_offset = 0;
                                        char *t_attach = NULL;
                                        GString *gstr = g_string_new (NULL);
-                                       
+
                                        len = 0;
                                        do {
-                                               status = e_gw_connection_get_attachment_base64 (cnc, 
-                                                               attach->id, t_offset, MAX_ATTACHMENT_SIZE, 
+                                               status = e_gw_connection_get_attachment_base64 (cnc,
+                                                               attach->id, t_offset, MAX_ATTACHMENT_SIZE,
                                                                (const char **)&t_attach, &t_len, &offset);
                                                if (status == E_GW_CONNECTION_STATUS_OK) {
                                                        char *temp = NULL;
-       
+
                                                        temp = g_base64_decode(t_attach, &len_iter);
                                                        gstr = g_string_append_len (gstr, temp, len_iter);
                                                        g_free (temp);
@@ -1709,8 +1709,8 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
                                        body_len = len;
                                        g_string_free (gstr, FALSE);
                                } else {
-                                       status = e_gw_connection_get_attachment (cnc, 
-                                                       attach->id, 0, -1, 
+                                       status = e_gw_connection_get_attachment (cnc,
+                                                       attach->id, 0, -1,
                                                        (const char **)&attachment, &len);
                                        if (status != E_GW_CONNECTION_STATUS_OK) {
                                                g_warning ("Could not get attachment\n");
@@ -1722,7 +1722,7 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
                                        g_free (attachment);
                                }
                                has_mime_822 = TRUE;
-                       } 
+                       }
                }
 
        }//if attach_list
@@ -1771,7 +1771,7 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
                        g_free (value);
                }
        }
-       
+
        if (has_mime_822)
                goto end;
        else
@@ -1813,7 +1813,7 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
                                        camel_data_wrapper_set_mime_type_field(CAMEL_DATA_WRAPPER (temp_msg), ct);
                                        camel_content_type_unref(ct);
                                        camel_medium_set_content_object ( CAMEL_MEDIUM (part),CAMEL_DATA_WRAPPER(temp_msg));
-                                       
+
                                        camel_multipart_add_part (multipart,part);
                                        camel_object_unref (temp_msg);
                                        camel_object_unref (part);
@@ -1827,13 +1827,13 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
 
                                        len = 0;
                                        do {
-                                               status = e_gw_connection_get_attachment_base64 (cnc, 
-                                                               attach->id, t_offset, MAX_ATTACHMENT_SIZE, 
+                                               status = e_gw_connection_get_attachment_base64 (cnc,
+                                                               attach->id, t_offset, MAX_ATTACHMENT_SIZE,
                                                                (const char **)&t_attach, &t_len, &offset);
                                                if (status == E_GW_CONNECTION_STATUS_OK) {
                                                        int len_iter = 0;
                                                        char *temp = NULL;
-       
+
                                                        temp = g_base64_decode(t_attach, &len_iter);
                                                        gstr = g_string_append_len (gstr, temp, len_iter);
                                                        g_free (temp);
@@ -1848,8 +1848,8 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
                                        g_string_free (gstr, FALSE);
                                        is_base64_encoded = FALSE;
                                } else {
-                                       status = e_gw_connection_get_attachment (cnc, 
-                                                       attach->id, 0, -1, 
+                                       status = e_gw_connection_get_attachment (cnc,
+                                                       attach->id, 0, -1,
                                                        (const char **)&attachment, &len);
                                }
                                if (status != E_GW_CONNECTION_STATUS_OK) {
@@ -1867,9 +1867,9 @@ groupwise_folder_item_to_msg( CamelFolder *folder,
                                                if (attach->contentid) {
                                                        gchar **t;
                                                        t= g_strsplit_set (attach->contentid, "<>", -1);
-                                                       if (!t[1]) 
+                                                       if (!t[1])
                                                                camel_mime_part_set_content_id (part, attach->contentid);
-                                                       else 
+                                                       else
                                                                camel_mime_part_set_content_id (part, t[1]);
                                                        g_strfreev (t);
                                                        camel_mime_part_set_content_location (part, attach->name);
@@ -1914,14 +1914,14 @@ end:
 }
 
 static void
-gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex) 
+gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex)
 {
        CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER (folder);
        GPtrArray *summary = NULL;
        int index = 0;
        GList *temp;
        CamelFolderChangeInfo *changes = NULL;
-       CamelMessageInfo *info; 
+       CamelMessageInfo *info;
        changes = camel_folder_change_info_new ();
 
        item_list = g_list_reverse (item_list);
@@ -1930,7 +1930,7 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex)
        /*item_ids : List of ids from the summary*/
        while (index < summary->len) {
                info = g_ptr_array_index (summary, index);
-               temp = NULL; 
+               temp = NULL;
 
                if (item_list) {
                        temp = g_list_find_custom (item_list, (const char *)info->uid, (GCompareFunc) strcmp);
@@ -1942,7 +1942,7 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex)
                        camel_data_cache_remove (gw_folder->cache, "cache", info->uid, NULL);
                        camel_folder_change_info_remove_uid (changes, info->uid);
                        CAMEL_GROUPWISE_FOLDER_REC_UNLOCK (folder, cache_lock);
-               } else { 
+               } else {
                        item_list = g_list_delete_link (item_list, temp);
                }
                index ++;
@@ -1954,10 +1954,10 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex)
                CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store);
 
                CAMEL_SERVICE_REC_LOCK (gw_store, connect_lock);
-               gw_update_cache (folder, item_list, ex, TRUE);  
+               gw_update_cache (folder, item_list, ex, TRUE);
                CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
 
-               g_list_foreach (item_list, (GFunc)g_free, NULL);        
+               g_list_foreach (item_list, (GFunc)g_free, NULL);
                g_list_free (item_list);
        }
 
@@ -1999,7 +1999,7 @@ groupwise_append_message (CamelFolder *folder, CamelMimeMessage *message,
        CAMEL_SERVICE_REC_LOCK (folder->parent_store, connect_lock);
        /*Get the container id*/
        container_id = camel_groupwise_store_container_id_lookup (gw_store, folder->full_name) ;
-       
+
        item = camel_groupwise_util_item_from_message (cnc, message, CAMEL_ADDRESS (message->from));
        /*Set the source*/
        if (!strcmp (folder->name, RECEIVED))
@@ -2038,7 +2038,7 @@ groupwise_append_message (CamelFolder *folder, CamelMimeMessage *message,
        }
 
        if (appended_uid)
-               *appended_uid = g_strdup (id);  
+               *appended_uid = g_strdup (id);
        g_free (id);
        CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
 }
@@ -2060,8 +2060,8 @@ uid_compar (const void *va, const void *vb)
 }
 
 static void
-groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, 
-               CamelFolder *destination, GPtrArray **transferred_uids, 
+groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
+               CamelFolder *destination, GPtrArray **transferred_uids,
                gboolean delete_originals, CamelException *ex)
 {
        int count, index = 0;
@@ -2086,7 +2086,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
        if (transferred_uids)
                *transferred_uids = NULL;
 
-       if (delete_originals) 
+       if (delete_originals)
                source_container_id = camel_groupwise_store_container_id_lookup (gw_store, source->full_name) ;
        else
                source_container_id = NULL;
@@ -2115,7 +2115,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
                        if (camel_exception_is_set (ex))
                                break;
 
-                       if (delete_originals) { 
+                       if (delete_originals) {
                                if ( !strcmp(source->full_name, SENT) ) {
                                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                                        _("This message is not available in offline mode."));
@@ -2156,11 +2156,11 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
                                gw_info->server_flags = gw_info->info.flags;
 
                                if (diff.bits & CAMEL_MESSAGE_SEEN) {
-                                       
+
                                        /*
-                                       wrapper is a list wrapper bcos e_gw_connection_mark_read 
+                                       wrapper is a list wrapper bcos e_gw_connection_mark_read
                                        is designed for passing multiple uids. Also, there are is not much
-                                       need/use for a e_gw_connection_mark_ITEM_[un]read       
+                                       need/use for a e_gw_connection_mark_ITEM_[un]read
                                        */
 
                                        wrapper = g_list_prepend (wrapper, (char *)uid);
@@ -2171,12 +2171,12 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
                                        wrapper = NULL;
                                }
 
-                               
+
                                /* A User may mark a message as Unread and then immediately move it to
                                some other folder. The following piece of code take care of such scenario.
-                               
-                               However, Remember that When a mail is deleted after being marked as unread, 
-                               I am not syncing the read-status. 
+
+                               However, Remember that When a mail is deleted after being marked as unread,
+                               I am not syncing the read-status.
                                */
 
                                if (unset_flags.bits & CAMEL_MESSAGE_SEEN) {
@@ -2192,22 +2192,22 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
 
                if (delete_originals) {
                        if (strcmp(source->full_name, "Sent Items")) {
-                               status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index], 
+                               status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index],
                                                dest_container_id, source_container_id);
                        } else {
                                char *container_id = NULL;
                                container_id = e_gw_connection_get_container_id (cnc, "Mailbox");
-                               status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index], 
+                               status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index],
                                                dest_container_id, container_id);
                                g_free (container_id);
                        }
 
                } else
-                       status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index], 
+                       status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index],
                                        dest_container_id, NULL);
 
                if (status == E_GW_CONNECTION_STATUS_OK) {
-                       if (delete_originals) { 
+                       if (delete_originals) {
                                if ( !strcmp(source->full_name, SENT) ) {
                                        camel_folder_delete_message(source, uids->pdata[index]);
                                } else {
@@ -2251,7 +2251,7 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex)
        int i, max;
        gboolean delete = FALSE;
        GList *deleted_items, *deleted_head;
-       
+
 
        deleted_items = deleted_head = NULL;
        cnc = cnc_lookup (priv);
@@ -2353,7 +2353,7 @@ camel_groupwise_folder_class_init (CamelGroupwiseFolderClass *camel_groupwise_fo
        camel_folder_class->get_message = groupwise_folder_get_message;
        camel_folder_class->rename = groupwise_folder_rename;
        camel_folder_class->search_by_expression = groupwise_folder_search_by_expression;
-       camel_folder_class->search_by_uids = groupwise_folder_search_by_uids; 
+       camel_folder_class->search_by_uids = groupwise_folder_search_by_uids;
        camel_folder_class->search_free = groupwise_folder_search_free;
        camel_folder_class->append_message = groupwise_append_message;
        camel_folder_class->refresh_info = groupwise_refresh_info;
@@ -2379,7 +2379,7 @@ camel_groupwise_folder_init (gpointer object, gpointer klass)
 #ifdef ENABLE_THREADS
        g_static_mutex_init(&gw_folder->priv->search_lock);
        g_static_rec_mutex_init(&gw_folder->priv->cache_lock);
-#endif 
+#endif
 
        gw_folder->need_rescan = TRUE;
 }
@@ -2456,7 +2456,7 @@ gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
 
 }
 
-void 
+void
 convert_to_calendar (EGwItem *item, char **str, int *len)
 {
        EGwItemOrganizer *org = NULL;
@@ -2474,7 +2474,7 @@ convert_to_calendar (EGwItem *item, char **str, int *len)
        gstr = g_string_append (gstr, "BEGIN:VEVENT\n");
 
        if ((recur_key = e_gw_item_get_recurrence_key (item)) != 0) {
-               char *recur_k = g_strdup_printf ("%d", recur_key); 
+               char *recur_k = g_strdup_printf ("%d", recur_key);
 
                g_string_append_printf (gstr, "UID:%s\n", recur_k);
                g_string_append_printf (gstr, "X-GW-RECURRENCE-KEY:%s\n", recur_k);
@@ -2497,7 +2497,7 @@ convert_to_calendar (EGwItem *item, char **str, int *len)
                                g_string_append_c(gstr, *temp);
                        temp++;
                }
-               g_string_append(gstr, "\n");    
+               g_string_append(gstr, "\n");
        }
 
        g_string_append_printf (gstr, "DTSTAMP:%s\n", e_gw_item_get_creation_date (item));
@@ -2507,7 +2507,7 @@ convert_to_calendar (EGwItem *item, char **str, int *len)
 
        org = e_gw_item_get_organizer (item);
        if (org)
-               g_string_append_printf (gstr, "ORGANIZER;CN= %s;ROLE= CHAIR;\n MAILTO:%s\n", 
+               g_string_append_printf (gstr, "ORGANIZER;CN= %s;ROLE= CHAIR;\n MAILTO:%s\n",
                                org->display_name, org->email);
 
        recp_list = e_gw_item_get_recipient_list (item);
@@ -2516,7 +2516,7 @@ convert_to_calendar (EGwItem *item, char **str, int *len)
 
                for (rl = recp_list ; rl != NULL ; rl = rl->next) {
                        EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
-                       g_string_append_printf (gstr, 
+                       g_string_append_printf (gstr,
                                        "ATTENDEE;CN= %s;ROLE= REQ-PARTICIPANT:\nMAILTO:%s\n",
                                        recp->display_name, recp->email);
                }
@@ -2554,7 +2554,7 @@ convert_to_calendar (EGwItem *item, char **str, int *len)
        g_strfreev (tmp);
 }
 
-static void 
+static void
 convert_to_task (EGwItem *item, char **str, int *len)
 {
        EGwItemOrganizer *org = NULL;
@@ -2579,7 +2579,7 @@ convert_to_task (EGwItem *item, char **str, int *len)
 
        org = e_gw_item_get_organizer (item);
        if (org)
-               g_string_append_printf (gstr, "ORGANIZER;CN= %s;ROLE= CHAIR;\n MAILTO:%s\n", 
+               g_string_append_printf (gstr, "ORGANIZER;CN= %s;ROLE= CHAIR;\n MAILTO:%s\n",
                                org->display_name, org->email);
 
        recp_list = e_gw_item_get_recipient_list (item);
@@ -2588,7 +2588,7 @@ convert_to_task (EGwItem *item, char **str, int *len)
 
                for (rl = recp_list ; rl != NULL ; rl = rl->next) {
                        EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
-                       g_string_append_printf (gstr, 
+                       g_string_append_printf (gstr,
                                        "ATTENDEE;CN= %s;ROLE= REQ-PARTICIPANT:\nMAILTO:%s\n",
                                        recp->display_name, recp->email);
                }
@@ -2620,7 +2620,7 @@ convert_to_task (EGwItem *item, char **str, int *len)
        g_strfreev (tmp);
 }
 
-static void 
+static void
 convert_to_note (EGwItem *item, char **str, int *len)
 {
        EGwItemOrganizer *org = NULL;
@@ -2642,9 +2642,9 @@ convert_to_note (EGwItem *item, char **str, int *len)
 
        org = e_gw_item_get_organizer (item);
        if (org)
-               g_string_append_printf (gstr, "ORGANIZER;CN= %s;ROLE= CHAIR;\n MAILTO:%s\n", 
+               g_string_append_printf (gstr, "ORGANIZER;CN= %s;ROLE= CHAIR;\n MAILTO:%s\n",
                                org->display_name, org->email);
-       
+
        gstr = g_string_append (gstr, "END:VJOURNAL\n");
        gstr = g_string_append (gstr, "END:VCALENDAR\n");
 
index be94b08..7c78584 100644 (file)
@@ -1,16 +1,16 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-groupwise-folder.h: class for an groupwise folder */
 
-/* 
+/*
  * Authors:
  *   Sivaiah Nallagatla <snallagatla@novell.com>
  *   parthasarathi susarla <sparthasarathi@novell.com>
- *  
+ *
  *
  * Copyright (C) 2004, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -69,8 +69,8 @@ struct _CamelGroupwiseFolder {
 struct _CamelGroupwiseFolderClass {
        CamelOfflineFolderClass parent_class;
 
-       /* Virtual methods */   
-       
+       /* Virtual methods */
+
 } ;
 
 
index 49dc5e0..ef990f1 100644 (file)
@@ -66,7 +66,7 @@ CamelType
 camel_groupwise_journal_get_type (void)
 {
        static CamelType type = NULL;
-       
+
        if (!type) {
                type = camel_type_register (camel_offline_journal_get_type (),
                                            "CamelGroupwiseJournal",
@@ -77,7 +77,7 @@ camel_groupwise_journal_get_type (void)
                                            (CamelObjectInitFunc) camel_groupwise_journal_init,
                                            (CamelObjectFinalizeFunc) camel_groupwise_journal_finalize);
        }
-       
+
        return type;
 }
 
@@ -85,9 +85,9 @@ static void
 camel_groupwise_journal_class_init (CamelGroupwiseJournalClass *klass)
 {
        CamelOfflineJournalClass *journal_class = (CamelOfflineJournalClass *) klass;
-       
+
        parent_class = (CamelOfflineJournalClass *) camel_type_get_global_classfuncs (CAMEL_TYPE_OFFLINE_JOURNAL);
-       
+
        journal_class->entry_free = groupwise_entry_free;
        journal_class->entry_load = groupwise_entry_load;
        journal_class->entry_write = groupwise_entry_write;
@@ -97,20 +97,20 @@ camel_groupwise_journal_class_init (CamelGroupwiseJournalClass *klass)
 static void
 camel_groupwise_journal_init (CamelGroupwiseJournal *journal, CamelGroupwiseJournalClass *klass)
 {
-       
+
 }
 
 static void
 camel_groupwise_journal_finalize (CamelObject *object)
 {
-       
+
 }
 
 static void
 groupwise_entry_free (CamelOfflineJournal *journal, EDListNode *entry)
 {
        CamelGroupwiseJournalEntry *groupwise_entry = (CamelGroupwiseJournalEntry *) entry;
-       
+
        g_free (groupwise_entry->uid);
        g_free (groupwise_entry->original_uid);
        g_free (groupwise_entry->source_container);
@@ -121,12 +121,12 @@ static EDListNode *
 groupwise_entry_load (CamelOfflineJournal *journal, FILE *in)
 {
        CamelGroupwiseJournalEntry *entry;
-       
+
        entry = g_malloc0 (sizeof (CamelGroupwiseJournalEntry));
-       
+
        if (camel_file_util_decode_uint32 (in, &entry->type) == -1)
                goto exception;
-       
+
        switch (entry->type) {
        case CAMEL_GROUPWISE_JOURNAL_ENTRY_APPEND:
                if (camel_file_util_decode_string (in, &entry->uid) == -1)
@@ -143,17 +143,17 @@ groupwise_entry_load (CamelOfflineJournal *journal, FILE *in)
        default:
                goto exception;
        }
-       
+
        return (EDListNode *) entry;
-       
+
  exception:
-       
+
        if (entry->type == CAMEL_GROUPWISE_JOURNAL_ENTRY_TRANSFER)
                g_free (entry->source_container);
-       
+
        g_free (entry->uid);
        g_free (entry);
-       
+
        return NULL;
 }
 
@@ -161,10 +161,10 @@ static int
 groupwise_entry_write (CamelOfflineJournal *journal, EDListNode *entry, FILE *out)
 {
        CamelGroupwiseJournalEntry *groupwise_entry = (CamelGroupwiseJournalEntry *) entry;
-       
+
        if (camel_file_util_encode_uint32 (out, groupwise_entry->type) == -1)
                return -1;
-       
+
        switch (groupwise_entry->type) {
        case CAMEL_GROUPWISE_JOURNAL_ENTRY_APPEND:
                if (camel_file_util_encode_string (out, groupwise_entry->uid))
@@ -181,7 +181,7 @@ groupwise_entry_write (CamelOfflineJournal *journal, EDListNode *entry, FILE *ou
        default:
                g_assert_not_reached ();
        }
-       
+
        return 0;
 }
 
@@ -205,40 +205,40 @@ groupwise_entry_play_append (CamelOfflineJournal *journal, CamelGroupwiseJournal
        CamelMessageInfo *info;
        CamelStream *stream;
        CamelException lex;
-       
+
        /* if the message isn't in the cache, the user went behind our backs so "not our problem" */
        if (!gw_folder->cache || !(stream = camel_data_cache_get (gw_folder->cache, "cache", entry->uid, ex)))
                goto done;
-       
+
        message = camel_mime_message_new ();
        if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) message, stream) == -1) {
                camel_object_unref (message);
                camel_object_unref (stream);
                goto done;
        }
-       
+
        camel_object_unref (stream);
-       
+
        if (!(info = camel_folder_summary_uid (folder->summary, entry->uid))) {
                /* Note: this should never happen, but rather than crash lets make a new info */
                info = camel_message_info_new (NULL);
        }
-       
+
        camel_exception_init (&lex);
        camel_folder_append_message (folder, message, info, NULL, &lex);
        camel_message_info_free (info);
        camel_object_unref (message);
-       
+
        if (camel_exception_is_set (&lex)) {
                camel_exception_xfer (ex, &lex);
                return -1;
        }
-       
+
  done:
-       
+
        camel_folder_summary_remove_uid (folder->summary, entry->uid);
        camel_data_cache_remove (gw_folder->cache, "cache", entry->uid, NULL);
-       
+
        return 0;
 }
 
@@ -253,22 +253,22 @@ groupwise_entry_play_transfer (CamelOfflineJournal *journal, CamelGroupwiseJourn
        CamelException lex;
        CamelFolder *src;
        const char *name;
-       
+
        if (!(info = (CamelMessageInfoBase *) camel_folder_summary_uid (folder->summary, entry->uid))) {
                /* Note: this should never happen, but rather than crash lets make a new info */
                info = camel_message_info_new (NULL);
        }
-       
+
        name = camel_groupwise_store_folder_lookup ((CamelGroupwiseStore *) folder->parent_store, entry->source_container);
        if (name && (src = camel_store_get_folder (folder->parent_store, name, 0, ex))) {
                uids = g_ptr_array_sized_new (1);
                g_ptr_array_add (uids, entry->original_uid);
-               
+
                camel_exception_init (&lex);
                camel_folder_transfer_messages_to (src, uids, folder, &xuids, FALSE, &lex);
                if (!camel_exception_is_set (&lex)) {
                        real = (CamelGroupwiseMessageInfo *) camel_folder_summary_uid (folder->summary, xuids->pdata[0]);
-                       
+
                        /* transfer all the system flags, user flags/tags, etc */
                        gw_message_info_dup_to ((CamelMessageInfoBase *) real, (CamelMessageInfoBase *) info);
                        camel_message_info_free (real);
@@ -276,7 +276,7 @@ groupwise_entry_play_transfer (CamelOfflineJournal *journal, CamelGroupwiseJourn
                        camel_exception_xfer (ex, &lex);
                        goto exception;
                }
-               
+
                g_ptr_array_free (xuids, TRUE);
                g_ptr_array_free (uids, TRUE);
                camel_object_unref (src);
@@ -285,18 +285,18 @@ groupwise_entry_play_transfer (CamelOfflineJournal *journal, CamelGroupwiseJourn
                                      entry->source_container);
                goto exception;
        }
-       
+
        /* message was successfully transferred, remove the fake item from the cache/summary */
        camel_folder_summary_remove_uid (folder->summary, entry->uid);
        camel_data_cache_remove (gw_folder->cache, "cache", entry->uid, NULL);
        camel_message_info_free (info);
-       
+
        return 0;
-       
+
  exception:
-       
+
        camel_message_info_free (info);
-       
+
        return -1;
 }
 
@@ -304,7 +304,7 @@ static int
 groupwise_entry_play (CamelOfflineJournal *journal, EDListNode *entry, CamelException *ex)
 {
        CamelGroupwiseJournalEntry *groupwise_entry = (CamelGroupwiseJournalEntry *) entry;
-       
+
        switch (groupwise_entry->type) {
        case CAMEL_GROUPWISE_JOURNAL_ENTRY_APPEND:
                return groupwise_entry_play_append (journal, groupwise_entry, ex);
@@ -322,12 +322,12 @@ CamelOfflineJournal *
 camel_groupwise_journal_new (CamelGroupwiseFolder *folder, const char *filename)
 {
        CamelOfflineJournal *journal;
-       
+
        g_return_val_if_fail (CAMEL_IS_GROUPWISE_FOLDER (folder), NULL);
-       
+
        journal = (CamelOfflineJournal *) camel_object_new (camel_groupwise_journal_get_type ());
        camel_offline_journal_construct (journal, (CamelFolder *) folder, filename);
-       
+
        return journal;
 }
 
@@ -342,22 +342,22 @@ update_cache (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *messag
        CamelStream *cache;
        guint32 nextuid;
        char *uid;
-       
+
        if (groupwise_folder->cache == NULL) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Cannot append message in offline mode: cache unavailable"));
                return FALSE;
        }
-       
+
        nextuid = camel_folder_summary_next_uid (folder->summary);
        uid = g_strdup_printf ("-%u", nextuid);
-       
+
        if (!(cache = camel_data_cache_add (groupwise_folder->cache, "cache", uid, ex))) {
                folder->summary->nextuid--;
                g_free (uid);
                return FALSE;
        }
-       
+
        if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *) message, cache) == -1
            || camel_stream_flush (cache) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -369,22 +369,22 @@ update_cache (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *messag
                g_free (uid);
                return FALSE;
        }
-       
+
        camel_object_unref (cache);
-       
+
        info = camel_folder_summary_info_new_from_message (folder->summary, message);
        g_free(info->uid);
        info->uid = g_strdup (uid);
-       
+
        gw_message_info_dup_to ((CamelMessageInfoBase *) info, (CamelMessageInfoBase *) mi);
-       
+
        camel_folder_summary_add (folder->summary, info);
-       
+
        if (updated_uid)
                *updated_uid = g_strdup (uid);
-       
+
        g_free (uid);
-       
+
        return TRUE;
 }
 
@@ -395,16 +395,16 @@ camel_groupwise_journal_append (CamelGroupwiseJournal *groupwise_journal, CamelM
        CamelOfflineJournal *journal = (CamelOfflineJournal *) groupwise_journal;
        CamelGroupwiseJournalEntry *entry;
        char *uid;
-       
+
        if (!update_cache (groupwise_journal, message, mi, &uid, ex))
                return;
-       
+
        entry = g_new (CamelGroupwiseJournalEntry, 1);
        entry->type = CAMEL_GROUPWISE_JOURNAL_ENTRY_APPEND;
        entry->uid = uid;
-                               
+
        e_dlist_addtail (&journal->queue, (EDListNode *) entry);
-       
+
        if (appended_uid)
                *appended_uid = g_strdup (uid);
 }
@@ -419,18 +419,18 @@ camel_groupwise_journal_transfer (CamelGroupwiseJournal *groupwise_journal, Came
        CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(journal->folder->parent_store) ;
        CamelGroupwiseJournalEntry *entry;
        char *uid;
-       
+
        if (!update_cache (groupwise_journal, message, mi, &uid, ex))
                return;
-       
+
        entry = g_new (CamelGroupwiseJournalEntry, 1);
        entry->type = CAMEL_GROUPWISE_JOURNAL_ENTRY_APPEND;
        entry->uid = uid;
        entry->original_uid = g_strdup (original_uid);
        entry->source_container = g_strdup (camel_groupwise_store_container_id_lookup (gw_store, ((CamelFolder *)source_folder)->name));
-       
+
        e_dlist_addtail (&journal->queue, (EDListNode *) entry);
-       
+
        if (transferred_uid)
                *transferred_uid = g_strdup (uid);
 }
index 068698b..79c9ddb 100644 (file)
@@ -53,7 +53,7 @@ enum {
 
 struct _CamelGroupwiseJournalEntry {
        EDListNode node;
-       
+
        int type;
 
        char *uid;
@@ -63,12 +63,12 @@ struct _CamelGroupwiseJournalEntry {
 
 struct _CamelGroupwiseJournal {
        CamelOfflineJournal parent_object;
-       
+
 };
 
 struct _CamelGroupwiseJournalClass {
        CamelOfflineJournalClass parent_class;
-       
+
 };
 
 
@@ -79,7 +79,7 @@ CamelOfflineJournal *camel_groupwise_journal_new (struct _CamelGroupwiseFolder *
 /* interfaces for adding a journal entry */
 void camel_groupwise_journal_append (CamelGroupwiseJournal *journal, CamelMimeMessage *message, const CamelMessageInfo *mi,
                                     char **appended_uid, CamelException *ex);
-void camel_groupwise_journal_transfer (CamelGroupwiseJournal *journal, CamelGroupwiseFolder *source_folder, CamelMimeMessage *message, 
+void camel_groupwise_journal_transfer (CamelGroupwiseJournal *journal, CamelGroupwiseFolder *source_folder, CamelMimeMessage *message,
                                       const CamelMessageInfo *mi, const char *orginal_uid, char **transferred_uid, CamelException *ex);
 
 G_END_DECLS
index 81a92a7..7ed75fb 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright 2004 Novell Inc
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index ab3c425..57f020d 100644 (file)
@@ -77,8 +77,8 @@ CamelProviderConfEntry groupwise_conf_entries[] = {
 
        { CAMEL_PROVIDER_CONF_HIDDEN, "auth-domain", NULL,
          NULL, "Groupwise" },
-               
-       { CAMEL_PROVIDER_CONF_SECTION_END }, 
+
+       { CAMEL_PROVIDER_CONF_SECTION_END },
 
        { CAMEL_PROVIDER_CONF_END }
 };
@@ -104,10 +104,10 @@ static CamelProvider groupwise_provider = {
 
 CamelServiceAuthType camel_groupwise_password_authtype = {
        N_("Password"),
-       
+
        N_("This option will connect to the GroupWise server using a "
           "plaintext password."),
-       
+
        "",
        TRUE
 };
@@ -139,14 +139,14 @@ camel_provider_module_init(void)
        groupwise_provider.auto_detect = groupwise_auto_detect_cb;
        groupwise_provider.authtypes = g_list_prepend (groupwise_provider.authtypes, &camel_groupwise_password_authtype);
        groupwise_provider.translation_domain = GETTEXT_PACKAGE;
-       
+
        if (use_imap)
                groupwise_provider.object_types[CAMEL_PROVIDER_STORE] = imap_provider->object_types [CAMEL_PROVIDER_STORE];
        else    {
                groupwise_provider.object_types[CAMEL_PROVIDER_STORE] =  camel_groupwise_store_get_type();
                groupwise_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = camel_groupwise_transport_get_type();
-       } 
-       
+       }
+
        camel_provider_register (&groupwise_provider);
 }
 
@@ -168,7 +168,7 @@ groupwise_url_hash (gconstpointer key)
        add_hash (&hash, u->authmech);
        add_hash (&hash, u->host);
        hash ^= u->port;
-       
+
        return hash;
 }
 
@@ -181,7 +181,7 @@ check_equal (char *s1, char *s2)
                else
                        return FALSE;
        }
-       
+
        if (s2 == NULL)
                return FALSE;
 
@@ -192,7 +192,7 @@ static gint
 groupwise_url_equal (gconstpointer a, gconstpointer b)
 {
        const CamelURL *u1 = a, *u2 = b;
-       
+
        return check_equal (u1->protocol, u2->protocol)
                && check_equal (u1->user, u2->user)
                && check_equal (u1->authmech, u2->authmech)
index b30b575..9fff75a 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2002 Ximian Inc.
  *
- * Authors: Parthasarathi Susarla <sparthasarathi@novell.com>  
+ * Authors: Parthasarathi Susarla <sparthasarathi@novell.com>
  *
  * Description: Based on the imap implementaion of camelstoresummary
  *
@@ -72,7 +72,7 @@ camel_groupwise_store_summary_class_init (CamelGroupwiseStoreSummaryClass *klass
 
        ssklass->summary_header_load = summary_header_load;
        ssklass->summary_header_save = summary_header_save;
-       
+
        ssklass->store_info_load = store_info_load;
        ssklass->store_info_save = store_info_save;
        ssklass->store_info_free = store_info_free;
@@ -429,7 +429,7 @@ camel_groupwise_store_summary_namespace_new(CamelGroupwiseStoreSummary *s, const
        return ns;
 }
 
-void 
+void
 camel_groupwise_store_summary_namespace_set(CamelGroupwiseStoreSummary *s, CamelGroupwiseStoreNamespace *ns)
 {
        d(printf("Setting namesapce to '%s' '%c' -> '%s'\n", ns->full_name, ns->sep, ns->path));
@@ -468,7 +468,7 @@ summary_header_load(CamelStoreSummary *s, FILE *in)
         gint32 version, capabilities, count ;
 
        namespace_clear (s) ;
-       
+
        if (camel_groupwise_store_summary_parent->summary_header_load ((CamelStoreSummary *)s, in) == -1
                        || camel_file_util_decode_fixed_int32(in, &version) == -1)
                return -1 ;
@@ -482,7 +482,7 @@ summary_header_load(CamelStoreSummary *s, FILE *in)
 
        summary->capabilities = capabilities ;
        if (count == 1) {
-               if ((summary->namespace = namespace_load (s, in)) == NULL)      
+               if ((summary->namespace = namespace_load (s, in)) == NULL)
                        return -1 ;
        }
        return 0 ;
index a301e6b..7c6295f 100644 (file)
@@ -39,7 +39,7 @@
 #include <glib/gstdio.h>
 
 #include "camel-debug.h"
-#include "camel-folder.h" 
+#include "camel-folder.h"
 #include "camel-net-utils.h"
 #include "camel-private.h"
 #include "camel-session.h"
@@ -51,7 +51,7 @@
 #include "camel-groupwise-summary.h"
 #include "camel-groupwise-utils.h"
 
-#define d(x) 
+#define d(x)
 #define CURSOR_ITEM_LIMIT 100
 #define JUNK_ENABLE 1
 #define JUNK_PERSISTENCE 14
@@ -91,13 +91,13 @@ groupwise_store_construct (CamelService *service, CamelSession *session,
        const char *property_value;
        CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
        char *path = NULL;
-       
+
        d("in groupwise store constrcut\n");
 
        CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
        if (camel_exception_is_set (ex))
                return;
-       
+
        if (!(url->host || url->user)) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID,
                                     _("Host or user not available in url"));
@@ -109,12 +109,12 @@ groupwise_store_construct (CamelService *service, CamelSession *session,
         * This is a dirty hack. But it *WORKS*
         */
        groupwise_store->list_loaded = 3;
-       
+
        /*storage path*/
        priv->storage_path = camel_session_get_storage_path (session, service, ex);
        if (!priv->storage_path)
                return;
-       
+
        /*store summary*/
        path = g_alloca (strlen (priv->storage_path) + 32);
        sprintf (path, "%s/.summary", priv->storage_path);
@@ -122,7 +122,7 @@ groupwise_store_construct (CamelService *service, CamelSession *session,
        camel_store_summary_set_filename ((CamelStoreSummary *)groupwise_store->summary, path);
        camel_store_summary_touch ((CamelStoreSummary *)groupwise_store->summary);
        camel_store_summary_load ((CamelStoreSummary *) groupwise_store->summary);
-       
+
        /*host and user*/
        priv->server_name = g_strdup (url->host);
        priv->user = g_strdup (url->user);
@@ -142,10 +142,10 @@ groupwise_store_construct (CamelService *service, CamelSession *session,
                priv->port = g_strdup (property_value);
 
        /*filter*/
-       if (camel_url_get_param (url, "filter")) 
+       if (camel_url_get_param (url, "filter"))
                store->flags |= CAMEL_STORE_FILTER_INBOX;
-       
-       /*Hash Table*/  
+
+       /*Hash Table*/
        priv->id_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
        priv->name_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
        priv->parent_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
@@ -182,12 +182,12 @@ groupwise_auth_loop (CamelService *service, CamelException *ex)
        gboolean authenticated = FALSE;
        char *uri;
 
-       if (priv->use_ssl && !g_str_equal (priv->use_ssl, "never")) 
+       if (priv->use_ssl && !g_str_equal (priv->use_ssl, "never"))
                uri = g_strconcat ("https://", priv->server_name, ":", priv->port, "/soap", NULL);
-       else 
+       else
                uri = g_strconcat ("http://", priv->server_name, ":", priv->port, "/soap", NULL);
        service->url->passwd = NULL;
-       
+
 
        while (!authenticated) {
                if (errbuf) {
@@ -196,11 +196,11 @@ groupwise_auth_loop (CamelService *service, CamelException *ex)
                        g_free (service->url->passwd);
                        service->url->passwd = NULL;
                }
-               
-       
+
+
                if (!service->url->passwd && !(store->flags & CAMEL_STORE_PROXY)) {
                        char *prompt;
-                       
+
                        prompt = g_strdup_printf (_("%sPlease enter the GroupWise "
                                                    "password for %s@%s"),
                                                  errbuf ? errbuf : "",
@@ -212,14 +212,14 @@ groupwise_auth_loop (CamelService *service, CamelException *ex)
                        g_free (prompt);
                        g_free (errbuf);
                        errbuf = NULL;
-                       
+
                        if (!service->url->passwd) {
                                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
                                                     _("You did not enter a password."));
                                return FALSE;
                        }
                }
-               
+
                priv->cnc = e_gw_connection_new (uri, priv->user, service->url->passwd);
                if (!E_IS_GW_CONNECTION(priv->cnc) && priv->use_ssl && g_str_equal (priv->use_ssl, "when-possible")) {
                        char *http_uri = g_strconcat ("http://", uri + 8, NULL);
@@ -229,13 +229,13 @@ groupwise_auth_loop (CamelService *service, CamelException *ex)
                if (!E_IS_GW_CONNECTION(priv->cnc)) {
                        errbuf = g_strdup_printf (_("Unable to authenticate "
                                            "to GroupWise server. "));
-                                                 
+
                        camel_exception_clear (ex);
-               } else 
+               } else
                        authenticated = TRUE;
-               
+
        }
-       
+
        return TRUE;
 }
 
@@ -272,8 +272,8 @@ groupwise_connect (CamelService *service, CamelException *ex)
        CamelSession *session = service->session;
 
        d("in groupwise store connect\n");
-       
-/*     if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL || 
+
+/*     if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL ||
             (service->status == CAMEL_SERVICE_DISCONNECTED))
                return FALSE; */
        if (service->status == CAMEL_SERVICE_DISCONNECTED)
@@ -286,7 +286,7 @@ groupwise_connect (CamelService *service, CamelException *ex)
        }
 
        CAMEL_SERVICE_REC_LOCK (service, connect_lock);
-       
+
        if (priv->cnc) {
                CAMEL_SERVICE_REC_UNLOCK (service, connect_lock);
                return TRUE;
@@ -297,14 +297,14 @@ groupwise_connect (CamelService *service, CamelException *ex)
                camel_service_disconnect (service, TRUE, NULL);
                return FALSE;
        }
-       
-       
+
+
        service->status = CAMEL_SERVICE_CONNECTED;
        ((CamelOfflineStore *) store)->state = CAMEL_OFFLINE_STORE_NETWORK_AVAIL;
 
        if (!e_gw_connection_get_version (priv->cnc)) {
-               camel_session_alert_user(session, 
-                               CAMEL_SESSION_ALERT_WARNING, 
+               camel_session_alert_user(session,
+                               CAMEL_SESSION_ALERT_WARNING,
                                _("Some features may not work correctly with your current server version"),
                                FALSE);
 
@@ -334,13 +334,13 @@ groupwise_disconnect_cleanup (CamelService *service, gboolean clean, CamelExcept
 {
        CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (service);
        CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
-       
+
        g_print ("camel_groupwise_store_finalize\n");
        if (groupwise_store->summary) {
                camel_store_summary_save ((CamelStoreSummary *)groupwise_store->summary);
                camel_object_unref (groupwise_store->summary);
        }
-       
+
        if (priv) {
                if (priv->user) {
                        g_free (priv->user);
@@ -362,13 +362,13 @@ groupwise_disconnect_cleanup (CamelService *service, gboolean clean, CamelExcept
                        g_free (priv->base_url);
                        priv->base_url = NULL;
                }
-               
+
                if (priv->storage_path)
                        g_free(priv->storage_path);
 
                if(groupwise_store->root_container)
                        g_free (groupwise_store->root_container);
-               
+
                if (priv->id_hash)
                        g_hash_table_destroy (priv->id_hash);
 
@@ -388,7 +388,7 @@ static gboolean
 groupwise_disconnect (CamelService *service, gboolean clean, CamelException *ex)
 {
        CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (service);
-       
+
        if (clean) {
                CAMEL_SERVICE_REC_LOCK (groupwise_store, connect_lock);
                if (groupwise_store->priv && groupwise_store->priv->cnc) {
@@ -397,7 +397,7 @@ groupwise_disconnect (CamelService *service, gboolean clean, CamelException *ex)
                }
                CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
        }
-       
+
        //groupwise_disconnect_cleanup (service, clean, ex);
        return TRUE;
 }
@@ -406,7 +406,7 @@ static  GList*
 groupwise_store_query_auth_types (CamelService *service, CamelException *ex)
 {
        GList *auth_types = NULL;
-       
+
        d("in query auth types\n");
        auth_types = g_list_prepend (auth_types,  &camel_groupwise_password_authtype);
        return auth_types;
@@ -436,18 +436,18 @@ groupwise_build_folder_info(CamelGroupwiseStore *gw_store, const char *parent_na
        CamelGroupwiseStorePrivate *priv = gw_store->priv;
 
        fi = g_malloc0(sizeof(*fi));
-       
+
        fi->unread = -1;
        fi->total = -1;
 
        if (parent_name) {
-               if (strlen(parent_name) > 0) 
+               if (strlen(parent_name) > 0)
                        fi->full_name = g_strconcat(parent_name, "/", folder_name, NULL);
                else
                        fi->full_name = g_strdup (folder_name);
-       } else 
+       } else
                fi->full_name = g_strdup(folder_name);
+
        url = camel_url_new(priv->base_url,NULL);
        g_free(url->path);
        url->path = g_strdup_printf("/%s", fi->full_name);
@@ -467,7 +467,7 @@ groupwise_build_folder_info(CamelGroupwiseStore *gw_store, const char *parent_na
                fi->flags |= CAMEL_FOLDER_TYPE_TRASH;
        else if (!strcmp (folder_name, "Junk Mail"))
                fi->flags |= CAMEL_FOLDER_TYPE_JUNK;
-               
+
        fi->name = g_strdup(name);
        return fi;
 }
@@ -482,7 +482,7 @@ groupwise_forget_folder (CamelGroupwiseStore *gw_store, const char *folder_name,
        CamelFolderInfo *fi;
        const char *name;
 
-       
+
        name = folder_name;
 
        storage_path = g_strdup_printf ("%s/folders", priv->storage_path);
@@ -545,7 +545,7 @@ groupwise_get_folder_from_disk (CamelStore *store, const char *folder_name, guin
        return folder;
 }
 
-static CamelFolder * 
+static CamelFolder *
 groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
 {
        CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (store);
@@ -556,11 +556,11 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
        EGwConnectionStatus status;
        GList *list = NULL;
        gboolean done = FALSE, all_ok = TRUE;
-       const char *position = E_GW_CURSOR_POSITION_END; 
+       const char *position = E_GW_CURSOR_POSITION_END;
        int count = 0, cursor, summary_count = 0;
        CamelStoreInfo *si = NULL;
        guint total = 0;
-       
+
        folder = groupwise_get_folder_from_disk (store, folder_name, flags, ex);
        if (folder) {
                camel_object_ref (folder);
@@ -575,7 +575,7 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
                CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
                return NULL;
        }
-       
+
        if (gw_store->current_folder) {
                camel_object_unref (gw_store->current_folder);
                gw_store->current_folder = NULL;
@@ -604,7 +604,7 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
                return NULL;
        }
        g_free (folder_dir);
-       
+
        si = camel_store_summary_path ((CamelStoreSummary *)gw_store->summary, folder_name);
        if (si) {
                total = si->total;
@@ -617,7 +617,7 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
        if(!summary_count || !summary->time_string) {
                d(g_print ("\n\n** %s **: No summary as yet : using get cursor request\n\n", folder->name);)
 
-               status = e_gw_connection_create_cursor (priv->cnc, container_id, 
+               status = e_gw_connection_create_cursor (priv->cnc, container_id,
                                "peek id recipient attachments distribution subject status options priority startDate created delivered size hasAttachment",
                                NULL,
                                &cursor);
@@ -631,8 +631,8 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
                camel_folder_summary_clear (folder->summary);
 
                while (!done) {
-                       status = e_gw_connection_read_cursor (priv->cnc, container_id, 
-                                                             cursor, FALSE, 
+                       status = e_gw_connection_read_cursor (priv->cnc, container_id,
+                                                             cursor, FALSE,
                                                              CURSOR_ITEM_LIMIT, position, &list);
                        if (status != E_GW_CONNECTION_STATUS_OK) {
                                all_ok = FALSE;
@@ -648,13 +648,13 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
                                g_free (container_id);
                                return NULL;*/
                        }
-                       
+
                        count += g_list_length (list);
-               
+
                        if (total > 0)
                                camel_operation_progress (NULL, (100*count)/total);
                        gw_update_summary (folder, list,  ex);
-                       
+
                        if (!list)
                                done = TRUE;
                        g_list_foreach (list, (GFunc)g_object_unref, NULL);
@@ -666,7 +666,7 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
                e_gw_connection_destroy_cursor (priv->cnc, container_id, cursor);
 
                camel_operation_end (NULL);
-       } 
+       }
        if (done && all_ok) {
                if (summary->time_string)
                        g_free (summary->time_string);
@@ -684,7 +684,7 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags,
        return folder;
 }
 
-void 
+void
 gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guint32 flags, CamelException *ex)
 {
        CamelGroupwiseStorePrivate *priv = gw_store->priv;
@@ -693,11 +693,11 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
        EGwConnectionStatus status;
        GList *list = NULL;
        gboolean done = FALSE;
-       const char *position = E_GW_CURSOR_POSITION_END; 
+       const char *position = E_GW_CURSOR_POSITION_END;
        int count = 0, cursor, summary_count = 0;
        CamelStoreInfo *si = NULL;
        guint total = 0;
-       
+
        camel_exception_clear (ex);
 
        CAMEL_SERVICE_REC_LOCK (gw_store, connect_lock);
@@ -706,7 +706,7 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
                CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
                return;
        }
-       
+
        if (!E_IS_GW_CONNECTION( priv->cnc)) {
                if (!groupwise_connect (CAMEL_SERVICE((CamelStore*)gw_store), ex)) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, _("Authentication failed"));
@@ -714,7 +714,7 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
                        return;
                }
        }
-       
+
        container_id =  g_strdup (g_hash_table_lookup (priv->name_hash, folder->full_name));
 
        si = camel_store_summary_path ((CamelStoreSummary *)gw_store->summary, folder->name);
@@ -731,7 +731,7 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
        if(!summary_count || !summary->time_string) {
                d(g_print ("\n\n** %s **: Summary missing???? Reloading summary....\n\n", folder->name);)
 
-               status = e_gw_connection_create_cursor (priv->cnc, container_id, 
+               status = e_gw_connection_create_cursor (priv->cnc, container_id,
                                "peek id recipient attachments distribution subject status options priority startDate created delivered size hasAttachment",
                                NULL,
                                &cursor);
@@ -744,8 +744,8 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
                camel_operation_start (NULL, _("Fetching summary information for new messages in %s"), folder->name);
 
                while (!done) {
-                       status = e_gw_connection_read_cursor (priv->cnc, container_id, 
-                                                             cursor, FALSE, 
+                       status = e_gw_connection_read_cursor (priv->cnc, container_id,
+                                                             cursor, FALSE,
                                                              CURSOR_ITEM_LIMIT, position, &list);
                        if (status != E_GW_CONNECTION_STATUS_OK) {
                                CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
@@ -756,13 +756,13 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
                                g_free (container_id);
                                return;
                        }
-                       
+
                        count += g_list_length (list);
-               
+
                        if (total > 0)
                                camel_operation_progress (NULL, (100*count)/total);
                        gw_update_summary (folder, list,  ex);
-                       
+
                        if (!list)
                                done = TRUE;
                        g_list_foreach (list, (GFunc)g_object_unref, NULL);
@@ -774,7 +774,7 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
                e_gw_connection_destroy_cursor (priv->cnc, container_id, cursor);
 
                camel_operation_end (NULL);
-       } 
+       }
 
        if (done) {
                if (summary->time_string)
@@ -785,7 +785,7 @@ gw_store_reload_folder (CamelGroupwiseStore *gw_store, CamelFolder *folder, guin
        camel_folder_summary_save (folder->summary);
 
        gw_store->current_folder = folder;
-       
+
        g_free (container_id);
        CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
        return;
@@ -804,7 +804,7 @@ convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, con
        name = e_gw_container_get_name (container);
        id = e_gw_container_get_id (container);
        type = e_gw_container_get_container_type (container);
-               
+
        fi = g_new0 (CamelFolderInfo, 1);
 
        if (type == E_GW_CONTAINER_TYPE_INBOX)
@@ -822,7 +822,7 @@ convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, con
                (type == E_GW_CONTAINER_TYPE_DRAFT) ||
                (type == E_GW_CONTAINER_TYPE_CABINET) ||
                (type == E_GW_CONTAINER_TYPE_JUNK) ||
-               (type == E_GW_CONTAINER_TYPE_TRASH) ) 
+               (type == E_GW_CONTAINER_TYPE_TRASH) )
                fi->flags |= CAMEL_FOLDER_SYSTEM;
        /*
           parent_hash contains the "parent id <-> container id" combination. So we form
@@ -844,12 +844,12 @@ convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, con
                        temp = g_hash_table_lookup (priv->id_hash, temp_parent );
                        if (temp == NULL) {
                                break;
-                       }       
+                       }
                        str = g_strconcat ( temp, "/", str, NULL);
 
                        temp_parent = g_hash_table_lookup (priv->parent_hash, temp_parent);
 
-               } 
+               }
                fi->full_name = g_strdup (str);
                fi->uri = g_strconcat (url, str, NULL);
                g_free (str);
@@ -882,7 +882,7 @@ convert_to_folder_info (CamelGroupwiseStore *store, EGwContainer *container, con
        si->info.unread = fi->unread;
        si->info.flags = fi->flags;
        /*refresh info*/
-       if (store->current_folder 
+       if (store->current_folder
            && !strcmp (store->current_folder->full_name, fi->full_name)
            && type != E_GW_CONTAINER_TYPE_INBOX) {
                CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS (store->current_folder))->refresh_info(store->current_folder, ex);
@@ -935,7 +935,7 @@ groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
                g_free ((char *)url);
                url = temp_url;
        }
-       
+
        /*populate the hash table for finding the mapping from container id <-> folder name*/
        for (;temp_list != NULL ; temp_list = g_list_next (temp_list) ) {
                const char *name, *id, *parent;
@@ -949,7 +949,7 @@ groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
                }
 
                /*id_hash returns the name for a given container id*/
-               g_hash_table_insert (priv->id_hash, g_strdup(id), g_strdup(name)); 
+               g_hash_table_insert (priv->id_hash, g_strdup(id), g_strdup(name));
                /*parent_hash returns the parent container id, given an id*/
                g_hash_table_insert (priv->parent_hash, g_strdup(id), g_strdup(parent));
        }
@@ -959,7 +959,7 @@ groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
        for (;folder_list != NULL; folder_list = g_list_next (folder_list)) {
                EGwContainerType type;
                EGwContainer *container = E_GW_CONTAINER (folder_list->data);
-               
+
                type = e_gw_container_get_container_type (container);
 
                if (e_gw_container_is_root(container))
@@ -978,7 +978,7 @@ groupwise_folders_sync (CamelGroupwiseStore *store, CamelException *ex)
                        }
                }
        }
-       
+
        g_free ((char *)url);
        e_gw_connection_free_container_list (list);
        count = camel_store_summary_count ((CamelStoreSummary *)store->summary);
@@ -1033,9 +1033,9 @@ groupwise_get_folder_info_offline (CamelStore *store, const char *top,
        for (i=0;i<camel_store_summary_count((CamelStoreSummary *)groupwise_store->summary);i++) {
                CamelStoreInfo *si = camel_store_summary_index((CamelStoreSummary *)groupwise_store->summary, i);
 
-               if (si == NULL) 
+               if (si == NULL)
                        continue;
-               
+
                if ( !strcmp(name, camel_groupwise_store_info_full_name (groupwise_store->summary, si))
                     || match_path (path, camel_groupwise_store_info_full_name (groupwise_store->summary, si))) {
                        fi = groupwise_build_folder_info(groupwise_store, NULL, camel_store_info_path((CamelStoreSummary *)groupwise_store->summary, si));
@@ -1068,7 +1068,7 @@ store_refresh_refresh (CamelSession *session, CamelSessionThreadMsg *msg)
 {
        struct _store_refresh_msg *m = (struct _store_refresh_msg *)msg;
        CamelGroupwiseStore *groupwise_store = (CamelGroupwiseStore *)m->store;
-       
+
        CAMEL_SERVICE_REC_LOCK (m->store, connect_lock);
        if (!camel_groupwise_store_connected ((CamelGroupwiseStore *)m->store, &m->ex))
                goto done;
@@ -1105,7 +1105,7 @@ groupwise_get_folder_info (CamelStore *store, const char *top, guint32 flags, Ca
        CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
        CamelFolderInfo *info = NULL;
        char *top_folder = NULL;
-       
+
        if (top) {
                top_folder = g_hash_table_lookup (priv->name_hash, top);
                /* 'top' is a valid path, but doesnt have a container id
@@ -1117,7 +1117,7 @@ groupwise_get_folder_info (CamelStore *store, const char *top, guint32 flags, Ca
                }*/
        }
 
-       if (top && groupwise_is_system_folder (top)) 
+       if (top && groupwise_is_system_folder (top))
                return groupwise_build_folder_info (groupwise_store, NULL, top );
 
        /*
@@ -1151,7 +1151,7 @@ groupwise_get_folder_info (CamelStore *store, const char *top, guint32 flags, Ca
                if (!priv->cnc) {
                        if (groupwise_connect ((CamelService *)store, ex)) {
                                g_warning ("Could connect!!!\n");
-                       } else 
+                       } else
                                g_warning ("Could not connect..failure connecting\n");
                }
                if (camel_groupwise_store_connected ((CamelGroupwiseStore *)store, ex)) {
@@ -1188,18 +1188,18 @@ create_junk_folder (CamelStore *store)
        folder_name = "Junk Mail";
        parent_id = "";
        /* TODO: check for offlining*/
-               
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
        status = e_gw_connection_modify_junk_settings (priv->cnc, JUNK_ENABLE, 0, 0,  JUNK_PERSISTENCE);
        if (status == E_GW_CONNECTION_STATUS_OK) {
                root = groupwise_build_folder_info(groupwise_store, parent_name, folder_name);
                camel_store_summary_save((CamelStoreSummary *)groupwise_store->summary);
-               
+
                child_container_id = e_gw_connection_get_container_id (priv->cnc, "Junk Mail");
                if (!child_container_id)
                        g_warning("failed to retrieve id for junk folder");
-               
-               g_hash_table_insert (priv->id_hash, g_strdup(child_container_id), g_strdup(folder_name)); 
+
+               g_hash_table_insert (priv->id_hash, g_strdup(child_container_id), g_strdup(folder_name));
                g_hash_table_insert (priv->name_hash, g_strdup(folder_name), g_strdup(child_container_id));
                g_hash_table_insert (priv->parent_hash, g_strdup(child_container_id), g_strdup(parent_id));
                camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root);
@@ -1225,7 +1225,7 @@ groupwise_create_folder(CamelStore *store,
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create GroupWise folders in offline mode."));
                return NULL;
        }
-       
+
        if(parent_name == NULL) {
                parent_name = "";
                if (groupwise_is_system_folder (folder_name)) {
@@ -1255,7 +1255,7 @@ groupwise_create_folder(CamelStore *store,
                root = groupwise_build_folder_info(groupwise_store, parent_name,folder_name);
                camel_store_summary_save((CamelStoreSummary *)groupwise_store->summary);
 
-               g_hash_table_insert (priv->id_hash, g_strdup(child_container_id), g_strdup(folder_name)); 
+               g_hash_table_insert (priv->id_hash, g_strdup(child_container_id), g_strdup(folder_name));
                g_hash_table_insert (priv->name_hash, g_strdup(root->full_name), g_strdup(child_container_id));
                g_hash_table_insert (priv->parent_hash, g_strdup(child_container_id), g_strdup(parent_id));
 
@@ -1265,7 +1265,7 @@ groupwise_create_folder(CamelStore *store,
        return root;
 }
 
-static void 
+static void
 groupwise_delete_folder(CamelStore *store,
                                   const char *folder_name,
                                   CamelException *ex)
@@ -1273,10 +1273,10 @@ groupwise_delete_folder(CamelStore *store,
        CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (store);
        CamelGroupwiseStorePrivate  *priv = groupwise_store->priv;
        EGwConnectionStatus status;
-       const char * container; 
-       
+       const char * container;
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        if (!camel_groupwise_store_connected ((CamelGroupwiseStore *)store, ex)) {
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return;
@@ -1294,13 +1294,13 @@ groupwise_delete_folder(CamelStore *store,
 
                g_hash_table_remove (priv->id_hash, container);
                g_hash_table_remove (priv->name_hash, folder_name);
-               
+
                g_hash_table_remove (priv->parent_hash, container);
        }
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
 
-static void 
+static void
 groupwise_rename_folder(CamelStore *store,
                        const char *old_name,
                        const char *new_name,
@@ -1311,7 +1311,7 @@ groupwise_rename_folder(CamelStore *store,
        char *oldpath, *newpath, *storepath;
        const char *container_id;
        char *temp_new = NULL;
-       
+
        if (groupwise_is_system_folder (old_name)) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot rename Groupwise folder `%s' to `%s'"),
                                      old_name, new_name);
@@ -1319,19 +1319,19 @@ groupwise_rename_folder(CamelStore *store,
        }
 
        CAMEL_SERVICE_REC_LOCK (groupwise_store, connect_lock);
-       
+
        if (!camel_groupwise_store_connected ((CamelGroupwiseStore *)store, ex)) {
                CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
                return;
        }
-       
+
        container_id = camel_groupwise_store_container_id_lookup (groupwise_store, old_name);
        temp_new = strrchr (new_name, '/');
-       if (temp_new) 
+       if (temp_new)
                temp_new++;
        else
                temp_new = (char *)new_name;
-       
+
        if (!container_id || e_gw_connection_rename_folder (priv->cnc, container_id , temp_new) != E_GW_CONNECTION_STATUS_OK)
        {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot rename Groupwise folder `%s' to `%s'"),
@@ -1362,13 +1362,13 @@ groupwise_rename_folder(CamelStore *store,
        CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
 }
 
-char * 
-groupwise_get_name(CamelService *service, gboolean brief) 
+char *
+groupwise_get_name(CamelService *service, gboolean brief)
 {
-       if(brief) 
+       if(brief)
                return g_strdup_printf(_("GroupWise server %s"), service->url->host);
        else
-               return g_strdup_printf(_("GroupWise service for %s on %s"), 
+               return g_strdup_printf(_("GroupWise service for %s on %s"),
                                       service->url->user, service->url->host);
 }
 
@@ -1419,14 +1419,14 @@ groupwise_get_trash (CamelStore *store, CamelException *ex)
                camel_object_state_read(folder);
 
                return folder;
-       } else 
+       } else
                return NULL;
 }
 
 /*
  * Function to check if we are both connected and are _actually_
  * online. Based on an equivalient function in IMAP
- */ 
+ */
 gboolean
 camel_groupwise_store_connected (CamelGroupwiseStore *store, CamelException *ex)
 {
@@ -1438,7 +1438,7 @@ camel_groupwise_store_connected (CamelGroupwiseStore *store, CamelException *ex)
        return FALSE;
 }
 
-static int 
+static int
 match_path(const char *path, const char *name)
 {
        char p, n;
@@ -1472,18 +1472,18 @@ camel_groupwise_store_class_init (CamelGroupwiseStoreClass *camel_groupwise_stor
                CAMEL_SERVICE_CLASS (camel_groupwise_store_class);
        CamelStoreClass *camel_store_class =
                CAMEL_STORE_CLASS (camel_groupwise_store_class);
-       
+
        parent_class = CAMEL_OFFLINE_STORE_CLASS (camel_type_get_global_classfuncs (camel_offline_store_get_type ()));
-       
+
        camel_service_class->construct = groupwise_store_construct;
        camel_service_class->query_auth_types = groupwise_store_query_auth_types;
        camel_service_class->get_name = groupwise_get_name;
        camel_service_class->connect = groupwise_connect;
        camel_service_class->disconnect = groupwise_disconnect;
-       
+
        camel_store_class->hash_folder_name = groupwise_hash_folder_name;
        camel_store_class->compare_folder_name = groupwise_compare_folder_name;
-       
+
        camel_store_class->get_folder = groupwise_get_folder;
        camel_store_class->create_folder = groupwise_create_folder;
        camel_store_class->delete_folder = groupwise_delete_folder;
@@ -1500,13 +1500,13 @@ camel_groupwise_store_finalize (CamelObject *object)
 {
        CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (object);
        CamelGroupwiseStorePrivate *priv = groupwise_store->priv;
-       
+
        g_print ("camel_groupwise_store_finalize\n");
        if (groupwise_store->summary) {
                camel_store_summary_save ((CamelStoreSummary *)groupwise_store->summary);
                camel_object_unref (groupwise_store->summary);
        }
-       
+
        if (priv) {
                if (priv->user) {
                        g_free (priv->user);
@@ -1528,7 +1528,7 @@ camel_groupwise_store_finalize (CamelObject *object)
                        g_free (priv->base_url);
                        priv->base_url = NULL;
                }
-               
+
                if (E_IS_GW_CONNECTION (priv->cnc)) {
                        g_object_unref (priv->cnc);
                        priv->cnc = NULL;
@@ -1539,7 +1539,7 @@ camel_groupwise_store_finalize (CamelObject *object)
 
                if(groupwise_store->root_container)
                        g_free (groupwise_store->root_container);
-               
+
                if (priv->id_hash)
                        g_hash_table_destroy (priv->id_hash);
 
@@ -1560,7 +1560,7 @@ camel_groupwise_store_init (gpointer object, gpointer klass)
 {
        CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE (object);
        CamelGroupwiseStorePrivate *priv = g_new0 (CamelGroupwiseStorePrivate, 1);
-       
+
        d("in groupwise store init\n");
        priv->server_name = NULL;
        priv->port = NULL;
@@ -1568,14 +1568,14 @@ camel_groupwise_store_init (gpointer object, gpointer klass)
        priv->user = NULL;
        priv->cnc = NULL;
        groupwise_store->priv = priv;
-       
+
 }
 
 CamelType
 camel_groupwise_store_get_type (void)
 {
        static CamelType camel_groupwise_store_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_groupwise_store_type == CAMEL_INVALID_TYPE)   {
                camel_groupwise_store_type =
                        camel_type_register (camel_offline_store_get_type (),
@@ -1587,6 +1587,6 @@ camel_groupwise_store_get_type (void)
                                             (CamelObjectInitFunc) camel_groupwise_store_init,
                                             (CamelObjectFinalizeFunc) camel_groupwise_store_finalize);
        }
-       
+
        return camel_groupwise_store_type;
 }
index 189ae22..6921683 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-groupwise-store.h : class for an groupwise store */
 
-/* 
+/*
  * Authors: Sivaiah Nallagatla <snallagatla@novell.com>
  *
  * Copyright (C) 2004 Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -53,7 +53,7 @@ struct _CamelGroupwiseStore {
        char *root_container;
        CamelGroupwiseStorePrivate *priv;
        CamelFolder *current_folder;
-       
+
        /* the parameters field is not to be included not. probably for 2.6*/
        /*guint32 parameters;*/
        time_t refresh_stamp;
index 0c2d080..5ffe06c 100644 (file)
@@ -4,7 +4,7 @@
  *
  *  Authors:
  *     parthasrathi susarla <sparthasrathi@novell.com>
- * Based on the IMAP summary class implementation by: 
+ * Based on the IMAP summary class implementation by:
  *    Michael Zucchi <notzed@ximian.com>
  *    Dan Winship <danw@ximian.com>
  *
@@ -51,7 +51,7 @@ static CamelMessageInfo *gw_message_info_load (CamelFolderSummary *s, FILE *in)
 static int gw_message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info) ;
 static CamelMessageContentInfo * gw_content_info_load (CamelFolderSummary *s, FILE *in) ;
 static int gw_content_info_save (CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *info) ;
-static gboolean gw_info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set);         
+static gboolean gw_info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set);
 
 static void camel_groupwise_summary_class_init (CamelGroupwiseSummaryClass *klass);
 static void camel_groupwise_summary_init       (CamelGroupwiseSummary *obj);
@@ -123,7 +123,7 @@ camel_groupwise_summary_init (CamelGroupwiseSummary *obj)
        /* subclasses need to set the right instance data sizes */
        s->message_info_size = sizeof(CamelGroupwiseMessageInfo);
        s->content_info_size = sizeof(CamelGroupwiseMessageContentInfo);
-       
+
        /* Meta-summary - Overriding UID len */
        s->meta_summary->uid_len = 2048;
 }
@@ -143,7 +143,7 @@ camel_groupwise_summary_new (struct _CamelFolder *folder, const char *filename)
 {
        CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (
                        camel_object_new (camel_groupwise_summary_get_type ()));
-       
+
        summary->folder = folder ;
        camel_folder_summary_set_build_content (summary, TRUE);
        camel_folder_summary_set_filename (summary, filename);
@@ -167,7 +167,7 @@ gw_summary_header_load (CamelFolderSummary *s, FILE *in)
        if (camel_file_util_decode_fixed_int32(in, &ims->version) == -1
                        || camel_file_util_decode_fixed_int32(in, &ims->validity) == -1)
                return -1;
-       
+
        if (camel_file_util_decode_string (in, &ims->time_string) == -1)
                return -1;
        return 0 ;
@@ -224,7 +224,7 @@ gw_message_info_save (CamelFolderSummary *s, FILE *out, CamelMessageInfo *info)
 
 static CamelMessageContentInfo *
 gw_content_info_load (CamelFolderSummary *s, FILE *in)
-{       
+{
        if (fgetc (in))
                return camel_groupwise_summary_parent->content_info_load (s, in);
        else
@@ -255,7 +255,7 @@ gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set)
        /* we don't set flags which aren't appropriate for the folder*/
        if ((set == (CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK_LEARN|CAMEL_MESSAGE_SEEN)) && (old & CAMEL_GW_MESSAGE_JUNK))
                return FALSE;
-       
+
        mi->flags = (old & ~flags) | (set & flags);
        if (old != mi->flags) {
                mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
@@ -264,11 +264,11 @@ gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set)
        }
        /* This is a hack, we are using CAMEL_MESSAGE_JUNK justo to hide the item
         * we make sure this doesn't have any side effects*/
-       
+
        if ((set == CAMEL_MESSAGE_JUNK_LEARN) && (old & CAMEL_GW_MESSAGE_JUNK)) {
                mi->flags |= CAMEL_GW_MESSAGE_NOJUNK | CAMEL_MESSAGE_JUNK;
 
-               /* This has ugly side-effects. Evo will never learn unjunk. 
+               /* This has ugly side-effects. Evo will never learn unjunk.
 
                   We need to create one CAMEL_MESSAGE_HIDDEN flag which must be used for all hiding operations. We must also get rid of the seperate file that is maintained somewhere in evolution/mail/em-folder-browser.c for hidden messages
                 */
@@ -277,7 +277,7 @@ gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set)
                        camel_folder_summary_touch(mi->summary);
                }
 
-       } else  if ((old & ~CAMEL_MESSAGE_SYSTEM_MASK) == (mi->flags & ~CAMEL_MESSAGE_SYSTEM_MASK)) 
+       } else  if ((old & ~CAMEL_MESSAGE_SYSTEM_MASK) == (mi->flags & ~CAMEL_MESSAGE_SYSTEM_MASK))
                return FALSE;
 
        if (mi->summary && mi->summary->folder && mi->uid) {
@@ -296,7 +296,7 @@ gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set)
 void
 camel_gw_summary_add_offline (CamelFolderSummary *summary, const char *uid, CamelMimeMessage *message, const CamelMessageInfo *info)
 {
-       CamelGroupwiseMessageInfo *mi ; 
+       CamelGroupwiseMessageInfo *mi ;
        const CamelFlag *flag ;
        const CamelTag *tag ;
 
@@ -347,7 +347,7 @@ groupwise_summary_clear (CamelFolderSummary *summary, gboolean uncache)
        for (i = 0; i < count; i++) {
                if (!(info = camel_folder_summary_index (summary, i)))
                        continue;
-               
+
                uid = camel_message_info_uid (info);
                camel_folder_change_info_remove_uid (changes, uid);
                camel_folder_summary_remove_uid (summary, uid);
index b0ec0e5..eda28c4 100644 (file)
@@ -52,7 +52,7 @@ struct _CamelGroupwiseMessageInfo {
 
 struct _CamelGroupwiseMessageContentInfo {
        CamelMessageContentInfo info ;
-} ; 
+} ;
 
 
 struct _CamelGroupwiseSummary {
index 94abeae..604c6f3 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-groupwise-transport.c : class for an groupwise transport */
 
-/* 
+/*
  * Authors: Sivaiah Nallagatla <snallagatla@novell.com>
  *         Parthasarathi Susarla <sparthasarathi@novell.com>
  *
  * Copyright (C) 2004 Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -38,7 +38,7 @@
 #include "camel-mime-message.h"
 #include "camel-mime-utils.h"
 #include "camel-multipart.h"
-#include "camel-session.h" 
+#include "camel-session.h"
 #include "camel-stream-mem.h"
 #include "camel-stream.h"
 
@@ -70,13 +70,13 @@ camel_groupwise_transport_class_init (CamelGroupwiseTransportClass *camel_groupw
 
        CamelServiceClass *camel_service_class =
                CAMEL_SERVICE_CLASS (camel_groupwise_transport_class);
-       
+
        parent_class = CAMEL_TRANSPORT_CLASS (camel_type_get_global_classfuncs (camel_transport_get_type ()));
-       
+
        camel_service_class->connect = groupwise_transport_connect;
        camel_service_class->get_name = groupwise_transport_get_name;
        camel_service_class->construct = groupwise_transport_construct;
-       
+
        /* virtual method overload */
        camel_transport_class->send_to = groupwise_send_to;
 }
@@ -137,9 +137,9 @@ groupwise_transport_connect (CamelService *service, CamelException *ex)
 
 
 static gboolean
-groupwise_send_to (CamelTransport *transport, 
+groupwise_send_to (CamelTransport *transport,
                   CamelMimeMessage *message,
-                  CamelAddress *from, 
+                  CamelAddress *from,
                   CamelAddress *recipients,
                   CamelException *ex)
 {
@@ -186,9 +186,9 @@ groupwise_send_to (CamelTransport *transport,
                camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, _("Authentication failed"));
                return FALSE;
        }
-       
+
        item = camel_groupwise_util_item_from_message (cnc, message, from);
-       
+
        reply_request = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), "In-Reply-To");
        if (reply_request) {
                char *id;
@@ -197,7 +197,7 @@ groupwise_send_to (CamelTransport *transport,
                id = (char *)g_malloc0 (len-1);
                id = memcpy(id, reply_request+2, len-3);
                status = e_gw_connection_reply_item (cnc, id, NULL, &temp_item);
-               if (status != E_GW_CONNECTION_STATUS_OK) 
+               if (status != E_GW_CONNECTION_STATUS_OK)
                        g_warning ("Could not send a replyRequest...continuing without!!\n");
                else {
                        info = e_gw_item_get_link_info (temp_item);
@@ -206,8 +206,8 @@ groupwise_send_to (CamelTransport *transport,
 
                g_free (id);
        }
-       
-       
+
+
        /*Send item*/
        status = e_gw_connection_send_item (cnc, item, &sent_item_list);
        if (status != E_GW_CONNECTION_STATUS_OK) {
index d8717ba..c1d6903 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-groupwise-transport.h : class for an groupwise transport */
 
-/* 
+/*
  * Authors: Sivaiah Nallagatla <snallagatla@novell.com>
  *
  * Copyright (C) 2004 Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index d7b4b29..27ecaaf 100644 (file)
@@ -270,7 +270,7 @@ add_recipients(GSList *recipient_list, CamelAddress *recipients, int recipient_t
 {
        int total_add,i;
        EGwItemRecipient *recipient;
-       
+
        total_add = camel_address_length (recipients);
        for (i=0 ; i<total_add ; i++) {
                const char *name = NULL, *addr = NULL;
@@ -288,20 +288,20 @@ add_recipients(GSList *recipient_list, CamelAddress *recipients, int recipient_t
        return recipient_list;
 }
 
-static void 
+static void
 send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content, CamelContentType *type, CamelDataWrapper *dw, const char *filename, const char *cid, GSList **attach_list)
 {
        EGwItemLinkInfo *info = NULL;
        EGwConnectionStatus status;
        EGwItemAttachment *attachment;
        EGwItem *temp_item;
-       
+
        attachment = g_new0 (EGwItemAttachment, 1);
        attachment->contentType = camel_content_type_simple (type);
-       
+
        if (cid)
                attachment->contentid = camel_header_contentid_decode (cid);
-       
+
        if (filename) {
                if (camel_content_type_is (type, "application", "pgp-signature")) {
                        char *temp_str;
@@ -332,7 +332,7 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
                        temp_len = 0;
                }
        }
-       
+
        if (camel_content_type_is (type, "text", "html") || camel_content_type_is (type, "multipart", "alternative")) {
                if (!filename)
                        filename = "text.htm";
@@ -348,7 +348,7 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
                const char *message_id;
                char *msgid;
                int len;
-               
+
                message_id = camel_medium_get_header (CAMEL_MEDIUM (dw), "Message-Id");
                /*
                 * XXX: The following code piece is a screwed up way of doing stuff.
@@ -356,7 +356,7 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
                 * since it removes the container id portion from the id and which the
                 * groupwise server needs.
                 */
-               
+
                len = strlen (message_id);
                msgid = (char *)g_malloc0 (len-1);
                msgid = memcpy(msgid, message_id+2, len-3);
@@ -364,7 +364,7 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
 
                status = e_gw_connection_forward_item (cnc, msgid, NULL, TRUE, &temp_item);
                g_free (msgid);
-               
+
                if (status != E_GW_CONNECTION_STATUS_OK) {
                        g_warning ("Could not send a forwardRequest...continuing without!!\n");
                } else {
@@ -376,7 +376,7 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
                        attachment->name = g_strdup (temp_attach->name);
                        g_free (attachment->contentType);
                        attachment->contentType = g_strdup ("Mail");
-                       g_free (attachment->data); 
+                       g_free (attachment->data);
                        attachment->data = NULL;
                        attachment->size = 0;
                        info = e_gw_item_get_link_info (temp_item);
@@ -400,18 +400,18 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
 
        /*Egroupwise item*/
        item = e_gw_item_new_empty ();
-       
+
        /*populate recipient list*/
        recipients = CAMEL_ADDRESS (camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO));
        recipient_list=add_recipients(recipient_list,recipients,E_GW_ITEM_RECIPIENT_TO);
-       
+
        recipients = CAMEL_ADDRESS (camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC));
        recipient_list=add_recipients(recipient_list,recipients,E_GW_ITEM_RECIPIENT_CC);
-       
+
        recipients = CAMEL_ADDRESS (camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_BCC));
        recipient_list=add_recipients(recipient_list,recipients,E_GW_ITEM_RECIPIENT_BC);
        recipient_list = g_slist_reverse (recipient_list);
-       
+
        /** Get the mime parts from CamelMimemessge **/
        mp = (CamelMultipart *)camel_medium_get_content_object (CAMEL_MEDIUM (message));
        if(!mp) {
@@ -428,20 +428,20 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
                CamelStreamMem *content = (CamelStreamMem *)camel_stream_mem_new ();
                CamelDataWrapper *dw = NULL;
                CamelContentType *type;
-               
+
                dw = camel_medium_get_content_object (CAMEL_MEDIUM (message));
                type = camel_mime_part_get_content_type((CamelMimePart *)message);
-               
+
                if (camel_content_type_is (type, "text", "plain")) {
                        CamelStream *filtered_stream;
                        CamelMimeFilter *filter;
                        const char *charset;
                        char *content_type;
-                       
+
                        content_type = camel_content_type_simple (type);
                        e_gw_item_set_content_type (item, content_type);
                        g_free (content_type);
-                       
+
                        charset = camel_content_type_param (type, "charset");
                        if (charset && g_ascii_strcasecmp (charset, "US-ASCII") && g_ascii_strcasecmp (charset, "UTF-8")) {
                                filter = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "UTF-8");
@@ -453,18 +453,18 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
                                filtered_stream = (CamelStream *) content;
                                camel_object_ref (content);
                        }
-                       
+
                        camel_data_wrapper_decode_to_stream (dw, filtered_stream);
                        camel_stream_flush (filtered_stream);
                        camel_object_unref (filtered_stream);
-                       
+
                        camel_stream_write ((CamelStream *) content, "", 1);
                        e_gw_item_set_message (item, (const char *)content->buffer->data);
                } else {
                        camel_data_wrapper_decode_to_stream (dw, (CamelStream *) content);
-                       send_as_attachment (cnc, item, content, type, dw, NULL, NULL, &attach_list);    
+                       send_as_attachment (cnc, item, content, type, dw, NULL, NULL, &attach_list);
                }
-               
+
                camel_object_unref (content);
        }
        /*Populate EGwItem*/
@@ -481,15 +481,15 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
        e_gw_item_set_subject (item, camel_mime_message_get_subject(message));
        /*attachmets*/
        e_gw_item_set_attach_id_list (item, attach_list);
-       
+
        /*send options*/
        e_gw_item_set_sendoptions (item, TRUE);
 
-       if ((char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_REPLY_CONVENIENT)) 
+       if ((char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_REPLY_CONVENIENT))
                e_gw_item_set_reply_request (item, TRUE);
-       
+
        send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_REPLY_WITHIN);
-       if (send_options) { 
+       if (send_options) {
                e_gw_item_set_reply_request (item, TRUE);
                e_gw_item_set_reply_within (item, send_options);
        }
@@ -503,7 +503,7 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
 
        send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM(message), X_TRACK_WHEN);
 
-       /*we check if user has modified the status tracking options, if no then we anyway 
+       /*we check if user has modified the status tracking options, if no then we anyway
         * set status tracking all*/
        if (send_options) {
                switch (atoi(send_options)) {
@@ -537,8 +537,8 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
                                break;
                        case 1: e_gw_item_set_notify_deleted (item, E_GW_ITEM_NOTIFY_MAIL);
                }
-       }       
-       
+       }
+
        send_options = (char *)camel_medium_get_header (CAMEL_MEDIUM (message), X_SEND_OPT_PRIORITY);
        if (send_options) {
                switch (atoi(send_options)) {
@@ -567,7 +567,7 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
                        case E_GW_SECURITY_FOR_YOUR_EYES_ONLY : e_gw_item_set_security(item, "ForYourEyesOnly");
                                                                break;
                }
-       } 
+       }
        return item;
 }
 
@@ -595,7 +595,7 @@ strip_lt_gt (char **string, int s_offset, int e_offset)
 {
        char *temp = NULL;
        int len;
-       
+
        temp = g_strdup (*string);
        len = strlen (*string);
 
@@ -632,19 +632,19 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
 
                type = camel_mime_part_get_content_type(part);
                dw = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-               
+
                if (CAMEL_IS_MULTIPART (dw)) {
                        do_multipart (cnc, item, (CamelMultipart *) camel_medium_get_content_object ((CamelMedium *) part), attach_list);
                        continue;
                }
-               
+
                if (type->subtype && !strcmp (type->subtype, "alternative")) {
                        /* eh... I don't think this code will ever get hit? */
                        CamelMimePart *temp_part;
                        const char *cid = NULL;
                        CamelStreamMem *temp_content = (CamelStreamMem *)camel_stream_mem_new ();
                        CamelDataWrapper *temp_dw = NULL;
-                       
+
                        temp_part = camel_multipart_get_part ((CamelMultipart *)dw, 1);
                        if (temp_part) {
                                is_alternative = TRUE;
@@ -657,18 +657,18 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
                        }
                        camel_object_unref (temp_content);
                        continue;
-               } 
-               
+               }
+
                if (i == 0 && camel_content_type_is (type, "text", "plain")) {
                        CamelStream *filtered_stream;
                        CamelMimeFilter *filter;
                        const char *charset;
                        char *content_type;
-                       
+
                        content_type = camel_content_type_simple (type);
                        e_gw_item_set_content_type (item, content_type);
                        g_free (content_type);
-                       
+
                        charset = camel_content_type_param (type, "charset");
                        if (charset && g_ascii_strcasecmp (charset, "US-ASCII") && g_ascii_strcasecmp (charset, "UTF-8")) {
                                filter = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "UTF-8");
@@ -680,22 +680,22 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
                                filtered_stream = (CamelStream *) content;
                                camel_object_ref (content);
                        }
-                       
+
                        camel_data_wrapper_decode_to_stream (dw, filtered_stream);
                        camel_stream_flush (filtered_stream);
                        camel_object_unref (filtered_stream);
-                       
+
                        camel_stream_write ((CamelStream *) content, "", 1);
                        e_gw_item_set_message (item, (const char *)content->buffer->data);
                } else {
                        filename = camel_mime_part_get_filename (part);
                        disposition = camel_mime_part_get_disposition (part);
                        content_id = camel_mime_part_get_content_id (part);
-                       
+
                        camel_data_wrapper_decode_to_stream (dw, (CamelStream *) content);
                        send_as_attachment (cnc, item, content, type, dw, filename, content_id, attach_list);
                }
-               
+
                camel_object_unref (content);
        } /*end of for*/
 }
index e634b7e..2a586f4 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2001 Ximian, Inc.
  *
  * This library is free software; you can redistribute it and/or
index ea12dd8..148ab93 100644 (file)
@@ -66,7 +66,7 @@ static CamelProviderConfEntry hula_conf_entries[] = {
        { CAMEL_PROVIDER_CONF_ENTRY, "namespace", "override_namespace",
          N_("Namespace") },
        { CAMEL_PROVIDER_CONF_SECTION_END },
-       
+
        { CAMEL_PROVIDER_CONF_END }
        /* revisit each options in other providers (incl. authdomain) for
         * relevancy - harish*/
@@ -93,10 +93,10 @@ static CamelProvider hula_provider = {
 
 static CamelServiceAuthType camel_hula_password_authtype = {
        N_("Password"),
-       
+
        N_("This option will connect to the Hula server using a "
           "plaintext password."),
-       
+
        "",
        TRUE
 };
@@ -126,10 +126,10 @@ camel_provider_module_init(void)
        hula_provider.auto_detect = hula_auto_detect_cb;
        hula_provider.authtypes = g_list_prepend (hula_provider.authtypes, &camel_hula_password_authtype);
        hula_provider.translation_domain = GETTEXT_PACKAGE;
-       
+
        hula_provider.object_types[CAMEL_PROVIDER_STORE] = imap_provider->object_types [CAMEL_PROVIDER_STORE];
-        
-       
+
+
        camel_provider_register (&hula_provider);
 }
 
@@ -151,7 +151,7 @@ hula_url_hash (gconstpointer key)
        add_hash (&hash, u->authmech);
        add_hash (&hash, u->host);
        hash ^= u->port;
-       
+
        return hash;
 }
 
@@ -164,7 +164,7 @@ check_equal (char *s1, char *s2)
                else
                        return FALSE;
        }
-       
+
        if (s2 == NULL)
                return FALSE;
 
@@ -175,7 +175,7 @@ static gint
 hula_url_equal (gconstpointer a, gconstpointer b)
 {
        const CamelURL *u1 = a, *u2 = b;
-       
+
        return check_equal (u1->protocol, u2->protocol)
                && check_equal (u1->user, u2->user)
                && check_equal (u1->authmech, u2->authmech)
index 0af848b..e34f634 100644 (file)
@@ -93,9 +93,9 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder,
 {
        va_list ap;
        char *cmd;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        if (fmt) {
                va_start (ap, fmt);
                cmd = imap_command_strdup_vprintf (store, fmt, ap);
@@ -107,14 +107,14 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder,
                store->current_folder = folder;
                cmd = imap_command_strdup_printf (store, "SELECT %F", folder->full_name);
        }
-       
+
        if (!imap_command_start (store, folder, cmd, ex)) {
                g_free (cmd);
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return NULL;
        }
        g_free (cmd);
-       
+
        return imap_read_response (store, ex);
 }
 
@@ -159,15 +159,15 @@ camel_imap_command_start (CamelImapStore *store, CamelFolder *folder,
        va_list ap;
        char *cmd;
        gboolean ok;
-       
+
        va_start (ap, fmt);
        cmd = imap_command_strdup_vprintf (store, fmt, ap);
        va_end (ap);
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
        ok = imap_command_start (store, folder, cmd, ex);
        g_free (cmd);
-       
+
        if (!ok)
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
        return ok;
@@ -178,15 +178,15 @@ imap_command_start (CamelImapStore *store, CamelFolder *folder,
                    const char *cmd, CamelException *ex)
 {
        ssize_t nwritten;
-       
+
        g_return_val_if_fail(store->ostream!=NULL, FALSE);
        g_return_val_if_fail(store->istream!=NULL, FALSE);
-       
+
        /* Check for current folder */
        if (folder && folder != store->current_folder) {
                CamelImapResponse *response;
                CamelException internal_ex;
-               
+
                response = camel_imap_command (store, folder, ex, NULL);
                if (!response)
                        return FALSE;
@@ -198,11 +198,11 @@ imap_command_start (CamelImapStore *store, CamelFolder *folder,
                        return FALSE;
                }
        }
-       
+
        /* Send the command */
        if (camel_verbose_debug) {
                const char *mask;
-               
+
                if (!strncmp ("LOGIN \"", cmd, 7))
                        mask = "LOGIN \"xxx\" xxx";
                else if (!strncmp ("LOGIN {", cmd, 7))
@@ -211,13 +211,13 @@ imap_command_start (CamelImapStore *store, CamelFolder *folder,
                        mask = "LOGIN xxx xxx";
                else
                        mask = cmd;
-               
+
                fprintf (stderr, "sending : %c%.5u %s\r\n", store->tag_prefix, store->command, mask);
        }
-       
+
        nwritten = camel_stream_printf (store->ostream, "%c%.5u %s\r\n",
                                        store->tag_prefix, store->command++, cmd);
-       
+
        if (nwritten == -1) {
                if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
@@ -225,11 +225,11 @@ imap_command_start (CamelImapStore *store, CamelFolder *folder,
                else
                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                             g_strerror (errno));
-               
+
                camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
                return FALSE;
        }
-       
+
        return TRUE;
 }
 
@@ -243,7 +243,7 @@ imap_command_start (CamelImapStore *store, CamelFolder *folder,
  * This method is for sending continuing responses to the IMAP server
  * after camel_imap_command() or camel_imap_command_response() returns
  * a continuation response.
- * 
+ *
  * This function assumes you have an exclusive lock on the imap stream.
  *
  * Return value: as for camel_imap_command(). On failure, the store's
@@ -258,7 +258,7 @@ camel_imap_command_continuation (CamelImapStore *store, const char *cmd,
 
        g_return_val_if_fail(store->ostream!=NULL, NULL);
        g_return_val_if_fail(store->istream!=NULL, NULL);
-       
+
        if (camel_stream_write (store->ostream, cmd, cmdlen) == -1 ||
            camel_stream_write (store->ostream, "\r\n", 2) == -1) {
                if (errno == EINTR)
@@ -271,7 +271,7 @@ camel_imap_command_continuation (CamelImapStore *store, const char *cmd,
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return NULL;
        }
-       
+
        return imap_read_response (store, ex);
 }
 
@@ -296,12 +296,12 @@ camel_imap_command_response (CamelImapStore *store, char **response,
 {
        CamelImapResponseType type;
        char *respbuf;
-       
+
        if (camel_imap_store_readline (store, &respbuf, ex) < 0) {
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return CAMEL_IMAP_RESPONSE_ERROR;
        }
-       
+
        switch (*respbuf) {
        case '*':
                if (!g_ascii_strncasecmp (respbuf, "* BYE", 5)) {
@@ -316,7 +316,7 @@ camel_imap_command_response (CamelImapStore *store, char **response,
                        type = CAMEL_IMAP_RESPONSE_ERROR;
                        break;
                }
-               
+
                /* Read the rest of the response. */
                type = CAMEL_IMAP_RESPONSE_UNTAGGED;
                respbuf = imap_read_untagged (store, respbuf, ex);
@@ -334,7 +334,7 @@ camel_imap_command_response (CamelImapStore *store, char **response,
                        camel_session_alert_user(((CamelService *)store)->session, CAMEL_SESSION_ALERT_WARNING, msg, FALSE);
                        g_free(msg);
                }
-               
+
                break;
        case '+':
                type = CAMEL_IMAP_RESPONSE_CONTINUATION;
@@ -344,11 +344,11 @@ camel_imap_command_response (CamelImapStore *store, char **response,
                break;
        }
        *response = respbuf;
-       
+
        if (type == CAMEL_IMAP_RESPONSE_ERROR ||
            type == CAMEL_IMAP_RESPONSE_TAGGED)
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-       
+
        return type;
 }
 
@@ -358,39 +358,39 @@ imap_read_response (CamelImapStore *store, CamelException *ex)
        CamelImapResponse *response;
        CamelImapResponseType type;
        char *respbuf, *p;
-       
+
        /* Get another lock so that when we reach the tagged
         * response and camel_imap_command_response unlocks,
         * we're still locked. This lock is owned by response
         * and gets unlocked when response is freed.
         */
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        response = g_new0 (CamelImapResponse, 1);
        if (store->current_folder && camel_disco_store_status (CAMEL_DISCO_STORE (store)) != CAMEL_DISCO_STORE_RESYNCING) {
                response->folder = store->current_folder;
                camel_object_ref (CAMEL_OBJECT (response->folder));
        }
-       
+
        response->untagged = g_ptr_array_new ();
        while ((type = camel_imap_command_response (store, &respbuf, ex))
               == CAMEL_IMAP_RESPONSE_UNTAGGED)
                g_ptr_array_add (response->untagged, respbuf);
-       
+
        if (type == CAMEL_IMAP_RESPONSE_ERROR) {
                camel_imap_response_free_without_processing (store, response);
                return NULL;
        }
-       
+
        response->status = respbuf;
-       
+
        /* Check for OK or continuation response. */
        if (*respbuf == '+')
                return response;
        p = strchr (respbuf, ' ');
        if (p && !g_ascii_strncasecmp (p, " OK", 3))
                return response;
-       
+
        /* We should never get BAD, or anything else but +, OK, or NO
         * for that matter.  Well, we could get BAD, treat as NO.
         */
@@ -403,7 +403,7 @@ imap_read_response (CamelImapStore *store, CamelException *ex)
                camel_imap_response_free_without_processing (store, response);
                return NULL;
        }
-       
+
        p += 3;
        if (!*p++)
                p = NULL;
@@ -426,23 +426,23 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
        GPtrArray *data;
        GString *str;
        char *end, *p, *s, *d;
-       
+
        p = strrchr (line, '{');
        if (!p)
                return line;
-       
+
        data = g_ptr_array_new ();
        fulllen = 0;
-       
+
        while (1) {
                str = g_string_new (line);
                g_free (line);
                fulllen += str->len;
                g_ptr_array_add (data, str);
-               
+
                if (!(p = strrchr (str->str, '{')) || p[1] == '-')
                        break;
-               
+
                /* HACK ALERT: We scan the non-literal part of the string, looking for possible s expression braces.
                   This assumes we're getting s-expressions, which we should be.
                   This is so if we get a blank line after a literal, in an s-expression, we can keep going, since
@@ -454,17 +454,17 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
                        else if (*s == ')')
                                sexp--;
                }
-               
+
                length = strtoul (p + 1, &end, 10);
                if (*end != '}' || *(end + 1) || end == p + 1 || length >= UINT_MAX - 2)
                        break;
                ldigits = end - (p + 1);
-               
+
                /* Read the literal */
                str = g_string_sized_new (length + 2);
                str->str[0] = '\n';
                nread = 0;
-               
+
                do {
                        if ((n = camel_stream_read (store->istream, str->str + nread + 1, length - nread)) == -1) {
                                if (errno == EINTR)
@@ -477,10 +477,10 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
                                g_string_free (str, TRUE);
                                goto lose;
                        }
-                       
+
                        nread += n;
                } while (n > 0 && nread < length);
-               
+
                if (nread < length) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                             _("Server response ended too soon."));
@@ -495,7 +495,7 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
                        fwrite(str->str+1, 1, length, stdout);
                        printf("<--\n");
                }
-               
+
                /* Fix up the literal, turning CRLFs into LF. Also, if
                 * we find any embedded NULs, strip them. This is
                 * dubious, but:
@@ -505,7 +505,7 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
                 *   - WU-imapd 12.264 (at least) will cheerily pass
                 *     NULs along if they are embedded in the message
                 */
-               
+
                s = d = str->str + 1;
                end = str->str + 1 + length;
                while (s < end) {
@@ -521,7 +521,7 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
                }
                *d = '\0';
                str->len = length + 1;
-               
+
                /* p points to the "{" in the line that starts the
                 * literal. The length of the CR-less response must be
                 * less than or equal to the length of the response
@@ -531,7 +531,7 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
                 * GString's length would be off...
                 */
                sprintf (p, "{%0*u}", ldigits, length);
-               
+
                fulllen += str->len;
                g_ptr_array_add (data, str);
 
@@ -546,7 +546,7 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
                                g_warning("Server sent empty line after a literal, assuming in error");
                } while (line[0] == 0 && sexp > 0);
        }
-       
+
        /* Now reassemble the data. */
        p = line = g_malloc (fulllen + 1);
        for (i = 0; i < data->len; i++) {
@@ -558,7 +558,7 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
        *p = '\0';
        g_ptr_array_free (data, TRUE);
        return line;
-       
+
  lose:
        for (i = 0; i < data->len; i++)
                g_string_free (data->pdata[i], TRUE);
@@ -581,13 +581,13 @@ camel_imap_response_free (CamelImapStore *store, CamelImapResponse *response)
        int i, number, exists = 0;
        GArray *expunged = NULL;
        char *resp, *p;
-       
+
        if (!response)
                return;
-       
+
        for (i = 0; i < response->untagged->len; i++) {
                resp = response->untagged->pdata[i];
-               
+
                if (response->folder) {
                        /* Check if it's something we need to handle. */
                        number = strtoul (resp + 2, &p, 10);
@@ -605,10 +605,10 @@ camel_imap_response_free (CamelImapStore *store, CamelImapResponse *response)
                }
                g_free (resp);
        }
-       
+
        g_ptr_array_free (response->untagged, TRUE);
        g_free (response->status);
-       
+
        if (response->folder) {
                if (exists > 0 || expunged) {
                        /* Update the summary */
@@ -617,10 +617,10 @@ camel_imap_response_free (CamelImapStore *store, CamelImapResponse *response)
                        if (expunged)
                                g_array_free (expunged, TRUE);
                }
-               
+
                camel_object_unref (CAMEL_OBJECT (response->folder));
        }
-       
+
        g_free (response);
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
@@ -639,7 +639,7 @@ camel_imap_response_free_without_processing (CamelImapStore *store,
 {
        if (!response)
                return;
-       
+
        if (response->folder) {
                camel_object_unref (CAMEL_OBJECT (response->folder));
                response->folder = NULL;
@@ -670,20 +670,20 @@ camel_imap_response_extract (CamelImapStore *store,
 {
        int len = strlen (type), i;
        char *resp;
-       
+
        len = strlen (type);
-       
+
        for (i = 0; i < response->untagged->len; i++) {
                resp = response->untagged->pdata[i];
                /* Skip "* ", and initial sequence number, if present */
                strtoul (resp + 2, &resp, 10);
                if (*resp == ' ')
                        resp = (char *) imap_next_word (resp);
-               
+
                if (!g_ascii_strncasecmp (resp, type, len))
                        break;
        }
-       
+
        if (i < response->untagged->len) {
                resp = response->untagged->pdata[i];
                g_ptr_array_remove_index (response->untagged, i);
@@ -693,7 +693,7 @@ camel_imap_response_extract (CamelImapStore *store,
                                      _("IMAP server response did not contain "
                                        "%s information"), type);
        }
-       
+
        camel_imap_response_free (store, response);
        return resp;
 }
@@ -717,14 +717,14 @@ camel_imap_response_extract_continuation (CamelImapStore *store,
                                          CamelException *ex)
 {
        char *status;
-       
+
        if (response->status && *response->status == '+') {
                status = response->status;
                response->status = NULL;
                camel_imap_response_free (store, response);
                return status;
        }
-       
+
        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                              _("Unexpected OK response from IMAP server: %s"),
                              response->status);
@@ -742,7 +742,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
        int num, len, i, arglen;
 
        args = g_ptr_array_new ();
-       
+
        /* Determine the length of the data */
        len = strlen (fmt);
        p = start = fmt;
@@ -750,7 +750,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
                p = strchr (start, '%');
                if (!p)
                        break;
-               
+
                switch (*++p) {
                case 'd':
                        num = va_arg (ap, int);
@@ -780,7 +780,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
                        } else if (*p == 'G') {
                                string = camel_utf8_utf7(string);
                        }
-                               
+
                        arglen = strlen (string);
                        g_ptr_array_add (args, string);
                        if (imap_is_atom (string)) {
@@ -803,7 +803,7 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
                        break;
                }
        }
-       
+
        /* Now write out the string */
        outptr = out = g_malloc (len + 1);
        p = start = fmt;
@@ -817,13 +817,13 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
                        strncpy (outptr, start, p - start);
                        outptr += p - start;
                }
-               
+
                switch (*++p) {
                case 'd':
                        num = GPOINTER_TO_INT (args->pdata[i++]);
                        outptr += sprintf (outptr, "%d", num);
                        break;
-                       
+
                case 's':
                        string = args->pdata[i++];
                        outptr += sprintf (outptr, "%s", string);
@@ -840,12 +840,12 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
                                        outptr += sprintf (outptr, "{%d+}\r\n%s", len, string);
                                } else {
                                        char *quoted = imap_quote_string (string);
-                                       
+
                                        outptr += sprintf (outptr, "%s", quoted);
                                        g_free (quoted);
                                }
                        }
-                       
+
                        if (*p == 'F' || *p == 'G')
                                g_free (string);
                        break;
@@ -853,10 +853,10 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
                        *outptr++ = '%';
                        *outptr++ = *p;
                }
-               
+
                start = *p ? p + 1 : p;
        }
-       
+
        g_ptr_array_free (args, TRUE);
 
        return out;
@@ -867,10 +867,10 @@ imap_command_strdup_printf (CamelImapStore *store, const char *fmt, ...)
 {
        va_list ap;
        char *result;
-       
+
        va_start (ap, fmt);
        result = imap_command_strdup_vprintf (store, fmt, ap);
        va_end (ap);
-       
+
        return result;
 }
index d9c5ca4..685d917 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-command.h: IMAP command sending/parsing routines */
 
-/* 
+/*
  * Authors:
  *   Dan Winship <danw@ximian.com>
  *   Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright (C) 2000, 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index c91ed4d..5b5a6d2 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-folder.c: class for an imap folder */
 
-/* 
+/*
  * Authors:
  *   Dan Winship <danw@ximian.com>
- *   Jeffrey Stedfast <fejj@ximian.com> 
+ *   Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright (C) 2000, 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -23,7 +23,7 @@
  * USA
  */
 
-#include <config.h> 
+#include <config.h>
 
 #include <ctype.h>
 #include <errno.h>
@@ -71,7 +71,7 @@
 #include "camel-imap-utils.h"
 #include "camel-imap-wrapper.h"
 
-#define d(x) 
+#define d(x)
 
 /* set to -1 for infinite size (suggested max command-line length is
  * 1000 octets (see rfc2683), so we should keep the uid-set length to
@@ -183,13 +183,13 @@ camel_imap_folder_init (gpointer object, gpointer klass)
 {
        CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (object);
        CamelFolder *folder = CAMEL_FOLDER (object);
-       
+
        folder->permanent_flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED |
                CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN;
-       
+
        folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
                                 CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
-       
+
        imap_folder->priv = g_malloc0(sizeof(*imap_folder->priv));
 #ifdef ENABLE_THREADS
        g_static_mutex_init(&imap_folder->priv->search_lock);
@@ -203,7 +203,7 @@ CamelType
 camel_imap_folder_get_type (void)
 {
        static CamelType camel_imap_folder_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_imap_folder_type == CAMEL_INVALID_TYPE) {
                parent_class = camel_disco_folder_get_type();
                camel_imap_folder_type =
@@ -215,7 +215,7 @@ camel_imap_folder_get_type (void)
                                             (CamelObjectInitFunc) camel_imap_folder_init,
                                             (CamelObjectFinalizeFunc) imap_finalize);
        }
-       
+
        return camel_imap_folder_type;
 }
 
@@ -296,9 +296,9 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
        GData *fetch_data;
        int i, count;
        char *resp;
-       
+
        count = camel_folder_summary_count (folder->summary);
-       
+
        for (i = 0; i < response->untagged->len; i++) {
                resp = response->untagged->pdata[i] + 2;
                if (!g_ascii_strncasecmp (resp, "FLAGS ", 6) && !perm_flags) {
@@ -306,7 +306,7 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
                        folder->permanent_flags = imap_parse_flag_list (&resp);
                } else if (!g_ascii_strncasecmp (resp, "OK [PERMANENTFLAGS ", 19)) {
                        resp += 19;
-                       
+
                        /* workaround for broken IMAP servers that send "* OK [PERMANENTFLAGS ()] Permanent flags"
                         * even tho they do allow storing flags. *Sigh* So many fucking broken IMAP servers out there. */
                        if ((perm_flags = imap_parse_flag_list (&resp)) != 0)
@@ -315,7 +315,7 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
                        validity = strtoul (resp + 16, NULL, 10);
                } else if (isdigit ((unsigned char)*resp)) {
                        unsigned long num = strtoul (resp, &resp, 10);
-                       
+
                        if (!g_ascii_strncasecmp (resp, " EXISTS", 7)) {
                                exists = num;
                                /* Remove from the response so nothing
@@ -336,11 +336,11 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
                                              _("Folder was destroyed and recreated on server."));
                        return;
                }
-               
+
                /* FIXME: find missing UIDs ? */
                return;
        }
-       
+
        if (!imap_summary->validity)
                imap_summary->validity = validity;
        else if (validity != imap_summary->validity) {
@@ -353,13 +353,13 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
                camel_imap_folder_changed (folder, exists, NULL, ex);
                return;
        }
-       
+
        /* If we've lost messages, we have to rescan everything */
        if (exists < count)
                imap_folder->need_rescan = TRUE;
        else if (count != 0 && !imap_folder->need_rescan) {
                CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
-               
+
                /* Similarly, if the UID of the highest message we
                 * know about has changed, then that indicates that
                 * messages have been both added and removed, so we
@@ -384,36 +384,36 @@ camel_imap_folder_selected (CamelFolder *folder, CamelImapResponse *response,
                        }
                        if (uid != 0 || val != count || g_ascii_strncasecmp (resp, " FETCH (", 8) != 0)
                                continue;
-                       
+
                        fetch_data = parse_fetch_response (imap_folder, resp + 7);
                        uid = strtoul (g_datalist_get_data (&fetch_data, "UID"), NULL, 10);
                        g_datalist_clear (&fetch_data);
                }
                camel_imap_response_free_without_processing (store, response);
-               
+
                info = camel_folder_summary_index (folder->summary, count - 1);
                val = strtoul (camel_message_info_uid (info), NULL, 10);
                camel_message_info_free(info);
                if (uid == 0 || uid != val)
                        imap_folder->need_rescan = TRUE;
        }
-       
+
        /* Now rescan if we need to */
        if (imap_folder->need_rescan) {
                imap_rescan (folder, exists, ex);
                return;
        }
-       
+
        /* If we don't need to rescan completely, but new messages
         * have been added, find out about them.
         */
        if (exists > count)
                camel_imap_folder_changed (folder, exists, NULL, ex);
-       
+
        /* And we're done. */
 }
 
-static void           
+static void
 imap_finalize (CamelObject *object)
 {
        CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (object);
@@ -620,14 +620,14 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
        CamelFolderChangeInfo *changes = NULL;
 
        imap_folder->need_rescan = FALSE;
-       
+
        summary_len = camel_folder_summary_count (folder->summary);
        if (summary_len == 0) {
                if (exists)
                        camel_imap_folder_changed (folder, exists, NULL, ex);
                return;
        }
-       
+
        /* Check UIDs and flags of all messages we already know of. */
        camel_operation_start (NULL, _("Scanning for changed messages in %s"), folder->name);
        info = camel_folder_summary_index (folder->summary, summary_len - 1);
@@ -639,34 +639,34 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
                camel_operation_end (NULL);
                return;
        }
-       
+
        new = g_malloc0 (summary_len * sizeof (*new));
        summary_got = 0;
        while ((type = camel_imap_command_response (store, &resp, ex)) == CAMEL_IMAP_RESPONSE_UNTAGGED) {
                GData *data;
                char *uid;
                guint32 flags;
-               
+
                data = parse_fetch_response (imap_folder, resp);
                g_free (resp);
                if (!data)
                        continue;
-               
+
                seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
                uid = g_datalist_get_data (&data, "UID");
                flags = GPOINTER_TO_UINT (g_datalist_get_data (&data, "FLAGS"));
-               
+
                if (!uid || !seq || seq > summary_len || seq < 0) {
                        g_datalist_clear (&data);
                        continue;
                }
-               
+
                camel_operation_progress (NULL, ++summary_got * 100 / summary_len);
                new[seq - 1].uid = g_strdup (uid);
                new[seq - 1].flags = flags;
                g_datalist_clear (&data);
        }
-       
+
        camel_operation_end (NULL);
        if (type == CAMEL_IMAP_RESPONSE_ERROR) {
                for (i = 0; i < summary_len && new[i].uid; i++)
@@ -674,10 +674,10 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
                g_free (new);
                return;
        }
-       
+
        /* Free the final tagged response */
        g_free (resp);
-       
+
        /* If we find a UID in the summary that doesn't correspond to
         * the UID in the folder, then either: (a) it's a real UID,
         * but the message was deleted on the server, or (b) it's a
@@ -689,7 +689,7 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
        for (i = 0; i < summary_len && new[i].uid; i++) {
                info = camel_folder_summary_index (folder->summary, i);
                iinfo = (CamelImapMessageInfo *)info;
-               
+
                if (strcmp (camel_message_info_uid (info), new[i].uid) != 0) {
                        camel_message_info_free(info);
                        seq = i + 1;
@@ -698,11 +698,11 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
                        summary_len--;
                        continue;
                }
-               
+
                /* Update summary flags */
                if (new[i].flags != iinfo->server_flags) {
                        guint32 server_set, server_cleared;
-                       
+
                        server_set = new[i].flags & ~iinfo->server_flags;
                        server_cleared = iinfo->server_flags & ~new[i].flags;
 
@@ -723,14 +723,14 @@ imap_rescan (CamelFolder *folder, int exists, CamelException *ex)
                camel_object_trigger_event(CAMEL_OBJECT (folder), "folder_changed", changes);
                camel_folder_change_info_free(changes);
        }
-       
+
        seq = i + 1;
-       
+
        /* Free remaining memory. */
        while (i < summary_len && new[i].uid)
                g_free (new[i++].uid);
        g_free (new);
-       
+
        /* Remove any leftover cached summary messages. (Yes, we
         * repeatedly add the same number to the removed array.
         * See RFC2060 7.4.1)
@@ -760,7 +760,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, char **set)
        CamelImapMessageInfo *info;
        int i, max, range;
        GString *gset;
-       
+
        matches = g_ptr_array_new ();
        gset = g_string_new ("");
        max = camel_folder_summary_count (folder->summary);
@@ -780,7 +780,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, char **set)
                        }
                        continue;
                }
-               
+
                g_ptr_array_add (matches, info);
                if (range != -1)
                        continue;
@@ -789,12 +789,12 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, char **set)
                        g_string_append_c (gset, ',');
                g_string_append_printf (gset, "%s", camel_message_info_uid (info));
        }
-       
+
        if (range != -1 && range != max - 1) {
                info = matches->pdata[matches->len - 1];
                g_string_append_printf (gset, ":%s", camel_message_info_uid (info));
        }
-       
+
        if (matches->len) {
                *set = gset->str;
                g_string_free (gset, FALSE);
@@ -825,15 +825,15 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
        char *set, *flaglist;
        gboolean unset;
        int i, j, max;
-       
+
        if (folder->permanent_flags == 0) {
                imap_sync_offline (folder, ex);
                return;
        }
-       
+
        camel_exception_init (&local_ex);
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        /* Find a message with changed flags, find all of the other
         * messages like it, sync them as a group, mark them as
         * updated, and continue.
@@ -842,7 +842,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
        for (i = 0; i < max; i++) {
                if (!(info = (CamelImapMessageInfo *)camel_folder_summary_index (folder->summary, i)))
                        continue;
-               
+
                if (!(info->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
                        camel_message_info_free((CamelMessageInfo *)info);
                        continue;
@@ -852,7 +852,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
                   empty-set of flags so... if this is true then we
                   want to unset the previously set flags.*/
                unset = !(info->info.flags & folder->permanent_flags);
-               
+
                /* Note: get_matching() uses UID_SET_LIMIT to limit
                   the size of the uid-set string. We don't have to
                   loop here to flush all the matching uids because
@@ -863,7 +863,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
                camel_message_info_free(info);
                if (matches == NULL)
                        continue;
-               
+
                /* Make sure we're connected before issuing commands */
                if (!camel_imap_store_connected(store, ex)) {
                        g_free(set);
@@ -873,17 +873,17 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
                /* FIXME: since we don't know the previously set flags,
                   if unset is TRUE then just unset all the flags? */
                flaglist = imap_create_flag_list (unset ? folder->permanent_flags : info->info.flags & folder->permanent_flags);
-               
+
                /* Note: to `unset' flags, use -FLAGS.SILENT (<flag list>) */
                response = camel_imap_command (store, folder, &local_ex,
                                               "UID STORE %s %sFLAGS.SILENT %s",
                                               set, unset ? "-" : "", flaglist);
                g_free (set);
                g_free (flaglist);
-               
+
                if (response)
                        camel_imap_response_free (store, response);
-               
+
                if (!camel_exception_is_set (&local_ex)) {
                        for (j = 0; j < matches->len; j++) {
                                info = matches->pdata[j];
@@ -892,29 +892,29 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
                        }
                        camel_folder_summary_touch (folder->summary);
                }
-               
+
                for (j = 0; j < matches->len; j++) {
                        info = matches->pdata[j];
                        camel_message_info_free(&info->info);
                }
                g_ptr_array_free (matches, TRUE);
-               
+
                /* We unlock here so that other threads can have a chance to grab the connect_lock */
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-               
+
                /* check for an exception */
                if (camel_exception_is_set (&local_ex)) {
                        camel_exception_xfer (ex, &local_ex);
                        return;
                }
-               
+
                /* Re-lock the connect_lock */
                CAMEL_SERVICE_REC_LOCK (store, connect_lock);
        }
-       
+
        /* Save the summary */
        imap_sync_offline (folder, ex);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
 
@@ -939,11 +939,11 @@ imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException
 {
        CamelFolderChangeInfo *changes;
        int i;
-       
+
        qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-       
+
        changes = camel_folder_change_info_new ();
-       
+
        for (i = 0; i < uids->len; i++) {
                camel_folder_summary_remove_uid (folder->summary, uids->pdata[i]);
                camel_folder_change_info_remove_uid (changes, uids->pdata[i]);
@@ -967,7 +967,7 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
        CamelImapResponse *response;
        int uid = 0;
        char *set;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
 
        if ((store->capabilities & IMAP_CAPABILITY_UIDPLUS) == 0) {
@@ -977,9 +977,9 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
                        return;
                }
        }
-       
+
        qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-       
+
        while (uid < uids->len) {
                set = imap_uid_array_to_set (folder->summary, uids, uid, UID_SET_LIMIT, &uid);
                response = camel_imap_command (store, folder, ex,
@@ -992,17 +992,17 @@ imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *
                        g_free (set);
                        return;
                }
-               
+
                if (store->capabilities & IMAP_CAPABILITY_UIDPLUS) {
                        response = camel_imap_command (store, folder, ex,
                                                       "UID EXPUNGE %s", set);
                } else
                        response = camel_imap_command (store, folder, ex, "EXPUNGE");
-               
+
                if (response)
                        camel_imap_response_free (store, response);
        }
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
 
@@ -1022,13 +1022,13 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
                imap_expunge_uids_online (folder, uids, ex);
                return;
        }
-       
+
        /* If we don't have UID EXPUNGE we need to avoid expunging any
         * of the wrong messages. So we search for deleted messages,
         * and any that aren't in our to-expunge list get temporarily
         * marked un-deleted.
         */
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
 
        ((CamelFolderClass *)CAMEL_OBJECT_GET_CLASS(folder))->sync(folder, 0, ex);
@@ -1047,32 +1047,32 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return;
        }
-       
+
        if (result[8] == ' ') {
                char *uid, *lasts = NULL;
                unsigned long euid, kuid;
                int ei, ki;
-               
+
                keep_uids = g_ptr_array_new ();
                mark_uids = g_ptr_array_new ();
-               
+
                /* Parse SEARCH response */
                for (uid = strtok_r (result + 9, " ", &lasts); uid; uid = strtok_r (NULL, " ", &lasts))
                        g_ptr_array_add (keep_uids, uid);
                qsort (keep_uids->pdata, keep_uids->len,
                       sizeof (void *), uid_compar);
-               
+
                /* Fill in "mark_uids", empty out "keep_uids" as needed */
                for (ei = ki = 0; ei < uids->len; ei++) {
                        euid = strtoul (uids->pdata[ei], NULL, 10);
-                       
+
                        for (kuid = 0; ki < keep_uids->len; ki++) {
                                kuid = strtoul (keep_uids->pdata[ki], NULL, 10);
-                               
+
                                if (kuid >= euid)
                                        break;
                        }
-                       
+
                        if (euid == kuid)
                                g_ptr_array_remove_index (keep_uids, ki);
                        else
@@ -1082,26 +1082,26 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
                /* Empty SEARCH result, meaning nothing is marked deleted
                 * on server.
                 */
-               
+
                keep_uids = NULL;
                mark_uids = uids;
        }
-       
+
        /* Unmark messages to be kept */
-       
+
        if (keep_uids) {
                char *uidset;
                int uid = 0;
-               
+
                while (uid < keep_uids->len) {
                        uidset = imap_uid_array_to_set (folder->summary, keep_uids, uid, UID_SET_LIMIT, &uid);
-                       
+
                        response = camel_imap_command (store, folder, ex,
                                                       "UID STORE %s -FLAGS.SILENT (\\Deleted)",
                                                       uidset);
-                       
+
                        g_free (uidset);
-                       
+
                        if (!response) {
                                g_ptr_array_free (keep_uids, TRUE);
                                g_ptr_array_free (mark_uids, TRUE);
@@ -1111,21 +1111,21 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
                        camel_imap_response_free (store, response);
                }
        }
-       
+
        /* Mark any messages that still need to be marked */
        if (mark_uids) {
                char *uidset;
                int uid = 0;
-               
+
                while (uid < mark_uids->len) {
                        uidset = imap_uid_array_to_set (folder->summary, mark_uids, uid, UID_SET_LIMIT, &uid);
-                       
+
                        response = camel_imap_command (store, folder, ex,
                                                       "UID STORE %s +FLAGS.SILENT (\\Deleted)",
                                                       uidset);
-                       
+
                        g_free (uidset);
-                       
+
                        if (!response) {
                                g_ptr_array_free (keep_uids, TRUE);
                                g_ptr_array_free (mark_uids, TRUE);
@@ -1138,37 +1138,37 @@ imap_expunge_uids_resyncing (CamelFolder *folder, GPtrArray *uids, CamelExceptio
                if (mark_uids != uids)
                        g_ptr_array_free (mark_uids, TRUE);
        }
-       
+
        /* Do the actual expunging */
        response = camel_imap_command (store, folder, ex, "EXPUNGE");
        if (response)
                camel_imap_response_free (store, response);
-       
+
        /* And fix the remaining messages if we mangled them */
        if (keep_uids) {
                char *uidset;
                int uid = 0;
-               
+
                while (uid < keep_uids->len) {
                        uidset = imap_uid_array_to_set (folder->summary, keep_uids, uid, UID_SET_LIMIT, &uid);
-                       
+
                        /* Don't pass ex if it's already been set */
                        response = camel_imap_command (store, folder,
                                                       camel_exception_is_set (ex) ? NULL : ex,
                                                       "UID STORE %s +FLAGS.SILENT (\\Deleted)",
                                                       uidset);
-                       
+
                        g_free (uidset);
                        if (response)
                                camel_imap_response_free (store, response);
                }
-               
+
                g_ptr_array_free (keep_uids, TRUE);
        }
 
        /* now we can free this, now that we're done with keep_uids */
        g_free (result);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
 
@@ -1181,7 +1181,7 @@ get_temp_uid (void)
        G_LOCK_DEFINE_STATIC (lock);
 
        G_LOCK (lock);
-       res = g_strdup_printf ("tempuid-%lx-%d", 
+       res = g_strdup_printf ("tempuid-%lx-%d",
                               (unsigned long) time (NULL),
                               counter++);
        G_UNLOCK (lock);
@@ -1234,15 +1234,15 @@ do_append (CamelFolder *folder, CamelMimeMessage *message,
        GByteArray *ba;
        char *flagstr, *end;
        guint32 flags = 0;
-       
+
        /* encode any 8bit parts so we avoid sending embedded nul-chars and such  */
        camel_mime_message_encode_8bit_parts (message);
-       
+
        /* FIXME: We could avoid this if we knew how big the message was. */
        memstream = camel_stream_mem_new ();
        ba = g_byte_array_new ();
        camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (memstream), ba);
-       
+
        streamfilter = camel_stream_filter_new_with_stream (memstream);
        crlf_filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE,
                                                  CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
@@ -1267,12 +1267,12 @@ retry:
                flagstr = imap_create_flag_list (flags);
        else
                flagstr = NULL;
-       
+
        response = camel_imap_command (store, NULL, ex, "APPEND %F%s%s {%d}",
                                       folder->full_name, flagstr ? " " : "",
                                       flagstr ? flagstr : "", ba->len);
        g_free (flagstr);
-       
+
        if (!response) {
                if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_SERVICE_INVALID && !store->nocustomappend) {
                        camel_exception_clear(ex);
@@ -1288,7 +1288,7 @@ retry:
                g_byte_array_free (ba, TRUE);
                return NULL;
        }
-       
+
        /* send the rest of our data - the mime message */
        response2 = camel_imap_command_continuation (store, (const char *) ba->data, ba->len, ex);
        g_byte_array_free (ba, TRUE);
@@ -1297,7 +1297,7 @@ retry:
        camel_imap_response_free (store, response);
        if (!response2)
                return response2;
-       
+
        if (store->capabilities & IMAP_CAPABILITY_UIDPLUS) {
                *uid = camel_strstrcase (response2->status, "[APPENDUID ");
                if (*uid)
@@ -1312,7 +1312,7 @@ retry:
                }
        } else
                *uid = NULL;
-       
+
        return response2;
 }
 
@@ -1330,7 +1330,7 @@ imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
        response = do_append (folder, message, info, &uid, ex);
        if (!response)
                return;
-       
+
        if (uid) {
                /* Cache first, since freeing response may trigger a
                 * summary update that will want this information.
@@ -1346,9 +1346,9 @@ imap_append_online (CamelFolder *folder, CamelMimeMessage *message,
                        g_free (uid);
        } else if (appended_uid)
                *appended_uid = NULL;
-       
+
        camel_imap_response_free (store, response);
-       
+
        /* Make sure a "folder_changed" is emitted. */
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
        if (store->current_folder != folder ||
@@ -1365,15 +1365,15 @@ imap_append_resyncing (CamelFolder *folder, CamelMimeMessage *message,
        CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
        CamelImapResponse *response;
        char *uid;
-       
+
        response = do_append (folder, message, info, &uid, ex);
        if (!response)
                return;
-       
+
        if (uid) {
                CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
                const char *olduid = camel_message_info_uid (info);
-               
+
                CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock);
                camel_imap_message_cache_copy (imap_folder->cache, olduid,
                                               imap_folder->cache, uid, ex);
@@ -1385,7 +1385,7 @@ imap_append_resyncing (CamelFolder *folder, CamelMimeMessage *message,
                        g_free (uid);
        } else if (appended_uid)
                *appended_uid = NULL;
-       
+
        camel_imap_response_free (store, response);
 }
 
@@ -1523,7 +1523,7 @@ do_copy (CamelFolder *source, GPtrArray *uids,
        CamelImapResponse *response;
        char *uidset;
        int uid = 0, last=0, i;
-       
+
        while (uid < uids->len && !camel_exception_is_set (ex)) {
                uidset = imap_uid_array_to_set (source->summary, uids, uid, UID_SET_LIMIT, &uid);
 
@@ -1561,9 +1561,9 @@ imap_transfer_online (CamelFolder *source, GPtrArray *uids,
                return;
 
        count = camel_folder_summary_count (dest->summary);
-       
+
        qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-       
+
        /* Now copy the messages */
        do_copy(source, uids, dest, delete_originals, ex);
        if (camel_exception_is_set (ex))
@@ -1573,7 +1573,7 @@ imap_transfer_online (CamelFolder *source, GPtrArray *uids,
        if (store->current_folder != dest ||
            camel_folder_summary_count (dest->summary) == count)
                camel_folder_refresh_info (dest, ex);
-       
+
        /* FIXME */
        if (transferred_uids)
                *transferred_uids = NULL;
@@ -1590,9 +1590,9 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
        const char *uid;
        CamelMimeMessage *message;
        CamelMessageInfo *info;
-       
+
        qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
-       
+
        /* This is trickier than append_resyncing, because some of
         * the messages we are copying may have been copied or
         * appended into @source while we were offline, in which case
@@ -1719,11 +1719,11 @@ static void
 part_spec_push (struct _part_spec_stack **stack, int part)
 {
        struct _part_spec_stack *node;
-       
+
        node = g_new (struct _part_spec_stack, 1);
        node->parent = *stack;
        node->part = part;
-       
+
        *stack = node;
 }
 
@@ -1732,15 +1732,15 @@ part_spec_pop (struct _part_spec_stack **stack)
 {
        struct _part_spec_stack *node;
        int part;
-       
+
        g_return_val_if_fail (*stack != NULL, 0);
-       
+
        node = *stack;
        *stack = node->parent;
-       
+
        part = node->part;
        g_free (node);
-       
+
        return part;
 }
 
@@ -1752,11 +1752,11 @@ content_info_get_part_spec (CamelMessageContentInfo *ci)
        char *part_spec, *buf;
        size_t len = 1;
        int part;
-       
+
        node = ci;
        while (node->parent) {
                CamelMessageContentInfo *child;
-               
+
                /* FIXME: is this only supposed to apply if 'node' is a multipart? */
                if (node->parent->parent &&
                                camel_content_type_is (node->parent->type, "message", "*") &&
@@ -1764,32 +1764,32 @@ content_info_get_part_spec (CamelMessageContentInfo *ci)
                        node = node->parent;
                        continue;
                }
-               
+
                child = node->parent->childs;
                for (part = 1; child; part++) {
                        if (child == node)
                                break;
-                       
+
                        child = child->next;
                }
-               
+
                part_spec_push (&stack, part);
-               
+
                len += 2;
                while ((part = part / 10))
                        len++;
-               
+
                node = node->parent;
        }
-       
+
        buf = part_spec = g_malloc (len);
        part_spec[0] = '\0';
-       
+
        while (stack) {
                part = part_spec_pop (&stack);
                buf += sprintf (buf, "%d%s", part, stack ? "." : "");
        }
-       
+
        return part_spec;
 }
 
@@ -1805,7 +1805,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
        CamelDataWrapper *content = NULL;
        CamelStream *stream;
        char *part_spec;
-       
+
        part_spec = content_info_get_part_spec (ci);
 
        d(printf("get content '%s' '%s' (frommsg = %d)\n", part_spec, camel_content_type_format(ci->type), frommsg));
@@ -1815,22 +1815,22 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
                CamelMultipartSigned *body_mp;
                char *spec;
                int ret;
-               
+
                /* Note: because we get the content parts uninterpreted anyway, we could potentially
                   just use the normalmultipart code, except that multipart/signed wont let you yet! */
-               
+
                body_mp = camel_multipart_signed_new ();
                /* need to set this so it grabs the boundary and other info about the signed type */
                /* we assume that part->content_type is more accurate/full than ci->type */
                camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (body_mp), CAMEL_DATA_WRAPPER (part)->mime_type);
-               
+
                spec = g_alloca(strlen(part_spec) + 6);
                if (frommsg)
                        sprintf(spec, part_spec[0] ? "%s.TEXT" : "TEXT", part_spec);
                else
                        strcpy(spec, part_spec);
                g_free(part_spec);
-               
+
                stream = camel_imap_folder_fetch_data (imap_folder, uid, spec, FALSE, ex);
                if (stream) {
                        ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (body_mp), stream);
@@ -1840,30 +1840,30 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
                                return NULL;
                        }
                }
-               
+
                return (CamelDataWrapper *) body_mp;
        } else if (camel_content_type_is (ci->type, "multipart", "*")) {
                CamelMultipart *body_mp;
                char *child_spec;
                int speclen, num, isdigest;
-               
+
                if (camel_content_type_is (ci->type, "multipart", "encrypted"))
                        body_mp = (CamelMultipart *) camel_multipart_encrypted_new ();
                else
                        body_mp = camel_multipart_new ();
-               
+
                /* need to set this so it grabs the boundary and other info about the multipart */
                /* we assume that part->content_type is more accurate/full than ci->type */
                camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (body_mp), CAMEL_DATA_WRAPPER (part)->mime_type);
                isdigest = camel_content_type_is(((CamelDataWrapper *)part)->mime_type, "multipart", "digest");
-               
+
                speclen = strlen (part_spec);
                child_spec = g_malloc (speclen + 17); /* dot + 10 + dot + MIME + nul */
                memcpy (child_spec, part_spec, speclen);
                if (speclen > 0)
                        child_spec[speclen++] = '.';
                g_free (part_spec);
-               
+
                ci = ci->childs;
                num = 1;
                while (ci) {
@@ -1871,7 +1871,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
                        stream = camel_imap_folder_fetch_data (imap_folder, uid, child_spec, FALSE, ex);
                        if (stream) {
                                int ret;
-                               
+
                                part = camel_mime_part_new ();
                                ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (part), stream);
                                camel_object_unref (CAMEL_OBJECT (stream));
@@ -1881,10 +1881,10 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
                                        g_free (child_spec);
                                        return NULL;
                                }
-                               
+
                                content = get_content (imap_folder, uid, part, ci, FALSE, ex);
                        }
-                       
+
                        if (!stream || !content) {
                                camel_object_unref (CAMEL_OBJECT (body_mp));
                                g_free (child_spec);
@@ -1916,12 +1916,12 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
 
                        camel_multipart_add_part (body_mp, part);
                        camel_object_unref(part);
-                       
+
                        ci = ci->next;
                }
-               
+
                g_free (child_spec);
-               
+
                return (CamelDataWrapper *) body_mp;
        } else if (camel_content_type_is (ci->type, "message", "rfc822")) {
                content = (CamelDataWrapper *) get_message (imap_folder, uid, ci->childs, ex);
@@ -1975,7 +1975,7 @@ get_message (CamelImapFolder *imap_folder, const char *uid,
                camel_object_unref (CAMEL_OBJECT (msg));
                return NULL;
        }
-       
+
        content = get_content (imap_folder, uid, CAMEL_MIME_PART (msg), ci, TRUE, ex);
        if (!content) {
                camel_object_unref (CAMEL_OBJECT (msg));
@@ -1994,7 +1994,7 @@ get_message (CamelImapFolder *imap_folder, const char *uid,
        camel_data_wrapper_set_mime_type_field(content, camel_mime_part_get_content_type((CamelMimePart *)msg));
        camel_medium_set_content_object (CAMEL_MEDIUM (msg), content);
        camel_object_unref (CAMEL_OBJECT (content));
-       
+
        return msg;
 }
 
@@ -2006,7 +2006,7 @@ get_message_simple (CamelImapFolder *imap_folder, const char *uid,
 {
        CamelMimeMessage *msg;
        int ret;
-       
+
        if (!stream) {
                stream = camel_imap_folder_fetch_data (imap_folder, uid, "",
                                                       FALSE, ex);
@@ -2034,7 +2034,7 @@ content_info_incomplete (CamelMessageContentInfo *ci)
 {
        if (!ci->type)
                return TRUE;
-       
+
        if (camel_content_type_is (ci->type, "multipart", "*")
            || camel_content_type_is (ci->type, "message", "rfc822")) {
                if (!ci->childs)
@@ -2094,7 +2094,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                                GData *fetch_data = NULL;
                                char *body, *found_uid;
                                int i;
-                               
+
                                CAMEL_SERVICE_REC_LOCK(store, connect_lock);
                                if (!camel_imap_store_connected(store, ex)) {
                                        CAMEL_SERVICE_REC_UNLOCK(store, connect_lock);
@@ -2102,7 +2102,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                                                             _("This message is not currently available"));
                                        goto fail;
                                }
-                               
+
                                response = camel_imap_command (store, folder, ex, "UID FETCH %s BODY", uid);
                                CAMEL_SERVICE_REC_UNLOCK(store, connect_lock);
 
@@ -2119,7 +2119,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                                                        body = NULL;
                                                }
                                        }
-                                       
+
                                        if (body) {
                                                /* NB: small race here, setting the info.content */
                                                imap_parse_body ((const char **) &body, folder, mi->info.content);
@@ -2128,7 +2128,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
 
                                        if (fetch_data)
                                                g_datalist_clear (&fetch_data);
-                                       
+
                                        camel_imap_response_free (store, response);
                                } else {
                                        camel_exception_clear(ex);
@@ -2140,7 +2140,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                                camel_message_info_dump((CamelMessageInfo *)mi);
                                camel_debug_end();
                        }
-                       
+
                        /* FETCH returned OK, but we didn't parse a BODY
                         * response. Courier will return invalid BODY
                         * responses for invalidly MIMEd messages, so
@@ -2161,7 +2161,7 @@ done:     /* FIXME, this shouldn't be done this way. */
                camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Source", store->base_url);
 fail:
        camel_message_info_free(&mi->info);
-       
+
        return msg;
 }
 
@@ -2198,9 +2198,9 @@ decode_time (const unsigned char **in, int *hour, int *min, int *sec)
 {
        register const unsigned char *inptr;
        int *val, colons = 0;
-       
+
        *hour = *min = *sec = 0;
-       
+
        val = hour;
        for (inptr = *in; *inptr && !isspace ((int) *inptr); inptr++) {
                if (*inptr == ':') {
@@ -2220,9 +2220,9 @@ decode_time (const unsigned char **in, int *hour, int *min, int *sec)
                else
                        *val = (*val * 10) + (*inptr - '0');
        }
-       
+
        *in = inptr;
-       
+
        return TRUE;
 }
 
@@ -2234,52 +2234,52 @@ decode_internaldate (const unsigned char *in)
        unsigned char *buf;
        struct tm tm;
        time_t date;
-       
+
        memset ((void *) &tm, 0, sizeof (struct tm));
-       
+
        tm.tm_mday = strtoul ((char *) inptr, (char **) &buf, 10);
        if (buf == inptr || *buf != '-')
                return (time_t) -1;
-       
+
        inptr = buf + 1;
        if (inptr[3] != '-')
                return (time_t) -1;
-       
+
        for (n = 0; n < 12; n++) {
                if (!g_ascii_strncasecmp ((gchar *) inptr, tm_months[n], 3))
                        break;
        }
-       
+
        if (n >= 12)
                return (time_t) -1;
-       
+
        tm.tm_mon = n;
-       
+
        inptr += 4;
-       
+
        n = strtoul ((char *) inptr, (char **) &buf, 10);
        if (buf == inptr || *buf != ' ')
                return (time_t) -1;
-       
+
        tm.tm_year = n - 1900;
-       
+
        inptr = buf + 1;
        if (!decode_time (&inptr, &hour, &min, &sec))
                return (time_t) -1;
-       
+
        tm.tm_hour = hour;
        tm.tm_min = min;
        tm.tm_sec = sec;
-       
+
        n = strtol ((char *) inptr, NULL, 10);
-       
+
        date = e_mktime_utc (&tm);
-       
+
        /* date is now GMT of the time we want, but not offset by the timezone ... */
-       
+
        /* this should convert the time to the GMT equiv time */
        date -= ((n / 100) * 60 * 60) + (n % 100) * 60;
-       
+
        return date;
 }
 
@@ -2292,32 +2292,32 @@ add_message_from_data (CamelFolder *folder, GPtrArray *messages,
        CamelImapMessageInfo *mi;
        const char *idate;
        int seq;
-       
+
        seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
        if (seq < first)
                return;
        stream = g_datalist_get_data (&data, "BODY_PART_STREAM");
        if (!stream)
                return;
-       
+
        if (seq - first >= messages->len)
                g_ptr_array_set_size (messages, seq - first + 1);
-       
+
        msg = camel_mime_message_new ();
        if (camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), stream) == -1) {
                camel_object_unref (CAMEL_OBJECT (msg));
                return;
        }
-       
+
        mi = (CamelImapMessageInfo *)camel_folder_summary_info_new_from_message (folder->summary, msg);
        camel_object_unref (CAMEL_OBJECT (msg));
-       
+
        if ((idate = g_datalist_get_data (&data, "INTERNALDATE")))
                mi->info.date_received = decode_internaldate ((const unsigned char *) idate);
-       
+
        if (mi->info.date_received == -1)
                mi->info.date_received = mi->info.date_sent;
-       
+
        messages->pdata[seq - first] = mi;
 }
 
@@ -2345,7 +2345,7 @@ imap_update_summary (CamelFolder *folder, int exists,
        CamelStream *stream;
        char *uid, *resp;
        GData *data;
-       
+
        if (store->server_level >= IMAP_LEVEL_IMAP4REV1) {
                if (store->headers == IMAP_FETCH_ALL_HEADERS)
                        header_spec = g_string_new ("HEADER");
@@ -2368,7 +2368,7 @@ imap_update_summary (CamelFolder *folder, int exists,
                header_spec = g_string_new ("0");
 
        d(printf("Header is : %s", header_spec->str));
-       
+
        /* Figure out if any of the new messages are already cached (which
         * may be the case if we're re-syncing after disconnected operation).
         * If so, get their UIDs, FLAGS, and SIZEs. If not, get all that
@@ -2382,7 +2382,7 @@ imap_update_summary (CamelFolder *folder, int exists,
                camel_message_info_free(&mi->info);
        } else
                uidval = 0;
-       
+
        size = (exists - seq) * (IMAP_PRETEND_SIZEOF_FLAGS + IMAP_PRETEND_SIZEOF_SIZE + IMAP_PRETEND_SIZEOF_HEADERS);
        got = 0;
        if (!camel_imap_command_start (store, folder, ex,
@@ -2392,7 +2392,7 @@ imap_update_summary (CamelFolder *folder, int exists,
                return;
        }
        camel_operation_start (NULL, _("Fetching summary information for new messages in %s"), folder->name);
-       
+
        /* Parse the responses. We can't add a message to the summary
         * until we've gotten its headers, and there's no guarantee
         * the server will send the responses in a useful order...
@@ -2405,13 +2405,13 @@ imap_update_summary (CamelFolder *folder, int exists,
                g_free (resp);
                if (!data)
                        continue;
-               
+
                seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
                if (seq < first) {
                        g_datalist_clear (&data);
                        continue;
                }
-               
+
                if (g_datalist_get_data (&data, "FLAGS"))
                        got += IMAP_PRETEND_SIZEOF_FLAGS;
                if (g_datalist_get_data (&data, "RFC822.SIZE"))
@@ -2419,25 +2419,25 @@ imap_update_summary (CamelFolder *folder, int exists,
                stream = g_datalist_get_data (&data, "BODY_PART_STREAM");
                if (stream) {
                        got += IMAP_PRETEND_SIZEOF_HEADERS;
-                       
+
                        /* Use the stream now so we don't tie up many
                         * many fds if we're fetching many many messages.
                         */
                        add_message_from_data (folder, messages, first, data);
                        g_datalist_set_data (&data, "BODY_PART_STREAM", NULL);
                }
-               
+
                camel_operation_progress (NULL, got * 100 / size);
                g_ptr_array_add (fetch_data, data);
        }
        camel_operation_end (NULL);
-       
+
        if (type == CAMEL_IMAP_RESPONSE_ERROR)
                goto lose;
-       
+
        /* Free the final tagged response */
        g_free (resp);
-       
+
        /* Figure out which headers we still need to fetch. */
        needheaders = g_ptr_array_new ();
        size = got = 0;
@@ -2445,24 +2445,24 @@ imap_update_summary (CamelFolder *folder, int exists,
                data = fetch_data->pdata[i];
                if (g_datalist_get_data (&data, "BODY_PART_LEN"))
                        continue;
-               
+
                uid = g_datalist_get_data (&data, "UID");
                if (uid) {
                        g_ptr_array_add (needheaders, uid);
                        size += IMAP_PRETEND_SIZEOF_HEADERS;
                }
        }
-       
+
        /* And fetch them */
        if (needheaders->len) {
                char *uidset;
                int uid = 0;
-               
+
                qsort (needheaders->pdata, needheaders->len,
                       sizeof (void *), uid_compar);
-               
+
                camel_operation_start (NULL, _("Fetching summary information for new messages in %s"), folder->name);
-               
+
                while (uid < needheaders->len) {
                        uidset = imap_uid_array_to_set (folder->summary, needheaders, uid, UID_SET_LIMIT, &uid);
                        if (!camel_imap_command_start (store, folder, ex,
@@ -2475,14 +2475,14 @@ imap_update_summary (CamelFolder *folder, int exists,
                                goto lose;
                        }
                        g_free (uidset);
-                       
+
                        while ((type = camel_imap_command_response (store, &resp, ex))
                               == CAMEL_IMAP_RESPONSE_UNTAGGED) {
                                data = parse_fetch_response (imap_folder, resp);
                                g_free (resp);
                                if (!data)
                                        continue;
-                               
+
                                stream = g_datalist_get_data (&data, "BODY_PART_STREAM");
                                if (stream) {
                                        add_message_from_data (folder, messages, first, data);
@@ -2491,33 +2491,33 @@ imap_update_summary (CamelFolder *folder, int exists,
                                }
                                g_datalist_clear (&data);
                        }
-                       
+
                        if (type == CAMEL_IMAP_RESPONSE_ERROR) {
                                g_ptr_array_free (needheaders, TRUE);
                                camel_operation_end (NULL);
                                goto lose;
                        }
                }
-               g_string_free (header_spec, TRUE);      
+               g_string_free (header_spec, TRUE);
                g_ptr_array_free (needheaders, TRUE);
                camel_operation_end (NULL);
        }
-       
+
        /* Now finish up summary entries (fix UIDs, set flags and size) */
        for (i = 0; i < fetch_data->len; i++) {
                data = fetch_data->pdata[i];
-               
+
                seq = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE"));
                if (seq >= first + messages->len) {
                        g_datalist_clear (&data);
                        continue;
                }
-               
+
                mi = messages->pdata[seq - first];
                if (mi == NULL) {
                        CamelMessageInfo *pmi = NULL;
                        int j;
-                       
+
                        /* This is a kludge around a bug in Exchange
                         * 5.5 that sometimes claims multiple messages
                         * have the same UID. See bug #17694 for
@@ -2527,23 +2527,23 @@ imap_update_summary (CamelFolder *folder, int exists,
                         * will have a clone in his/her message-list,
                         * but at least we don't crash.
                         */
-                       
+
                        /* find the previous valid message info */
                        for (j = seq - first - 1; j >= 0; j--) {
                                pmi = messages->pdata[j];
                                if (pmi != NULL)
                                        break;
                        }
-                       
+
                        if (pmi == NULL) {
                                /* Server response is *really* fucked up,
                                   I guess we just pretend it never happened? */
                                continue;
                        }
-                       
+
                        mi = (CamelImapMessageInfo *)camel_message_info_clone(pmi);
                }
-               
+
                uid = g_datalist_get_data (&data, "UID");
                if (uid)
                        mi->info.uid = g_strdup (uid);
@@ -2559,11 +2559,11 @@ imap_update_summary (CamelFolder *folder, int exists,
                size = GPOINTER_TO_INT (g_datalist_get_data (&data, "RFC822.SIZE"));
                if (size)
                        mi->info.size = size;
-               
+
                g_datalist_clear (&data);
        }
        g_ptr_array_free (fetch_data, TRUE);
-       
+
        /* And add the entries to the summary, etc. */
        for (i = 0; i < messages->len; i++) {
                mi = messages->pdata[i];
@@ -2588,19 +2588,19 @@ imap_update_summary (CamelFolder *folder, int exists,
                                if (folder->summary->messages->pdata[seq] == info)
                                        break;
                        }
-                       
+
                        g_warning("Message already present? %s", camel_message_info_uid(mi));
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                              _("Unexpected server response: Identical UIDs provided for messages %d and %d"),
                                              seq + 1, i + first);
-                       
+
                        camel_message_info_free(&info->info);
                        break;
                }
-               
+
                camel_folder_summary_add (folder->summary, (CamelMessageInfo *)mi);
                camel_folder_change_info_add_uid (changes, camel_message_info_uid (mi));
-               
+
                if ((mi->info.flags & CAMEL_IMAP_MESSAGE_RECENT))
                        camel_folder_change_info_recent_uid(changes, camel_message_info_uid (mi));
        }
@@ -2609,11 +2609,11 @@ imap_update_summary (CamelFolder *folder, int exists,
                if ((mi = messages->pdata[i]))
                        camel_message_info_free(&mi->info);
        }
-       
+
        g_ptr_array_free (messages, TRUE);
-       
+
        return;
-       
+
  lose:
        if (fetch_data) {
                for (i = 0; i < fetch_data->len; i++) {
@@ -2640,11 +2640,11 @@ camel_imap_folder_changed (CamelFolder *folder, int exists,
        CamelFolderChangeInfo *changes;
        CamelMessageInfo *info;
        int len;
-       
+
        changes = camel_folder_change_info_new ();
        if (expunged) {
                int i, id;
-               
+
                for (i = 0; i < expunged->len; i++) {
                        id = g_array_index (expunged, int, i);
                        info = camel_folder_summary_index (folder->summary, id - 1);
@@ -2653,7 +2653,7 @@ camel_imap_folder_changed (CamelFolder *folder, int exists,
                                /* I guess a message that we never retrieved got expunged? */
                                continue;
                        }
-                       
+
                        camel_folder_change_info_remove_uid (changes, camel_message_info_uid (info));
                        CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock);
                        camel_imap_message_cache_remove (imap_folder->cache, camel_message_info_uid (info));
@@ -2662,14 +2662,14 @@ camel_imap_folder_changed (CamelFolder *folder, int exists,
                        camel_message_info_free(info);
                }
        }
-       
+
        len = camel_folder_summary_count (folder->summary);
        if (exists > len)
                imap_update_summary (folder, exists, changes, ex);
-       
+
        if (camel_folder_change_info_changed (changes))
                camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
-       
+
        camel_folder_change_info_free (changes);
        camel_folder_summary_save (folder->summary);
 }
@@ -2703,7 +2703,7 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
        GData *fetch_data;
        char *found_uid;
        int i;
-       
+
        /* EXPUNGE responses have to modify the cache, which means
         * they have to grab the cache_lock while holding the
         * connect_lock.
@@ -2721,7 +2721,7 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
                stream = camel_imap_message_cache_get (imap_folder->cache, uid, "", ex);
        }
        CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock);
-       
+
        if (stream || cache_only)
                return stream;
 
@@ -2737,7 +2737,7 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return NULL;
        }
-       
+
        camel_exception_clear (ex);
        if (store->server_level < IMAP_LEVEL_IMAP4REV1 && !*section_text) {
                response = camel_imap_command (store, folder, ex,
@@ -2750,19 +2750,19 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
        }
        /* We won't need the connect_lock again after this. */
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-       
+
        if (!response) {
                CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock);
                return NULL;
        }
-       
+
        for (i = 0; i < response->untagged->len; i++) {
                fetch_data = parse_fetch_response (imap_folder, response->untagged->pdata[i]);
                found_uid = g_datalist_get_data (&fetch_data, "UID");
                stream = g_datalist_get_data (&fetch_data, "BODY_PART_STREAM");
                if (found_uid && stream && !strcmp (uid, found_uid))
                        break;
-               
+
                g_datalist_clear (&fetch_data);
                stream = NULL;
        }
@@ -2775,7 +2775,7 @@ camel_imap_folder_fetch_data (CamelImapFolder *imap_folder, const char *uid,
                camel_object_ref (CAMEL_OBJECT (stream));
                g_datalist_clear (&fetch_data);
        }
-       
+
        return stream;
 }
 
@@ -2786,10 +2786,10 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
        char *start, *part_spec = NULL, *body = NULL, *uid = NULL, *idate = NULL;
        gboolean cache_header = TRUE, header = FALSE;
        size_t body_len = 0;
-       
+
        if (*response != '(') {
                long seq;
-               
+
                if (*response != '*' || *(response + 1) != ' ')
                        return NULL;
                seq = strtoul (response + 2, &response, 10);
@@ -2798,35 +2798,35 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
                if (g_ascii_strncasecmp (response, " FETCH (", 8) != 0)
                        return NULL;
                response += 7;
-               
+
                g_datalist_set_data (&data, "SEQUENCE", GINT_TO_POINTER (seq));
        }
-       
+
        do {
                /* Skip the initial '(' or the ' ' between elements */
                response++;
-               
+
                if (!g_ascii_strncasecmp (response, "FLAGS ", 6)) {
                        guint32 flags;
-                       
+
                        response += 6;
                        /* FIXME user flags */
                        flags = imap_parse_flag_list (&response);
-                       
+
                        g_datalist_set_data (&data, "FLAGS", GUINT_TO_POINTER (flags));
                } else if (!g_ascii_strncasecmp (response, "RFC822.SIZE ", 12)) {
                        unsigned long size;
-                       
+
                        response += 12;
                        size = strtoul (response, &response, 10);
                        g_datalist_set_data (&data, "RFC822.SIZE", GUINT_TO_POINTER (size));
                } else if (!g_ascii_strncasecmp (response, "BODY[", 5) ||
                           !g_ascii_strncasecmp (response, "RFC822 ", 7)) {
                        char *p;
-                       
+
                        if (*response == 'B') {
                                response += 5;
-                               
+
                                /* HEADER], HEADER.FIELDS (...)], or 0] */
                                if (!g_ascii_strncasecmp (response, "HEADER", 6)) {
                                        header = TRUE;
@@ -2834,31 +2834,31 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
                                                cache_header = FALSE;
                                } else if (!g_ascii_strncasecmp (response, "0]", 2))
                                        header = TRUE;
-                               
+
                                p = strchr (response, ']');
                                if (!p || *(p + 1) != ' ')
                                        break;
-                               
+
                                if (cache_header)
                                        part_spec = g_strndup (response, p - response);
                                else
                                        part_spec = g_strdup ("HEADER.FIELDS");
-                               
+
                                response = p + 2;
                        } else {
                                part_spec = g_strdup ("");
                                response += 7;
-                               
+
                                if (!g_ascii_strncasecmp (response, "HEADER", 6))
                                        header = TRUE;
                        }
-                       
+
                        body = imap_parse_nstring ((const char **) &response, &body_len);
                        if (!response) {
                                g_free (part_spec);
                                break;
                        }
-                       
+
                        if (!body)
                                body = g_strdup ("");
                        g_datalist_set_data_full (&data, "BODY_PART_SPEC", part_spec, g_free);
@@ -2875,14 +2875,14 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
                        }
                } else if (!g_ascii_strncasecmp (response, "UID ", 4)) {
                        int len;
-                       
+
                        len = strcspn (response + 4, " )");
                        uid = g_strndup (response + 4, len);
                        g_datalist_set_data_full (&data, "UID", uid, g_free);
                        response += 4 + len;
                } else if (!g_ascii_strncasecmp (response, "INTERNALDATE ", 13)) {
                        int len;
-                       
+
                        response += 13;
                        if (*response == '"') {
                                response++;
@@ -2896,15 +2896,15 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
                        break;
                }
        } while (response && *response != ')');
-       
+
        if (!response || *response != ')') {
                g_datalist_clear (&data);
                return NULL;
        }
-       
+
        if (uid && body) {
                CamelStream *stream;
-               
+
                if (header && !cache_header) {
                        stream = camel_stream_mem_new_with_buffer (body, body_len);
                } else {
@@ -2916,12 +2916,12 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
                        if (stream == NULL)
                                stream = camel_stream_mem_new_with_buffer (body, body_len);
                }
-               
+
                if (stream)
                        g_datalist_set_data_full (&data, "BODY_PART_STREAM", stream,
                                                  (GDestroyNotify) camel_object_unref);
        }
-       
+
        return data;
 }
 
index 607ba6f..1b4d3e9 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-folder.h: class for an imap folder */
 
-/* 
+/*
  * Authors:
  *   Dan Winship <danw@ximian.com>
- *   Jeffrey Stedfast <fejj@ximian.com> 
+ *   Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright (C) 2000, 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -42,7 +42,7 @@ struct _CamelImapFolder {
        CamelDiscoFolder parent_object;
 
         struct _CamelImapFolderPrivate *priv;
-       
+
        CamelFolderSearch *search;
        CamelImapMessageCache *cache;
 
@@ -54,8 +54,8 @@ struct _CamelImapFolder {
 typedef struct {
        CamelDiscoFolderClass parent_class;
 
-       /* Virtual methods */   
-       
+       /* Virtual methods */
+
 } CamelImapFolderClass;
 
 
index 2578035..3da6442 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-message-cache.c: Class for an IMAP message cache */
 
-/* 
- * Author: 
+/*
+ * Author:
  *   Dan Winship <danw@ximian.com>
  *
  * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -50,7 +50,7 @@ CamelType
 camel_imap_message_cache_get_type (void)
 {
        static CamelType camel_imap_message_cache_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_imap_message_cache_type == CAMEL_INVALID_TYPE) {
                camel_imap_message_cache_type = camel_type_register (
                        CAMEL_OBJECT_TYPE, "CamelImapMessageCache",
@@ -213,9 +213,9 @@ camel_imap_message_cache_max_uid (CamelImapMessageCache *cache)
 
 /**
  * camel_imap_message_cache_set_path:
- * @cache: 
- * @path: 
- * 
+ * @cache:
+ * @path:
+ *
  * Set the path used for the message cache.
  **/
 void
@@ -245,7 +245,7 @@ insert_setup (CamelImapMessageCache *cache, const char *uid, const char *part_sp
 {
        CamelStream *stream;
        int fd;
-       
+
 #ifdef G_OS_WIN32
        /* Trailing periods in file names are silently dropped on
         * Win32, argh. The code in this file requires the period to
@@ -260,7 +260,7 @@ insert_setup (CamelImapMessageCache *cache, const char *uid, const char *part_sp
        stream = g_hash_table_lookup (cache->parts, *key);
        if (stream)
                camel_object_unref (CAMEL_OBJECT (stream));
-       
+
        fd = g_open (*path, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0600);
        if (fd == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -269,7 +269,7 @@ insert_setup (CamelImapMessageCache *cache, const char *uid, const char *part_sp
                g_free (*path);
                return NULL;
        }
-       
+
        return camel_stream_fs_new_with_fd (fd);
 }
 
@@ -314,18 +314,18 @@ camel_imap_message_cache_insert (CamelImapMessageCache *cache, const char *uid,
 {
        char *path, *key;
        CamelStream *stream;
-       
+
        stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
        if (!stream)
                return NULL;
-       
+
        if (camel_stream_write (stream, data, len) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to cache message %s: %s"),
                                      uid, g_strerror (errno));
                return insert_abort (path, stream);
        }
-       
+
        return insert_finish (cache, uid, path, key, stream);
 }
 
@@ -345,11 +345,11 @@ camel_imap_message_cache_insert_stream (CamelImapMessageCache *cache,
 {
        char *path, *key;
        CamelStream *stream;
-       
+
        stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
        if (!stream)
                return;
-       
+
        if (camel_stream_write_to_stream (data_stream, stream) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to cache message %s: %s"),
@@ -381,7 +381,7 @@ camel_imap_message_cache_insert_wrapper (CamelImapMessageCache *cache,
        stream = insert_setup (cache, uid, part_spec, &path, &key, ex);
        if (!stream)
                return;
-       
+
        if (camel_data_wrapper_write_to_stream (wrapper, stream) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to cache message %s: %s"),
@@ -410,10 +410,10 @@ camel_imap_message_cache_get (CamelImapMessageCache *cache, const char *uid,
 {
        CamelStream *stream;
        char *path, *key;
-       
+
        if (uid[0] == 0)
                return NULL;
-       
+
 #ifdef G_OS_WIN32
        /* See comment in insert_setup() */
        if (!*part_spec)
@@ -428,7 +428,7 @@ camel_imap_message_cache_get (CamelImapMessageCache *cache, const char *uid,
                g_free (path);
                return stream;
        }
-       
+
        stream = camel_stream_fs_new_with_name (path, O_RDONLY, 0);
        if (stream) {
                cache_put (cache, uid, key, stream);
@@ -437,9 +437,9 @@ camel_imap_message_cache_get (CamelImapMessageCache *cache, const char *uid,
                                      _("Failed to cache %s: %s"),
                                      part_spec, g_strerror (errno));
        }
-       
+
        g_free (path);
-       
+
        return stream;
 }
 
@@ -529,11 +529,11 @@ camel_imap_message_cache_copy (CamelImapMessageCache *source,
        CamelStream *stream;
        char *part;
        int i;
-       
+
        subparts = g_hash_table_lookup (source->parts, source_uid);
        if (!subparts || !subparts->len)
                return;
-       
+
        for (i = 0; i < subparts->len; i++) {
                part = strchr (subparts->pdata[i], '.');
                if (!part++)
index d4563d0..e9c3f16 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-message-cache.h: Class for an IMAP message cache */
 
-/* 
- * Author: 
+/*
+ * Author:
  *   Dan Winship <danw@ximian.com>
  *
  * Copyright (C) 2001 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -49,8 +49,8 @@ struct _CamelImapMessageCache {
 typedef struct {
        CamelFolderClass parent_class;
 
-       /* Virtual methods */   
-       
+       /* Virtual methods */
+
 } CamelImapMessageCacheClass;
 
 
index 631b580..1d678cc 100644 (file)
@@ -96,10 +96,10 @@ static CamelProvider imap_provider = {
 
 CamelServiceAuthType camel_imap_password_authtype = {
        N_("Password"),
-       
+
        N_("This option will connect to the IMAP server using a "
           "plaintext password."),
-       
+
        "",
        TRUE
 };
@@ -134,7 +134,7 @@ imap_url_hash (gconstpointer key)
        add_hash (&hash, u->authmech);
        add_hash (&hash, u->host);
        hash ^= u->port;
-       
+
        return hash;
 }
 
@@ -147,10 +147,10 @@ check_equal (char *s1, char *s2)
                else
                        return FALSE;
        }
-       
+
        if (s2 == NULL)
                return FALSE;
-       
+
        return strcmp (s1, s2) == 0;
 }
 
@@ -158,7 +158,7 @@ static int
 imap_url_equal (gconstpointer a, gconstpointer b)
 {
        const CamelURL *u1 = a, *u2 = b;
-       
+
        return check_equal (u1->protocol, u2->protocol)
                && check_equal (u1->user, u2->user)
                && check_equal (u1->authmech, u2->authmech)
index 89a5b2d..997d5a3 100644 (file)
@@ -108,7 +108,7 @@ camel_imap_search_class_init (CamelImapSearchClass *camel_imap_search_class)
                CAMEL_FOLDER_SEARCH_CLASS (camel_imap_search_class);
 
        imap_search_parent_class = (CamelFolderSearchClass *)camel_type_get_global_classfuncs (camel_folder_search_get_type ());
-       
+
        /* virtual method overload */
        camel_folder_search_class->body_contains = imap_body_contains;
 }
@@ -138,7 +138,7 @@ CamelType
 camel_imap_search_get_type (void)
 {
        static CamelType camel_imap_search_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_imap_search_type == CAMEL_INVALID_TYPE) {
                camel_imap_search_type = camel_type_register (
                        CAMEL_FOLDER_SEARCH_TYPE, "CamelImapSearch",
@@ -221,7 +221,7 @@ save_match(CamelImapSearch *is, struct _match_record *mr)
                return -1;
 
        d(printf("Saving search cache entry to '%s': %s\n", mr->hash, mr->terms[0]));
-       
+
        /* we write the whole thing, then re-write the header magic, saves fancy sync code */
        memcpy(&header.mark, "    ", 4);
        header.termcount = 0;
@@ -321,21 +321,21 @@ sync_match(CamelImapSearch *is, struct _match_record *mr)
        struct _camel_search_words *words;
        GString *search;
        int i;
-       
+
        if (mr->lastuid >= is->lastuid && mr->validity == is->validity)
                return 0;
-       
+
        d(printf ("updating match record for uid's %d:%d\n", mr->lastuid+1, is->lastuid));
-       
+
        /* TODO: Handle multiple search terms */
-       
+
        /* This handles multiple search words within a single term */
        words = camel_search_words_split (mr->terms[0]);
        search = g_string_new ("");
        g_string_append_printf (search, "UID %d:%d", mr->lastuid + 1, is->lastuid);
        for (i = 0; i < words->len; i++) {
                char *w = words->words[i]->word, c;
-               
+
                g_string_append_printf (search, " BODY \"");
                while ((c = *w++)) {
                        if (c == '\\' || c == '"')
@@ -345,7 +345,7 @@ sync_match(CamelImapSearch *is, struct _match_record *mr)
                g_string_append_c (search, '"');
        }
        camel_search_words_free (words);
-       
+
        /* We only try search using utf8 if its non us-ascii text? */
        if ((words->type & CAMEL_SEARCH_WORD_8BIT) &&  (store->capabilities & IMAP_CAPABILITY_utf8_search)) {
                response = camel_imap_command (store, folder, NULL,
@@ -364,7 +364,7 @@ sync_match(CamelImapSearch *is, struct _match_record *mr)
        result = camel_imap_response_extract (store, response, "SEARCH", NULL);
        if (!result)
                return -1;
-       
+
        p = result + sizeof ("* SEARCH");
        for (p = strtok_r (p, " ", &lasts); p; p = strtok_r (NULL, " ", &lasts)) {
                uid = strtoul(p, NULL, 10);
@@ -423,7 +423,7 @@ imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Came
        CamelImapSearch *is = (CamelImapSearch *)s;
        char *uid;
        ESExpResult *r;
-       CamelMessageInfo *info; 
+       CamelMessageInfo *info;
        GHashTable *uid_hash = NULL;
        GPtrArray *array;
        int i, j;
index a8e6c1e..828170d 100644 (file)
@@ -109,7 +109,7 @@ CamelType
 camel_imap_store_summary_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                camel_imap_store_summary_parent = (CamelStoreSummaryClass *)camel_store_summary_get_type();
                type = camel_type_register((CamelType)camel_imap_store_summary_parent, "CamelImapStoreSummary",
@@ -120,7 +120,7 @@ camel_imap_store_summary_get_type (void)
                                           (CamelObjectInitFunc) camel_imap_store_summary_init,
                                           (CamelObjectFinalizeFunc) camel_imap_store_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -128,7 +128,7 @@ camel_imap_store_summary_get_type (void)
  * camel_imap_store_summary_new:
  *
  * Create a new CamelImapStoreSummary object.
- * 
+ *
  * Return value: A new CamelImapStoreSummary widget.
  **/
 CamelImapStoreSummary *
@@ -141,14 +141,14 @@ camel_imap_store_summary_new (void)
 
 /**
  * camel_imap_store_summary_full_name:
- * @s: 
- * @path: 
- * 
+ * @s:
+ * @path:
+ *
  * Retrieve a summary item by full name.
  *
  * A referenced to the summary item is returned, which may be
  * ref'd or free'd as appropriate.
- * 
+ *
  * Return value: The summary item, or NULL if the @full_name name
  * is not available.
  * It must be freed using camel_store_summary_info_free().
@@ -320,7 +320,7 @@ camel_imap_store_summary_add_from_full(CamelImapStoreSummary *s, const char *ful
                } else {
                        if (full_name[len] == ns->sep)
                                len++;
-                       
+
                        prefix = camel_imap_store_summary_full_to_path(s, full_name+len, ns->sep);
                        if (*ns->path) {
                                pathu8 = g_strdup_printf ("%s/%s", ns->path, prefix);
@@ -537,7 +537,7 @@ summary_header_save(CamelStoreSummary *s, FILE *out)
        if (camel_imap_store_summary_parent->summary_header_save((CamelStoreSummary *)s, out) == -1
            || camel_file_util_encode_fixed_int32(out, CAMEL_IMAP_STORE_SUMMARY_VERSION) == -1
            || camel_file_util_encode_fixed_int32(out, is->capabilities) == -1
-           || camel_file_util_encode_fixed_int32(out, count) == -1)        
+           || camel_file_util_encode_fixed_int32(out, count) == -1)
                return -1;
 
        if (is->namespace && namespace_save(s, out, is->namespace) == -1)
index c0fb8cf..885df2b 100644 (file)
@@ -63,7 +63,7 @@
 #include "camel-imap-summary.h"
 #include "camel-imap-utils.h"
 
-#define d(x) 
+#define d(x)
 
 /* Specified in RFC 2060 */
 #define IMAP_PORT "143"
@@ -139,17 +139,17 @@ camel_imap_store_class_init (CamelImapStoreClass *camel_imap_store_class)
                CAMEL_STORE_CLASS (camel_imap_store_class);
        CamelDiscoStoreClass *camel_disco_store_class =
                CAMEL_DISCO_STORE_CLASS (camel_imap_store_class);
-       
+
        parent_class = CAMEL_DISCO_STORE_CLASS (camel_type_get_global_classfuncs (camel_disco_store_get_type ()));
-       
+
        /* virtual method overload */
        camel_object_class->setv = imap_setv;
        camel_object_class->getv = imap_getv;
-       
+
        camel_service_class->construct = construct;
        camel_service_class->query_auth_types = query_auth_types;
        camel_service_class->get_name = imap_get_name;
-       
+
        camel_store_class->hash_folder_name = hash_folder_name;
        camel_store_class->compare_folder_name = compare_folder_name;
        camel_store_class->create_folder = create_folder;
@@ -162,7 +162,7 @@ camel_imap_store_class_init (CamelImapStoreClass *camel_imap_store_class)
        camel_store_class->noop = imap_noop;
        camel_store_class->get_trash = imap_get_trash;
        camel_store_class->get_junk = imap_get_junk;
-       
+
        camel_disco_store_class->can_work_offline = can_work_offline;
        camel_disco_store_class->connect_online = imap_connect_online;
        camel_disco_store_class->connect_offline = imap_connect_offline;
@@ -196,7 +196,7 @@ camel_imap_store_finalize (CamelObject *object)
                camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
                camel_object_unref(imap_store->summary);
        }
-       
+
        if (imap_store->base_url)
                g_free (imap_store->base_url);
        if (imap_store->storage_path)
@@ -215,10 +215,10 @@ static void
 camel_imap_store_init (gpointer object, gpointer klass)
 {
        CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
-       
+
        imap_store->istream = NULL;
        imap_store->ostream = NULL;
-       
+
        imap_store->dir_sep = '\0';
        imap_store->current_folder = NULL;
        imap_store->connected = FALSE;
@@ -234,7 +234,7 @@ CamelType
 camel_imap_store_get_type (void)
 {
        static CamelType camel_imap_store_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_imap_store_type == CAMEL_INVALID_TYPE)        {
                camel_imap_store_type =
                        camel_type_register (CAMEL_DISCO_STORE_TYPE,
@@ -246,7 +246,7 @@ camel_imap_store_get_type (void)
                                             (CamelObjectInitFunc) camel_imap_store_init,
                                             (CamelObjectFinalizeFunc) camel_imap_store_finalize);
        }
-       
+
        return camel_imap_store_type;
 }
 
@@ -329,7 +329,7 @@ construct (CamelService *service, CamelSession *session,
                                imap_store->dir_sep = is->namespace->sep;
                        }
                }
+
                imap_store->capabilities = is->capabilities;
                imap_set_server_level(imap_store);
        }
@@ -341,10 +341,10 @@ imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
        CamelImapStore *store = (CamelImapStore *) object;
        guint32 tag, flags;
        int i;
-       
+
        for (i = 0; i < args->argc; i++) {
                tag = args->argv[i].tag;
-               
+
                /* make sure this is an arg we're supposed to handle */
                if ((tag & CAMEL_ARG_TAG) <= CAMEL_IMAP_STORE_ARG_FIRST ||
                    (tag & CAMEL_ARG_TAG) >= CAMEL_IMAP_STORE_ARG_FIRST + 100)
@@ -362,7 +362,7 @@ imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
                case CAMEL_IMAP_STORE_OVERRIDE_NAMESPACE:
                        flags = args->argv[i].ca_int ? IMAP_PARAM_OVERRIDE_NAMESPACE : 0;
                        flags |= (store->parameters & ~IMAP_PARAM_OVERRIDE_NAMESPACE);
-                       
+
                        if (store->parameters != flags) {
                                store->parameters = flags;
                                /* the current imap code will need to do a reconnect for this to take effect */
@@ -393,15 +393,15 @@ imap_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
                        /* error?? */
                        continue;
                }
-               
+
                /* let our parent know that we've handled this arg */
                camel_argv_ignore (args, i);
        }
-       
+
        /* FIXME: if we need to reconnect for a change to take affect,
            we need to do it here... or, better yet, somehow chain it
            up to CamelService's setv implementation. */
-       
+
        return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args);
 }
 
@@ -411,15 +411,15 @@ imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
        CamelImapStore *store = (CamelImapStore *) object;
        guint32 tag;
        int i;
-       
+
        for (i = 0; i < args->argc; i++) {
                tag = args->argv[i].tag;
-               
+
                /* make sure this is an arg we're supposed to handle */
                if ((tag & CAMEL_ARG_TAG) <= CAMEL_IMAP_STORE_ARG_FIRST ||
                    (tag & CAMEL_ARG_TAG) >= CAMEL_IMAP_STORE_ARG_FIRST + 100)
                        continue;
-               
+
                switch (tag) {
                case CAMEL_IMAP_STORE_NAMESPACE:
                        *args->argv[i].ca_str = store->namespace;
@@ -444,7 +444,7 @@ imap_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
                        break;
                }
        }
-       
+
        return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args);
 }
 
@@ -515,7 +515,7 @@ imap_get_capability (CamelService *service, CamelException *ex)
        CamelImapStore *store = CAMEL_IMAP_STORE (service);
        CamelImapResponse *response;
        char *result;
-       
+
        /* Find out the IMAP capabilities */
        /* We assume we have utf8 capable search until a failed search tells us otherwise */
        store->capabilities = IMAP_CAPABILITY_utf8_search;
@@ -526,7 +526,7 @@ imap_get_capability (CamelService *service, CamelException *ex)
        result = camel_imap_response_extract (store, response, "CAPABILITY ", ex);
        if (!result)
                return FALSE;
-       
+
        /* Skip over "* CAPABILITY ". */
        parse_capability(store, result+13);
        g_free (result);
@@ -540,15 +540,15 @@ imap_get_capability (CamelService *service, CamelException *ex)
                        g_free (result);
                }
        }
-       
+
        imap_set_server_level (store);
-       
+
        if (store->summary->capabilities != store->capabilities) {
                store->summary->capabilities = store->capabilities;
                camel_store_summary_touch((CamelStoreSummary *)store->summary);
                camel_store_summary_save((CamelStoreSummary *)store->summary);
        }
-       
+
        return TRUE;
 }
 
@@ -573,7 +573,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
        gboolean force_imap4 = FALSE;
        gboolean clean_quit = TRUE;
        char *buf;
-       
+
        if (ssl_mode != MODE_CLEAR) {
 #ifdef HAVE_SSL
                if (ssl_mode == MODE_TLS) {
@@ -585,13 +585,13 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                      _("Could not connect to %s: %s"),
                                      service->url->host, _("SSL unavailable"));
-               
+
                return FALSE;
 #endif /* HAVE_SSL */
        } else {
                tcp_stream = camel_tcp_stream_raw_new ();
        }
-       
+
        if (camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai) == -1) {
                if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
@@ -601,15 +601,15 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                                              _("Could not connect to %s: %s"),
                                              service->url->host,
                                              g_strerror (errno));
-               
+
                camel_object_unref (tcp_stream);
-               
+
                return FALSE;
        }
-       
+
        store->ostream = tcp_stream;
        store->istream = camel_stream_buffer_new (tcp_stream, CAMEL_STREAM_BUFFER_READ);
-       
+
        store->connected = TRUE;
        store->preauthed = FALSE;
        store->command = 0;
@@ -630,20 +630,20 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                        camel_object_unref (store->istream);
                        store->istream = NULL;
                }
-               
+
                if (store->ostream) {
                        camel_object_unref (store->ostream);
                        store->ostream = NULL;
                }
-               
+
                store->connected = FALSE;
-               
+
                return FALSE;
        }
-       
+
        if (!strncmp(buf, "* PREAUTH", 9))
                store->preauthed = TRUE;
-       
+
        if (strstr (buf, "Courier-IMAP") || getenv("CAMEL_IMAP_BRAINDAMAGED")) {
                /* Courier-IMAP is braindamaged. So far this flag only
                 * works around the fact that Courier-IMAP is known to
@@ -671,47 +671,47 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                 **/
                force_imap4 = TRUE;
        }
-       
+
        g_free (buf);
-       
+
        /* get the imap server capabilities */
        if (!imap_get_capability (service, ex)) {
                if (store->istream) {
                        camel_object_unref (store->istream);
                        store->istream = NULL;
                }
-               
+
                if (store->ostream) {
                        camel_object_unref (store->ostream);
                        store->ostream = NULL;
                }
-               
+
                store->connected = FALSE;
                return FALSE;
        }
-       
+
        if (force_imap4) {
                store->capabilities &= ~IMAP_CAPABILITY_IMAP4REV1;
                store->server_level = IMAP_LEVEL_IMAP4;
        }
-       
+
        if (ssl_mode != MODE_TLS) {
                /* we're done */
                return TRUE;
        }
-       
+
 #ifdef HAVE_SSL
        if (!(store->capabilities & IMAP_CAPABILITY_STARTTLS)) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to connect to IMAP server %s in secure mode: %s"),
                                      service->url->host, _("STARTTLS not supported"));
-               
+
                goto exception;
        }
-       
+
        /* as soon as we send a STARTTLS command, all hope is lost of a clean QUIT if problems arise */
        clean_quit = FALSE;
-       
+
        response = camel_imap_command (store, NULL, ex, "STARTTLS");
        if (!response) {
                camel_object_unref (store->istream);
@@ -719,9 +719,9 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                store->istream = store->ostream = NULL;
                return FALSE;
        }
-       
+
        camel_imap_response_free_without_processing (store, response);
-       
+
        /* Okay, now toggle SSL/TLS mode */
        if (camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream)) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -735,7 +735,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                              service->url->host, _("SSL is not available in this build"));
        goto exception;
 #endif /* HAVE_SSL */
-       
+
        /* rfc2595, section 4 states that after a successful STLS
            command, the client MUST discard prior CAPA responses */
        if (!imap_get_capability (service, ex)) {
@@ -743,18 +743,18 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                        camel_object_unref (store->istream);
                        store->istream = NULL;
                }
-               
+
                if (store->ostream) {
                        camel_object_unref (store->ostream);
                        store->ostream = NULL;
                }
-               
+
                store->connected = FALSE;
-               
+
                return FALSE;
        }
 
-       if (store->capabilities & IMAP_CAPABILITY_LOGINDISABLED ) { 
+       if (store->capabilities & IMAP_CAPABILITY_LOGINDISABLED ) {
                clean_quit = TRUE;
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                _("Failed to connect to IMAP server %s in secure mode: %s"), service->url->host, _("Unknown error"));
@@ -762,28 +762,28 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
        }
 
        return TRUE;
-       
+
  exception:
-       
+
        if (clean_quit && store->connected) {
                /* try to disconnect cleanly */
                response = camel_imap_command (store, NULL, ex, "LOGOUT");
                if (response)
                        camel_imap_response_free_without_processing (store, response);
        }
-       
+
        if (store->istream) {
                camel_object_unref (store->istream);
                store->istream = NULL;
        }
-       
+
        if (store->ostream) {
                camel_object_unref (store->ostream);
                store->ostream = NULL;
        }
-       
+
        store->connected = FALSE;
-       
+
        return FALSE;
 }
 
@@ -802,7 +802,7 @@ connect_to_server_process (CamelService *service, const char *cmd, CamelExceptio
        char *full_cmd;
        char *child_env[7];
 
-       /* Put full details in the environment, in case the connection 
+       /* Put full details in the environment, in case the connection
           program needs them */
        buf = camel_url_to_string(service->url, 0);
        child_env[i++] = g_strdup_printf("URL=%s", buf);
@@ -838,7 +838,7 @@ connect_to_server_process (CamelService *service, const char *cmd, CamelExceptio
                        full_cmd = tmp;
                        break;
                }
-               
+
                len = pc - buf;
 
                var = NULL;
@@ -862,17 +862,17 @@ connect_to_server_process (CamelService *service, const char *cmd, CamelExceptio
                full_cmd = tmp;
                buf = pc + 2;
        }
-                       
+
        g_free(cmd_copy);
 
        cmd_stream = camel_stream_process_new ();
-       
+
        ret = camel_stream_process_connect (CAMEL_STREAM_PROCESS(cmd_stream),
                                            full_cmd, (const char **)child_env);
 
        while (i)
                g_free(child_env[--i]);
-               
+
        if (ret == -1) {
                if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
@@ -881,57 +881,57 @@ connect_to_server_process (CamelService *service, const char *cmd, CamelExceptio
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                              _("Could not connect with command \"%s\": %s"),
                                              full_cmd, g_strerror (errno));
-               
+
                camel_object_unref (cmd_stream);
                g_free (full_cmd);
                return FALSE;
        }
        g_free (full_cmd);
-       
+
        store->ostream = cmd_stream;
        store->istream = camel_stream_buffer_new (cmd_stream, CAMEL_STREAM_BUFFER_READ);
-       
+
        store->connected = TRUE;
        store->preauthed = FALSE;
        store->command = 0;
-       
+
        /* Read the greeting, if any, and deal with PREAUTH */
        if (camel_imap_store_readline (store, &buf, ex) < 0) {
                if (store->istream) {
                        camel_object_unref (store->istream);
                        store->istream = NULL;
                }
-               
+
                if (store->ostream) {
                        camel_object_unref (store->ostream);
                        store->ostream = NULL;
                }
-               
+
                store->connected = FALSE;
                return FALSE;
        }
        if (!strncmp(buf, "* PREAUTH", 9))
                store->preauthed = TRUE;
        g_free (buf);
-       
+
        /* get the imap server capabilities */
        if (!imap_get_capability (service, ex)) {
                if (store->istream) {
                        camel_object_unref (store->istream);
                        store->istream = NULL;
                }
-               
+
                if (store->ostream) {
                        camel_object_unref (store->ostream);
                        store->ostream = NULL;
                }
-               
+
                store->connected = FALSE;
                return FALSE;
        }
-       
+
        return TRUE;
-       
+
 }
 
 #endif
@@ -964,7 +964,7 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
        if (camel_url_get_param(service->url, "use_command")
            && (command = camel_url_get_param(service->url, "command")))
                return connect_to_server_process(service, command, ex);
-#endif 
+#endif
        if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
                for (i = 0; ssl_options[i].value; i++)
                        if (!strcmp (ssl_options[i].value, ssl_mode))
@@ -977,13 +977,13 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
                serv = "imap";
                port = IMAP_PORT;
        }
-       
+
        if (service->url->port) {
                serv = g_alloca (16);
                sprintf (serv, "%d", service->url->port);
                port = NULL;
        }
-       
+
        memset (&hints, 0, sizeof (hints));
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_family = PF_UNSPEC;
@@ -992,14 +992,14 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
                camel_exception_clear (ex);
                ai = camel_getaddrinfo(service->url->host, port, &hints, ex);
        }
-       
+
        if (ai == NULL)
                return FALSE;
-       
+
        ret = connect_to_server (service, ai, mode, ex);
-       
+
        camel_freeaddrinfo (ai);
-       
+
        return ret;
 }
 
@@ -1012,10 +1012,10 @@ query_auth_types (CamelService *service, CamelException *ex)
        CamelServiceAuthType *authtype;
        GList *sasl_types, *t, *next;
        gboolean connected;
-       
+
        if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex))
                return NULL;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
        connected = store->istream != NULL && store->connected;
        if (!connected)
@@ -1023,18 +1023,18 @@ query_auth_types (CamelService *service, CamelException *ex)
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
        if (!connected)
                return NULL;
-       
+
        sasl_types = camel_sasl_authtype_list (FALSE);
        for (t = sasl_types; t; t = next) {
                authtype = t->data;
                next = t->next;
-               
+
                if (!g_hash_table_lookup (store->authtypes, authtype->authproto)) {
                        sasl_types = g_list_remove_link (sasl_types, t);
                        g_list_free_1 (t);
                }
        }
-       
+
        return g_list_prepend (sasl_types, &camel_imap_password_authtype);
 }
 
@@ -1066,12 +1066,12 @@ imap_build_folder_info(CamelImapStore *imap_store, const char *folder_name)
                fi->name = g_strdup (_("Inbox"));
        else
                fi->name = g_strdup (name);
-       
+
        return fi;
 }
 
 static void
-imap_folder_effectively_unsubscribed(CamelImapStore *imap_store, 
+imap_folder_effectively_unsubscribed(CamelImapStore *imap_store,
                                     const char *folder_name, CamelException *ex)
 {
        CamelFolderInfo *fi;
@@ -1116,7 +1116,7 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
                name++;
        else
                name = folder_name;
-       
+
        storage_path = g_strdup_printf ("%s/folders", imap_store->storage_path);
        folder_dir = imap_path_to_physical (storage_path, folder_name);
        g_free (storage_path);
@@ -1124,7 +1124,7 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
                g_free (folder_dir);
                goto event;
        }
-       
+
        summary_file = g_strdup_printf ("%s/summary", folder_dir);
        summary = camel_imap_summary_new (NULL, summary_file);
        if (!summary) {
@@ -1144,17 +1144,17 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
                g_free (folder_dir);
                goto event;
        }
-       
+
        cache = camel_imap_message_cache_new (folder_dir, summary, ex);
        if (cache)
                camel_imap_message_cache_clear (cache);
-       
+
        camel_object_unref (cache);
        camel_object_unref (summary);
-       
+
        g_unlink (summary_file);
        g_free (summary_file);
-       
+
        journal_file = g_strdup_printf ("%s/journal", folder_dir);
        g_unlink (journal_file);
        g_free (journal_file);
@@ -1166,10 +1166,10 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
        state_file = g_strdup_printf("%s/subfolders", folder_dir);
        g_rmdir(state_file);
        g_free(state_file);
-       
+
        g_rmdir (folder_dir);
        g_free (folder_dir);
-       
+
  event:
 
        camel_store_summary_remove_path((CamelStoreSummary *)imap_store->summary, folder_name);
@@ -1181,7 +1181,7 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
 }
 
 static gboolean
-imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_name, 
+imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_name,
                                CamelException *ex)
 {
        CamelImapResponse *response;
@@ -1216,9 +1216,9 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
 {
        GPtrArray *folders;
        int i;
-       
+
        folders = camel_object_bag_list(CAMEL_STORE (store)->folders);
-       
+
        for (i = 0; i <folders->len; i++) {
                CamelFolder *folder = folders->pdata[i];
 
@@ -1235,10 +1235,10 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
                if (camel_exception_is_set (ex) &&
                    imap_check_folder_still_extant (store, folder->full_name, ex) == FALSE) {
                        gchar *namedup;
-                       
+
                        /* the folder was deleted (may happen when we come back online
                         * after being offline */
-                       
+
                        namedup = g_strdup (folder->full_name);
                        camel_object_unref(folder);
                        imap_folder_effectively_unsubscribed (store, namedup, ex);
@@ -1247,7 +1247,7 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
                } else
                        camel_object_unref(folder);
        }
-       
+
        g_ptr_array_free (folders, TRUE);
 }
 #endif
@@ -1259,28 +1259,28 @@ try_auth (CamelImapStore *store, const char *mech, CamelException *ex)
        CamelImapResponse *response;
        char *resp;
        char *sasl_resp;
-       
+
        response = camel_imap_command (store, NULL, ex, "AUTHENTICATE %s", mech);
        if (!response)
                return FALSE;
-       
+
        sasl = camel_sasl_new ("imap", mech, CAMEL_SERVICE (store));
        while (!camel_sasl_authenticated (sasl)) {
                resp = camel_imap_response_extract_continuation (store, response, ex);
                if (!resp)
                        goto lose;
-               
+
                sasl_resp = camel_sasl_challenge_base64 (sasl, imap_next_word (resp), ex);
                g_free (resp);
                if (!sasl_resp || camel_exception_is_set (ex))
                        goto break_and_lose;
-               
+
                response = camel_imap_command_continuation (store, sasl_resp, strlen (sasl_resp), ex);
                g_free (sasl_resp);
                if (!response)
                        goto lose;
        }
-       
+
        resp = camel_imap_response_extract_continuation (store, response, NULL);
        if (resp) {
                /* Oops. SASL claims we're done, but the IMAP server
@@ -1289,25 +1289,25 @@ try_auth (CamelImapStore *store, const char *mech, CamelException *ex)
                g_free (resp);
                goto lose;
        }
-       
+
        camel_object_unref (sasl);
-       
+
        return TRUE;
-       
+
  break_and_lose:
        /* Get the server out of "waiting for continuation data" mode. */
        response = camel_imap_command_continuation (store, "*", 1, NULL);
        if (response)
                camel_imap_response_free (store, response);
-       
+
  lose:
        if (!camel_exception_is_set (ex)) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                     _("Bad authentication response from server."));
        }
-       
+
        camel_object_unref (sasl);
-       
+
        return FALSE;
 }
 
@@ -1321,9 +1321,9 @@ imap_auth_loop (CamelService *service, CamelException *ex)
        char *errbuf = NULL;
        gboolean authenticated = FALSE;
        const char *auth_domain;
-       
+
        auth_domain = camel_url_get_param (service->url, "auth-domain");
-       
+
        if (store->preauthed) {
                if (camel_verbose_debug)
                        fprintf(stderr, "Server %s has preauthenticated us.\n",
@@ -1340,7 +1340,7 @@ imap_auth_loop (CamelService *service, CamelException *ex)
                                              service->url->authmech);
                        return FALSE;
                }
-               
+
                authtype = camel_sasl_authtype (service->url->authmech);
                if (!authtype) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
@@ -1348,14 +1348,14 @@ imap_auth_loop (CamelService *service, CamelException *ex)
                                              service->url->authmech);
                        return FALSE;
                }
-               
+
                if (!authtype->need_password) {
                        authenticated = try_auth (store, authtype->authproto, ex);
                        if (!authenticated)
                                return FALSE;
                }
        }
-       
+
        while (!authenticated) {
                if (errbuf) {
                        /* We need to un-cache the password before prompting again */
@@ -1363,10 +1363,10 @@ imap_auth_loop (CamelService *service, CamelException *ex)
                        g_free (service->url->passwd);
                        service->url->passwd = NULL;
                }
-               
+
                if (!service->url->passwd) {
                        char *prompt;
-                       
+
                        prompt = g_strdup_printf (_("%sPlease enter the IMAP "
                                                    "password for %s@%s"),
                                                  errbuf ? errbuf : "",
@@ -1378,14 +1378,14 @@ imap_auth_loop (CamelService *service, CamelException *ex)
                        g_free (prompt);
                        g_free (errbuf);
                        errbuf = NULL;
-                       
+
                        if (!service->url->passwd) {
                                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
                                                     _("You did not enter a password."));
                                return FALSE;
                        }
                }
-               
+
                if (!store->connected) {
                        /* Some servers (eg, courier) will disconnect on
                         * a bad password. So reconnect here.
@@ -1393,7 +1393,7 @@ imap_auth_loop (CamelService *service, CamelException *ex)
                        if (!connect_to_server_wrapper (service, ex))
                                return FALSE;
                }
-               
+
                if (authtype)
                        authenticated = try_auth (store, authtype->authproto, ex);
                else {
@@ -1409,14 +1409,14 @@ imap_auth_loop (CamelService *service, CamelException *ex)
                if (!authenticated) {
                        if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_USER_CANCEL)
                                return FALSE;
-                       
+
                        errbuf = g_strdup_printf (_("Unable to authenticate "
                                                    "to IMAP server.\n%s\n\n"),
                                                  camel_exception_get_description (ex));
                        camel_exception_clear (ex);
                }
        }
-       
+
        return TRUE;
 }
 
@@ -1424,7 +1424,7 @@ static gboolean
 can_work_offline (CamelDiscoStore *disco_store)
 {
        CamelImapStore *store = CAMEL_IMAP_STORE (disco_store);
-       
+
        return camel_store_summary_count((CamelStoreSummary *)store->summary) != 0;
 }
 
@@ -1445,29 +1445,29 @@ imap_connect_online (CamelService *service, CamelException *ex)
                camel_service_disconnect (service, TRUE, NULL);
                return FALSE;
        }
-       
+
        /* Get namespace and hierarchy separator */
        if ((store->capabilities & IMAP_CAPABILITY_NAMESPACE) &&
            !(store->parameters & IMAP_PARAM_OVERRIDE_NAMESPACE)) {
                response = camel_imap_command (store, NULL, ex, "NAMESPACE");
                if (!response)
                        goto done;
-               
+
                result = camel_imap_response_extract (store, response, "NAMESPACE", ex);
                if (!result)
                        goto done;
-               
+
 #if 0
                /* new code... */
                namespaces = imap_parse_namespace_response (result);
                imap_namespaces_destroy (namespaces);
                /* end new code */
 #endif
-               
+
                name = camel_strstrcase (result, "NAMESPACE ((");
                if (name) {
                        char *sep;
-                       
+
                        name += 12;
                        store->namespace = imap_parse_string ((const char **) &name, &len);
                        if (name && *name++ == ' ') {
@@ -1480,10 +1480,10 @@ imap_connect_online (CamelService *service, CamelException *ex)
                }
                g_free (result);
        }
-       
+
        if (!store->namespace)
                store->namespace = g_strdup ("");
-       
+
        if (!store->dir_sep) {
                if (store->server_level >= IMAP_LEVEL_IMAP4REV1) {
                        /* This idiom means "tell me the hierarchy separator
@@ -1503,7 +1503,7 @@ imap_connect_online (CamelService *service, CamelException *ex)
                }
                if (!response)
                        goto done;
-               
+
                result = camel_imap_response_extract (store, response, "LIST", NULL);
                if (result) {
                        imap_parse_list_response (store, result, NULL, &store->dir_sep, NULL);
@@ -1513,25 +1513,25 @@ imap_connect_online (CamelService *service, CamelException *ex)
                        store->dir_sep = '/';   /* Guess */
                }
        }
-       
+
        /* canonicalize the namespace to end with dir_sep */
        len = strlen (store->namespace);
        if (len && store->namespace[len - 1] != store->dir_sep) {
                gchar *tmp;
-               
+
                tmp = g_strdup_printf ("%s%c", store->namespace, store->dir_sep);
                g_free (store->namespace);
                store->namespace = tmp;
        }
-       
+
        ns = camel_imap_store_summary_namespace_new(store->summary, store->namespace, store->dir_sep);
        camel_imap_store_summary_namespace_set(store->summary, ns);
-       
+
        if ((store->parameters & IMAP_PARAM_SUBSCRIPTIONS)
            && camel_store_summary_count((CamelStoreSummary *)store->summary) == 0) {
                CamelStoreInfo *si;
                char *pattern;
-               
+
                get_folders_sync(store, store->namespace, ex);
                if (camel_exception_is_set(ex))
                        goto done;
@@ -1556,17 +1556,17 @@ imap_connect_online (CamelService *service, CamelException *ex)
                }
                store->refresh_stamp = time(NULL);
        }
-       
-       
+
+
  done:
        /* save any changes we had */
        camel_store_summary_save((CamelStoreSummary *)store->summary);
 
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-       
+
        if (camel_exception_is_set (ex))
                camel_service_disconnect (service, TRUE, NULL);
-       
+
        return !camel_exception_is_set (ex);
 }
 
@@ -1578,7 +1578,7 @@ imap_connect_offline (CamelService *service, CamelException *ex)
 
        if (!disco_store->diary)
                return FALSE;
-       
+
        store->connected = !camel_exception_is_set (ex);
        return store->connected;
 }
@@ -1593,31 +1593,31 @@ imap_disconnect_offline (CamelService *service, gboolean clean, CamelException *
                camel_object_unref(store->istream);
                store->istream = NULL;
        }
-       
+
        if (store->ostream) {
                camel_stream_close(store->ostream);
                camel_object_unref(store->ostream);
                store->ostream = NULL;
        }
-       
+
        store->connected = FALSE;
        if (store->current_folder) {
                camel_object_unref (store->current_folder);
                store->current_folder = NULL;
        }
-       
+
        if (store->authtypes) {
                g_hash_table_foreach_remove (store->authtypes,
                                             free_key, NULL);
                g_hash_table_destroy (store->authtypes);
                store->authtypes = NULL;
        }
-       
+
        if (store->namespace && !(store->parameters & IMAP_PARAM_OVERRIDE_NAMESPACE)) {
                g_free (store->namespace);
                store->namespace = NULL;
        }
-               
+
        return TRUE;
 }
 
@@ -1626,14 +1626,14 @@ imap_disconnect_online (CamelService *service, gboolean clean, CamelException *e
 {
        CamelImapStore *store = CAMEL_IMAP_STORE (service);
        CamelImapResponse *response;
-       
+
        if (store->connected && clean) {
                response = camel_imap_command (store, NULL, NULL, "LOGOUT");
                camel_imap_response_free (store, response);
        }
-       
+
        imap_disconnect_offline (service, clean, ex);
-       
+
        return TRUE;
 }
 
@@ -1653,7 +1653,7 @@ imap_summary_is_dirty (CamelFolderSummary *summary)
                        camel_message_info_free(info);
                }
        }
-       
+
        return FALSE;
 }
 
@@ -1663,7 +1663,7 @@ imap_noop (CamelStore *store, CamelException *ex)
        CamelImapStore *imap_store = (CamelImapStore *) store;
        CamelImapResponse *response;
        CamelFolder *current_folder;
-       
+
        CAMEL_SERVICE_REC_LOCK (imap_store, connect_lock);
 
        if (!camel_imap_store_connected(imap_store, ex))
@@ -1747,7 +1747,7 @@ static void
 imap_status_item_free (struct imap_status_item *items)
 {
        struct imap_status_item *next;
-       
+
        while (items != NULL) {
                next = items->next;
                g_free (items->name);
@@ -1762,9 +1762,9 @@ get_folder_status (CamelImapStore *imap_store, const char *folder_name, const ch
        struct imap_status_item *items, *item, *tail;
        CamelImapResponse *response;
        char *status, *name, *p;
-       
+
        /* FIXME: we assume the server is STATUS-capable */
-       
+
        response = camel_imap_command (imap_store, NULL, NULL,
                                       "STATUS %F (%s)",
                                       folder_name,
@@ -1781,14 +1781,14 @@ get_folder_status (CamelImapStore *imap_store, const char *folder_name, const ch
                camel_exception_clear (&ex);
                return NULL;
        }
-       
+
        if (!(status = camel_imap_response_extract (imap_store, response, "STATUS", NULL)))
                return NULL;
-       
+
        p = status + strlen ("* STATUS ");
        while (*p == ' ')
                p++;
-       
+
        /* skip past the mailbox string */
        if (*p == '"') {
                p++;
@@ -1797,52 +1797,52 @@ get_folder_status (CamelImapStore *imap_store, const char *folder_name, const ch
                                p++;
                                break;
                        }
-                       
+
                        p++;
                }
        } else {
                while (*p != ' ')
                        p++;
        }
-       
+
        while (*p == ' ')
                p++;
-       
+
        if (*p++ != '(') {
                g_free (status);
                return NULL;
        }
-       
+
        while (*p == ' ')
                p++;
-       
+
        if (*p == ')') {
                g_free (status);
                return NULL;
        }
-       
+
        items = NULL;
        tail = (struct imap_status_item *) &items;
-       
+
        do {
                name = p;
                while (*p != ' ')
                        p++;
-               
+
                item = g_malloc (sizeof (struct imap_status_item));
                item->next = NULL;
                item->name = g_strndup (name, p - name);
                item->value = strtoul (p, &p, 10);
-               
+
                tail->next = item;
                tail = item;
-               
+
                while (*p == ' ')
                        p++;
        } while (*p != ')');
-       
+
        g_free (status);
-       
+
        return items;
 }
 
@@ -1867,7 +1867,7 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
                CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
                return NULL;
        }
-       
+
        if (!g_ascii_strcasecmp (folder_name, "INBOX"))
                folder_name = "INBOX";
 
@@ -1879,26 +1879,26 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
        if (!response) {
                char *folder_real, *parent_name, *parent_real;
                const char *c;
-               
+
                if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_USER_CANCEL) {
                        CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
                        return NULL;
                }
-               
+
                camel_exception_clear (ex);
-               
+
                if (!(flags & CAMEL_STORE_FOLDER_CREATE)) {
                        CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
                        camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
                                              _("No such folder %s"), folder_name);
                        return NULL;
                }
-               
+
                parent_name = strrchr(folder_name, '/');
                c = parent_name ? parent_name+1 : folder_name;
                while (*c && *c != imap_store->dir_sep && !strchr ("#%*", *c))
                        c++;
-               
+
                if (*c != '\0') {
                        CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
                        camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
@@ -1913,56 +1913,56 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
                } else {
                        parent_real = NULL;
                }
-               
+
                if (parent_real != NULL) {
                        gboolean need_convert = FALSE;
                        char *resp, *thisone;
                        guint32 flags;
                        int i;
-                       
+
                        if (!(response = camel_imap_command (imap_store, NULL, ex, "LIST \"\" %G", parent_real))) {
                                CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
                                g_free (parent_name);
                                g_free (parent_real);
                                return NULL;
                        }
-                       
+
                        /* FIXME: does not handle unexpected circumstances very well */
                        for (i = 0; i < response->untagged->len; i++) {
                                resp = response->untagged->pdata[i];
-                               
+
                                if (!imap_parse_list_response (imap_store, resp, &flags, NULL, &thisone))
                                        continue;
-                               
+
                                if (!strcmp (parent_name, thisone)) {
                                        if (flags & CAMEL_FOLDER_NOINFERIORS)
                                                need_convert = TRUE;
                                }
-                               
+
                                g_free (thisone);
                        }
-                       
+
                        camel_imap_response_free (imap_store, response);
-                       
+
                        /* if not, check if we can delete it and recreate it */
                        if (need_convert) {
                                struct imap_status_item *items, *item;
                                guint32 messages = 0;
                                CamelException lex;
                                char *name;
-                               
+
                                item = items = get_folder_status (imap_store, parent_name, "MESSAGES");
                                while (item != NULL) {
                                        if (!g_ascii_strcasecmp (item->name, "MESSAGES")) {
                                                messages = item->value;
                                                break;
                                        }
-                                       
+
                                        item = item->next;
                                }
-                               
+
                                imap_status_item_free (items);
-                               
+
                                if (messages > 0) {
                                        camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
                                                             _("The parent folder is not allowed to contain subfolders"));
@@ -1971,7 +1971,7 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
                                        g_free (parent_real);
                                        return NULL;
                                }
-                               
+
                                /* delete the old parent and recreate it */
                                camel_exception_init (&lex);
                                delete_folder (store, parent_name, &lex);
@@ -1982,13 +1982,13 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
                                        g_free (parent_real);
                                        return NULL;
                                }
-                               
+
                                /* add the dirsep to the end of parent_name */
                                name = g_strdup_printf ("%s%c", parent_real, imap_store->dir_sep);
                                response = camel_imap_command (imap_store, NULL, ex, "CREATE %G",
                                                               name);
                                g_free (name);
-                               
+
                                if (!response) {
                                        CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
                                        g_free (parent_name);
@@ -1997,10 +1997,10 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
                                } else
                                        camel_imap_response_free (imap_store, response);
                        }
-                       
+
                        g_free (parent_real);
                }
-               
+
                g_free (parent_name);
 
                folder_real = camel_imap_store_summary_path_to_full(imap_store->summary, folder_name, imap_store->dir_sep);
@@ -2009,7 +2009,7 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
                        camel_imap_store_summary_add_from_full(imap_store->summary, folder_real, imap_store->dir_sep);
 
                        camel_imap_response_free (imap_store, response);
-                       
+
                        response = camel_imap_command (imap_store, NULL, NULL, "SELECT %F", folder_name);
                }
                g_free(folder_real);
@@ -2021,11 +2021,11 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot create folder `%s': folder exists."),
                                      folder_name);
-               
+
                camel_imap_response_free_without_processing (imap_store, response);
-               
+
                CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
-               
+
                return NULL;
        }
 
@@ -2051,9 +2051,9 @@ get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, Ca
                }
        }
        camel_imap_response_free_without_processing (imap_store, response);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (imap_store, connect_lock);
-       
+
        return new_folder;
 }
 
@@ -2083,7 +2083,7 @@ get_folder_offline (CamelStore *store, const char *folder_name,
                camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
                                      _("No such folder %s"), folder_name);
        }
-       
+
        return new_folder;
 }
 
@@ -2097,7 +2097,7 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
 
        if (!camel_imap_store_connected(imap_store, ex))
                goto fail;
-       
+
        /* make sure this folder isn't currently SELECTed */
        response = camel_imap_command (imap_store, NULL, ex, "SELECT INBOX");
        if (!response)
@@ -2164,7 +2164,7 @@ rename_folder_info (CamelImapStore *imap_store, const char *old_name, const char
                        else
                                npath = g_strdup(new_name);
                        nfull = camel_imap_store_summary_path_to_full(imap_store->summary, npath, imap_store->dir_sep);
-                       
+
                        /* workaround for broken server (courier uses '.') that doesn't rename
                           subordinate folders as required by rfc 2060 */
                        if (imap_store->dir_sep == '.') {
@@ -2197,7 +2197,7 @@ rename_folder (CamelStore *store, const char *old_name, const char *new_name_in,
 
        if (!camel_imap_store_connected(imap_store, ex))
                goto fail;
-       
+
        /* make sure this folder isn't currently SELECTed - it's
            actually possible to rename INBOX but if you do another
            INBOX will immediately be created by the server */
@@ -2221,7 +2221,7 @@ rename_folder (CamelStore *store, const char *old_name, const char *new_name_in,
                        manage_subscriptions(store, old_name, TRUE);
                goto fail;
        }
-       
+
        camel_imap_response_free (imap_store, response);
 
        /* rename summary, and handle broken server */
@@ -2240,7 +2240,7 @@ rename_folder (CamelStore *store, const char *old_name, const char *new_name_in,
                g_warning ("Could not rename message cache '%s' to '%s': %s: cache reset",
                           oldpath, newpath, strerror (errno));
        }
-       
+
        g_free (oldpath);
        g_free (newpath);
 fail:
@@ -2260,23 +2260,23 @@ create_folder (CamelStore *store, const char *parent_name,
        gboolean need_convert;
        int i = 0, flags;
        const char *c;
-       
+
        if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), ex))
                return NULL;
        if (!parent_name)
                parent_name = "";
-       
+
        c = folder_name;
        while (*c && *c != imap_store->dir_sep && !strchr ("#%*", *c))
                c++;
-       
+
        if (*c != '\0') {
                camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
                                      _("The folder name \"%s\" is invalid because it contains the character \"%c\""),
                                      folder_name, *c);
                return NULL;
        }
-       
+
        /* check if the parent allows inferiors */
 
        /* FIXME: use storesummary directly */
@@ -2294,14 +2294,14 @@ create_folder (CamelStore *store, const char *parent_name,
                g_free(parent_real);
                return NULL;
        }
-       
+
        /* FIXME: does not handle unexpected circumstances very well */
        for (i = 0; i < response->untagged->len && !need_convert; i++) {
                resp = response->untagged->pdata[i];
-               
+
                if (!imap_parse_list_response (imap_store, resp, &flags, NULL, &thisone))
                        continue;
-               
+
                if (strcmp (thisone, parent_name) == 0) {
                        if (flags & CAMEL_FOLDER_NOINFERIORS)
                                need_convert = TRUE;
@@ -2309,49 +2309,49 @@ create_folder (CamelStore *store, const char *parent_name,
 
                g_free(thisone);
        }
-       
+
        camel_imap_response_free (imap_store, response);
-       
+
        camel_exception_init (&internal_ex);
-       
+
        /* if not, check if we can delete it and recreate it */
        if (need_convert) {
                struct imap_status_item *items, *item;
                guint32 messages = 0;
                char *name;
-               
+
                item = items = get_folder_status (imap_store, parent_name, "MESSAGES");
                while (item != NULL) {
                        if (!g_ascii_strcasecmp (item->name, "MESSAGES")) {
                                messages = item->value;
                                break;
                        }
-                       
+
                        item = item->next;
                }
-               
+
                imap_status_item_free (items);
-               
+
                if (messages > 0) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
                                             _("The parent folder is not allowed to contain subfolders"));
                        g_free(parent_real);
                        return NULL;
                }
-               
+
                /* delete the old parent and recreate it */
                delete_folder (store, parent_name, &internal_ex);
                if (camel_exception_is_set (&internal_ex)) {
                        camel_exception_xfer (ex, &internal_ex);
                        return NULL;
                }
-               
+
                /* add the dirsep to the end of parent_name */
                name = g_strdup_printf ("%s%c", parent_real, imap_store->dir_sep);
                response = camel_imap_command (imap_store, NULL, ex, "CREATE %G",
                                               name);
                g_free (name);
-               
+
                if (!response) {
                        g_free(parent_real);
                        return NULL;
@@ -2360,13 +2360,13 @@ create_folder (CamelStore *store, const char *parent_name,
 
                root = imap_build_folder_info(imap_store, parent_name);
        }
-       
+
        /* ok now we can create the folder */
        real_name = camel_imap_store_summary_path_to_full(imap_store->summary, folder_name, imap_store->dir_sep);
        full_name = imap_concat (imap_store, parent_real, real_name);
        g_free(real_name);
        response = camel_imap_command (imap_store, NULL, ex, "CREATE %G", full_name);
-       
+
        if (response) {
                CamelImapStoreInfo *si;
                CamelFolderInfo *fi;
@@ -2393,7 +2393,7 @@ create_folder (CamelStore *store, const char *parent_name,
 
        g_free (full_name);
        g_free(parent_real);
-       
+
        return root;
 }
 
@@ -2431,16 +2431,16 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store,
        if (!g_ascii_strcasecmp(fi->full_name, "inbox")) {
                flags |= CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_TYPE_INBOX;
                fi->name = g_strdup (_("Inbox"));
-       } else 
+       } else
                fi->name = g_strdup(camel_store_info_name(imap_store->summary, si));
-       
+
        /* HACK: some servers report noinferiors for all folders (uw-imapd)
           We just translate this into nochildren, and let the imap layer enforce
           it.  See create folder */
        if (flags & CAMEL_FOLDER_NOINFERIORS)
                flags = (flags & ~CAMEL_FOLDER_NOINFERIORS) | CAMEL_FOLDER_NOCHILDREN;
        fi->flags = flags;
-       
+
        url = camel_url_new (imap_store->base_url, NULL);
        path = alloca(strlen(fi->full_name)+2);
        sprintf(path, "/%s", fi->full_name);
@@ -2641,7 +2641,7 @@ refresh_refresh(CamelSession *session, CamelSessionThreadMsg *msg)
 
        if (store->namespace && store->namespace[0]) {
                char *pattern;
-               
+
                get_folders_sync(store, "INBOX", &m->ex);
                if (camel_exception_is_set(&m->ex))
                        goto done;
@@ -2726,7 +2726,7 @@ get_folder_info_online (CamelStore *store, const char *top, guint32 flags, Camel
                                get_folders_sync(imap_store, "INBOX", ex);
                                if (camel_exception_is_set(ex))
                                        goto fail;
-                               
+
                                i = strlen(imap_store->namespace)-1;
                                pattern = g_alloca(i+5);
                                strcpy(pattern, imap_store->namespace);
@@ -2741,7 +2741,7 @@ get_folder_info_online (CamelStore *store, const char *top, guint32 flags, Camel
                        }
                } else {
                        char *name;
-                       
+
                        name = camel_imap_store_summary_full_from_path(imap_store->summary, top);
                        if (name == NULL)
                                name = camel_imap_store_summary_path_to_full(imap_store->summary, top, imap_store->dir_sep);
@@ -2822,7 +2822,7 @@ get_folder_info_offline (CamelStore *store, const char *top,
 
                if (si == NULL)
                        continue;
-               
+
                if ((!strcmp(name, camel_imap_store_info_full_name(imap_store->summary, si))
                     || imap_match_pattern(imap_store->dir_sep, pattern, camel_imap_store_info_full_name(imap_store->summary, si))
                     || (include_inbox && !g_ascii_strcasecmp (camel_imap_store_info_full_name(imap_store->summary, si), "INBOX")))
@@ -2838,14 +2838,14 @@ get_folder_info_offline (CamelStore *store, const char *top,
                           it.  See create folder */
                        if (fi->flags & CAMEL_FOLDER_NOINFERIORS)
                                fi->flags = (fi->flags & ~CAMEL_FOLDER_NOINFERIORS) | CAMEL_FOLDER_NOCHILDREN;
-                       
+
                        /* blah, this gets lost somewhere, i can't be bothered finding out why */
                        if (!g_ascii_strcasecmp(fi->full_name, "inbox"))
                                fi->flags = (fi->flags & ~CAMEL_FOLDER_TYPE_MASK) | CAMEL_FOLDER_TYPE_INBOX;
-                       
+
                        if (si->flags & CAMEL_FOLDER_NOSELECT) {
                                CamelURL *url = camel_url_new(fi->uri, NULL);
-                               
+
                                camel_url_set_param (url, "noselect", "yes");
                                g_free(fi->uri);
                                fi->uri = camel_url_to_string (url, 0);
@@ -2898,13 +2898,13 @@ subscribe_folder (CamelStore *store, const char *folder_name,
 
        if (!camel_imap_store_connected (imap_store, ex))
                goto done;
-       
+
        response = camel_imap_command (imap_store, NULL, ex,
                                       "SUBSCRIBE %F", folder_name);
        if (!response)
                goto done;
        camel_imap_response_free (imap_store, response);
-       
+
        si = camel_store_summary_path((CamelStoreSummary *)imap_store->summary, folder_name);
        if (si) {
                if ((si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) == 0) {
@@ -2914,7 +2914,7 @@ subscribe_folder (CamelStore *store, const char *folder_name,
                }
                camel_store_summary_info_free((CamelStoreSummary *)imap_store->summary, si);
        }
-       
+
        if (imap_store->renaming) {
                /* we don't need to emit a "folder_subscribed" signal
                    if we are in the process of renaming folders, so we
@@ -2924,7 +2924,7 @@ subscribe_folder (CamelStore *store, const char *folder_name,
 
        fi = imap_build_folder_info(imap_store, folder_name);
        fi->flags |= CAMEL_FOLDER_NOCHILDREN;
-       
+
        camel_object_trigger_event (CAMEL_OBJECT (store), "folder_subscribed", fi);
        camel_folder_info_free (fi);
 done:
@@ -2939,10 +2939,10 @@ unsubscribe_folder (CamelStore *store, const char *folder_name,
        CamelImapResponse *response;
 
        CAMEL_SERVICE_REC_LOCK(store, connect_lock);
-       
+
        if (!camel_imap_store_connected (imap_store, ex))
                goto done;
-       
+
        response = camel_imap_command (imap_store, NULL, ex,
                                       "UNSUBSCRIBE %F", folder_name);
        if (!response)
@@ -2960,7 +2960,7 @@ folder_flags_have_changed (CamelFolder *folder)
 {
        CamelMessageInfo *info;
        int i, max;
-       
+
        max = camel_folder_summary_count (folder->summary);
        for (i = 0; i < max; i++) {
                info = camel_folder_summary_index (folder->summary, i);
@@ -2970,7 +2970,7 @@ folder_flags_have_changed (CamelFolder *folder)
                        return TRUE;
                }
        }
-       
+
        return FALSE;
 }
 #endif
@@ -3009,29 +3009,29 @@ camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *e
        char linebuf[1024] = {0};
        GByteArray *ba;
        ssize_t nread;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP_STORE (store), -1);
        g_return_val_if_fail (dest, -1);
-       
+
        *dest = NULL;
-       
+
        /* Check for connectedness. Failed (or cancelled) operations will
         * close the connection. We can't expect a read to have any
         * meaning if we reconnect, so always set an exception.
         */
-       
+
        if (!camel_imap_store_connected (store, ex))
                return -1;
-       
+
        stream = CAMEL_STREAM_BUFFER (store->istream);
-       
+
        ba = g_byte_array_new ();
        while ((nread = camel_stream_buffer_gets (stream, linebuf, sizeof (linebuf))) > 0) {
                g_byte_array_append (ba, linebuf, nread);
                if (linebuf[nread - 1] == '\n')
                        break;
        }
-       
+
        if (nread <= 0) {
                if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled"));
@@ -3039,17 +3039,17 @@ camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *e
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                              _("Server unexpectedly disconnected: %s"),
                                              g_strerror (errno));
-               
+
                camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
                g_byte_array_free (ba, TRUE);
                return -1;
        }
-       
+
        if (camel_verbose_debug) {
                fprintf (stderr, "received: ");
                fwrite (ba->data, 1, ba->len, stderr);
        }
-       
+
        /* camel-imap-command.c:imap_read_untagged expects the CRLFs
            to be stripped off and be nul-terminated *sigh* */
        nread = ba->len - 1;
@@ -3058,9 +3058,9 @@ camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *e
                ba->data[nread - 1] = '\0';
                nread--;
        }
-       
+
        *dest = ba->data;
        g_byte_array_free (ba, FALSE);
-       
+
        return nread;
 }
index cea8d1b..33179df 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-store.h : class for an imap store */
 
-/* 
+/*
  * Authors: Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright (C) 2000 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -111,13 +111,13 @@ typedef enum {
 #define IMAP_FETCH_MINIMAL_HEADERS 3
 
 struct _CamelImapStore {
-       CamelDiscoStore parent_object;  
-       
+       CamelDiscoStore parent_object;
+
        CamelStream *istream;
        CamelStream *ostream;
 
        struct _CamelImapStoreSummary *summary;
-       
+
        /* Information about the command channel / connection status */
        guint connected:1;
        guint preauthed:1;
@@ -131,14 +131,14 @@ struct _CamelImapStore {
        char tag_prefix;
        guint32 command;
        CamelFolder *current_folder;
-       
+
        /* Information about the server */
        CamelImapServerLevel server_level;
        guint32 capabilities, parameters;
        /* NB: namespace should be handled by summary->namespace */
        char *namespace, dir_sep, *base_url, *storage_path;
        GHashTable *authtypes;
-       
+
        time_t refresh_stamp;
 
        guint32 headers;
index c2822b1..e3ccc5a 100644 (file)
@@ -149,7 +149,7 @@ static int
 summary_header_load (CamelFolderSummary *s, FILE *in)
 {
        CamelImapSummary *ims = CAMEL_IMAP_SUMMARY (s);
-       
+
        if (camel_imap_summary_parent->summary_header_load (s, in) == -1)
                return -1;
 
@@ -160,18 +160,18 @@ summary_header_load (CamelFolderSummary *s, FILE *in)
        /* Version 1 */
        if (camel_file_util_decode_fixed_int32(in, &ims->version) == -1)
                return -1;
-       
+
        if (ims->version == 2) {
                /* Version 2: for compat with version 2 of the imap4 summary files */
                int have_mlist;
-               
+
                if (camel_file_util_decode_fixed_int32 (in, &have_mlist) == -1)
                        return -1;
        }
-       
+
        if (camel_file_util_decode_fixed_int32(in, &ims->validity) == -1)
                return -1;
-       
+
        if (ims->version > CAMEL_IMAP_SUMMARY_VERSION) {
                g_warning("Unkown summary version\n");
                errno = EINVAL;
index 8311bbf..df9e139 100644 (file)
@@ -87,7 +87,7 @@ void camel_imap_summary_add_offline (CamelFolderSummary *summary,
                                     CamelMimeMessage *message,
                                     const CamelMessageInfo *info);
 
-void camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary, 
+void camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary,
                                              const char *uid,
                                              const CamelMessageInfo *info);
 
index 69ee21f..a482d5b 100644 (file)
@@ -1,11 +1,11 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-types.h: IMAP types */
 
-/* 
+/*
  * Copyright (C) 2001 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index f7f65ea..f7332e8 100644 (file)
@@ -54,16 +54,16 @@ const char *
 imap_next_word (const char *buf)
 {
        const char *word;
-       
+
        /* skip over current word */
        word = buf;
        while (*word && *word != ' ')
                word++;
-       
+
        /* skip over white space */
        while (*word && *word == ' ')
                word++;
-       
+
        return word;
 }
 
@@ -72,7 +72,7 @@ static void
 imap_namespace_destroy (struct _namespace *namespace)
 {
        struct _namespace *node, *next;
-       
+
        node = namespace;
        while (node) {
                next = node->next;
@@ -100,30 +100,30 @@ imap_namespace_decode (const char **in, struct _namespace **namespace)
        const char *inptr;
        char *astring;
        size_t len;
-       
+
        inptr = *in;
-       
+
        list = NULL;
        tail = (struct _namespace *) &list;
-       
+
        if (g_ascii_strncasecmp (inptr, "NIL", 3) != 0) {
                if (*inptr++ != '(')
                        goto exception;
-               
+
                while (*inptr && *inptr != ')') {
                        if (*inptr++ != '(')
                                goto exception;
-                       
+
                        node = g_new (struct _namespace, 1);
                        node->next = NULL;
-                       
+
                        /* get the namespace prefix */
                        astring = imap_parse_astring (&inptr, &len);
                        if (!astring) {
                                g_free (node);
                                goto exception;
                        }
-                       
+
                        /* decode IMAP's modified UTF-7 into UTF-8 */
                        node->prefix = imap_mailbox_decode (astring, len);
                        g_free (astring);
@@ -131,34 +131,34 @@ imap_namespace_decode (const char **in, struct _namespace **namespace)
                                g_free (node);
                                goto exception;
                        }
-                       
+
                        tail->next = node;
                        tail = node;
-                       
+
                        /* get the namespace directory delimiter */
                        inptr = imap_next_word (inptr);
-                       
+
                        if (!g_ascii_strncasecmp (inptr, "NIL", 3)) {
                                inptr = imap_next_word (inptr);
                                node->delim = '\0';
                        } else if (*inptr++ == '"') {
                                if (*inptr == '\\')
                                        inptr++;
-                               
+
                                node->delim = *inptr++;
-                               
+
                                if (*inptr++ != '"')
                                        goto exception;
                        } else
                                goto exception;
-                       
+
                        if (*inptr == ' ') {
                                /* parse extra flags... for now we
                                    don't save them, but in the future
                                    we may want to? */
                                while (*inptr == ' ')
                                        inptr++;
-                               
+
                                while (*inptr && *inptr != ')') {
                                        /* this should be a QSTRING or ATOM */
                                        inptr = imap_next_word (inptr);
@@ -166,38 +166,38 @@ imap_namespace_decode (const char **in, struct _namespace **namespace)
                                                /* skip over the param list */
                                                imap_skip_list (&inptr);
                                        }
-                                       
+
                                        while (*inptr == ' ')
                                                inptr++;
                                }
                        }
-                       
+
                        if (*inptr++ != ')')
                                goto exception;
-                       
+
                        /* there shouldn't be spaces according to the
                            ABNF grammar, but we all know how closely
                            people follow specs */
                        while (*inptr == ' ')
                                inptr++;
                }
-               
+
                if (*inptr == ')')
                        inptr++;
        } else {
                inptr += 3;
        }
-       
+
        *in = inptr;
        *namespace = list;
-       
+
        return TRUE;
-       
+
  exception:
-       
+
        /* clean up any namespaces we may have allocated */
        imap_namespace_destroy (list);
-       
+
        return FALSE;
 }
 
@@ -206,7 +206,7 @@ static void
 namespace_dump (struct _namespace *namespace)
 {
        struct _namespace *node;
-       
+
        if (namespace) {
                printf ("(");
                node = namespace;
@@ -216,12 +216,12 @@ namespace_dump (struct _namespace *namespace)
                                printf ("\"%c\")", node->delim);
                        else
                                printf ("NUL)");
-                       
+
                        node = node->next;
                        if (node)
                                printf (" ");
                }
-               
+
                printf (")");
        } else {
                printf ("NIL");
@@ -246,52 +246,52 @@ imap_parse_namespace_response (const char *response)
 {
        struct _namespaces *namespaces;
        const char *inptr;
-       
+
        d(printf ("parsing: %s\n", response));
-       
+
        if (*response != '*')
                return NULL;
-       
+
        inptr = imap_next_word (response);
        if (g_ascii_strncasecmp (inptr, "NAMESPACE", 9) != 0)
                return NULL;
-       
+
        inptr = imap_next_word (inptr);
-       
+
        namespaces = g_new (struct _namespaces, 1);
        namespaces->personal = NULL;
        namespaces->other = NULL;
        namespaces->shared = NULL;
-       
+
        if (!imap_namespace_decode (&inptr, &namespaces->personal))
                goto exception;
-       
+
        if (*inptr != ' ')
                goto exception;
-       
+
        while (*inptr == ' ')
                inptr++;
-       
+
        if (!imap_namespace_decode (&inptr, &namespaces->other))
                goto exception;
-       
+
        if (*inptr != ' ')
                goto exception;
-       
+
        while (*inptr == ' ')
                inptr++;
-       
+
        if (!imap_namespace_decode (&inptr, &namespaces->shared))
                goto exception;
-       
+
        d(namespaces_dump (namespaces));
-       
+
        return namespaces;
-       
+
  exception:
-       
+
        imap_namespaces_destroy (namespaces);
-       
+
        return NULL;
 }
 
@@ -314,26 +314,26 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
        gboolean is_lsub = FALSE;
        const char *word;
        size_t len;
-       
+
        if (*buf != '*')
                return FALSE;
-       
+
        word = imap_next_word (buf);
        if (g_ascii_strncasecmp (word, "LIST", 4) && g_ascii_strncasecmp (word, "LSUB", 4))
                return FALSE;
-       
+
        /* check if we are looking at an LSUB response */
        if (word[1] == 'S' || word[1] == 's')
                is_lsub = TRUE;
-       
+
        /* get the flags */
        word = imap_next_word (word);
        if (*word != '(')
                return FALSE;
-       
+
        if (flags)
                *flags = 0;
-       
+
        word++;
        while (*word != ')') {
                len = strcspn (word, " )");
@@ -351,12 +351,12 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
                        else if (!g_ascii_strncasecmp (word, "\\HasNoChildren", len))
                                *flags |= CAMEL_FOLDER_NOCHILDREN;
                }
-               
+
                word += len;
                while (*word == ' ')
                        word++;
        }
-       
+
        /* get the directory separator */
        word = imap_next_word (word);
        if (!strncmp (word, "NIL", 3)) {
@@ -372,11 +372,11 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
                        return FALSE;
        } else
                return FALSE;
-       
+
        if (folder) {
                char *astring;
                char *mailbox;
-               
+
                /* get the folder name */
                word = imap_next_word (word);
                astring = imap_parse_astring (&word, &len);
@@ -389,7 +389,7 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
                g_free (astring);
                if (!mailbox)
                        return FALSE;
-               
+
                /* Kludge around Courier imap's LSUB response for INBOX when it
                 * isn't subscribed to.
                 *
@@ -404,11 +404,11 @@ imap_parse_list_response (CamelImapStore *store, const char *buf, int *flags, ch
                 */
                if (is_lsub && flags && !g_ascii_strcasecmp (mailbox, "INBOX"))
                        *flags &= ~CAMEL_FOLDER_NOSELECT;
-               
+
                *folder = mailbox;
 
        }
-       
+
        return TRUE;
 }
 
@@ -430,13 +430,13 @@ imap_parse_folder_name (CamelImapStore *store, const char *folder_name)
        GPtrArray *heirarchy;
        char **paths;
        const char *p;
-       
+
        p = folder_name;
        if (*p == store->dir_sep)
                p++;
-       
+
        heirarchy = g_ptr_array_new ();
-       
+
        while (*p) {
                if (*p == '"') {
                        p++;
@@ -446,19 +446,19 @@ imap_parse_folder_name (CamelImapStore *store, const char *folder_name)
                                p++;
                        continue;
                }
-               
+
                if (*p == store->dir_sep)
                        g_ptr_array_add (heirarchy, g_strndup (folder_name, p - folder_name));
-               
+
                p++;
        }
-       
+
        g_ptr_array_add (heirarchy, g_strdup (folder_name));
        g_ptr_array_add (heirarchy, NULL);
-       
+
        paths = (char **) heirarchy->pdata;
        g_ptr_array_free (heirarchy, FALSE);
-       
+
        return paths;
 }
 
@@ -467,7 +467,7 @@ imap_create_flag_list (guint32 flags)
 {
        GString *gstr;
        char *flag_list;
-       
+
        gstr = g_string_new ("(");
 
        if (flags & CAMEL_MESSAGE_ANSWERED)
@@ -534,12 +534,12 @@ imap_parse_flag_list (char **flag_list_p)
        char *flag_list = *flag_list_p;
        guint32 flags = 0;
        int len;
-       
+
        if (*flag_list++ != '(') {
                *flag_list_p = NULL;
                return 0;
        }
-       
+
        while (*flag_list && *flag_list != ')') {
                len = strcspn (flag_list, " )");
                if (!g_ascii_strncasecmp (flag_list, "\\Answered", len))
@@ -568,17 +568,17 @@ imap_parse_flag_list (char **flag_list_p)
                        flags |= CAMEL_IMAP_MESSAGE_LABEL4;
                else if (!g_ascii_strncasecmp(flag_list, "$Label5", len))
                        flags |= CAMEL_IMAP_MESSAGE_LABEL5;
-               
+
                flag_list += len;
                if (*flag_list == ' ')
                        flag_list++;
        }
-       
+
        if (*flag_list++ != ')') {
                *flag_list_p = NULL;
                return 0;
        }
-       
+
        *flag_list_p = flag_list;
        return flags;
 }
@@ -616,14 +616,14 @@ static unsigned char imap_atom_specials[256] = {
 /* 50 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1,
 /* 60 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 /* 70 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 };
 
 #define imap_is_atom_char(c) ((imap_atom_specials[(c)&0xff] & 0x01) != 0)
@@ -670,17 +670,17 @@ imap_parse_string_generic (const char **str_p, size_t *len, int type)
 {
        const char *str = *str_p;
        char *out;
-       
+
        if (!str)
                return NULL;
        else if (*str == '"') {
                char *p;
                size_t size;
-               
+
                str++;
                size = strcspn (str, "\"") + 1;
                p = out = g_malloc (size);
-               
+
                /* a quoted string cannot be broken into multiple lines */
                while (*str && *str != '"' && *str != '\n') {
                        if (*str == '\\')
@@ -707,7 +707,7 @@ imap_parse_string_generic (const char **str_p, size_t *len, int type)
                        *str_p = NULL;
                        return NULL;
                }
-               
+
                out = g_strndup (str, *len);
                *str_p = str + *len;
                return out;
@@ -718,7 +718,7 @@ imap_parse_string_generic (const char **str_p, size_t *len, int type)
        } else if (type == IMAP_ASTRING && imap_is_atom_char ((unsigned char)*str)) {
                while (imap_is_atom_char ((unsigned char) *str))
                        str++;
-               
+
                *len = str - *str_p;
                out = g_strndup (*str_p, *len);
                *str_p += *len;
@@ -743,7 +743,7 @@ static void
 skip_asn (const char **str_p)
 {
        const char *str = *str_p;
-       
+
        if (!str)
                return;
        else if (*str == '"') {
@@ -760,7 +760,7 @@ skip_asn (const char **str_p)
                        *str_p = NULL;
        } else if (*str == '{') {
                unsigned long len;
-               
+
                len = strtoul (str + 1, (char **) &str, 10);
                if (*str != '}' || *(str + 1) != '\n' ||
                    strlen (str + 2) < len) {
@@ -799,34 +799,34 @@ parse_params (const char **parms_p, CamelContentType *type)
        const char *parms = *parms_p;
        char *name, *value;
        size_t len;
-       
+
        if (!g_ascii_strncasecmp (parms, "nil", 3)) {
                *parms_p += 3;
                return 0;
        }
-       
+
        if (*parms++ != '(')
                return -1;
-       
+
        while (parms && *parms != ')') {
                name = imap_parse_nstring (&parms, &len);
                skip_char (&parms, ' ');
                value = imap_parse_nstring (&parms, &len);
-               
+
                if (name && value)
                        camel_content_type_set_param (type, name, value);
                g_free (name);
                g_free (value);
-               
+
                if (parms && *parms == ' ')
                        parms++;
        }
-       
+
        if (!parms || *parms++ != ')')
                return -1;
-       
+
        *parms_p = parms;
-       
+
        return 0;
 }
 
@@ -843,48 +843,48 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
        size_t len;
        size_t size;
        char *p;
-       
+
        if (*inptr++ != '(')
                return NULL;
-       
+
        if (ci == NULL) {
                ci = camel_folder_summary_content_info_new (folder->summary);
                g_ptr_array_add (cis, ci);
        }
-       
+
        if (*inptr == '(') {
                /* body_type_mpart */
                CamelMessageContentInfo *tail, *children = NULL;
-               
+
                tail = (CamelMessageContentInfo *) &children;
-               
+
                do {
                        if (!(child = imap_body_decode (&inptr, NULL, folder, cis)))
                                return NULL;
-                       
+
                        child->parent = ci;
                        tail->next = child;
                        tail = child;
                } while (*inptr == '(');
-               
+
                if (*inptr++ != ' ')
                        return NULL;
-               
+
                if (g_ascii_strncasecmp (inptr, "nil", 3) != 0) {
                        subtype = imap_parse_string (&inptr, &len);
                } else {
                        subtype = NULL;
                        inptr += 3;
                }
-               
+
                ctype = camel_content_type_new ("multipart", subtype ? subtype : "mixed");
                g_free (subtype);
-               
+
                if (*inptr++ != ')') {
                        camel_content_type_unref (ctype);
                        return NULL;
                }
-               
+
                ci->type = ctype;
                ci->childs = children;
        } else {
@@ -896,12 +896,12 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                } else {
                        return NULL;
                }
-               
+
                if (*inptr++ != ' ') {
                        g_free (type);
                        return NULL;
                }
-               
+
                if (g_ascii_strncasecmp (inptr, "nil", 3) != 0) {
                        subtype = imap_parse_string (&inptr, &len);
                        if (inptr == NULL) {
@@ -915,23 +915,23 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                                subtype = NULL;
                        inptr += 3;
                }
-               
+
                camel_strdown (type);
                camel_strdown (subtype);
                ctype = camel_content_type_new (type, subtype);
                g_free (subtype);
                g_free (type);
-               
+
                if (*inptr++ != ' ')
                        goto exception;
-               
+
                /* content-type params */
                if (parse_params (&inptr, ctype) == -1)
                        goto exception;
-               
+
                if (*inptr++ != ' ')
                        goto exception;
-               
+
                /* content-id */
                if (g_ascii_strncasecmp (inptr, "nil", 3) != 0) {
                        id = imap_parse_string (&inptr, &len);
@@ -939,10 +939,10 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                                goto exception;
                } else
                        inptr += 3;
-               
+
                if (*inptr++ != ' ')
                        goto exception;
-               
+
                /* description */
                if (g_ascii_strncasecmp (inptr, "nil", 3) != 0) {
                        description = imap_parse_string (&inptr, &len);
@@ -950,10 +950,10 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                                goto exception;
                } else
                        inptr += 3;
-               
+
                if (*inptr++ != ' ')
                        goto exception;
-               
+
                /* encoding */
                if (g_ascii_strncasecmp (inptr, "nil", 3) != 0) {
                        encoding = imap_parse_string (&inptr, &len);
@@ -961,10 +961,10 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                                goto exception;
                } else
                        inptr += 3;
-               
+
                if (*inptr++ != ' ')
                        goto exception;
-               
+
                /* size */
                size = strtoul ((const char *) inptr, &p, 10);
                /* check if the size wasn't negative */
@@ -980,43 +980,43 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                        goto exception;
 
                inptr = (const unsigned char *) p;
-               
+
                if (camel_content_type_is (ctype, "message", "rfc822")) {
                        /* body_type_msg */
                        if (*inptr++ != ' ')
                                goto exception;
-                       
+
                        /* envelope */
                        imap_skip_list (&inptr);
-                       
+
                        if (!inptr || *inptr++ != ' ')
                                goto exception;
-                       
+
                        /* body */
                        if (!(child = imap_body_decode (&inptr, NULL, folder, cis)))
                                goto exception;
                        child->parent = ci;
-                       
+
                        if (!inptr || *inptr++ != ' ')
                                goto exception;
-                       
+
                        /* lines */
                        strtoul ((const char *) inptr, &p, 10);
                        inptr = (const unsigned char *) p;
                } else if (camel_content_type_is (ctype, "text", "*")) {
                        if (!inptr || *inptr++ != ' ')
                                goto exception;
-                       
+
                        /* lines */
                        strtoul ((const char *) inptr, &p, 10);
                        inptr = (const unsigned char *) p;
                } else {
                        /* body_type_basic */
                }
-               
+
                if (!inptr || *inptr++ != ')')
                        goto exception;
-               
+
                ci->type = ctype;
                ci->id = id;
                ci->description = description;
@@ -1024,18 +1024,18 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
                ci->size = size;
                ci->childs = child;
        }
-       
+
        *in = inptr;
-       
+
        return ci;
-       
+
  exception:
-       
+
        camel_content_type_unref (ctype);
        g_free (id);
        g_free (description);
        g_free (encoding);
-       
+
        return NULL;
 }
 
@@ -1058,31 +1058,31 @@ imap_parse_body (const char **body_p, CamelFolder *folder,
        CamelMessageContentInfo *child;
        GPtrArray *children;
        int i;
-       
+
        if (!inptr || *inptr != '(') {
                *body_p = NULL;
                return;
        }
-       
+
        children = g_ptr_array_new ();
-       
+
        if (!(imap_body_decode (&inptr, ci, folder, children))) {
                for (i = 0; i < children->len; i++) {
                        child = children->pdata[i];
-                       
+
                        /* content_info_free will free all the child
                         * nodes, but we don't want that. */
                        child->next = NULL;
                        child->parent = NULL;
                        child->childs = NULL;
-                       
+
                        camel_folder_summary_content_info_free (folder->summary, child);
                }
                *body_p = NULL;
        } else {
                *body_p = inptr;
        }
-       
+
        g_ptr_array_free (children, TRUE);
 }
 
@@ -1100,16 +1100,16 @@ imap_quote_string (const char *str)
        const char *p;
        char *quoted, *q;
        int len;
-       
+
        g_assert (strchr (str, '\r') == NULL);
-       
+
        len = strlen (str);
        p = str;
        while ((p = strpbrk (p, "\"\\"))) {
                len++;
                p++;
        }
-       
+
        quoted = q = g_malloc (len + 3);
        *q++ = '"';
        for (p = str; *p; ) {
@@ -1119,7 +1119,7 @@ imap_quote_string (const char *str)
        }
        *q++ = '"';
        *q = '\0';
-       
+
        return quoted;
 }
 
@@ -1129,7 +1129,7 @@ get_summary_uid_numeric (CamelFolderSummary *summary, int index)
 {
        CamelMessageInfo *info;
        unsigned long uid;
-       
+
        info = camel_folder_summary_index (summary, index);
        uid = strtoul (camel_message_info_uid (info), NULL, 10);
        camel_message_info_free(info);
@@ -1156,7 +1156,7 @@ get_summary_uid_numeric (CamelFolderSummary *summary, int index)
  * *not* included in the returned set string.
  *
  * Note: @uids MUST be in sorted order for this code to work properly.
- * 
+ *
  * Return value: the set, which the caller must free with g_free()
  **/
 char *
@@ -1167,14 +1167,14 @@ imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ss
        int si, scount;
        GString *gset;
        char *set;
-       
+
        g_return_val_if_fail (uids->len > uid, NULL);
-       
+
        gset = g_string_new (uids->pdata[uid]);
        last_uid = strtoul (uids->pdata[uid], NULL, 10);
        next_summary_uid = 0;
        scount = camel_folder_summary_count (summary);
-       
+
        for (uid++, si = 0; uid < uids->len && !UID_SET_FULL (gset->len, maxlen); uid++) {
                /* Find the next UID in the summary after the one we
                 * just wrote out.
@@ -1183,7 +1183,7 @@ imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ss
                        next_summary_uid = get_summary_uid_numeric (summary, si);
                if (last_uid >= next_summary_uid)
                        next_summary_uid = (unsigned long) -1;
-               
+
                /* Now get the next UID from @uids */
                this_uid = strtoul (uids->pdata[uid], NULL, 10);
                if (this_uid == next_summary_uid || this_uid == last_uid + 1)
@@ -1195,18 +1195,18 @@ imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids, int uid, ss
                        }
                        g_string_append_printf (gset, ",%lu", this_uid);
                }
-               
+
                last_uid = this_uid;
        }
-       
+
        if (range)
                g_string_append_printf (gset, ":%lu", last_uid);
-       
+
        *lastuid = uid;
-       
+
        set = gset->str;
        g_string_free (gset, FALSE);
-       
+
        return set;
 }
 
@@ -1233,10 +1233,10 @@ imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids)
        char *p, *q;
        unsigned long uid, suid;
        int si, scount;
-       
+
        arr = g_ptr_array_new ();
        scount = camel_folder_summary_count (summary);
-       
+
        p = (char *)uids;
        si = 0;
        do {
@@ -1244,7 +1244,7 @@ imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids)
                if (p == q)
                        goto lose;
                g_ptr_array_add (arr, g_strndup (p, q - p));
-               
+
                if (*q == ':') {
                        /* Find the summary entry for the UID after the one
                         * we just saw.
@@ -1256,11 +1256,11 @@ imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids)
                        }
                        if (si >= scount)
                                suid = uid + 1;
-                       
+
                        uid = strtoul (q + 1, &p, 10);
                        if (p == q + 1)
                                goto lose;
-                       
+
                        /* Add each summary UID until we find one
                         * larger than the end of the range
                         */
@@ -1274,9 +1274,9 @@ imap_uid_set_to_array (CamelFolderSummary *summary, const char *uids)
                } else
                        p = q;
        } while (*p++ == ',');
-       
+
        return arr;
-       
+
  lose:
        g_warning ("Invalid uid set %s", uids);
        imap_uid_array_free (arr);
@@ -1293,7 +1293,7 @@ void
 imap_uid_array_free (GPtrArray *arr)
 {
        int i;
-       
+
        for (i = 0; i < arr->len; i++)
                g_free (arr->pdata[i]);
        g_ptr_array_free (arr, TRUE);
@@ -1303,7 +1303,7 @@ char *
 imap_concat (CamelImapStore *imap_store, const char *prefix, const char *suffix)
 {
        size_t len;
-       
+
        len = strlen (prefix);
        if (len == 0 || prefix[len - 1] == imap_store->dir_sep)
                return g_strdup_printf ("%s%s", prefix, suffix);
@@ -1319,7 +1319,7 @@ imap_mailbox_encode (const unsigned char *in, size_t inlen)
        buf = g_alloca (inlen + 1);
        memcpy (buf, in, inlen);
        buf[inlen] = 0;
-       
+
        return camel_utf8_utf7 (buf);
 }
 
@@ -1327,11 +1327,11 @@ char *
 imap_mailbox_decode (const unsigned char *in, size_t inlen)
 {
        char *buf;
-       
+
        buf = g_alloca (inlen + 1);
        memcpy (buf, in, inlen);
        buf[inlen] = 0;
-       
+
        return camel_utf7_utf8 (buf);
 }
 
index a8cb8db..f32d874 100644 (file)
@@ -78,9 +78,9 @@ camel_imap_wrapper_finalize (CamelObject *object)
                g_free (imap_wrapper->uid);
        if (imap_wrapper->part)
                g_free (imap_wrapper->part_spec);
-       
+
        g_mutex_free (imap_wrapper->priv->lock);
-       
+
        g_free (imap_wrapper->priv);
 }
 
@@ -118,11 +118,11 @@ static void
 imap_wrapper_hydrate (CamelImapWrapper *imap_wrapper, CamelStream *stream)
 {
        CamelDataWrapper *data_wrapper = (CamelDataWrapper *) imap_wrapper;
-       
+
        camel_object_ref (stream);
        data_wrapper->stream = stream;
        data_wrapper->offline = FALSE;
-       
+
        camel_object_unref (imap_wrapper->folder);
        imap_wrapper->folder = NULL;
        g_free (imap_wrapper->uid);
@@ -136,11 +136,11 @@ static ssize_t
 write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
 {
        CamelImapWrapper *imap_wrapper = CAMEL_IMAP_WRAPPER (data_wrapper);
-       
+
        CAMEL_IMAP_WRAPPER_LOCK (imap_wrapper, lock);
        if (data_wrapper->offline) {
                CamelStream *datastream;
-               
+
                datastream = camel_imap_folder_fetch_data (
                        imap_wrapper->folder, imap_wrapper->uid,
                        imap_wrapper->part_spec, FALSE, NULL);
@@ -154,12 +154,12 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
 #endif
                        return -1;
                }
-               
+
                imap_wrapper_hydrate (imap_wrapper, datastream);
                camel_object_unref (datastream);
        }
        CAMEL_IMAP_WRAPPER_UNLOCK (imap_wrapper, lock);
-       
+
        return parent_class->write_to_stream (data_wrapper, stream);
 }
 
index 5c74377..1e3003e 100644 (file)
@@ -54,7 +54,7 @@ static int
 imap4_string_get_type (const char *str)
 {
        int type = 0;
-       
+
        while (*str) {
                if (!is_atom (*str)) {
                        if (is_qsafe (*str))
@@ -64,7 +64,7 @@ imap4_string_get_type (const char *str)
                }
                str++;
        }
-       
+
        return type;
 }
 
@@ -74,7 +74,7 @@ imap4_string_is_atom_safe (const char *str)
 {
        while (is_atom (*str))
                str++;
-       
+
        return *str == '\0';
 }
 
@@ -83,7 +83,7 @@ imap4_string_is_quote_safe (const char *str)
 {
        while (is_qsafe (*str))
                str++;
-       
+
        return *str == '\0';
 }
 #endif
@@ -94,16 +94,16 @@ camel_imap4_literal_length (CamelIMAP4Literal *literal)
        CamelStream *stream, *null;
        CamelMimeFilter *crlf;
        size_t len;
-       
+
        if (literal->type == CAMEL_IMAP4_LITERAL_STRING)
                return strlen (literal->literal.string);
-       
+
        null = camel_stream_null_new ();
        crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
        stream = (CamelStream *) camel_stream_filter_new_with_stream (null);
        camel_stream_filter_add ((CamelStreamFilter *) stream, crlf);
        camel_object_unref (crlf);
-       
+
        switch (literal->type) {
        case CAMEL_IMAP4_LITERAL_STREAM:
                camel_stream_write_to_stream (literal->literal.stream, stream);
@@ -116,12 +116,12 @@ camel_imap4_literal_length (CamelIMAP4Literal *literal)
                g_assert_not_reached ();
                break;
        }
-       
+
        len = ((CamelStreamNull *) null)->written;
-       
+
        camel_object_unref (stream);
        camel_object_unref (null);
-       
+
        return len;
 }
 
@@ -129,13 +129,13 @@ static CamelIMAP4CommandPart *
 command_part_new (void)
 {
        CamelIMAP4CommandPart *part;
-       
+
        part = g_new (CamelIMAP4CommandPart, 1);
        part->next = NULL;
        part->buffer = NULL;
        part->buflen = 0;
        part->literal = NULL;
-       
+
        return part;
 }
 
@@ -144,7 +144,7 @@ imap4_command_append_string (CamelIMAP4Engine *engine, CamelIMAP4CommandPart **t
 {
        CamelIMAP4CommandPart *part;
        CamelIMAP4Literal *literal;
-       
+
        switch (imap4_string_get_type (string)) {
        case IMAP4_STRING_ATOM:
                /* string is safe as it is... */
@@ -164,17 +164,17 @@ imap4_command_append_string (CamelIMAP4Engine *engine, CamelIMAP4CommandPart **t
                        literal = g_new (CamelIMAP4Literal, 1);
                        literal->type = CAMEL_IMAP4_LITERAL_STRING;
                        literal->literal.string = g_strdup (string);
-                       
+
                        g_string_append_printf (str, "{%lu}\r\n", strlen (string));
-                       
+
                        (*tail)->buffer = g_strdup (str->str);
                        (*tail)->buflen = str->len;
                        (*tail)->literal = literal;
-                       
+
                        part = command_part_new ();
                        (*tail)->next = part;
                        (*tail) = part;
-                       
+
                        g_string_truncate (str, 0);
                }
                break;
@@ -188,15 +188,15 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
        CamelIMAP4Command *ic;
        const char *start;
        GString *str;
-       
+
        tail = parts = command_part_new ();
-       
+
        str = g_string_new ("");
        start = format;
-       
+
        while (*format) {
                register char ch = *format++;
-               
+
                if (ch == '%') {
                        CamelIMAP4Literal *literal;
                        CamelIMAP4Folder *folder;
@@ -206,9 +206,9 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
                        size_t len;
                        void *obj;
                        int c, d;
-                       
+
                        g_string_append_len (str, start, format - start - 1);
-                       
+
                        switch (*format) {
                        case '%':
                                /* literal % */
@@ -238,7 +238,7 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
                        case 'L':
                                /* Literal */
                                obj = va_arg (args, void *);
-                               
+
                                literal = g_new (CamelIMAP4Literal, 1);
                                if (CAMEL_IS_DATA_WRAPPER (obj)) {
                                        literal->type = CAMEL_IMAP4_LITERAL_WRAPPER;
@@ -249,23 +249,23 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
                                } else {
                                        g_assert_not_reached ();
                                }
-                               
+
                                camel_object_ref (obj);
-                               
+
                                /* FIXME: take advantage of LITERAL+? */
                                len = camel_imap4_literal_length (literal);
                                g_string_append_printf (str, "{%lu}\r\n", len);
-                               
+
                                tail->buffer = g_strdup (str->str);
                                tail->buflen = str->len;
                                tail->literal = literal;
-                               
+
                                part = command_part_new ();
                                tail->next = part;
                                tail = part;
-                               
+
                                g_string_truncate (str, 0);
-                               
+
                                break;
                        case 'V':
                                /* a string vector of arguments which may need to be quoted or made into literals */
@@ -273,16 +273,16 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
                                while (*function != ' ')
                                        function--;
                                function++;
-                               
+
                                function = g_strdup (function);
-                               
+
                                strv = va_arg (args, char **);
                                for (d = 0; strv[d]; d++) {
                                        if (d > 0)
                                                g_string_append (str, function);
                                        imap4_command_append_string (engine, &tail, str, strv[d]);
                                }
-                               
+
                                g_free (function);
                                break;
                        case 'S':
@@ -301,19 +301,19 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
                                g_string_append_c (str, *format);
                                break;
                        }
-                       
+
                        format++;
-                       
+
                        start = format;
                }
        }
-       
+
        g_string_append (str, start);
        tail->buffer = str->str;
        tail->buflen = str->len;
        tail->literal = NULL;
        g_string_free (str, FALSE);
-       
+
        ic = g_new0 (CamelIMAP4Command, 1);
        ((EDListNode *) ic)->next = NULL;
        ((EDListNode *) ic)->prev = NULL;
@@ -324,15 +324,15 @@ camel_imap4_command_newv (CamelIMAP4Engine *engine, CamelIMAP4Folder *imap4_fold
        ic->ref_count = 1;
        ic->parts = parts;
        ic->part = parts;
-       
+
        camel_exception_init (&ic->ex);
-       
+
        if (imap4_folder) {
                camel_object_ref (imap4_folder);
                ic->folder = imap4_folder;
        } else
                ic->folder = NULL;
-       
+
        return ic;
 }
 
@@ -341,11 +341,11 @@ camel_imap4_command_new (CamelIMAP4Engine *engine, CamelIMAP4Folder *folder, con
 {
        CamelIMAP4Command *command;
        va_list args;
-       
+
        va_start (args, format);
        command = camel_imap4_command_newv (engine, folder, format, args);
        va_end (args);
-       
+
        return command;
 }
 
@@ -366,30 +366,30 @@ camel_imap4_command_unref (CamelIMAP4Command *ic)
 {
        CamelIMAP4CommandPart *part, *next;
        int i;
-       
+
        if (ic == NULL)
                return;
-       
+
        ic->ref_count--;
        if (ic->ref_count == 0) {
                if (ic->folder)
                        camel_object_unref (ic->folder);
-               
+
                g_free (ic->tag);
-               
+
                for (i = 0; i < ic->resp_codes->len; i++) {
                        CamelIMAP4RespCode *resp_code;
-                       
+
                        resp_code = ic->resp_codes->pdata[i];
                        camel_imap4_resp_code_free (resp_code);
                }
                g_ptr_array_free (ic->resp_codes, TRUE);
-               
+
                g_hash_table_foreach (ic->untagged, (GHFunc) g_free, NULL);
                g_hash_table_destroy (ic->untagged);
-               
+
                camel_exception_clear (&ic->ex);
-               
+
                part = ic->parts;
                while (part != NULL) {
                        g_free (part->buffer);
@@ -405,15 +405,15 @@ camel_imap4_command_unref (CamelIMAP4Command *ic)
                                        camel_object_unref (part->literal->literal.wrapper);
                                        break;
                                }
-                               
+
                                g_free (part->literal);
                        }
-                       
+
                        next = part->next;
                        g_free (part);
                        part = next;
                }
-               
+
                g_free (ic);
        }
 }
@@ -426,20 +426,20 @@ imap4_literal_write_to_stream (CamelIMAP4Literal *literal, CamelStream *stream)
        CamelDataWrapper *wrapper;
        CamelMimeFilter *crlf;
        char *string;
-       
+
        if (literal->type == CAMEL_IMAP4_LITERAL_STRING) {
                string = literal->literal.string;
                if (camel_stream_write (stream, string, strlen (string)) == -1)
                        return -1;
-               
+
                return 0;
        }
-       
+
        crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
        ostream = (CamelStream *) camel_stream_filter_new_with_stream (stream);
        camel_stream_filter_add ((CamelStreamFilter *) ostream, crlf);
        camel_object_unref (crlf);
-       
+
        /* write the literal */
        switch (literal->type) {
        case CAMEL_IMAP4_LITERAL_STREAM:
@@ -453,21 +453,21 @@ imap4_literal_write_to_stream (CamelIMAP4Literal *literal, CamelStream *stream)
                        goto exception;
                break;
        }
-       
+
        camel_object_unref (ostream);
        ostream = NULL;
-       
+
 #if 0
        if (camel_stream_write (stream, "\r\n", 2) == -1)
                return -1;
 #endif
-       
+
        return 0;
-       
+
  exception:
-       
+
        camel_object_unref (ostream);
-       
+
        return -1;
 }
 
@@ -509,76 +509,76 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
        camel_imap4_token_t token;
        unsigned char *linebuf;
        size_t len;
-       
+
        g_assert (ic->part != NULL);
-       
+
        if (ic->part == ic->parts) {
                ic->tag = g_strdup_printf ("%c%.5u", engine->tagprefix, engine->tag++);
                camel_stream_printf (engine->ostream, "%s ", ic->tag);
                d(fprintf (stderr, "sending: %s ", ic->tag));
        }
-       
+
        if (camel_debug ("imap4:command")) {
                int sending = ic->part != ic->parts;
                unsigned char *eoln, *eob;
-               
+
                linebuf = ic->part->buffer;
                eob = linebuf + ic->part->buflen;
-               
+
                do {
                        eoln = linebuf;
                        while (eoln < eob && *eoln != '\n')
                                eoln++;
-                       
+
                        if (eoln < eob)
                                eoln++;
-                       
+
                        if (sending)
                                fwrite ("sending: ", 1, 10, stderr);
                        fwrite (linebuf, 1, eoln - linebuf, stderr);
-                       
+
                        linebuf = eoln + 1;
                        sending = 1;
                } while (linebuf < eob);
        }
-       
+
        linebuf = ic->part->buffer;
        len = ic->part->buflen;
-       
+
        if (camel_stream_write (engine->ostream, linebuf, len) == -1) {
                camel_exception_setv (&ic->ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed sending command to IMAP server %s: %s"),
                                      engine->url->host, g_strerror (errno));
                goto exception;
        }
-       
+
        if (camel_stream_flush (engine->ostream) == -1) {
                camel_exception_setv (&ic->ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed sending command to IMAP server %s: %s"),
                                      engine->url->host, g_strerror (errno));
                goto exception;
        }
-       
+
        /* now we need to read the response(s) from the IMAP4 server */
-       
+
        do {
                if (camel_imap4_engine_next_token (engine, &token, &ic->ex) == -1)
                        goto exception;
-               
+
                if (token.token == '+') {
                        /* we got a continuation response from the server */
                        literal = ic->part->literal;
-                       
+
                        if (camel_imap4_engine_line (engine, &linebuf, &len, &ic->ex) == -1)
                                goto exception;
-                       
+
                        if (literal) {
                                if (imap4_literal_write_to_stream (literal, engine->ostream) == -1)
                                        goto exception;
-                               
+
                                g_free (linebuf);
                                linebuf = NULL;
-                               
+
                                break;
                        } else if (ic->plus) {
                                /* command expected a '+' response - probably AUTHENTICATE? */
@@ -586,13 +586,13 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                                        g_free (linebuf);
                                        return -1;
                                }
-                               
+
                                /* now we need to wait for a "<tag> OK/NO/BAD" response */
                        } else {
                                /* FIXME: error?? */
                                g_assert_not_reached ();
                        }
-                       
+
                        g_free (linebuf);
                        linebuf = NULL;
                } else if (token.token == '*') {
@@ -602,10 +602,10 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                } else if (token.token == CAMEL_IMAP4_TOKEN_ATOM && !strcmp (token.v.atom, ic->tag)) {
                        /* we got "<tag> OK/NO/BAD" */
                        d(fprintf (stderr, "got %s response\n", token.v.atom));
-                       
+
                        if (camel_imap4_engine_next_token (engine, &token, &ic->ex) == -1)
                                goto exception;
-                       
+
                        if (token.token == CAMEL_IMAP4_TOKEN_ATOM) {
                                if (!strcmp (token.v.atom, "OK"))
                                        result = CAMEL_IMAP4_RESULT_OK;
@@ -613,15 +613,15 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                                        result = CAMEL_IMAP4_RESULT_NO;
                                else if (!strcmp (token.v.atom, "BAD"))
                                        result = CAMEL_IMAP4_RESULT_BAD;
-                               
+
                                if (result == CAMEL_IMAP4_RESULT_NONE) {
                                        d(fprintf (stderr, "expected OK/NO/BAD but got %s\n", token.v.atom));
                                        goto unexpected;
                                }
-                               
+
                                if (camel_imap4_engine_next_token (engine, &token, &ic->ex) == -1)
                                        goto exception;
-                               
+
                                if (token.token == '[') {
                                        /* we have a response code */
                                        camel_imap4_stream_unget_token (engine->istream, &token);
@@ -638,10 +638,10 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                                        unexpected_token (&token);
                                        fprintf (stderr, "\n");
                                }
-                               
+
                                goto unexpected;
                        }
-                       
+
                        break;
                } else {
                        if (camel_debug ("imap4:command")) {
@@ -649,23 +649,23 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                                unexpected_token (&token);
                                fprintf (stderr, "\n");
                        }
-                       
+
                unexpected:
-                       
+
                        /* no fucking clue what we got... */
                        if (camel_imap4_engine_line (engine, &linebuf, &len, &ic->ex) == -1)
                                goto exception;
-                       
+
                        camel_exception_setv (&ic->ex, CAMEL_EXCEPTION_SYSTEM,
                                              _("Unexpected response from IMAP4 server %s: %s"),
                                              engine->url->host, linebuf);
-                       
+
                        g_free (linebuf);
-                       
+
                        goto exception;
                }
        } while (1);
-       
+
        /* status should always be ACTIVE here... */
        if (ic->status == CAMEL_IMAP4_COMMAND_ACTIVE) {
                ic->part = ic->part->next;
@@ -675,13 +675,13 @@ camel_imap4_command_step (CamelIMAP4Command *ic)
                        return 1;
                }
        }
-       
+
        return 0;
-       
+
  exception:
-       
+
        ic->status = CAMEL_IMAP4_COMMAND_ERROR;
-       
+
        return -1;
 }
 
@@ -690,16 +690,16 @@ void
 camel_imap4_command_reset (CamelIMAP4Command *ic)
 {
        int i;
-       
+
        for (i = 0; i < ic->resp_codes->len; i++)
                camel_imap4_resp_code_free (ic->resp_codes->pdata[i]);
        g_ptr_array_set_size (ic->resp_codes, 0);
-       
+
        ic->status = CAMEL_IMAP4_COMMAND_QUEUED;
        ic->result = CAMEL_IMAP4_RESULT_NONE;
        ic->part = ic->parts;
        g_free (ic->tag);
        ic->tag = NULL;
-       
+
        camel_exception_clear (&ic->ex);
 }
index 868a0dc..62fb261 100644 (file)
@@ -72,7 +72,7 @@ typedef struct _CamelIMAP4CommandPart {
        struct _CamelIMAP4CommandPart *next;
        unsigned char *buffer;
        size_t buflen;
-       
+
        CamelIMAP4Literal *literal;
 } CamelIMAP4CommandPart;
 
@@ -92,30 +92,30 @@ enum {
 
 struct _CamelIMAP4Command {
        EDListNode node;
-       
+
        struct _CamelIMAP4Engine *engine;
-       
+
        unsigned int ref_count:26;
        unsigned int status:3;
        unsigned int result:3;
        int id;
-       
+
        char *tag;
-       
+
        GPtrArray *resp_codes;
-       
+
        struct _CamelIMAP4Folder *folder;
        CamelException ex;
-       
+
        /* command parts - logical breaks in the overall command based on literals */
        CamelIMAP4CommandPart *parts;
-       
+
        /* current part */
        CamelIMAP4CommandPart *part;
-       
+
        /* untagged handlers */
        GHashTable *untagged;
-       
+
        /* '+' callback/data */
        CamelIMAP4PlusCallback plus;
        void *user_data;
index e6f5577..470a141 100644 (file)
@@ -58,7 +58,7 @@ CamelType
 camel_imap4_engine_get_type (void)
 {
        static CamelType type = 0;
-       
+
        if (!type) {
                type = camel_type_register (camel_object_get_type (),
                                            "CamelIMAP4Engine",
@@ -69,7 +69,7 @@ camel_imap4_engine_get_type (void)
                                            (CamelObjectInitFunc) camel_imap4_engine_init,
                                            (CamelObjectFinalizeFunc) camel_imap4_engine_finalize);
        }
-       
+
        return type;
 }
 
@@ -77,7 +77,7 @@ static void
 camel_imap4_engine_class_init (CamelIMAP4EngineClass *klass)
 {
        parent_class = camel_type_get_global_classfuncs (CAMEL_OBJECT_TYPE);
-       
+
        klass->tagprefix = 'A';
 }
 
@@ -86,36 +86,36 @@ camel_imap4_engine_init (CamelIMAP4Engine *engine, CamelIMAP4EngineClass *klass)
 {
        engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
        engine->level = CAMEL_IMAP4_LEVEL_UNKNOWN;
-       
+
        engine->session = NULL;
        engine->service = NULL;
        engine->url = NULL;
-       
+
        engine->istream = NULL;
        engine->ostream = NULL;
-       
+
        engine->authtypes = g_hash_table_new (g_str_hash, g_str_equal);
-       
+
        engine->capa = 0;
-       
+
        /* this is the suggested default, impacts the max command line length we'll send */
        engine->maxlentype = CAMEL_IMAP4_ENGINE_MAXLEN_LINE;
        engine->maxlen = 1000;
-       
+
        engine->namespaces.personal = NULL;
        engine->namespaces.other = NULL;
        engine->namespaces.shared = NULL;
-       
+
        if (klass->tagprefix > 'Z')
                klass->tagprefix = 'A';
-       
+
        engine->tagprefix = klass->tagprefix++;
        engine->tag = 0;
-       
+
        engine->nextid = 1;
-       
+
        engine->folder = NULL;
-       
+
        e_dlist_init (&engine->queue);
 }
 
@@ -124,27 +124,27 @@ camel_imap4_engine_finalize (CamelObject *object)
 {
        CamelIMAP4Engine *engine = (CamelIMAP4Engine *) object;
        EDListNode *node;
-       
+
        if (engine->istream)
                camel_object_unref (engine->istream);
-       
+
        if (engine->ostream)
                camel_object_unref (engine->ostream);
-       
+
        g_hash_table_foreach (engine->authtypes, (GHFunc) g_free, NULL);
        g_hash_table_destroy (engine->authtypes);
-       
+
        camel_imap4_namespace_clear (&engine->namespaces.personal);
        camel_imap4_namespace_clear (&engine->namespaces.other);
        camel_imap4_namespace_clear (&engine->namespaces.shared);
-       
+
        if (engine->folder)
                camel_object_unref (engine->folder);
-       
+
        while ((node = e_dlist_remhead (&engine->queue))) {
                node->next = NULL;
                node->prev = NULL;
-               
+
                camel_imap4_command_unref ((CamelIMAP4Command *) node);
        }
 }
@@ -161,15 +161,15 @@ CamelIMAP4Engine *
 camel_imap4_engine_new (CamelService *service, CamelIMAP4ReconnectFunc reconnect)
 {
        CamelIMAP4Engine *engine;
-       
+
        g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
-       
+
        engine = (CamelIMAP4Engine *) camel_object_new (CAMEL_TYPE_IMAP4_ENGINE);
        engine->session = service->session;
        engine->url = service->url;
        engine->service = service;
        engine->reconnect = reconnect;
-       
+
        return engine;
 }
 
@@ -192,29 +192,29 @@ camel_imap4_engine_take_stream (CamelIMAP4Engine *engine, CamelStream *stream, C
 {
        camel_imap4_token_t token;
        int code;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_ENGINE (engine), -1);
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), -1);
-       
+
        if (engine->istream)
                camel_object_unref (engine->istream);
-       
+
        if (engine->ostream)
                camel_object_unref (engine->ostream);
-       
+
        engine->istream = (CamelIMAP4Stream *) camel_imap4_stream_new (stream);
        engine->ostream = camel_stream_buffer_new (stream, CAMEL_STREAM_BUFFER_WRITE);
        engine->state = CAMEL_IMAP4_ENGINE_CONNECTED;
        camel_object_unref (stream);
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                goto exception;
-       
+
        if (token.token != '*') {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                goto exception;
        }
-       
+
        if ((code = camel_imap4_engine_handle_untagged_1 (engine, &token, ex)) == -1) {
                goto exception;
        } else if (code != CAMEL_IMAP4_UNTAGGED_OK && code != CAMEL_IMAP4_UNTAGGED_PREAUTH) {
@@ -222,18 +222,18 @@ camel_imap4_engine_take_stream (CamelIMAP4Engine *engine, CamelStream *stream, C
                                      engine->url->host);
                goto exception;
        }
-       
+
        return 0;
-       
+
  exception:
-       
+
        engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
-       
+
        camel_object_unref (engine->istream);
        engine->istream = NULL;
        camel_object_unref (engine->ostream);
        engine->ostream = NULL;
-       
+
        return -1;
 }
 
@@ -252,35 +252,35 @@ camel_imap4_engine_capability (CamelIMAP4Engine *engine, CamelException *ex)
 {
        CamelIMAP4Command *ic;
        int id, retval = 0;
-       
+
        ic = camel_imap4_engine_prequeue (engine, NULL, "CAPABILITY\r\n");
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                retval = -1;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        if (retval == -1 || !(engine->capa & CAMEL_IMAP4_CAPABILITY_XGWEXTENSIONS))
                return retval;
-       
+
        ic = camel_imap4_engine_prequeue (engine, NULL, "XGWEXTENSIONS\r\n");
        camel_imap4_command_register_untagged (ic, "XGWEXTENSIONS", parse_xgwextensions);
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                retval = -1;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        return retval;
 }
 
@@ -301,7 +301,7 @@ camel_imap4_engine_namespace (CamelIMAP4Engine *engine, CamelException *ex)
        GPtrArray *array = NULL;
        CamelIMAP4Command *ic;
        int id, i;
-       
+
        if (engine->capa & CAMEL_IMAP4_CAPABILITY_NAMESPACE) {
                ic = camel_imap4_engine_prequeue (engine, NULL, "NAMESPACE\r\n");
        } else {
@@ -309,48 +309,48 @@ camel_imap4_engine_namespace (CamelIMAP4Engine *engine, CamelException *ex)
                camel_imap4_command_register_untagged (ic, "LIST", camel_imap4_untagged_list);
                ic->user_data = array = g_ptr_array_new ();
        }
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
-               
+
                if (array != NULL)
                        g_ptr_array_free (array, TRUE);
-               
+
                return -1;
        }
-       
+
        if (array != NULL) {
                if (ic->result == CAMEL_IMAP4_RESULT_OK) {
                        CamelIMAP4Namespace *namespace;
-                       
+
                        g_assert (array->len >= 1);
                        list = array->pdata[0];
-                       
+
                        namespace = g_new (CamelIMAP4Namespace, 1);
                        namespace->next = NULL;
                        namespace->path = g_strdup ("");
                        namespace->sep = list->delim;
-                       
+
                        engine->namespaces.personal = namespace;
                } else {
                        /* should never *ever* happen */
                }
-               
+
                for (i = 0; i < array->len; i++) {
                        list = array->pdata[i];
                        g_free (list->name);
                        g_free (list);
                }
-               
+
                g_ptr_array_free (array, TRUE);
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        return 0;
 }
 
@@ -372,24 +372,24 @@ camel_imap4_engine_select_folder (CamelIMAP4Engine *engine, CamelFolder *folder,
        CamelIMAP4Command *ic;
        int id, retval = 0;
        int i;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_ENGINE (engine), -1);
        g_return_val_if_fail (CAMEL_IS_IMAP4_FOLDER (folder), -1);
-       
+
        /* POSSIBLE FIXME: if the folder to be selected will already
         * be selected by the time the queue is emptied, simply
         * no-op? */
-       
+
        ic = camel_imap4_engine_queue (engine, folder, "SELECT %F\r\n", folder);
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
                return -1;
        }
-       
+
        switch (ic->result) {
        case CAMEL_IMAP4_RESULT_OK:
                /*folder->mode = 0;*/
@@ -418,12 +418,12 @@ camel_imap4_engine_select_folder (CamelIMAP4Engine *engine, CamelFolder *folder,
                                break;
                        }
                }
-               
+
                /*if (folder->mode == 0) {
                  folder->mode = CAMEL_FOLDER_MODE_READ_ONLY;
                  g_warning ("Expected to find [READ-ONLY] or [READ-WRITE] in SELECT response");
                  }*/
-               
+
                break;
        case CAMEL_IMAP4_RESULT_NO:
                /* FIXME: would be good to save the NO reason into the err message */
@@ -442,9 +442,9 @@ camel_imap4_engine_select_folder (CamelIMAP4Engine *engine, CamelFolder *folder,
                g_assert_not_reached ();
                retval = -1;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        return retval;
 }
 
@@ -482,31 +482,31 @@ static int
 parse_xgwextensions (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, camel_imap4_token_t *token, CamelException *ex)
 {
        int i;
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        while (token->token == CAMEL_IMAP4_TOKEN_ATOM) {
                for (i = 0; imap4_xgwextensions[i].name; i++) {
                        if (!g_ascii_strcasecmp (imap4_xgwextensions[i].name, token->v.atom))
                                engine->capa |= imap4_xgwextensions[i].flag;
                }
-               
+
                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                        return -1;
        }
-       
+
        if (token->token != '\n') {
                d(fprintf (stderr, "expected '\\n' at the end of the XGWEXTENSIONS response\n"));
                goto unexpected;
        }
-       
+
        return 0;
-       
+
  unexpected:
-       
+
        camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
-       
+
        return -1;
 }
 
@@ -522,20 +522,20 @@ engine_parse_capability (CamelIMAP4Engine *engine, int sentinel, CamelException
 {
        camel_imap4_token_t token;
        int i;
-       
+
        /* we assume UTF8 searches work until proven otherwise */
        engine->capa = CAMEL_IMAP4_CAPABILITY_utf8_search;
        engine->level = 0;
-       
+
        g_hash_table_foreach_remove (engine->authtypes, (GHRFunc) auth_free, NULL);
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        while (token.token == CAMEL_IMAP4_TOKEN_ATOM) {
                if (!g_ascii_strncasecmp ("AUTH=", token.v.atom, 5)) {
                        CamelServiceAuthType *auth;
-                       
+
                        if ((auth = camel_sasl_authtype (token.v.atom + 5)) != NULL)
                                g_hash_table_insert (engine->authtypes, g_strdup (token.v.atom + 5), auth);
                } else {
@@ -544,19 +544,19 @@ engine_parse_capability (CamelIMAP4Engine *engine, int sentinel, CamelException
                                        engine->capa |= imap4_capabilities[i].flag;
                        }
                }
-               
+
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
        }
-       
+
        if (token.token != sentinel) {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        /* unget our sentinel token */
        camel_imap4_stream_unget_token (engine->istream, &token);
-       
+
        /* figure out which version of IMAP4 we are dealing with */
        if (engine->capa & CAMEL_IMAP4_CAPABILITY_IMAP4REV1) {
                engine->level = CAMEL_IMAP4_LEVEL_IMAP4REV1;
@@ -566,7 +566,7 @@ engine_parse_capability (CamelIMAP4Engine *engine, int sentinel, CamelException
        } else {
                engine->level = CAMEL_IMAP4_LEVEL_UNKNOWN;
        }
-       
+
        return 0;
 }
 
@@ -574,13 +574,13 @@ static int
 engine_parse_flags_list (CamelIMAP4Engine *engine, CamelIMAP4RespCode *resp, int perm, CamelException *ex)
 {
        guint32 flags = 0;
-       
+
        if (camel_imap4_parse_flags_list (engine, &flags, ex) == -1)
                return-1;
-       
+
        if (resp != NULL)
                resp->v.flags = flags;
-       
+
        if (engine->current && engine->current->folder) {
                if (perm)
                        ((CamelFolder *) engine->current->folder)->permanent_flags = flags;
@@ -596,7 +596,7 @@ engine_parse_flags_list (CamelIMAP4Engine *engine, CamelIMAP4RespCode *resp, int
                         "response for a folder, yet we do not currently have a folder selected?\n",
                         perm ? "PERMANENTFLAGS" : "FLAGS");
        }
-       
+
        return 0;
 }
 
@@ -604,19 +604,19 @@ static int
 engine_parse_flags (CamelIMAP4Engine *engine, CamelException *ex)
 {
        camel_imap4_token_t token;
-       
+
        if (engine_parse_flags_list (engine, NULL, FALSE, ex) == -1)
                return -1;
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        if (token.token != '\n') {
                d(fprintf (stderr, "Expected to find a '\\n' token after the FLAGS response\n"));
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        return 0;
 }
 
@@ -626,48 +626,48 @@ engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex)
        CamelIMAP4Namespace *namespaces[3], *node, *tail;
        camel_imap4_token_t token;
        int i, n = 0;
-       
+
        camel_imap4_namespace_clear (&engine->namespaces.personal);
        camel_imap4_namespace_clear (&engine->namespaces.other);
        camel_imap4_namespace_clear (&engine->namespaces.shared);
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        do {
                namespaces[n] = NULL;
                tail = (CamelIMAP4Namespace *) &namespaces[n];
-               
+
                if (token.token == '(') {
                        /* decode the list of namespace pairs */
                        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                                goto exception;
-                       
+
                        while (token.token == '(') {
                                /* decode a namespace pair */
-                               
+
                                /* get the path name token */
                                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                                        goto exception;
-                               
+
                                if (token.token != CAMEL_IMAP4_TOKEN_QSTRING) {
                                        d(fprintf (stderr, "Expected to find a qstring token as first element in NAMESPACE pair\n"));
                                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                                        goto exception;
                                }
-                               
+
                                node = g_new (CamelIMAP4Namespace, 1);
                                node->next = NULL;
                                node->path = g_strdup (token.v.qstring);
-                               
+
                                /* get the path delimiter token */
                                if (camel_imap4_engine_next_token (engine, &token, ex) == -1) {
                                        g_free (node->path);
                                        g_free (node);
-                                       
+
                                        goto exception;
                                }
-                               
+
                                switch (token.token) {
                                case CAMEL_IMAP4_TOKEN_NIL:
                                        node->sep = '\0';
@@ -689,38 +689,38 @@ engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex)
                                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                                        g_free (node->path);
                                        g_free (node);
-                                       
+
                                        goto exception;
                                }
-                               
+
                                tail->next = node;
                                tail = node;
-                               
+
                                /* canonicalise the namespace path */
                                if (node->path[strlen (node->path) - 1] == node->sep)
                                        node->path[strlen (node->path) - 1] = '\0';
-                               
+
                                /* canonicalise if this is an INBOX namespace */
                                if (!g_ascii_strncasecmp (node->path, "INBOX", 5) &&
                                    (node->path[6] == '\0' || node->path[6] == node->sep))
                                        memcpy (node->path, "INBOX", 5);
-                               
+
                                /* get the closing ')' for this namespace pair */
                                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                                        goto exception;
-                               
+
                                if (token.token != ')') {
                                        d(fprintf (stderr, "Expected to find a ')' token to close the current namespace pair\n"));
                                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
-                                       
+
                                        goto exception;
                                }
-                               
+
                                /* get the next token (should be either '(' or ')') */
                                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                                        goto exception;
                        }
-                       
+
                        if (token.token != ')') {
                                d(fprintf (stderr, "Expected to find a ')' to close the current namespace list\n"));
                                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
@@ -734,25 +734,25 @@ engine_parse_namespace (CamelIMAP4Engine *engine, CamelException *ex)
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                /* get the next token (should be either '(', NIL, or '\n') */
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        goto exception;
-               
+
                n++;
        } while (n < 3);
-       
+
        engine->namespaces.personal = namespaces[0];
        engine->namespaces.other = namespaces[1];
        engine->namespaces.shared = namespaces[2];
-       
+
        return 0;
-       
+
  exception:
-       
+
        for (i = 0; i <= n; i++)
                camel_imap4_namespace_clear (&namespaces[i]);
-       
+
        return -1;
 }
 
@@ -808,25 +808,25 @@ camel_imap4_engine_parse_resp_code (CamelIMAP4Engine *engine, CamelException *ex
        camel_imap4_token_t token;
        unsigned char *linebuf;
        size_t len;
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        if (token.token != '[') {
                d(fprintf (stderr, "Expected a '[' token (followed by a RESP-CODE)\n"));
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        if (token.token != CAMEL_IMAP4_TOKEN_ATOM) {
                d(fprintf (stderr, "Expected an atom token containing a RESP-CODE\n"));
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        for (code = 0; imap4_resp_codes[code].name; code++) {
                if (!strcmp (imap4_resp_codes[code].name, token.v.atom)) {
                        if (engine->current && imap4_resp_codes[code].save) {
@@ -836,7 +836,7 @@ camel_imap4_engine_parse_resp_code (CamelIMAP4Engine *engine, CamelException *ex
                        break;
                }
        }
-       
+
        switch (code) {
        case CAMEL_IMAP4_RESP_CODE_ALERT:
                /* nothing to do here, handled after switch statement */
@@ -864,195 +864,195 @@ camel_imap4_engine_parse_resp_code (CamelIMAP4Engine *engine, CamelException *ex
        case CAMEL_IMAP4_RESP_CODE_UIDNEXT:
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        goto exception;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_NUMBER) {
                        d(fprintf (stderr, "Expected an nz_number token as an argument to the UIDNEXT RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL)
                        resp->v.uidnext = token.v.number;
-               
+
                break;
        case CAMEL_IMAP4_RESP_CODE_UIDVALIDITY:
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        goto exception;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_NUMBER) {
                        d(fprintf (stderr, "Expected an nz_number token as an argument to the UIDVALIDITY RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL)
                        resp->v.uidvalidity = token.v.number;
-               
+
                break;
        case CAMEL_IMAP4_RESP_CODE_UNSEEN:
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_NUMBER) {
                        d(fprintf (stderr, "Expected an nz_number token as an argument to the UNSEEN RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL)
                        resp->v.unseen = token.v.number;
-               
+
                break;
        case CAMEL_IMAP4_RESP_CODE_NEWNAME:
                /* this RESP-CODE may actually be removed - see here:
                 * http://www.washington.edu/imap4/listarch/2001/msg00058.html */
-               
+
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_ATOM && token.token != CAMEL_IMAP4_TOKEN_QSTRING) {
                        d(fprintf (stderr, "Expected an atom or qstring token as the first argument to the NEWNAME RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL)
                        resp->v.newname[0] = g_strdup (token.v.atom);
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_ATOM && token.token != CAMEL_IMAP4_TOKEN_QSTRING) {
                        d(fprintf (stderr, "Expected an atom or qstring token as the second argument to the NEWNAME RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL)
                        resp->v.newname[1] = g_strdup (token.v.atom);
-               
+
                break;
        case CAMEL_IMAP4_RESP_CODE_APPENDUID:
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_NUMBER) {
                        d(fprintf (stderr, "Expected an nz_number token as the first argument to the APPENDUID RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL)
                        resp->v.appenduid.uidvalidity = token.v.number;
-               
+
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_NUMBER) {
                        d(fprintf (stderr, "Expected an nz_number token as the second argument to the APPENDUID RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL)
                        resp->v.appenduid.uid = token.v.number;
-               
+
                break;
        case CAMEL_IMAP4_RESP_CODE_COPYUID:
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_NUMBER) {
                        d(fprintf (stderr, "Expected an nz_number token as the first argument to the COPYUID RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL)
                        resp->v.copyuid.uidvalidity = token.v.number;
-               
+
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_ATOM && token.token != CAMEL_IMAP4_TOKEN_NUMBER) {
                        d(fprintf (stderr, "Expected an atom or numeric token as the second argument to the COPYUID RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL) {
                        if (token.token == CAMEL_IMAP4_TOKEN_NUMBER)
                                resp->v.copyuid.srcset = g_strdup_printf ("%lu", token.v.number);
                        else
                                resp->v.copyuid.srcset = g_strdup (token.v.atom);
                }
-               
+
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
-               
+
                if (token.token != CAMEL_IMAP4_TOKEN_ATOM && token.token != CAMEL_IMAP4_TOKEN_NUMBER) {
                        d(fprintf (stderr, "Expected an atom or numeric token as the third argument to the APPENDUID RESP-CODE\n"));
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                if (resp != NULL) {
                        if (token.token == CAMEL_IMAP4_TOKEN_NUMBER)
                                resp->v.copyuid.destset = g_strdup_printf ("%lu", token.v.number);
                        else
                                resp->v.copyuid.destset = g_strdup (token.v.atom);
                }
-               
+
                break;
        default:
                d(fprintf (stderr, "Unknown RESP-CODE encountered: %s\n", token.v.atom));
-               
+
                /* extensions are of the form: "[" atom [SPACE 1*<any TEXT_CHAR except "]">] "]" */
-               
+
                /* eat up the TEXT_CHARs */
                while (token.token != ']' && token.token != '\n') {
                        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                                goto exception;
                }
-               
+
                break;
        }
-       
+
        while (token.token != ']' && token.token != '\n') {
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        goto exception;
        }
-       
+
        if (token.token != ']') {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                d(fprintf (stderr, "Expected to find a ']' token after the RESP-CODE\n"));
                return -1;
        }
-       
+
        if (code == CAMEL_IMAP4_RESP_CODE_ALERT) {
                if (camel_imap4_engine_line (engine, &linebuf, &len, ex) == -1)
                        goto exception;
-               
+
                camel_session_alert_user (engine->session, CAMEL_SESSION_ALERT_INFO, linebuf, FALSE);
                g_free (linebuf);
        } else if (resp != NULL && code == CAMEL_IMAP4_RESP_CODE_PARSE) {
                if (camel_imap4_engine_line (engine, &linebuf, &len, ex) == -1)
                        goto exception;
-               
+
                resp->v.parse = linebuf;
        } else {
                /* eat up the rest of the response */
                if (camel_imap4_engine_line (engine, NULL, NULL, ex) == -1)
                        goto exception;
        }
-       
+
        if (resp != NULL)
                g_ptr_array_add (engine->current->resp_codes, resp);
-       
+
        return 0;
-       
+
  exception:
-       
+
        if (resp != NULL)
                camel_imap4_resp_code_free (resp);
-       
+
        return -1;
 }
 
@@ -1076,10 +1076,10 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke
        CamelIMAP4UntaggedCallback untagged;
        CamelFolder *folder;
        unsigned int v;
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        if (token->token == CAMEL_IMAP4_TOKEN_ATOM) {
                if (!strcmp ("BYE", token->v.atom)) {
                        /* we don't care if we fail here, either way we've been disconnected */
@@ -1091,19 +1091,19 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke
                                        camel_imap4_engine_line (engine, NULL, NULL, NULL);
                                }
                        }
-                       
+
                        engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
-                       
+
                        /* we don't return -1 here because there may be more untagged responses after the BYE */
                } else if (!strcmp ("CAPABILITY", token->v.atom)) {
                        /* capability tokens follow */
                        if (engine_parse_capability (engine, '\n', ex) == -1)
                                return -1;
-                       
+
                        /* find the eoln token */
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                return -1;
-                       
+
                        if (token->token != '\n') {
                                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                                return -1;
@@ -1117,11 +1117,11 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke
                                return -1;
                } else if (!strcmp ("NO", token->v.atom) || !strcmp ("BAD", token->v.atom)) {
                        code = !strcmp ("NO", token->v.atom) ? CAMEL_IMAP4_UNTAGGED_NO : CAMEL_IMAP4_UNTAGGED_BAD;
-                       
+
                        /* our command has been rejected */
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                return -1;
-                       
+
                        if (token->token == '[') {
                                /* we have a resp code */
                                camel_imap4_stream_unget_token (engine->istream, token);
@@ -1134,15 +1134,15 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke
                        }
                } else if (!strcmp ("OK", token->v.atom)) {
                        code = CAMEL_IMAP4_UNTAGGED_OK;
-                       
+
                        if (engine->state == CAMEL_IMAP4_ENGINE_CONNECTED) {
                                /* initial server greeting */
                                engine->state = CAMEL_IMAP4_ENGINE_PREAUTH;
                        }
-                       
+
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                return -1;
-                       
+
                        if (token->token == '[') {
                                /* we have a resp code */
                                camel_imap4_stream_unget_token (engine->istream, token);
@@ -1155,10 +1155,10 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke
                        }
                } else if (!strcmp ("PREAUTH", token->v.atom)) {
                        code = CAMEL_IMAP4_UNTAGGED_PREAUTH;
-                       
+
                        if (engine->state == CAMEL_IMAP4_ENGINE_CONNECTED)
                                engine->state = CAMEL_IMAP4_ENGINE_AUTHENTICATED;
-                       
+
                        if (camel_imap4_engine_parse_resp_code (engine, ex) == -1)
                                return -1;
                } else if (ic && (untagged = g_hash_table_lookup (ic->untagged, token->v.atom))) {
@@ -1167,23 +1167,23 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke
                                return -1;
                } else {
                        d(fprintf (stderr, "Unhandled atom token in untagged response: %s", token->v.atom));
-                       
+
                        if (camel_imap4_engine_eat_line (engine, ex) == -1)
                                return -1;
                }
        } else if (token->token == CAMEL_IMAP4_TOKEN_NUMBER) {
                /* we probably have something like "* 1 EXISTS" */
                v = token->v.number;
-               
+
                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                        return -1;
-               
+
                if (token->token != CAMEL_IMAP4_TOKEN_ATOM) {
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
-                       
+
                        return -1;
                }
-               
+
                /* which folder is this EXISTS/EXPUNGE/RECENT acting on? */
                if (engine->current && engine->current->folder)
                        folder = (CamelFolder *) engine->current->folder;
@@ -1191,7 +1191,7 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke
                        folder = (CamelFolder *) engine->folder;
                else
                        folder = NULL;
-               
+
                /* NOTE: these can be over-ridden by a registered untagged response handler */
                if (!strcmp ("EXISTS", token->v.atom)) {
                        camel_imap4_summary_set_exists (folder->summary, v);
@@ -1206,16 +1206,16 @@ camel_imap4_engine_handle_untagged_1 (CamelIMAP4Engine *engine, camel_imap4_toke
                } else {
                        d(fprintf (stderr, "Unrecognized untagged response: * %lu %s\n", v, token->v.atom));
                }
-               
+
                /* find the eoln token */
                if (camel_imap4_engine_eat_line (engine, ex) == -1)
                        return -1;
        } else {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
-               
+
                return -1;
        }
-       
+
        return code;
 }
 
@@ -1231,26 +1231,26 @@ void
 camel_imap4_engine_handle_untagged (CamelIMAP4Engine *engine, CamelException *ex)
 {
        camel_imap4_token_t token;
-       
+
        g_return_if_fail (CAMEL_IS_IMAP4_ENGINE (engine));
-       
+
        do {
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        goto exception;
-               
+
                if (token.token != '*')
                        break;
-               
+
                if (camel_imap4_engine_handle_untagged_1 (engine, &token, ex) == -1)
                        goto exception;
        } while (1);
-       
+
        camel_imap4_stream_unget_token (engine->istream, &token);
-       
+
        return;
-       
+
  exception:
-       
+
        engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
 }
 
@@ -1259,15 +1259,15 @@ static int
 imap4_process_command (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
 {
        int retval;
-       
+
        while ((retval = camel_imap4_command_step (ic)) == 0)
                ;
-       
+
        if (retval == -1) {
                engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
                return -1;
        }
-       
+
        return 0;
 }
 
@@ -1277,20 +1277,20 @@ engine_prequeue_folder_select (CamelIMAP4Engine *engine)
 {
        CamelIMAP4Command *ic;
        const char *cmd;
-       
+
        ic = (CamelIMAP4Command *) engine->queue.head;
        cmd = (const char *) ic->parts->buffer;
-       
+
        if (!ic->folder || ic->folder == engine->folder ||
            !strncmp (cmd, "SELECT ", 7) || !strncmp (cmd, "EXAMINE ", 8)) {
                /* no need to pre-queue a SELECT */
                return;
        }
-       
+
        /* we need to pre-queue a SELECT */
        ic = camel_imap4_engine_prequeue (engine, (CamelFolder *) ic->folder, "SELECT %F\r\n", ic->folder);
        ic->user_data = engine;
-       
+
        camel_imap4_command_unref (ic);
 }
 
@@ -1300,7 +1300,7 @@ engine_state_change (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
 {
        const char *cmd;
        int retval = 0;
-       
+
        cmd = ic->parts->buffer;
        if (!strncmp (cmd, "SELECT ", 7) || !strncmp (cmd, "EXAMINE ", 8)) {
                if (ic->result == CAMEL_IMAP4_RESULT_OK) {
@@ -1309,7 +1309,7 @@ engine_state_change (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
                        if (engine->folder)
                                camel_object_unref (engine->folder);
                        engine->folder = ic->folder;
-                       
+
                        engine->state = CAMEL_IMAP4_ENGINE_SELECTED;
                } else if (ic->user_data == engine) {
                        /* the engine pre-queued this SELECT command */
@@ -1321,7 +1321,7 @@ engine_state_change (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
        } else if (!strncmp (cmd, "LOGOUT", 6)) {
                engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
        }
-       
+
        return retval;
 }
 
@@ -1344,27 +1344,27 @@ camel_imap4_engine_iterate (CamelIMAP4Engine *engine)
        CamelIMAP4Command *ic, *nic;
        GPtrArray *resp_codes;
        int retval = -1;
-       
+
        if (e_dlist_empty (&engine->queue))
                return 0;
-       
+
        /* This sucks... it would be nicer if we didn't have to check the stream's disconnected status */
        if ((engine->state == CAMEL_IMAP4_ENGINE_DISCONNECTED || engine->istream->disconnected) && !engine->reconnecting) {
                CamelException rex;
                gboolean connected;
-               
+
                camel_exception_init (&rex);
                engine->reconnecting = TRUE;
                connected = engine->reconnect (engine, &rex);
                engine->reconnecting = FALSE;
-               
+
                if (!connected) {
                        /* pop the first command and act as tho it failed (which, technically, it did...) */
                        ic = (CamelIMAP4Command *) e_dlist_remhead (&engine->queue);
                        ic->status = CAMEL_IMAP4_COMMAND_ERROR;
                        camel_exception_xfer (&ic->ex, &rex);
                        camel_imap4_command_unref (ic);
-                       
+
                        /* FIXME: in a perfect world, if the connect failure was due to the user cancelling the
                         * passwd dialog, we'd either send a LOGOUT command here -or- we'd leave the connection
                         * open but in the PREAUTH state that we'd later be able to handle if the user queued
@@ -1374,17 +1374,17 @@ camel_imap4_engine_iterate (CamelIMAP4Engine *engine)
                        engine->istream = NULL;
                        camel_object_unref (engine->ostream);
                        engine->ostream = NULL;
-                       
+
                        return -1;
                }
        }
-       
+
        /* check to see if we need to pre-queue a SELECT, if so do it */
        engine_prequeue_folder_select (engine);
-       
+
        engine->current = ic = (CamelIMAP4Command *) e_dlist_remhead (&engine->queue);
        ic->status = CAMEL_IMAP4_COMMAND_ACTIVE;
-       
+
        if (imap4_process_command (engine, ic) != -1) {
                if (engine_state_change (engine, ic) == -1) {
                        /* This can ONLY happen if @ic was the pre-queued SELECT command
@@ -1395,26 +1395,26 @@ camel_imap4_engine_iterate (CamelIMAP4Engine *engine)
                         * information as possible, we move all @ic status information
                         * over to @nic and pretend we just processed @nic.
                         **/
-                       
+
                        nic = (CamelIMAP4Command *) e_dlist_remhead (&engine->queue);
-                       
+
                        nic->status = ic->status;
                        nic->result = ic->result;
                        resp_codes = nic->resp_codes;
                        nic->resp_codes = ic->resp_codes;
                        ic->resp_codes = resp_codes;
-                       
+
                        camel_exception_xfer (&nic->ex, &ic->ex);
-                       
+
                        camel_imap4_command_unref (ic);
                        ic = nic;
                }
-               
+
                retval = ic->id;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        return retval;
 }
 
@@ -1436,17 +1436,17 @@ camel_imap4_engine_queue (CamelIMAP4Engine *engine, CamelFolder *folder, const c
 {
        CamelIMAP4Command *ic;
        va_list args;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_ENGINE (engine), NULL);
-       
+
        va_start (args, format);
        ic = camel_imap4_command_newv (engine, (CamelIMAP4Folder *) folder, format, args);
        va_end (args);
-       
+
        ic->id = engine->nextid++;
        e_dlist_addtail (&engine->queue, (EDListNode *) ic);
        camel_imap4_command_ref (ic);
-       
+
        return ic;
 }
 
@@ -1468,25 +1468,25 @@ camel_imap4_engine_prequeue (CamelIMAP4Engine *engine, CamelFolder *folder, cons
 {
        CamelIMAP4Command *ic;
        va_list args;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_ENGINE (engine), NULL);
-       
+
        va_start (args, format);
        ic = camel_imap4_command_newv (engine, (CamelIMAP4Folder *) folder, format, args);
        va_end (args);
-       
+
        if (e_dlist_empty (&engine->queue)) {
                e_dlist_addtail (&engine->queue, (EDListNode *) ic);
                ic->id = engine->nextid++;
        } else {
                CamelIMAP4Command *nic;
                EDListNode *node;
-               
+
                node = (EDListNode *) ic;
                e_dlist_addhead (&engine->queue, node);
                nic = (CamelIMAP4Command *) node->next;
                ic->id = nic->id - 1;
-               
+
                if (ic->id == 0) {
                        /* increment all command ids */
                        node = engine->queue.head;
@@ -1497,9 +1497,9 @@ camel_imap4_engine_prequeue (CamelIMAP4Engine *engine, CamelFolder *folder, cons
                        }
                }
        }
-       
+
        camel_imap4_command_ref (ic);
-       
+
        return ic;
 }
 
@@ -1515,14 +1515,14 @@ void
 camel_imap4_engine_dequeue (CamelIMAP4Engine *engine, CamelIMAP4Command *ic)
 {
        EDListNode *node = (EDListNode *) ic;
-       
+
        if (node->next == NULL && node->prev == NULL)
                return;
-       
+
        e_dlist_remove (node);
        node->next = NULL;
        node->prev = NULL;
-       
+
        camel_imap4_command_unref (ic);
 }
 
@@ -1546,12 +1546,12 @@ camel_imap4_engine_next_token (CamelIMAP4Engine *engine, camel_imap4_token_t *to
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("IMAP4 server %s unexpectedly disconnected: %s"),
                                      engine->url->host, errno ? g_strerror (errno) : _("Unknown"));
-               
+
                engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
-               
+
                return -1;
        }
-       
+
        return 0;
 }
 
@@ -1572,27 +1572,27 @@ camel_imap4_engine_eat_line (CamelIMAP4Engine *engine, CamelException *ex)
        unsigned char *literal;
        int retval;
        size_t n;
-       
+
        do {
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
-               
+
                if (token.token == CAMEL_IMAP4_TOKEN_LITERAL) {
                        while ((retval = camel_imap4_stream_literal (engine->istream, &literal, &n)) == 1)
                                ;
-                       
+
                        if (retval == -1) {
                                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                                      _("IMAP4 server %s unexpectedly disconnected: %s"),
                                                      engine->url->host, errno ? g_strerror (errno) : _("Unknown"));
-                               
+
                                engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
-                               
+
                                return -1;
                        }
                }
        } while (token.token != '\n');
-       
+
        return 0;
 }
 
@@ -1617,37 +1617,37 @@ camel_imap4_engine_line (CamelIMAP4Engine *engine, unsigned char **line, size_t
        unsigned char *buf;
        size_t buflen;
        int retval;
-       
+
        if (line != NULL)
                linebuf = g_byte_array_new ();
-       
+
        while ((retval = camel_imap4_stream_line (engine->istream, &buf, &buflen)) > 0) {
                if (linebuf != NULL)
                        g_byte_array_append (linebuf, buf, buflen);
        }
-       
+
        if (retval == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("IMAP4 server %s unexpectedly disconnected: %s"),
                                      engine->url->host, errno ? g_strerror (errno) : _("Unknown"));
-               
+
                if (linebuf != NULL)
                        g_byte_array_free (linebuf, TRUE);
-               
+
                engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
-               
+
                return -1;
        }
-       
+
        if (linebuf != NULL) {
                g_byte_array_append (linebuf, buf, buflen);
-               
+
                *line = linebuf->data;
                *len = linebuf->len;
-               
+
                g_byte_array_free (linebuf, FALSE);
        }
-       
+
        return 0;
 }
 
@@ -1673,38 +1673,38 @@ camel_imap4_engine_literal (CamelIMAP4Engine *engine, unsigned char **literal, s
        unsigned char *buf;
        size_t buflen;
        int retval;
-       
+
        if (literal != NULL)
                literalbuf = g_byte_array_new ();
-       
+
        while ((retval = camel_imap4_stream_literal (engine->istream, &buf, &buflen)) > 0) {
                if (literalbuf != NULL)
                        g_byte_array_append (literalbuf, buf, buflen);
        }
-       
+
        if (retval == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("IMAP4 server %s unexpectedly disconnected: %s"),
                                      engine->url->host, errno ? g_strerror (errno) : _("Unknown"));
-               
+
                if (literalbuf != NULL)
                        g_byte_array_free (literalbuf, TRUE);
-               
+
                engine->state = CAMEL_IMAP4_ENGINE_DISCONNECTED;
-               
+
                return -1;
        }
-       
+
        if (literalbuf != NULL) {
                g_byte_array_append (literalbuf, buf, buflen);
                g_byte_array_append (literalbuf, "", 1);
-               
+
                *literal = literalbuf->data;
                *len = literalbuf->len - 1;
-               
+
                g_byte_array_free (literalbuf, FALSE);
        }
-       
+
        return 0;
 }
 
@@ -1725,10 +1725,10 @@ camel_imap4_engine_nstring (CamelIMAP4Engine *engine, unsigned char **nstring, C
 {
        camel_imap4_token_t token;
        size_t n;
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        switch (token.token) {
        case CAMEL_IMAP4_TOKEN_NIL:
                *nstring = NULL;
@@ -1747,7 +1747,7 @@ camel_imap4_engine_nstring (CamelIMAP4Engine *engine, unsigned char **nstring, C
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        return 0;
 }
 
@@ -1776,6 +1776,6 @@ camel_imap4_resp_code_free (CamelIMAP4RespCode *rcode)
        default:
                break;
        }
-       
+
        g_free (rcode);
 }
index de0a811..50f3c03 100644 (file)
@@ -78,10 +78,10 @@ enum {
        CAMEL_IMAP4_CAPABILITY_ACL              = (1 << 10),
        CAMEL_IMAP4_CAPABILITY_MULTIAPPEND      = (1 << 11),
        CAMEL_IMAP4_CAPABILITY_UNSELECT         = (1 << 12),
-       
+
        CAMEL_IMAP4_CAPABILITY_XGWEXTENSIONS    = (1 << 16),
        CAMEL_IMAP4_CAPABILITY_XGWMOVE          = (1 << 17),
-       
+
        CAMEL_IMAP4_CAPABILITY_useful_lsub      = (1 << 30),
        CAMEL_IMAP4_CAPABILITY_utf8_search      = (1 << 31),
 };
@@ -155,40 +155,40 @@ typedef gboolean (* CamelIMAP4ReconnectFunc) (CamelIMAP4Engine *engine, CamelExc
 
 struct _CamelIMAP4Engine {
        CamelObject parent_object;
-       
+
        CamelIMAP4ReconnectFunc reconnect;
        gboolean reconnecting;
-       
+
        CamelSession *session;
        CamelService *service;
        CamelURL *url;
-       
+
        camel_imap4_engine_t state;
        camel_imap4_level_t level;
        guint32 capa;
-       
+
        guint32 maxlen:31;
        guint32 maxlentype:1;
-       
+
        CamelIMAP4NamespaceList namespaces;
        GHashTable *authtypes;                    /* supported authtypes */
-       
+
        struct _CamelIMAP4Stream *istream;
        CamelStream *ostream;
-       
+
        unsigned char tagprefix;             /* 'A'..'Z' */
        unsigned int tag;                    /* next command tag */
        int nextid;
-       
+
        struct _CamelIMAP4Folder *folder;    /* currently selected folder */
-       
+
        EDList queue;                          /* queue of waiting commands */
        struct _CamelIMAP4Command *current;
 };
 
 struct _CamelIMAP4EngineClass {
        CamelObjectClass parent_class;
-       
+
        unsigned char tagprefix;
 };
 
index 5f4ccf8..bf24c64 100644 (file)
@@ -94,7 +94,7 @@ CamelType
 camel_imap4_folder_get_type (void)
 {
        static CamelType type = 0;
-       
+
        if (!type) {
                type = camel_type_register (camel_offline_folder_get_type (),
                                            "CamelIMAP4Folder",
@@ -105,7 +105,7 @@ camel_imap4_folder_get_type (void)
                                            (CamelObjectInitFunc) camel_imap4_folder_init,
                                            (CamelObjectFinalizeFunc) camel_imap4_folder_finalize);
        }
-       
+
        return type;
 }
 
@@ -115,19 +115,19 @@ camel_imap4_folder_class_init (CamelIMAP4FolderClass *klass)
        CamelFolderClass *folder_class = (CamelFolderClass *) klass;
        CamelObjectClass *object_class = (CamelObjectClass *) klass;
        int i;
-       
+
        parent_class = (CamelOfflineFolderClass *) camel_type_get_global_classfuncs (CAMEL_OFFLINE_FOLDER_TYPE);
-       
+
        if (imap4_folder_props == NULL) {
                for (i = 0; i < G_N_ELEMENTS (imap4_prop_list); i++) {
                        imap4_prop_list[i].description = _(imap4_prop_list[i].description);
                        imap4_folder_props = g_slist_prepend (imap4_folder_props, &imap4_prop_list[i]);
                }
        }
-       
+
        object_class->getv = imap4_getv;
        object_class->setv = imap4_setv;
-       
+
        folder_class->sync = imap4_sync;
        folder_class->refresh_info = imap4_refresh_info;
        folder_class->expunge = imap4_expunge;
@@ -143,7 +143,7 @@ static void
 camel_imap4_folder_init (CamelIMAP4Folder *folder, CamelIMAP4FolderClass *klass)
 {
        ((CamelFolder *) folder)->folder_flags |= CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY | CAMEL_FOLDER_HAS_SEARCH_CAPABILITY;
-       
+
        folder->utf7_name = NULL;
        folder->cachedir = NULL;
        folder->journal = NULL;
@@ -154,17 +154,17 @@ static void
 camel_imap4_folder_finalize (CamelObject *object)
 {
        CamelIMAP4Folder *folder = (CamelIMAP4Folder *) object;
-       
+
        camel_object_unref (folder->search);
-       
+
        if (folder->cache)
                camel_object_unref (folder->cache);
-       
+
        if (folder->journal) {
                camel_offline_journal_write (folder->journal, NULL);
                camel_object_unref (folder->journal);
        }
-       
+
        g_free (folder->utf7_name);
        g_free (folder->cachedir);
 }
@@ -175,12 +175,12 @@ imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
        CamelArgGetV props;
        int i, count = 0;
        guint32 tag;
-       
+
        for (i = 0; i < args->argc; i++) {
                CamelArgGet *arg = &args->argv[i];
-               
+
                tag = arg->tag;
-               
+
                switch (tag & CAMEL_ARG_TAG) {
                case CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES:
                case CAMEL_FOLDER_ARG_PROPERTIES:
@@ -196,13 +196,13 @@ imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
                        count++;
                        continue;
                }
-               
+
                arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
        }
-       
+
        if (count)
                return ((CamelObjectClass *) parent_class)->getv (object, ex, args);
-       
+
        return 0;
 }
 
@@ -213,12 +213,12 @@ imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
        gboolean save = FALSE;
        guint32 tag;
        int i;
-       
+
        for (i = 0; i < args->argc; i++) {
                CamelArg *arg = &args->argv[i];
-               
+
                tag = arg->tag;
-               
+
                switch (tag & CAMEL_ARG_TAG) {
                case CAMEL_IMAP4_FOLDER_ARG_ENABLE_MLIST:
                        if (folder->enable_mlist != arg->ca_int) {
@@ -229,13 +229,13 @@ imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args)
                default:
                        continue;
                }
-               
+
                arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE;
        }
-       
+
        if (save)
                camel_object_state_write (object);
-       
+
        return ((CamelObjectClass *) parent_class)->setv (object, ex, args);
 }
 
@@ -260,39 +260,39 @@ imap4_build_filename (const char *toplevel_dir, const char *full_name)
        const char *inptr = full_name;
        int subdirs = 0;
        char *path, *p;
-       
+
        if (*full_name == '\0')
                return g_strdup (toplevel_dir);
-       
+
        while (*inptr != '\0') {
                if (*inptr == '/')
                        subdirs++;
                inptr++;
        }
-       
+
        path = g_malloc (strlen (toplevel_dir) + (inptr - full_name) + (12 * subdirs) + 2);
        p = g_stpcpy (path, toplevel_dir);
-       
+
        if (p[-1] != '/')
                *p++ = '/';
-       
+
        inptr = full_name;
        while (*inptr != '\0') {
                while (*inptr != '/' && *inptr != '\0')
                        *p++ = *inptr++;
-               
+
                if (*inptr == '/') {
                        p = g_stpcpy (p, "/subfolders/");
                        inptr++;
-                       
+
                        /* strip extranaeous '/'s */
                        while (*inptr == '/')
                                inptr++;
                }
        }
-       
+
        *p = '\0';
-       
+
        return path;
 }
 
@@ -302,11 +302,11 @@ imap4_store_build_filename (void *store, const char *full_name)
        CamelIMAP4Store *imap4_store = (CamelIMAP4Store *) store;
        char *toplevel_dir;
        char *path;
-       
+
        toplevel_dir = g_strdup_printf ("%s/folders", imap4_store->storage_path);
        path = imap4_build_filename (toplevel_dir, full_name);
        g_free (toplevel_dir);
-       
+
        return path;
 }
 
@@ -319,18 +319,18 @@ camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException
        CamelFolder *folder;
        char *path;
        char sep;
-       
+
        if (!(p = strrchr (full_name, '/')))
                p = (char *) full_name;
        else
                p++;
-       
+
        name = g_alloca (strlen (p) + 1);
        strcpy (name, p);
-       
+
        utf7_name = g_alloca (strlen (full_name) + 1);
        strcpy (utf7_name, full_name);
-       
+
        sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, full_name);
        if (sep != '/') {
                p = utf7_name;
@@ -340,36 +340,36 @@ camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException
                        p++;
                }
        }
-       
+
        utf7_name = camel_utf8_utf7 (utf7_name);
-       
+
        folder = (CamelFolder *) (imap4_folder = (CamelIMAP4Folder *) camel_object_new (CAMEL_TYPE_IMAP4_FOLDER));
        camel_folder_construct (folder, store, full_name, name);
        imap4_folder->utf7_name = utf7_name;
-       
+
        folder->summary = camel_imap4_summary_new (folder);
        imap4_folder->cachedir = imap4_store_build_filename (store, folder->full_name);
        g_mkdir_with_parents (imap4_folder->cachedir, 0777);
-       
+
        imap4_folder->cache = camel_data_cache_new (imap4_folder->cachedir, 0, NULL);
-       
+
        path = imap4_get_summary_filename (imap4_folder->cachedir);
        camel_folder_summary_set_filename (folder->summary, path);
        g_free (path);
-       
+
        path = imap4_get_journal_filename (imap4_folder->cachedir);
        imap4_folder->journal = camel_imap4_journal_new (imap4_folder, path);
        g_free (path);
-       
+
        path = g_build_filename (imap4_folder->cachedir, "cmeta", NULL);
        camel_object_set (folder, NULL, CAMEL_OBJECT_STATE_FILE, path, NULL);
        g_free (path);
-       
+
        if (camel_object_state_read (folder) == -1) {
                /* set our defaults */
                imap4_folder->enable_mlist = TRUE;
        }
-       
+
        if (!g_ascii_strcasecmp (full_name, "INBOX")) {
                if (camel_url_get_param (((CamelService *) store)->url, "filter"))
                        folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
@@ -379,18 +379,18 @@ camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException
                if (camel_url_get_param (((CamelService *) store)->url, "filter_junk"))
                        folder->folder_flags |= CAMEL_FOLDER_FILTER_JUNK;
        }
-       
+
        imap4_folder->search = camel_imap4_search_new (((CamelIMAP4Store *) store)->engine, imap4_folder->cachedir);
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
                /* we don't care if the summary loading fails here */
                camel_folder_summary_load (folder->summary);
-               
+
                if (camel_imap4_engine_select_folder (((CamelIMAP4Store *) store)->engine, folder, ex) == -1) {
                        camel_object_unref (folder);
                        folder = NULL;
                }
-               
+
                if (folder && camel_imap4_summary_flush_updates (folder->summary, ex) == -1) {
                        camel_object_unref (folder);
                        folder = NULL;
@@ -401,12 +401,12 @@ camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException
                        camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_PATH,
                                              _("Cannot access folder `%s': %s"),
                                              full_name, g_strerror (ENOENT));
-                       
+
                        camel_object_unref (folder);
                        folder = NULL;
                }
        }
-       
+
        return folder;
 }
 
@@ -437,23 +437,23 @@ imap4_sync_flag (CamelFolder *folder, GPtrArray *infos, char onoff, const char *
        CamelIMAP4Command *ic;
        int i, id, retval = 0;
        char *set = NULL;
-       
+
        for (i = 0; i < infos->len; ) {
                i += camel_imap4_get_uid_set (engine, folder->summary, infos, i, 30 + strlen (flag), &set);
-               
+
                ic = camel_imap4_engine_queue (engine, folder, "UID STORE %s %cFLAGS.SILENT (%s)\r\n", set, onoff, flag);
                while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                        ;
-               
+
                g_free (set);
-               
+
                if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                        camel_exception_xfer (ex, &ic->ex);
                        camel_imap4_command_unref (ic);
-                       
+
                        return -1;
                }
-               
+
                switch (ic->result) {
                case CAMEL_IMAP4_RESULT_NO:
                        /* FIXME: would be good to save the NO reason into the err message */
@@ -469,13 +469,13 @@ imap4_sync_flag (CamelFolder *folder, GPtrArray *infos, char onoff, const char *
                        retval = -1;
                        break;
                }
-               
+
                camel_imap4_command_unref (ic);
-               
+
                if (retval == -1)
                        return -1;
        }
-       
+
        return 0;
 }
 
@@ -488,15 +488,15 @@ imap4_sync_changes (CamelFolder *folder, GPtrArray *sync, CamelException *ex)
        flags_diff_t diff;
        int retval = 0;
        int i, j;
-       
+
        on_set = g_ptr_array_new ();
        off_set = g_ptr_array_new ();
-       
+
        /* construct commands to sync system and user flags */
        for (i = 0; i < G_N_ELEMENTS (imap4_flags); i++) {
                if (!(imap4_flags[i].flag & folder->permanent_flags))
                        continue;
-               
+
                for (j = 0; j < sync->len; j++) {
                        iinfo = (CamelIMAP4MessageInfo *) (info = sync->pdata[j]);
                        camel_imap4_flags_diff (&diff, iinfo->server_flags, iinfo->info.flags);
@@ -508,34 +508,34 @@ imap4_sync_changes (CamelFolder *folder, GPtrArray *sync, CamelException *ex)
                                }
                        }
                }
-               
+
                if (on_set->len > 0) {
                        if ((retval = imap4_sync_flag (folder, on_set, '+', imap4_flags[i].name, ex)) == -1)
                                break;
-                       
+
                        g_ptr_array_set_size (on_set, 0);
                }
-               
+
                if (off_set->len > 0) {
                        if ((retval = imap4_sync_flag (folder, off_set, '-', imap4_flags[i].name, ex)) == -1)
                                break;
-                       
+
                        g_ptr_array_set_size (off_set, 0);
                }
        }
-       
+
        g_ptr_array_free (on_set, TRUE);
        g_ptr_array_free (off_set, TRUE);
-       
+
        if (retval == -1)
                return-1;
-       
+
        for (i = 0; i < sync->len; i++) {
                iinfo = (CamelIMAP4MessageInfo *) (info = sync->pdata[i]);
                iinfo->info.flags &= ~CAMEL_MESSAGE_FOLDER_FLAGGED;
                iinfo->server_flags = iinfo->info.flags & folder->permanent_flags;
        }
-       
+
        return 0;
 }
 
@@ -551,12 +551,12 @@ imap4_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
        GPtrArray *sync;
        int id, max, i;
        int retval;
-       
+
        if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
                return;
-       
+
        CAMEL_SERVICE_REC_LOCK (folder->parent_store, connect_lock);
-       
+
        /* gather a list of changes to sync to the server */
        if (folder->permanent_flags) {
                sync = g_ptr_array_new ();
@@ -566,7 +566,7 @@ imap4_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
                        if (iinfo->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED) {
                                camel_imap4_flags_diff (&diff, iinfo->server_flags, iinfo->info.flags);
                                diff.changed &= folder->permanent_flags;
-                               
+
                                /* weed out flag changes that we can't sync to the server */
                                if (!diff.changed)
                                        camel_message_info_free(info);
@@ -576,27 +576,27 @@ imap4_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
                                camel_message_info_free(info);
                        }
                }
-               
+
                if (sync->len > 0) {
                        retval = imap4_sync_changes (folder, sync, ex);
-                       
+
                        for (i = 0; i < sync->len; i++)
                                camel_message_info_free(sync->pdata[i]);
-                       
+
                        g_ptr_array_free (sync, TRUE);
-                       
+
                        if (retval == -1)
                                goto done;
                } else {
                        g_ptr_array_free (sync, TRUE);
                }
        }
-       
+
        if (expunge && !((CamelIMAP4Folder *) folder)->read_only) {
                ic = camel_imap4_engine_queue (engine, folder, "EXPUNGE\r\n");
                while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                        ;
-               
+
                switch (ic->result) {
                case CAMEL_IMAP4_RESULT_OK:
                        camel_imap4_summary_flush_updates (folder->summary, ex);
@@ -613,16 +613,16 @@ imap4_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
                                              folder->full_name);
                        break;
                }
-               
+
                camel_imap4_command_unref (ic);
        } else {
                camel_imap4_summary_flush_updates (folder->summary, ex);
        }
-       
+
        camel_folder_summary_save (folder->summary);
-       
+
  done:
-       
+
        CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
 }
 
@@ -640,35 +640,35 @@ imap4_refresh_info (CamelFolder *folder, CamelException *ex)
        CamelFolder *selected = (CamelFolder *) engine->folder;
        CamelIMAP4Command *ic;
        int id;
-       
+
        if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
                return;
-       
+
        CAMEL_SERVICE_REC_LOCK (folder->parent_store, connect_lock);
-       
+
        if (folder != selected) {
                if (camel_imap4_engine_select_folder (engine, folder, ex) == -1)
                        goto done;
-               
+
                ((CamelIMAP4Summary *) folder->summary)->update_flags = TRUE;
        } else {
                ic = camel_imap4_engine_queue (engine, NULL, "NOOP\r\n");
                while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                        ;
-               
+
                if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE)
                        camel_exception_xfer (ex, &ic->ex);
-               
+
                camel_imap4_command_unref (ic);
-               
+
                if (camel_exception_is_set (ex))
                        goto done;
        }
-       
+
        camel_imap4_summary_flush_updates (folder->summary, ex);
-       
+
  done:
-       
+
        CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
 }
 
@@ -682,51 +682,51 @@ untagged_fetch (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
        CamelMessageInfo *info;
        CamelMimeFilter *crlf;
        guint32 flags;
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        /* parse the FETCH response list */
        if (token->token != '(') {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                return -1;
        }
-       
+
        do {
                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                        goto exception;
-               
+
                if (token->token == ')' || token->token == '\n')
                        break;
-               
+
                if (token->token != CAMEL_IMAP4_TOKEN_ATOM)
                        goto unexpected;
-               
+
                if (!strcmp (token->v.atom, "BODY[")) {
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        if (token->token != ']')
                                goto unexpected;
-                       
+
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        if (token->token != CAMEL_IMAP4_TOKEN_LITERAL)
                                goto unexpected;
-                       
+
                        fstream = (CamelStream *) camel_stream_filter_new_with_stream (stream);
                        crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
                        camel_stream_filter_add ((CamelStreamFilter *) fstream, crlf);
                        camel_object_unref (crlf);
-                       
+
                        camel_stream_write_to_stream ((CamelStream *) engine->istream, fstream);
                        camel_stream_flush (fstream);
                        camel_object_unref (fstream);
                } else if (!strcmp (token->v.atom, "UID")) {
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        if (token->token != CAMEL_IMAP4_TOKEN_NUMBER || token->v.number == 0)
                                goto unexpected;
                } else if (!strcmp (token->v.atom, "FLAGS")) {
@@ -734,17 +734,17 @@ untagged_fetch (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
                         * given to us if another client recently changed the flags... */
                        if (camel_imap4_parse_flags_list (engine, &flags, ex) == -1)
                                goto exception;
-                       
+
                        if ((info = camel_folder_summary_index (summary, index - 1))) {
                                iinfo = (CamelIMAP4MessageInfo *) info;
                                iinfo->info.flags = camel_imap4_merge_flags (iinfo->server_flags, iinfo->info.flags, flags);
                                iinfo->server_flags = flags;
-                               
+
                                changes = camel_folder_change_info_new ();
                                camel_folder_change_info_change_uid (changes, camel_message_info_uid (info));
                                camel_object_trigger_event (engine->folder, "folder_changed", changes);
                                camel_folder_change_info_free (changes);
-                               
+
                                camel_message_info_free(info);
                        }
                } else {
@@ -752,20 +752,20 @@ untagged_fetch (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
                        d(fprintf (stderr, "huh? %s?...\n", token->v.atom));
                }
        } while (1);
-       
+
        if (token->token != ')') {
                d(fprintf (stderr, "expected ')' to close untagged FETCH response\n"));
                goto unexpected;
        }
-       
+
        return 0;
-       
+
  unexpected:
-       
+
        camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
-       
+
  exception:
-       
+
        return -1;
 }
 
@@ -779,12 +779,12 @@ imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
        CamelStream *stream, *cache;
        CamelIMAP4Command *ic;
        int id;
-       
+
        CAMEL_SERVICE_REC_LOCK (folder->parent_store, connect_lock);
-       
+
        if (imap4_folder->cache && (stream = camel_data_cache_get (imap4_folder->cache, "cache", uid, ex))) {
                message = camel_mime_message_new ();
-               
+
                if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) message, stream) == -1) {
                        if (errno == EINTR) {
                                CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
@@ -799,22 +799,22 @@ imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                                message = NULL;
                        }
                }
-               
+
                camel_object_unref (stream);
        }
-       
+
        if (message != NULL) {
                CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
                return message;
        }
-       
+
        if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
                camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                     _("This message is not available in offline mode."));
                return NULL;
        }
-       
+
        /* Note: While some hard-core IMAP extremists are probably
         * going to flame me for fetching entire messages here, it's
         * the *only* sure-fire way of working with all IMAP
@@ -835,24 +835,24 @@ imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
        ic = camel_imap4_engine_queue (engine, folder, "UID FETCH %s BODY.PEEK[]\r\n", uid);
        camel_imap4_command_register_untagged (ic, "FETCH", untagged_fetch);
        ic->user_data = stream = camel_stream_mem_new ();
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
                camel_object_unref (stream);
                goto done;
        }
-       
+
        switch (ic->result) {
        case CAMEL_IMAP4_RESULT_OK:
                camel_stream_reset (stream);
                message = camel_mime_message_new ();
                camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) message, stream);
                camel_stream_reset (stream);
-               
+
                /* cache the message locally */
                if (imap4_folder->cache && (cache = camel_data_cache_add (imap4_folder->cache, "cache", uid, NULL))) {
                        if (camel_stream_write_to_stream (stream, cache) == -1
@@ -860,7 +860,7 @@ imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                                camel_data_cache_remove (imap4_folder->cache, "cache", uid, NULL);
                        camel_object_unref (cache);
                }
-               
+
                break;
        case CAMEL_IMAP4_RESULT_NO:
                /* FIXME: would be good to save the NO reason into the err message */
@@ -874,15 +874,15 @@ imap4_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                                      uid, folder->full_name);
                break;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        camel_object_unref (stream);
-       
+
  done:
-       
+
        CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
-       
+
        return message;
 }
 
@@ -908,51 +908,51 @@ imap4_append_message (CamelFolder *folder, CamelMimeMessage *message,
        char date[50];
        struct tm tm;
        int id, i;
-       
+
        if (appended_uid)
                *appended_uid = NULL;
-       
+
        if (((CamelIMAP4Folder *) folder)->read_only) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot append message to folder `%s': Folder is read-only"),
                                      folder->full_name);
                return;
        }
-       
+
        if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                camel_imap4_journal_append ((CamelIMAP4Journal *) imap4_folder->journal, message, info, appended_uid, ex);
                return;
        }
-       
+
        CAMEL_SERVICE_REC_LOCK (folder->parent_store, connect_lock);
-       
+
        /* construct the option flags list */
        if (iinfo->info.flags & folder->permanent_flags) {
                p = g_stpcpy (flags, " (");
-               
+
                for (i = 0; i < G_N_ELEMENTS (imap4_flags); i++) {
                        if ((iinfo->info.flags & imap4_flags[i].flag) & folder->permanent_flags) {
                                p = g_stpcpy (p, imap4_flags[i].name);
                                *p++ = ' ';
                        }
                }
-               
+
                p[-1] = ')';
                *p = '\0';
        } else {
                flags[0] = '\0';
        }
-       
+
        /* construct the optional date_time string */
        if (iinfo->info.date_received > (time_t) 0) {
                int tzone;
-               
+
 #ifdef HAVE_LOCALTIME_R
                localtime_r (&iinfo->info.date_received, &tm);
 #else
                memcpy (&tm, localtime (&iinfo->info.date_received), sizeof (tm));
 #endif
-               
+
 #if defined (HAVE_TM_GMTOFF)
                tzone = -tm.tm_gmtoff;
 #elif defined (HAVE_TIMEZONE)
@@ -968,33 +968,33 @@ imap4_append_message (CamelFolder *folder, CamelMimeMessage *message,
 #else
 #error Neither HAVE_TIMEZONE nor HAVE_TM_GMTOFF defined. Rerun autoheader, autoconf, etc.
 #endif
-               
+
                sprintf (date, " \"%02d-%s-%04d %02d:%02d:%02d %+05d\"",
                         tm.tm_mday, tm_months[tm.tm_mon], tm.tm_year + 1900,
                         tm.tm_hour, tm.tm_min, tm.tm_sec, tzone);
        } else {
                date[0] = '\0';
        }
-       
+
  retry:
-       
+
        ic = camel_imap4_engine_queue (engine, NULL, "APPEND %F%s%s %L\r\n", folder, flags, date, message);
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
                CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
                return;
        }
-       
+
        switch (ic->result) {
        case CAMEL_IMAP4_RESULT_OK:
                if (!appended_uid || !(engine->capa & CAMEL_IMAP4_CAPABILITY_UIDPLUS))
                        break;
-               
+
                for (i = 0; i < ic->resp_codes->len; i++) {
                        resp = ic->resp_codes->pdata[i];
                        if (resp->code == CAMEL_IMAP4_RESP_CODE_APPENDUID) {
@@ -1009,44 +1009,44 @@ imap4_append_message (CamelFolder *folder, CamelMimeMessage *message,
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot append message to folder `%s': Unknown error"),
                                      folder->full_name);
-               
+
                for (i = 0; i < ic->resp_codes->len; i++) {
                        resp = ic->resp_codes->pdata[i];
                        if (resp->code == CAMEL_IMAP4_RESP_CODE_TRYCREATE) {
                                char *parent_name, *p;
-                               
+
                                parent_name = g_alloca (strlen (folder->full_name) + 1);
                                strcpy (parent_name, folder->full_name);
                                if (!(p = strrchr (parent_name, '/')))
                                        *parent_name = '\0';
                                else
                                        *p = '\0';
-                               
+
                                if (!(fi = camel_store_create_folder (folder->parent_store, parent_name, folder->name, &lex))) {
                                        camel_exception_clear (&lex);
                                        break;
                                }
-                               
+
                                camel_store_free_folder_info (folder->parent_store, fi);
                                camel_imap4_command_unref (ic);
                                camel_exception_clear (ex);
                                goto retry;
                        }
                }
-               
+
                break;
        case CAMEL_IMAP4_RESULT_BAD:
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot append message to folder `%s': Bad command"),
                                      folder->full_name);
-               
+
                break;
        default:
                g_assert_not_reached ();
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (folder->parent_store, connect_lock);
 }
 
@@ -1055,13 +1055,13 @@ static int
 info_uid_sort (const CamelMessageInfo **info0, const CamelMessageInfo **info1)
 {
        guint32 uid0, uid1;
-       
+
        uid0 = strtoul (camel_message_info_uid (*info0), NULL, 10);
        uid1 = strtoul (camel_message_info_uid (*info1), NULL, 10);
-       
+
        if (uid0 == uid1)
                return 0;
-       
+
        return uid0 < uid1 ? -1 : 1;
 }
 
@@ -1077,81 +1077,81 @@ imap4_transfer_messages_to (CamelFolder *src, GPtrArray *uids, CamelFolder *dest
        CamelException lex;
        GPtrArray *infos;
        char *set;
-       
+
        if (transferred_uids)
                *transferred_uids = NULL;
-       
+
        camel_exception_init (&lex);
        imap4_sync (src, FALSE, &lex);
        if (camel_exception_is_set (&lex)) {
                camel_exception_xfer (ex, &lex);
                return;
        }
-       
+
        infos = g_ptr_array_new ();
        for (i = 0; i < uids->len; i++) {
                if (!(info = camel_folder_summary_uid (src->summary, uids->pdata[i])))
                        continue;
-               
+
                g_ptr_array_add (infos, info);
        }
-       
+
        if (infos->len == 0) {
                g_ptr_array_free (infos, TRUE);
                return;
        }
-       
+
        g_ptr_array_sort (infos, (GCompareFunc) info_uid_sort);
-       
+
        CAMEL_SERVICE_REC_LOCK (src->parent_store, connect_lock);
-       
+
        /* check for offline operation */
        if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                CamelIMAP4Journal *journal = (CamelIMAP4Journal *) ((CamelIMAP4Folder *) dest)->journal;
                CamelMimeMessage *message;
-               
+
                for (i = 0; i < infos->len; i++) {
                        info = infos->pdata[i];
-                       
+
                        if (!(message = imap4_get_message (src, camel_message_info_uid (info), ex)))
                                break;
-                       
+
                        camel_imap4_journal_append (journal, message, info, NULL, ex);
                        camel_object_unref (message);
-                       
+
                        if (camel_exception_is_set (ex))
                                break;
-                       
+
                        if (move)
                                camel_folder_set_message_flags (src, camel_message_info_uid (info),
                                                                CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED);
                }
-               
+
                goto done;
        }
-       
+
        dest_namelen = strlen (camel_imap4_folder_utf7_name ((CamelIMAP4Folder *) dest));
-       
+
        for (i = 0; i < infos->len; i += n) {
                n = camel_imap4_get_uid_set (engine, src->summary, infos, i, 10 + dest_namelen, &set);
-               
+
                if (move && (engine->capa & CAMEL_IMAP4_CAPABILITY_XGWMOVE))
                        ic = camel_imap4_engine_queue (engine, src, "UID XGWMOVE %s %F\r\n", set, dest);
                else
                        ic = camel_imap4_engine_queue (engine, src, "UID COPY %s %F\r\n", set, dest);
-               
+
                while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                        ;
-               
+
                g_free (set);
-               
+
                if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                        camel_exception_xfer (ex, &ic->ex);
                        camel_imap4_command_unref (ic);
                        g_free (set);
                        goto done;
                }
-               
+
                switch (ic->result) {
                case CAMEL_IMAP4_RESULT_NO:
                        /* FIXME: would be good to save the NO reason into the err message */
@@ -1164,7 +1164,7 @@ imap4_transfer_messages_to (CamelFolder *src, GPtrArray *uids, CamelFolder *dest
                                                      _("Cannot copy messages from folder `%s' to folder `%s': Unknown"),
                                                      src->full_name, dest->full_name);
                        }
-                       
+
                        goto done;
                case CAMEL_IMAP4_RESULT_BAD:
                        if (move) {
@@ -1176,29 +1176,29 @@ imap4_transfer_messages_to (CamelFolder *src, GPtrArray *uids, CamelFolder *dest
                                                      _("Cannot copy messages from folder `%s' to folder `%s': Bad command"),
                                                      src->full_name, dest->full_name);
                        }
-                       
+
                        goto done;
                }
-               
+
                camel_imap4_command_unref (ic);
-               
+
                if (move && !(engine->capa & CAMEL_IMAP4_CAPABILITY_XGWMOVE)) {
                        for (j = i; j < n; j++) {
                                info = infos->pdata[j];
                                camel_folder_set_message_flags (src, camel_message_info_uid (info),
                                                                CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED);
                        }
-                       
+
                        camel_folder_summary_touch (src->summary);
                }
        }
-       
+
  done:
-       
+
        for (i = 0; i < infos->len; i++)
                camel_message_info_free (infos->pdata[i]);
        g_ptr_array_free (infos, TRUE);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (src->parent_store, connect_lock);
 }
 
@@ -1207,14 +1207,14 @@ imap4_search_by_expression (CamelFolder *folder, const char *expr, CamelExceptio
 {
        CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) folder;
        GPtrArray *matches;
-       
+
        CAMEL_SERVICE_REC_LOCK(folder->parent_store, connect_lock);
-       
+
        camel_folder_search_set_folder (imap4_folder->search, folder);
        matches = camel_folder_search_search (imap4_folder->search, expr, NULL, ex);
-       
+
        CAMEL_SERVICE_REC_UNLOCK(folder->parent_store, connect_lock);
-       
+
        return matches;
 }
 
@@ -1223,17 +1223,17 @@ imap4_search_by_uids (CamelFolder *folder, const char *expr, GPtrArray *uids, Ca
 {
        CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) folder;
        GPtrArray *matches;
-       
+
        if (uids->len == 0)
                return g_ptr_array_new ();
-       
+
        CAMEL_SERVICE_REC_LOCK(folder->parent_store, connect_lock);
-       
+
        camel_folder_search_set_folder (imap4_folder->search, folder);
        matches = camel_folder_search_search (imap4_folder->search, expr, uids, ex);
-       
+
        CAMEL_SERVICE_REC_UNLOCK(folder->parent_store, connect_lock);
-       
+
        return matches;
 }
 
@@ -1241,12 +1241,12 @@ static void
 imap4_search_free (CamelFolder *folder, GPtrArray *uids)
 {
        CamelIMAP4Folder *imap4_folder = (CamelIMAP4Folder *) folder;
-       
+
        g_return_if_fail (imap4_folder->search);
-       
+
        CAMEL_SERVICE_REC_LOCK(folder->parent_store, connect_lock);
-       
+
        camel_folder_search_free_result (imap4_folder->search, uids);
-       
+
        CAMEL_SERVICE_REC_UNLOCK(folder->parent_store, connect_lock);
 }
index 73a8e39..39c0e28 100644 (file)
@@ -54,22 +54,22 @@ enum {
 
 struct _CamelIMAP4Folder {
        CamelOfflineFolder parent_object;
-       
+
        CamelFolderSearch *search;
-       
+
        CamelOfflineJournal *journal;
        CamelDataCache *cache;
-       
+
        char *cachedir;
        char *utf7_name;
-       
+
        unsigned int read_only:1;
        unsigned int enable_mlist:1;
 };
 
 struct _CamelIMAP4FolderClass {
        CamelOfflineFolderClass parent_class;
-       
+
 };
 
 
index 3f91d8a..3cfe157 100644 (file)
@@ -63,7 +63,7 @@ CamelType
 camel_imap4_journal_get_type (void)
 {
        static CamelType type = 0;
-       
+
        if (!type) {
                type = camel_type_register (camel_offline_journal_get_type (),
                                            "CamelIMAP4Journal",
@@ -74,7 +74,7 @@ camel_imap4_journal_get_type (void)
                                            (CamelObjectInitFunc) camel_imap4_journal_init,
                                            (CamelObjectFinalizeFunc) camel_imap4_journal_finalize);
        }
-       
+
        return type;
 }
 
@@ -82,9 +82,9 @@ static void
 camel_imap4_journal_class_init (CamelIMAP4JournalClass *klass)
 {
        CamelOfflineJournalClass *journal_class = (CamelOfflineJournalClass *) klass;
-       
+
        parent_class = (CamelOfflineJournalClass *) camel_type_get_global_classfuncs (CAMEL_TYPE_OFFLINE_JOURNAL);
-       
+
        journal_class->entry_free = imap4_entry_free;
        journal_class->entry_load = imap4_entry_load;
        journal_class->entry_write = imap4_entry_write;
@@ -102,7 +102,7 @@ camel_imap4_journal_finalize (CamelObject *object)
 {
        CamelIMAP4Journal *journal = (CamelIMAP4Journal *) object;
        int i;
-       
+
        if (journal->failed) {
                for (i = 0; i < journal->failed->len; i++)
                        camel_message_info_free (journal->failed->pdata[i]);
@@ -114,7 +114,7 @@ static void
 imap4_entry_free (CamelOfflineJournal *journal, EDListNode *entry)
 {
        CamelIMAP4JournalEntry *imap4_entry = (CamelIMAP4JournalEntry *) entry;
-       
+
        g_free (imap4_entry->v.append_uid);
        g_free (imap4_entry);
 }
@@ -123,26 +123,26 @@ static EDListNode *
 imap4_entry_load (CamelOfflineJournal *journal, FILE *in)
 {
        CamelIMAP4JournalEntry *entry;
-       
+
        entry = g_malloc0 (sizeof (CamelIMAP4JournalEntry));
-       
+
        if (camel_file_util_decode_uint32 (in, &entry->type) == -1)
                goto exception;
-       
+
        switch (entry->type) {
        case CAMEL_IMAP4_JOURNAL_ENTRY_APPEND:
                if (camel_file_util_decode_string (in, &entry->v.append_uid) == -1)
                        goto exception;
-               
+
                break;
        default:
                goto exception;
        }
-       
+
        return (EDListNode *) entry;
-       
+
  exception:
-       
+
        switch (entry->type) {
        case CAMEL_IMAP4_JOURNAL_ENTRY_APPEND:
                g_free (entry->v.append_uid);
@@ -150,9 +150,9 @@ imap4_entry_load (CamelOfflineJournal *journal, FILE *in)
        default:
                g_assert_not_reached ();
        }
-       
+
        g_free (entry);
-       
+
        return NULL;
 }
 
@@ -160,20 +160,20 @@ static int
 imap4_entry_write (CamelOfflineJournal *journal, EDListNode *entry, FILE *out)
 {
        CamelIMAP4JournalEntry *imap4_entry = (CamelIMAP4JournalEntry *) entry;
-       
+
        if (camel_file_util_encode_uint32 (out, imap4_entry->type) == -1)
                return -1;
-       
+
        switch (imap4_entry->type) {
        case CAMEL_IMAP4_JOURNAL_ENTRY_APPEND:
                if (camel_file_util_encode_string (out, imap4_entry->v.append_uid))
                        return -1;
-               
+
                break;
        default:
                g_assert_not_reached ();
        }
-       
+
        return 0;
 }
 
@@ -198,31 +198,31 @@ imap4_entry_play_append (CamelOfflineJournal *journal, CamelIMAP4JournalEntry *e
        CamelStream *stream;
        CamelException lex;
        char *uid = NULL;
-       
+
        /* if the message isn't in the cache, the user went behind our backs so "not our problem" */
        if (!imap4_folder->cache || !(stream = camel_data_cache_get (imap4_folder->cache, "cache", entry->v.append_uid, ex)))
                goto done;
-       
+
        message = camel_mime_message_new ();
        if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) message, stream) == -1) {
                camel_object_unref (message);
                camel_object_unref (stream);
                goto done;
        }
-       
+
        camel_object_unref (stream);
-       
+
        if (!(info = camel_folder_summary_uid (folder->summary, entry->v.append_uid))) {
                /* info not in the summary, either because the summary
                 * got corrupted or because the previous time this
                 * journal was replay'd, it failed [1] */
                info = camel_message_info_new (NULL);
        }
-       
+
        camel_exception_init (&lex);
        camel_folder_append_message (folder, message, info, &uid, &lex);
        camel_object_unref (message);
-       
+
        if (camel_exception_is_set (&lex)) {
                /* Remove the message-info from the summary even if we fail or the next
                 * summary downsync will break because info indexes will be wrong */
@@ -234,27 +234,27 @@ imap4_entry_play_append (CamelOfflineJournal *journal, CamelIMAP4JournalEntry *e
                        camel_folder_summary_remove_uid (folder->summary, entry->v.append_uid);
                        camel_message_info_free (info);
                }
-               
+
                camel_exception_xfer (ex, &lex);
-               
+
                return -1;
        }
-       
+
        if (uid != NULL && (real = camel_folder_summary_uid (folder->summary, uid))) {
                /* Copy the system flags and user flags/tags over to the real
                   message-info now stored in the summary to prevent the user
                   from losing any of this meta-data */
                imap4_message_info_dup_to ((CamelMessageInfoBase *) real, (CamelMessageInfoBase *) info);
        }
-       
+
        camel_message_info_free (info);
        g_free (uid);
-       
+
  done:
-       
+
        camel_folder_summary_remove_uid (folder->summary, entry->v.append_uid);
        camel_data_cache_remove (imap4_folder->cache, "cache", entry->v.append_uid, NULL);
-       
+
        return 0;
 }
 
@@ -262,7 +262,7 @@ static int
 imap4_entry_play (CamelOfflineJournal *journal, EDListNode *entry, CamelException *ex)
 {
        CamelIMAP4JournalEntry *imap4_entry = (CamelIMAP4JournalEntry *) entry;
-       
+
        switch (imap4_entry->type) {
        case CAMEL_IMAP4_JOURNAL_ENTRY_APPEND:
                return imap4_entry_play_append (journal, imap4_entry, ex);
@@ -278,12 +278,12 @@ CamelOfflineJournal *
 camel_imap4_journal_new (CamelIMAP4Folder *folder, const char *filename)
 {
        CamelOfflineJournal *journal;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_FOLDER (folder), NULL);
-       
+
        journal = (CamelOfflineJournal *) camel_object_new (camel_imap4_journal_get_type ());
        camel_offline_journal_construct (journal, (CamelFolder *) folder, filename);
-       
+
        return journal;
 }
 
@@ -293,10 +293,10 @@ camel_imap4_journal_readd_failed (CamelIMAP4Journal *journal)
 {
        CamelFolderSummary *summary = ((CamelOfflineJournal *) journal)->folder->summary;
        int i;
-       
+
        for (i = 0; i < journal->failed->len; i++)
                camel_folder_summary_add (summary, journal->failed->pdata[i]);
-       
+
        g_ptr_array_set_size (journal->failed, 0);
 }
 
@@ -313,22 +313,22 @@ camel_imap4_journal_append (CamelIMAP4Journal *imap4_journal, CamelMimeMessage *
        CamelStream *cache;
        guint32 nextuid;
        char *uid;
-       
+
        if (imap4_folder->cache == NULL) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Cannot append message in offline mode: cache unavailable"));
                return;
        }
-       
+
        nextuid = camel_folder_summary_next_uid (folder->summary);
        uid = g_strdup_printf ("-%lu", nextuid);
-       
+
        if (!(cache = camel_data_cache_add (imap4_folder->cache, "cache", uid, ex))) {
                folder->summary->nextuid--;
                g_free (uid);
                return;
        }
-       
+
        if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *) message, cache) == -1
            || camel_stream_flush (cache) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -340,23 +340,23 @@ camel_imap4_journal_append (CamelIMAP4Journal *imap4_journal, CamelMimeMessage *
                g_free (uid);
                return;
        }
-       
+
        camel_object_unref (cache);
-       
+
        entry = g_new (CamelIMAP4JournalEntry, 1);
        entry->type = CAMEL_IMAP4_JOURNAL_ENTRY_APPEND;
        entry->v.append_uid = uid;
-       
+
        e_dlist_addtail (&journal->queue, (EDListNode *) entry);
-       
+
        info = camel_folder_summary_info_new_from_message (folder->summary, message);
        g_free(info->uid);
        info->uid = g_strdup (uid);
-       
+
        imap4_message_info_dup_to ((CamelMessageInfoBase *) info, (CamelMessageInfoBase *) mi);
-       
+
        camel_folder_summary_add (folder->summary, info);
-       
+
        if (appended_uid)
                *appended_uid = g_strdup (uid);
 }
index 610b408..42b657a 100644 (file)
@@ -51,9 +51,9 @@ enum {
 
 struct _CamelIMAP4JournalEntry {
        EDListNode node;
-       
+
        int type;
-       
+
        union {
                char *append_uid;
        } v;
@@ -61,13 +61,13 @@ struct _CamelIMAP4JournalEntry {
 
 struct _CamelIMAP4Journal {
        CamelOfflineJournal parent_object;
-       
+
        GPtrArray *failed;
 };
 
 struct _CamelIMAP4JournalClass {
        CamelOfflineJournalClass parent_class;
-       
+
 };
 
 
index 0cea162..599fdd6 100644 (file)
@@ -64,27 +64,27 @@ static CamelProviderConfEntry imap4_conf_entries[] = {
 static CamelProvider imap4_provider = {
        "imap4",
        N_("IMAP4rev1"),
-       
+
        N_("For reading and storing mail on IMAPv4rev1 servers."),
-       
+
        "mail",
-       
+
        CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
        CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL,
-       
+
        CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH | CAMEL_URL_FRAGMENT_IS_PATH,
-       
+
        imap4_conf_entries,
-       
+
        /* ... */
 };
 
 CamelServiceAuthType camel_imap4_password_authtype = {
        N_("Password"),
-       
+
        N_("This option will connect to the IMAPv4rev1 server using a "
           "plaintext password."),
-       
+
        "",
        TRUE
 };
@@ -102,12 +102,12 @@ imap4_url_hash (gconstpointer key)
 {
        const CamelURL *u = (CamelURL *)key;
        guint hash = 0;
-       
+
        add_hash (&hash, u->user);
        add_hash (&hash, u->authmech);
        add_hash (&hash, u->host);
        hash ^= u->port;
-       
+
        return hash;
 }
 
@@ -120,10 +120,10 @@ check_equal (char *s1, char *s2)
                else
                        return FALSE;
        }
-       
+
        if (s2 == NULL)
                return FALSE;
-       
+
        return strcmp (s1, s2) == 0;
 }
 
@@ -131,7 +131,7 @@ static int
 imap4_url_equal (gconstpointer a, gconstpointer b)
 {
        const CamelURL *u1 = a, *u2 = b;
-       
+
        return check_equal (u1->protocol, u2->protocol)
                && check_equal (u1->user, u2->user)
                && check_equal (u1->authmech, u2->authmech)
@@ -149,6 +149,6 @@ camel_provider_module_init (void)
        imap4_provider.authtypes = camel_sasl_authtype_list (FALSE);
        imap4_provider.authtypes = g_list_prepend (imap4_provider.authtypes, &camel_imap4_password_authtype);
        imap4_provider.translation_domain = GETTEXT_PACKAGE;
-       
+
        camel_provider_register (&imap4_provider);
 }
index 42bff9d..326146c 100644 (file)
@@ -50,7 +50,7 @@ CamelType
 camel_imap4_search_get_type (void)
 {
        static CamelType type = 0;
-       
+
        if (!type) {
                type = camel_type_register (camel_folder_search_get_type (),
                                            "CamelIMAP4Search",
@@ -61,7 +61,7 @@ camel_imap4_search_get_type (void)
                                            (CamelObjectInitFunc) camel_imap4_search_init,
                                            (CamelObjectFinalizeFunc) camel_imap4_search_finalize);
        }
-       
+
        return type;
 }
 
@@ -69,9 +69,9 @@ static void
 camel_imap4_search_class_init (CamelIMAP4SearchClass *klass)
 {
        CamelFolderSearchClass *search_class = (CamelFolderSearchClass *) klass;
-       
+
        parent_class = (CamelFolderSearchClass *) camel_type_get_global_classfuncs (CAMEL_FOLDER_SEARCH_TYPE);
-       
+
        search_class->body_contains = imap4_body_contains;
 }
 
@@ -92,11 +92,11 @@ CamelFolderSearch *
 camel_imap4_search_new (CamelIMAP4Engine *engine, const char *cachedir)
 {
        CamelIMAP4Search *search;
-       
+
        search = (CamelIMAP4Search *) camel_object_new (camel_imap4_search_get_type ());
        camel_folder_search_construct ((CamelFolderSearch *) search);
        search->engine = engine;
-       
+
        return (CamelFolderSearch *) search;
 }
 
@@ -108,30 +108,30 @@ untagged_search (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index,
        GPtrArray *matches = ic->user_data;
        CamelMessageInfo *info;
        char uid[12];
-       
+
        while (1) {
                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                        return -1;
-               
+
                if (token->token == '\n')
                        break;
-               
+
                if (token->token != CAMEL_IMAP4_TOKEN_NUMBER || token->v.number == 0)
                        goto unexpected;
-               
+
                sprintf (uid, "%lu", token->v.number);
                if ((info = camel_folder_summary_uid (summary, uid))) {
                        g_ptr_array_add (matches, (char *) camel_message_info_uid (info));
                        camel_message_info_free (info);
                }
        }
-       
+
        return 0;
-       
+
  unexpected:
-       
+
        camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
-       
+
        return -1;
 }
 
@@ -151,12 +151,12 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
        int id, i, n;
        size_t used;
        char *set;
-       
+
        if (((CamelOfflineStore *) engine->service)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
                return parent_class->body_contains (f, argc, argv, search);
-       
+
        summary_set = search->summary_set ? search->summary_set : search->summary;
-       
+
        /* check the simple cases */
        if (argc == 0 || summary_set->len == 0) {
                /* match nothing */
@@ -167,7 +167,7 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
                        r = e_sexp_result_new (f, ESEXP_RES_ARRAY_PTR);
                        r->value.ptrarray = g_ptr_array_new ();
                }
-               
+
                return r;
        } else if (argc == 1 && argv[0]->type == ESEXP_RES_STRING && argv[0]->value.string[0] == '\0') {
                /* match everything */
@@ -184,10 +184,10 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
                                r->value.ptrarray->pdata[i] = (char *) camel_message_info_uid (info);
                        }
                }
-               
+
                return r;
        }
-       
+
        strings = g_ptr_array_new ();
        for (i = 0; i < argc; i++) {
                if (argv[i]->type == ESEXP_RES_STRING && argv[i]->value.string[0] != '\0') {
@@ -199,17 +199,17 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
                                                utf8_search = TRUE;
                                                break;
                                        }
-                                       
+
                                        inptr++;
                                }
                        }
                }
        }
-       
+
        if (strings->len == 0) {
                /* match everything */
                g_ptr_array_free (strings, TRUE);
-               
+
                if (search->current) {
                        r = e_sexp_result_new (f, ESEXP_RES_BOOL);
                        r->value.bool = TRUE;
@@ -223,14 +223,14 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
                                r->value.ptrarray->pdata[i] = (char *) camel_message_info_uid (info);
                        }
                }
-               
+
                return r;
        }
-       
+
        g_ptr_array_add (strings, NULL);
        matches = g_ptr_array_new ();
        infos = g_ptr_array_new ();
-       
+
        if (search->current) {
                g_ptr_array_add (infos, search->current);
        } else {
@@ -239,39 +239,39 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
                for (i = 0; i < summary_set->len; i++)
                        infos->pdata[i] = summary_set->pdata[i];
        }
-       
+
  retry:
        if (utf8_search && (engine->capa & CAMEL_IMAP4_CAPABILITY_utf8_search))
                expr = "UID SEARCH CHARSET UTF-8 UID %s BODY %V\r\n";
        else
                expr = "UID SEARCH UID %s BODY %V\r\n";
-       
+
        used = strlen (expr) + (5 * (strings->len - 2));
-       
+
        for (i = 0; i < infos->len; i += n) {
                n = camel_imap4_get_uid_set (engine, search->folder->summary, infos, i, used, &set);
-               
+
                ic = camel_imap4_engine_queue (engine, search->folder, expr, set, strings->pdata);
                camel_imap4_command_register_untagged (ic, "SEARCH", untagged_search);
                ic->user_data = matches;
                g_free (set);
-               
+
                while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                        ;
-               
+
                if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                        camel_imap4_command_unref (ic);
                        goto done;
                }
-               
-               
+
+
                if (ic->result == CAMEL_IMAP4_RESULT_NO && utf8_search && (engine->capa & CAMEL_IMAP4_CAPABILITY_utf8_search)) {
                        int j;
-                       
+
                        /* might be because the server is lame and doesn't support UTF-8 */
                        for (j = 0; j < ic->resp_codes->len; j++) {
                                CamelIMAP4RespCode *resp = ic->resp_codes->pdata[j];
-                               
+
                                if (resp->code == CAMEL_IMAP4_RESP_CODE_BADCHARSET) {
                                        engine->capa &= ~CAMEL_IMAP4_CAPABILITY_utf8_search;
                                        camel_imap4_command_unref (ic);
@@ -279,23 +279,23 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
                                }
                        }
                }
-               
+
                if (ic->result != CAMEL_IMAP4_RESULT_OK) {
                        camel_imap4_command_unref (ic);
                        break;
                }
-               
+
                camel_imap4_command_unref (ic);
        }
-       
+
  done:
-       
+
        g_ptr_array_free (strings, TRUE);
        g_ptr_array_free (infos, TRUE);
-       
+
        if (search->current) {
                const char *uid;
-               
+
                uid = camel_message_info_uid (search->current);
                r = e_sexp_result_new (f, ESEXP_RES_BOOL);
                r->value.bool = FALSE;
@@ -305,12 +305,12 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
                                break;
                        }
                }
-               
+
                g_ptr_array_free (matches, TRUE);
        } else {
                r = e_sexp_result_new (f, ESEXP_RES_ARRAY_PTR);
                r->value.ptrarray = matches;
        }
-       
+
        return r;
 }
index ce93fc0..626d14b 100644 (file)
@@ -43,14 +43,14 @@ struct _CamelIMAP4Engine;
 
 struct _CamelIMAP4Search {
        CamelFolderSearch parent_object;
-       
+
        struct _CamelIMAP4Engine *engine;
-       
+
        guint32 lastuid;        /* current 'last uid' for the folder */
        guint32 validity;       /* validity of the current folder */
-       
+
        CamelDataCache *cache;  /* disk-cache for searches */
-       
+
        /* cache of body search matches */
        EDList matches;
        GHashTable *matches_hash;
@@ -59,7 +59,7 @@ struct _CamelIMAP4Search {
 
 struct _CamelIMAP4SearchClass {
        CamelFolderSearchClass parent_class;
-       
+
 };
 
 
index 7cd6202..b3b1662 100644 (file)
@@ -57,7 +57,7 @@ static void
 imap4_init_bits (unsigned short bit, unsigned short bitcopy, int remove, unsigned char *vals)
 {
        int i, len = strlen (vals);
-       
+
        if (!remove) {
                for (i = 0; i < len; i++)
                        camel_imap4_specials[vals[i]] |= bit;
@@ -86,15 +86,15 @@ void
 camel_imap4_specials_init (void)
 {
        int i;
-       
+
        for (i = 0; i < 256; i++) {
                camel_imap4_specials[i] = 0;
                if (i <= 0x1f || i >= 0x7f)
                        camel_imap4_specials[i] |= IS_CTRL;
        }
-       
+
        camel_imap4_specials[' '] |= IS_SPACE;
-       
+
        imap4_init_bits (IS_LWSP, 0, 0, CHARS_LWSP);
        imap4_init_bits (IS_ASPECIAL, 0, 0, CHARS_ATOM_SPECIALS);
        imap4_init_bits (IS_QSPECIAL, 0, 0, CHARS_QUOTED_SPECIALS);
index 36af7ba..6bee8ae 100644 (file)
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 enum {
        IS_ASPECIAL   = (1 << 0),
        IS_CTRL       = (1 << 1),
-       IS_LWSP       = (1 << 2), 
+       IS_LWSP       = (1 << 2),
        IS_QSPECIAL   = (1 << 3),
        IS_SPACE      = (1 << 4),
        IS_WILDCARD   = (1 << 5),
index 505b949..60e3c21 100644 (file)
@@ -60,7 +60,7 @@ CamelType
 camel_imap4_store_summary_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (camel_store_summary_get_type (),
                                            "CamelIMAP4StoreSummary",
@@ -71,7 +71,7 @@ camel_imap4_store_summary_get_type (void)
                                            (CamelObjectInitFunc) camel_imap4_store_summary_init,
                                            (CamelObjectFinalizeFunc) camel_imap4_store_summary_finalize);
        }
-       
+
        return type;
 }
 
@@ -80,12 +80,12 @@ static void
 camel_imap4_store_summary_class_init (CamelIMAP4StoreSummaryClass *klass)
 {
        CamelStoreSummaryClass *ssklass = (CamelStoreSummaryClass *) klass;
-       
+
        parent_class = (CamelStoreSummaryClass *) camel_store_summary_get_type ();
-       
+
        ssklass->summary_header_load = summary_header_load;
        ssklass->summary_header_save = summary_header_save;
-       
+
        ssklass->store_info_load = store_info_load;
        ssklass->store_info_save = store_info_save;
        ssklass->store_info_free = store_info_free;
@@ -103,7 +103,7 @@ static void
 camel_imap4_store_summary_finalize (CamelObject *obj)
 {
        CamelIMAP4StoreSummary *s = (CamelIMAP4StoreSummary *) obj;
-       
+
        if (s->namespaces)
                camel_imap4_namespace_list_free (s->namespaces);
 }
@@ -115,12 +115,12 @@ load_namespaces (FILE *in)
        CamelIMAP4Namespace *ns, *tail = NULL;
        CamelIMAP4NamespaceList *nsl;
        guint32 i, j, n;
-       
+
        nsl = g_malloc (sizeof (CamelIMAP4NamespaceList));
        nsl->personal = NULL;
        nsl->shared = NULL;
        nsl->other = NULL;
-       
+
        for (j = 0; j < 3; j++) {
                switch (j) {
                case 0:
@@ -133,22 +133,22 @@ load_namespaces (FILE *in)
                        tail = (CamelIMAP4Namespace *) &nsl->other;
                        break;
                }
-               
+
                if (camel_file_util_decode_fixed_int32 (in, &n) == -1)
                        goto exception;
-               
+
                for (i = 0; i < n; i++) {
                        guint32 sep;
                        char *path;
-                       
+
                        if (camel_file_util_decode_string (in, &path) == -1)
                                goto exception;
-                       
+
                        if (camel_file_util_decode_uint32 (in, &sep) == -1) {
                                g_free (path);
                                goto exception;
                        }
-                       
+
                        tail->next = ns = g_malloc (sizeof (CamelIMAP4Namespace));
                        ns->sep = sep & 0xff;
                        ns->path = path;
@@ -156,13 +156,13 @@ load_namespaces (FILE *in)
                        tail = ns;
                }
        }
-       
+
        return nsl;
-       
+
  exception:
-       
+
        camel_imap4_namespace_list_free (nsl);
-       
+
        return NULL;
 }
 
@@ -171,28 +171,28 @@ summary_header_load (CamelStoreSummary *s, FILE *in)
 {
        CamelIMAP4StoreSummary *is = (CamelIMAP4StoreSummary *) s;
        guint32 version, capa;
-       
+
        if (parent_class->summary_header_load (s, in) == -1)
                return -1;
-       
+
        if (camel_file_util_decode_fixed_int32 (in, &version) == -1)
                return -1;
-       
+
        is->version = version;
        if (version < CAMEL_IMAP4_STORE_SUMMARY_VERSION_0) {
                g_warning ("IMAP4 store summary header version too low");
                errno = EINVAL;
                return -1;
        }
-       
+
        if (camel_file_util_decode_fixed_int32 (in, &capa) == -1)
                return -1;
-       
+
        is->capa = capa;
-       
+
        if (!(is->namespaces = load_namespaces (in)))
                return -1;
-       
+
        return 0;
 }
 
@@ -201,7 +201,7 @@ save_namespaces (FILE *out, CamelIMAP4NamespaceList *nsl)
 {
        CamelIMAP4Namespace *ns, *cur = NULL;
        guint32 i, n;
-       
+
        for (i = 0; i < 3; i++) {
                switch (i) {
                case 0:
@@ -214,25 +214,25 @@ save_namespaces (FILE *out, CamelIMAP4NamespaceList *nsl)
                        cur = nsl->other;
                        break;
                }
-               
+
                for (ns = cur, n = 0; ns; n++)
                        ns = ns->next;
-               
+
                if (camel_file_util_encode_fixed_int32 (out, n) == -1)
                        return -1;
-               
+
                ns = cur;
                while (ns != NULL) {
                        if (camel_file_util_encode_string (out, ns->path) == -1)
                                return -1;
-                       
+
                        if (camel_file_util_encode_uint32 (out, ns->sep) == -1)
                                return -1;
-                       
+
                        ns = ns->next;
                }
        }
-       
+
        return 0;
 }
 
@@ -240,19 +240,19 @@ static int
 summary_header_save (CamelStoreSummary *s, FILE *out)
 {
        CamelIMAP4StoreSummary *is = (CamelIMAP4StoreSummary *) s;
-       
+
        if (parent_class->summary_header_save (s, out) == -1)
                return -1;
-       
+
        if (camel_file_util_encode_fixed_int32 (out, is->version) == -1)
                return -1;
-       
+
        if (camel_file_util_encode_fixed_int32 (out, is->capa) == -1)
                return -1;
-       
+
        if (save_namespaces (out, is->namespaces) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -279,7 +279,7 @@ store_info_free (CamelStoreSummary *s, CamelStoreInfo *info)
  * camel_imap4_store_summary_new:
  *
  * Create a new CamelIMAP4StoreSummary object.
- * 
+ *
  * Returns a new CamelIMAP4StoreSummary object.
  **/
 CamelIMAP4StoreSummary *
@@ -310,31 +310,31 @@ camel_imap4_store_summary_note_info (CamelIMAP4StoreSummary *s, CamelFolderInfo
 {
        CamelStoreSummary *ss = (CamelStoreSummary *) s;
        CamelStoreInfo *si;
-       
+
        if ((si = camel_store_summary_path (ss, fi->full_name))) {
                if (fi->unread != -1) {
                        si->unread = fi->unread;
                        ss->flags |= CAMEL_STORE_SUMMARY_DIRTY;
                }
-               
+
                if (fi->total != -1) {
                        si->total = fi->total;
                        ss->flags |= CAMEL_STORE_SUMMARY_DIRTY;
                }
-               
+
                camel_store_summary_info_free (ss, si);
                return;
        }
-       
+
        si = camel_store_summary_info_new (ss);
        si->path = g_strdup (fi->full_name);
        si->uri = g_strdup (fi->uri);
        si->flags = fi->flags;
        si->unread = fi->unread;
        si->total = fi->total;
-       
+
        camel_store_summary_add (ss, si);
-       
+
        /* FIXME: should this be recursive? */
 }
 
@@ -343,7 +343,7 @@ void
 camel_imap4_store_summary_unnote_info (CamelIMAP4StoreSummary *s, CamelFolderInfo *fi)
 {
        CamelStoreSummary *ss = (CamelStoreSummary *) s;
-       
+
        camel_store_summary_remove_path (ss, fi->full_name);
 }
 
@@ -353,14 +353,14 @@ store_info_to_folder_info (CamelStoreSummary *s, CamelStoreInfo *si)
 {
        CamelFolderInfo *fi;
        const char *name;
-       
+
        fi = g_malloc0 (sizeof (CamelFolderInfo));
        fi->full_name = g_strdup (camel_store_info_path (s, si));
        fi->uri = g_strdup (camel_store_info_uri (s, si));
        fi->flags = si->flags;
        fi->unread = si->unread;
        fi->total = si->total;
-       
+
        name = camel_store_info_name (s, si);
        if (!g_ascii_strcasecmp (fi->full_name, "INBOX")) {
                fi->flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
@@ -368,7 +368,7 @@ store_info_to_folder_info (CamelStoreSummary *s, CamelStoreInfo *si)
        } else {
                fi->name = g_strdup (name);
        }
-       
+
        return fi;
 }
 
@@ -381,31 +381,31 @@ camel_imap4_store_summary_get_folder_info (CamelIMAP4StoreSummary *s, const char
        CamelStoreInfo *si;
        size_t toplen, len;
        int i;
-       
+
        toplen = strlen (top);
        folders = g_ptr_array_new ();
-       
+
        for (i = 0; i < ss->folders->len; i++) {
                si = ss->folders->pdata[i];
                if (strncmp (si->path, top, toplen) != 0)
                        continue;
-               
+
                len = strlen (si->path);
                if (toplen > 0 && len > toplen && si->path[toplen] != '/')
                        continue;
-               
+
                if (len == toplen) {
                        /* found toplevel folder */
                        g_ptr_array_add (folders, store_info_to_folder_info (ss, si));
                        continue;
                }
-               
+
                if ((flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) || !strchr (si->path + toplen + 1, '/'))
                        g_ptr_array_add (folders, store_info_to_folder_info (ss, si));
        }
-       
+
        fi = camel_folder_info_build (folders, top, '/', TRUE);
        g_ptr_array_free (folders, TRUE);
-       
+
        return fi;
 }
index c3f2518..73e8abc 100644 (file)
@@ -52,12 +52,12 @@ struct _CamelIMAP4StoreInfo {
 
 struct _CamelIMAP4StoreSummary {
        CamelStoreSummary summary;
-       
+
        struct _CamelIMAP4StoreSummaryPrivate *priv;
-       
+
        /* header info */
        guint32 version;
-       
+
        CamelIMAP4NamespaceList *namespaces;
        guint32 capa;
 };
index da1348d..9e900d2 100644 (file)
@@ -84,7 +84,7 @@ CamelType
 camel_imap4_store_get_type (void)
 {
        static CamelType type = 0;
-       
+
        if (!type) {
                type = camel_type_register (camel_offline_store_get_type (),
                                            "CamelIMAP4Store",
@@ -95,7 +95,7 @@ camel_imap4_store_get_type (void)
                                            (CamelObjectInitFunc) camel_imap4_store_init,
                                            (CamelObjectFinalizeFunc) camel_imap4_store_finalize);
        }
-       
+
        return type;
 }
 
@@ -112,12 +112,12 @@ static int
 imap4_compare_folder_name (gconstpointer a, gconstpointer b)
 {
        gconstpointer aname = a, bname = b;
-       
+
        if (g_ascii_strcasecmp (a, "INBOX") == 0)
                aname = "INBOX";
        if (g_ascii_strcasecmp (b, "INBOX") == 0)
                bname = "INBOX";
-       
+
        return g_str_equal (aname, bname);
 }
 
@@ -126,18 +126,18 @@ camel_imap4_store_class_init (CamelIMAP4StoreClass *klass)
 {
        CamelServiceClass *service_class = (CamelServiceClass *) klass;
        CamelStoreClass *store_class = (CamelStoreClass *) klass;
-       
+
        parent_class = (CamelOfflineStoreClass *) camel_type_get_global_classfuncs (CAMEL_TYPE_OFFLINE_STORE);
-       
+
        service_class->construct = imap4_construct;
        service_class->get_name = imap4_get_name;
        service_class->connect = imap4_connect;
        service_class->disconnect = imap4_disconnect;
        service_class->query_auth_types = imap4_query_auth_types;
-       
+
        store_class->hash_folder_name = imap4_hash_folder_name;
        store_class->compare_folder_name = imap4_compare_folder_name;
-       
+
        store_class->get_folder = imap4_get_folder;
        store_class->create_folder = imap4_create_folder;
        store_class->delete_folder = imap4_delete_folder;
@@ -161,15 +161,15 @@ static void
 camel_imap4_store_finalize (CamelObject *object)
 {
        CamelIMAP4Store *store = (CamelIMAP4Store *) object;
-       
+
        if (store->summary) {
                camel_store_summary_save ((CamelStoreSummary *) store->summary);
                camel_object_unref (store->summary);
        }
-       
+
        if (store->engine)
                camel_object_unref (store->engine);
-       
+
        g_free (store->storage_path);
 }
 
@@ -179,29 +179,29 @@ imap4_construct (CamelService *service, CamelSession *session, CamelProvider *pr
 {
        CamelIMAP4Store *store = (CamelIMAP4Store *) service;
        char *buf;
-       
+
        CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
        if (camel_exception_is_set (ex))
                return;
-       
+
        if (camel_url_get_param (url, "use_lsub"))
                ((CamelStore *) store)->flags |= CAMEL_STORE_SUBSCRIPTIONS;
-       
+
        store->storage_path = camel_session_get_storage_path (session, service, ex);
        store->engine = camel_imap4_engine_new (service, imap4_reconnect);
-       
+
        /* setup/load the summary */
        buf = g_alloca (strlen (store->storage_path) + 32);
        sprintf (buf, "%s/.summary", store->storage_path);
        store->summary = camel_imap4_store_summary_new ();
        camel_store_summary_set_filename ((CamelStoreSummary *) store->summary, buf);
-       
+
        buf = camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL);
        url = camel_url_new (buf, NULL);
        g_free (buf);
        camel_store_summary_set_uri_base ((CamelStoreSummary *) store->summary, url);
        camel_url_free (url);
-       
+
        camel_store_summary_load ((CamelStoreSummary *) store->summary);
 }
 
@@ -236,7 +236,7 @@ connect_to_server (CamelIMAP4Engine *engine, struct addrinfo *ai, int ssl_mode,
        CamelIMAP4Command *ic;
        int id;
 #endif
-       
+
        if (ssl_mode != MODE_CLEAR) {
 #ifdef HAVE_SSL
                if (ssl_mode == MODE_TLS) {
@@ -248,13 +248,13 @@ connect_to_server (CamelIMAP4Engine *engine, struct addrinfo *ai, int ssl_mode,
                camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                      _("Could not connect to %s: %s"),
                                      service->url->host, _("SSL unavailable"));
-               
+
                return FALSE;
 #endif /* HAVE_SSL */
        } else {
                tcp_stream = camel_tcp_stream_raw_new ();
        }
-       
+
        if (camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai) == -1) {
                if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
@@ -264,48 +264,48 @@ connect_to_server (CamelIMAP4Engine *engine, struct addrinfo *ai, int ssl_mode,
                                              _("Could not connect to %s: %s"),
                                              service->url->host,
                                              g_strerror (errno));
-               
+
                camel_object_unref (tcp_stream);
-               
+
                return FALSE;
        }
-       
+
        /* set some socket options to better tailor the connection to our needs */
        sockopt.option = CAMEL_SOCKOPT_NODELAY;
        sockopt.value.no_delay = TRUE;
        camel_tcp_stream_setsockopt ((CamelTcpStream *) tcp_stream, &sockopt);
-       
+
        sockopt.option = CAMEL_SOCKOPT_KEEPALIVE;
        sockopt.value.keep_alive = TRUE;
        camel_tcp_stream_setsockopt ((CamelTcpStream *) tcp_stream, &sockopt);
-       
+
        if (camel_imap4_engine_take_stream (engine, tcp_stream, ex) == -1)
                return FALSE;
-       
+
        if (camel_imap4_engine_capability (engine, ex) == -1)
                return FALSE;
-       
+
        camel_imap4_store_summary_set_capabilities (((CamelIMAP4Store *) service)->summary, engine->capa);
-       
+
        if (ssl_mode != MODE_TLS) {
                /* we're done */
                return TRUE;
        }
-       
+
 #ifdef HAVE_SSL
        if (!(engine->capa & CAMEL_IMAP4_CAPABILITY_STARTTLS)) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to connect to IMAP server %s in secure mode: "
                                        "Server does not support STARTTLS"),
                                      service->url->host);
-               
+
                return FALSE;
        }
-       
+
        ic = camel_imap4_engine_prequeue (engine, NULL, "STARTTLS\r\n");
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->result != CAMEL_IMAP4_RESULT_OK) {
                if (ic->result != CAMEL_IMAP4_RESULT_OK) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -314,27 +314,27 @@ connect_to_server (CamelIMAP4Engine *engine, struct addrinfo *ai, int ssl_mode,
                } else {
                        camel_exception_xfer (ex, &ic->ex);
                }
-               
+
                camel_imap4_command_unref (ic);
-               
+
                return FALSE;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        if (camel_tcp_stream_ssl_enable_ssl ((CamelTcpStreamSSL *) tcp_stream) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to connect to IMAP server %s in secure mode: %s"),
                                      service->url->host, _("TLS negotiations failed"));
                return FALSE;
        }
-       
+
        return TRUE;
 #else
        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                              _("Failed to connect to IMAP server %s in secure mode: %s"),
                              service->url->host, _("SSL is not available in this build"));
-       
+
        return FALSE;
 #endif /* HAVE_SSL */
 }
@@ -361,7 +361,7 @@ connect_to_server_wrapper (CamelIMAP4Engine *engine, CamelException *ex)
        int mode, ret, i;
        const char *port;
        char *serv;
-       
+
        if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
                for (i = 0; ssl_options[i].value; i++)
                        if (!strcmp (ssl_options[i].value, ssl_mode))
@@ -374,13 +374,13 @@ connect_to_server_wrapper (CamelIMAP4Engine *engine, CamelException *ex)
                serv = "imap";
                port = "143";
        }
-       
+
        if (service->url->port) {
                serv = g_alloca (16);
                sprintf (serv, "%d", service->url->port);
                port = NULL;
        }
-       
+
        memset (&hints, 0, sizeof (hints));
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_family = PF_UNSPEC;
@@ -389,14 +389,14 @@ connect_to_server_wrapper (CamelIMAP4Engine *engine, CamelException *ex)
                camel_exception_clear (ex);
                ai = camel_getaddrinfo (service->url->host, port, &hints, ex);
        }
-       
+
        if (ai == NULL)
                return FALSE;
-       
+
        ret = connect_to_server (engine, ai, mode, ex);
-       
+
        camel_freeaddrinfo (ai);
-       
+
        return ret;
 }
 
@@ -406,35 +406,35 @@ sasl_auth (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, const unsigned char
        /* Perform a single challenge iteration */
        CamelSasl *sasl = ic->user_data;
        char *challenge;
-       
+
        if (camel_sasl_authenticated (sasl)) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                      _("Cannot authenticate to IMAP server %s using the %s authentication mechanism"),
                                      engine->url->host, engine->url->authmech);
                return -1;
        }
-       
+
        while (isspace (*linebuf))
                linebuf++;
-       
+
        if (*linebuf == '\0')
                linebuf = NULL;
-       
+
        if (!(challenge = camel_sasl_challenge_base64 (sasl, (const char *) linebuf, ex)))
                return -1;
-       
+
        d(fprintf (stderr, "sending : %s\r\n", challenge));
-       
+
        if (camel_stream_printf (engine->ostream, "%s\r\n", challenge) == -1) {
                g_free (challenge);
                return -1;
        }
-       
+
        g_free (challenge);
-       
+
        if (camel_stream_flush (engine->ostream) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -447,33 +447,33 @@ imap4_try_authenticate (CamelIMAP4Engine *engine, gboolean reprompt, const char
        CamelSasl *sasl = NULL;
        CamelIMAP4Command *ic;
        int id;
-       
+
        if (service->url->authmech)
                mech = g_hash_table_lookup (engine->authtypes, service->url->authmech);
-       
+
        if ((!mech || (mech && mech->need_password)) && !service->url->passwd) {
                guint32 flags = CAMEL_SESSION_PASSWORD_SECRET;
                char *prompt;
-               
+
                if (reprompt)
                        flags |= CAMEL_SESSION_PASSWORD_REPROMPT;
-               
+
                prompt = g_strdup_printf (_("%sPlease enter the IMAP password for %s on host %s"),
                                          errmsg ? errmsg : "",
                                          service->url->user,
                                          service->url->host);
-               
+
                service->url->passwd = camel_session_get_password (session, service, NULL, prompt, "password", flags, ex);
-               
+
                g_free (prompt);
-               
+
                if (!service->url->passwd)
                        return FALSE;
        }
-       
+
        if (service->url->authmech) {
                sasl = camel_sasl_new ("imap", mech->authproto, service);
-               
+
                ic = camel_imap4_engine_prequeue (engine, NULL, "AUTHENTICATE %s\r\n", service->url->authmech);
                ic->plus = sasl_auth;
                ic->user_data = sasl;
@@ -481,31 +481,31 @@ imap4_try_authenticate (CamelIMAP4Engine *engine, gboolean reprompt, const char
                ic = camel_imap4_engine_prequeue (engine, NULL, "LOGIN %S %S\r\n",
                                                  service->url->user, service->url->passwd);
        }
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (sasl != NULL)
                camel_object_unref (sasl);
-       
+
        if (id == -1 || ic->status == CAMEL_IMAP4_COMMAND_ERROR) {
                /* unrecoverable error */
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
-               
+
                return FALSE;
        }
-       
+
        if (ic->result != CAMEL_IMAP4_RESULT_OK) {
                camel_imap4_command_unref (ic);
-               
+
                /* try again */
-               
+
                return TRUE;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        return FALSE;
 }
 
@@ -516,10 +516,10 @@ imap4_reconnect (CamelIMAP4Engine *engine, CamelException *ex)
        gboolean reprompt = FALSE;
        char *errmsg = NULL;
        CamelException lex;
-       
+
        if (!connect_to_server_wrapper (engine, ex))
                return FALSE;
-       
+
        if (engine->state != CAMEL_IMAP4_ENGINE_AUTHENTICATED) {
 #define CANT_USE_AUTHMECH (!g_hash_table_lookup (engine->authtypes, service->url->authmech))
                if (service->url->authmech && CANT_USE_AUTHMECH) {
@@ -527,10 +527,10 @@ imap4_reconnect (CamelIMAP4Engine *engine, CamelException *ex)
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                              _("Cannot authenticate to IMAP server %s using %s"),
                                              service->url->host, service->url->authmech);
-                       
+
                        return FALSE;
                }
-               
+
                camel_exception_init (&lex);
                while (imap4_try_authenticate (engine, reprompt, errmsg, &lex)) {
                        g_free (errmsg);
@@ -541,18 +541,18 @@ imap4_reconnect (CamelIMAP4Engine *engine, CamelException *ex)
                        reprompt = TRUE;
                }
                g_free (errmsg);
-               
+
                if (camel_exception_is_set (&lex)) {
                        camel_exception_xfer (ex, &lex);
                        return FALSE;
                }
        }
-       
+
        if (camel_imap4_engine_namespace (engine, ex) == -1)
                return FALSE;
-       
+
        camel_imap4_store_summary_set_namespaces (((CamelIMAP4Store *) service)->summary, &engine->namespaces);
-       
+
        return TRUE;
 }
 
@@ -561,17 +561,17 @@ imap4_connect (CamelService *service, CamelException *ex)
 {
        CamelIMAP4Store *store = (CamelIMAP4Store *) service;
        gboolean retval;
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
                return TRUE;
-       
+
        CAMEL_SERVICE_REC_LOCK (service, connect_lock);
        if (store->engine->state == CAMEL_IMAP4_ENGINE_DISCONNECTED)
                retval = imap4_reconnect (store->engine, ex);
        else
                retval = TRUE;
        CAMEL_SERVICE_REC_UNLOCK (service, connect_lock);
-       
+
        return retval;
 }
 
@@ -581,20 +581,20 @@ imap4_disconnect (CamelService *service, gboolean clean, CamelException *ex)
        CamelIMAP4Store *store = (CamelIMAP4Store *) service;
        CamelIMAP4Command *ic;
        int id;
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
                return TRUE;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
        if (clean && store->engine->state != CAMEL_IMAP4_ENGINE_DISCONNECTED) {
                ic = camel_imap4_engine_queue (store->engine, NULL, "LOGOUT\r\n");
                while ((id = camel_imap4_engine_iterate (store->engine)) < ic->id && id != -1)
                        ;
-               
+
                camel_imap4_command_unref (ic);
        }
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-       
+
        return 0;
 }
 
@@ -607,27 +607,27 @@ imap4_query_auth_types (CamelService *service, CamelException *ex)
        CamelServiceAuthType *authtype;
        GList *sasl_types, *t, *next;
        gboolean connected;
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
                return NULL;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
        connected = connect_to_server_wrapper (store->engine, ex);
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
        if (!connected)
                return NULL;
-       
+
        sasl_types = camel_sasl_authtype_list (FALSE);
        for (t = sasl_types; t; t = next) {
                authtype = t->data;
                next = t->next;
-               
+
                if (!g_hash_table_lookup (store->engine->authtypes, authtype->authproto)) {
                        sasl_types = g_list_remove_link (sasl_types, t);
                        g_list_free_1 (t);
                }
        }
-       
+
        return g_list_prepend (sasl_types, &camel_imap4_password_authtype);
 }
 
@@ -637,10 +637,10 @@ imap4_folder_utf7_name (CamelStore *store, const char *folder_name, char wildcar
        char *real_name, *p;
        char sep = '\0';
        int len;
-       
+
        if (*folder_name) {
                sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, folder_name);
-               
+
                if (sep != '/') {
                        p = real_name = g_alloca (strlen (folder_name) + 1);
                        strcpy (real_name, folder_name);
@@ -649,25 +649,25 @@ imap4_folder_utf7_name (CamelStore *store, const char *folder_name, char wildcar
                                        *p = sep;
                                p++;
                        }
-                       
+
                        folder_name = real_name;
                }
-               
+
                real_name = camel_utf8_utf7 (folder_name);
        } else
                real_name = g_strdup ("");
-       
+
        if (wildcard) {
                len = strlen (real_name);
                real_name = g_realloc (real_name, len + 3);
-               
+
                if (len > 0)
                        real_name[len++] = sep;
-               
+
                real_name[len++] = wildcard;
                real_name[len] = '\0';
        }
-       
+
        return real_name;
 }
 
@@ -683,48 +683,48 @@ imap4_get_folder (CamelStore *store, const char *folder_name, guint32 flags, Cam
        char *utf7_name;
        int create;
        int id, i;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                if ((flags & CAMEL_STORE_FOLDER_CREATE) != 0) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create IMAP folders in offline mode."));
                } else {
                        folder = camel_imap4_folder_new (store, folder_name, ex);
                }
-               
+
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-               
+
                return folder;
        }
-       
+
        /* make sure the folder exists - try LISTing it? */
        utf7_name = imap4_folder_utf7_name (store, folder_name, '\0');
        ic = camel_imap4_engine_queue (engine, NULL, "LIST \"\" %S\r\n", utf7_name);
        camel_imap4_command_register_untagged (ic, "LIST", camel_imap4_untagged_list);
        ic->user_data = array = g_ptr_array_new ();
        g_free (utf7_name);
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
                g_ptr_array_free (array, TRUE);
                goto done;
        }
-       
+
        create = array->len == 0;
-       
+
        for (i = 0; i < array->len; i++) {
                list = array->pdata[i];
                g_free (list->name);
                g_free (list);
        }
-       
+
        g_ptr_array_free (array, TRUE);
-       
+
        if (ic->result != CAMEL_IMAP4_RESULT_OK) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot get folder `%s' on IMAP server %s: Unknown"),
@@ -732,39 +732,39 @@ imap4_get_folder (CamelStore *store, const char *folder_name, guint32 flags, Cam
                camel_imap4_command_unref (ic);
                goto done;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        if (create) {
                const char *basename;
                char *parent;
                int len;
-               
+
                if (!(flags & CAMEL_STORE_FOLDER_CREATE))
                        goto done;
-               
+
                if (!(basename = strrchr (folder_name, '/')))
                        basename = folder_name;
                else
                        basename++;
-               
+
                len = basename > folder_name ? (basename - folder_name) - 1 : 0;
                parent = g_alloca (len + 1);
                memcpy (parent, folder_name, len);
                parent[len] = '\0';
-               
+
                if (!(fi = imap4_create_folder (store, parent, basename, ex)))
                        goto done;
-               
+
                camel_store_free_folder_info (store, fi);
        }
-       
+
        folder = camel_imap4_folder_new (store, folder_name, ex);
-       
+
  done:
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-       
+
        return folder;
 }
 
@@ -779,48 +779,48 @@ imap4_folder_can_contain_folders (CamelStore *store, const char *folder_name, Ca
        GPtrArray *array;
        char *utf7_name;
        int id, i;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        utf7_name = imap4_folder_utf7_name (store, folder_name, '\0');
-       
+
        ic = camel_imap4_engine_queue (engine, NULL, "LIST \"\" %S\r\n", utf7_name);
        camel_imap4_command_register_untagged (ic, "LIST", camel_imap4_untagged_list);
        ic->user_data = array = g_ptr_array_new ();
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
-               
+
                for (i = 0; i < array->len; i++) {
                        list = array->pdata[i];
                        g_free (list->name);
                        g_free (list);
                }
-               
+
                goto done;
        }
-       
+
        if (ic->result != CAMEL_IMAP4_RESULT_OK) {
                camel_imap4_command_unref (ic);
-               
+
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot get LIST information for `%s' on IMAP server %s: %s"),
                                      folder_name, engine->url->host, ic->result == CAMEL_IMAP4_RESULT_BAD ?
                                      _("Bad command") : _("Unknown"));
-               
+
                for (i = 0; i < array->len; i++) {
                        list = array->pdata[i];
                        g_free (list->name);
                        g_free (list);
                }
-               
+
                goto done;
        }
-       
+
        flags = 0;
        for (i = 0; i < array->len; i++) {
                list = array->pdata[i];
@@ -829,14 +829,14 @@ imap4_folder_can_contain_folders (CamelStore *store, const char *folder_name, Ca
                g_free (list->name);
                g_free (list);
        }
-       
+
  done:
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-       
+
        g_ptr_array_free (array, TRUE);
        g_free (utf7_name);
-       
+
        return (flags & CAMEL_FOLDER_NOINFERIORS) == 0;
 }
 
@@ -850,29 +850,29 @@ imap4_folder_create (CamelStore *store, const char *folder_name, const char *sub
        CamelURL *url;
        const char *c;
        int id;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        utf7_name = imap4_folder_utf7_name (store, folder_name, '\0');
        ic = camel_imap4_engine_queue (engine, NULL, "CREATE %S%s\r\n", utf7_name, subfolder_hint);
        g_free (utf7_name);
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
                goto done;
        }
-       
+
        switch (ic->result) {
        case CAMEL_IMAP4_RESULT_OK:
                url = camel_url_copy (engine->url);
                camel_url_set_fragment (url, folder_name);
-               
+
                c = strrchr (folder_name, '/');
-               
+
                fi = g_malloc0 (sizeof (CamelFolderInfo));
                fi->full_name = g_strdup (folder_name);
                fi->name = g_strdup (c ? c + 1: folder_name);
@@ -881,9 +881,9 @@ imap4_folder_create (CamelStore *store, const char *folder_name, const char *sub
                fi->flags = 0;
                fi->unread = -1;
                fi->total = -1;
-               
+
                camel_imap4_store_summary_note_info (((CamelIMAP4Store *) store)->summary, fi);
-               
+
                camel_object_trigger_event (store, "folder_created", fi);
                break;
        case CAMEL_IMAP4_RESULT_NO:
@@ -900,13 +900,13 @@ imap4_folder_create (CamelStore *store, const char *folder_name, const char *sub
        default:
                g_assert_not_reached ();
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
  done:
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-       
+
        return fi;
 }
 
@@ -916,19 +916,19 @@ imap4_folder_recreate (CamelStore *store, const char *folder_name, CamelExceptio
        CamelFolderInfo *fi = NULL;
        char hint[2];
        char sep;
-       
+
        sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, folder_name);
        sprintf (hint, "%c", sep);
-       
+
        imap4_delete_folder (store, folder_name, ex);
        if (camel_exception_is_set (ex))
                return FALSE;
-       
+
        if (!(fi = imap4_folder_create (store, folder_name, hint, ex)))
                return FALSE;
-       
+
        camel_folder_info_free (fi);
-       
+
        return TRUE;
 }
 
@@ -939,9 +939,9 @@ imap4_create_folder (CamelStore *store, const char *parent_name, const char *fol
        const char *c;
        char *name;
        char sep;
-       
+
        sep = camel_imap4_get_path_delim (((CamelIMAP4Store *) store)->summary, parent_name);
-       
+
        c = folder_name;
        while (*c != '\0') {
                if (*c == sep || strchr ("/#%*", *c)) {
@@ -951,38 +951,38 @@ imap4_create_folder (CamelStore *store, const char *parent_name, const char *fol
                                              folder_name, *c);
                        return NULL;
                }
-               
+
                c++;
        }
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create IMAP folders in offline mode."));
                return NULL;
        }
-       
+
        if (parent_name != NULL && *parent_name) {
                CamelException lex;
-               
+
                camel_exception_init (&lex);
                if (!imap4_folder_can_contain_folders (store, parent_name, &lex)) {
                        if (camel_exception_is_set (&lex)) {
                                camel_exception_xfer (ex, &lex);
                                return NULL;
                        }
-                       
+
                        if (!imap4_folder_recreate (store, parent_name, &lex)) {
                                camel_exception_xfer (ex, &lex);
                                return NULL;
                        }
                }
-               
+
                name = g_strdup_printf ("%s/%s", parent_name, folder_name);
        } else
                name = g_strdup (folder_name);
-       
+
        fi = imap4_folder_create (store, name, "", ex);
        g_free (name);
-       
+
        return fi;
 }
 
@@ -997,57 +997,57 @@ imap4_delete_folder (CamelStore *store, const char *folder_name, CamelException
        CamelURL *url;
        const char *p;
        int id;
-       
+
        if (!g_ascii_strcasecmp (folder_name, "INBOX")) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot delete folder `%s': Special folder"),
                                      folder_name);
-               
+
                return;
        }
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot delete IMAP folders in offline mode."));
                return;
        }
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        if (selected && !strcmp (folder_name, selected->full_name))
                ic0 = camel_imap4_engine_queue (engine, NULL, "CLOSE\r\n");
-       
+
        utf7_name = imap4_folder_utf7_name (store, folder_name, '\0');
        ic = camel_imap4_engine_queue (engine, NULL, "DELETE %S\r\n", utf7_name);
        g_free (utf7_name);
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                if (ic0 && ic0->status != CAMEL_IMAP4_COMMAND_COMPLETE)
                        camel_exception_xfer (ex, &ic0->ex);
                else
                        camel_exception_xfer (ex, &ic->ex);
-               
+
                if (ic0 != NULL)
                        camel_imap4_command_unref (ic0);
-               
+
                camel_imap4_command_unref (ic);
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return;
        }
-       
+
        if (ic0 != NULL)
                camel_imap4_command_unref (ic0);
-       
+
        switch (ic->result) {
        case CAMEL_IMAP4_RESULT_OK:
                /* deleted */
                url = camel_url_copy (engine->url);
                camel_url_set_fragment (url, folder_name);
-               
+
                p = strrchr (folder_name, '/');
-               
+
                fi = g_malloc0 (sizeof (CamelFolderInfo));
                fi->full_name = g_strdup (folder_name);
                fi->name = g_strdup (p ? p + 1: folder_name);
@@ -1056,11 +1056,11 @@ imap4_delete_folder (CamelStore *store, const char *folder_name, CamelException
                fi->flags = 0;
                fi->unread = -1;
                fi->total = -1;
-               
+
                camel_imap4_store_summary_unnote_info (((CamelIMAP4Store *) store)->summary, fi);
-               
+
                camel_object_trigger_event (store, "folder_deleted", fi);
-               
+
                camel_folder_info_free (fi);
                break;
        case CAMEL_IMAP4_RESULT_NO:
@@ -1075,9 +1075,9 @@ imap4_delete_folder (CamelStore *store, const char *folder_name, CamelException
                                      folder_name);
                break;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
 
@@ -1088,39 +1088,39 @@ imap4_rename_folder (CamelStore *store, const char *old_name, const char *new_na
        char *old_uname, *new_uname;
        CamelIMAP4Command *ic;
        int id;
-       
+
        if (!g_ascii_strcasecmp (old_name, "INBOX")) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot rename folder `%s' to `%s': Special folder"),
                                      old_name, new_name);
-               
+
                return;
        }
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot rename IMAP folders in offline mode."));
                return;
        }
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        old_uname = imap4_folder_utf7_name (store, old_name, '\0');
        new_uname = imap4_folder_utf7_name (store, new_name, '\0');
-       
+
        ic = camel_imap4_engine_queue (engine, NULL, "RENAME %S %S\r\n", old_uname, new_uname);
        g_free (old_uname);
        g_free (new_uname);
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return;
        }
-       
+
        switch (ic->result) {
        case CAMEL_IMAP4_RESULT_OK:
                /* FIXME: need to update state on the renamed folder object */
@@ -1138,9 +1138,9 @@ imap4_rename_folder (CamelStore *store, const char *old_name, const char *new_na
                                      old_name, new_name);
                break;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
 
@@ -1155,7 +1155,7 @@ list_remove_duplicates (GPtrArray *array)
 {
        camel_imap4_list_t *list, *last;
        int i;
-       
+
        last = array->pdata[0];
        for (i = 1; i < array->len; i++) {
                list = array->pdata[i];
@@ -1178,23 +1178,23 @@ imap4_status (CamelStore *store, CamelFolderInfo *fi)
        GPtrArray *array;
        char *mailbox;
        int id, i;
-       
+
        mailbox = imap4_folder_utf7_name (store, fi->full_name, '\0');
        ic = camel_imap4_engine_queue (engine, NULL, "STATUS %S (MESSAGES UNSEEN)\r\n", mailbox);
        g_free (mailbox);
-       
+
        camel_imap4_command_register_untagged (ic, "STATUS", camel_imap4_untagged_status);
        ic->user_data = array = g_ptr_array_new ();
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_imap4_command_unref (ic);
                g_ptr_array_free (array, TRUE);
                return;
        }
-       
+
        for (i = 0; i < array->len; i++) {
                status = array->pdata[i];
                attr = status->attr_list;
@@ -1207,11 +1207,11 @@ imap4_status (CamelStore *store, CamelFolderInfo *fi)
                        g_free (attr);
                        attr = next;
                }
-               
+
                g_free (status->mailbox);
                g_free (status);
        }
-       
+
        camel_imap4_command_unref (ic);
        g_ptr_array_free (array, TRUE);
 }
@@ -1225,26 +1225,26 @@ imap4_subscription_info (CamelStore *store, CamelFolderInfo *fi)
        GPtrArray *array;
        char *mailbox;
        int id, i;
-       
+
        mailbox = imap4_folder_utf7_name (store, fi->full_name, '\0');
        ic = camel_imap4_engine_queue (engine, NULL, "LSUB \"\" %S\r\n", mailbox);
        camel_imap4_command_register_untagged (ic, "LSUB", camel_imap4_untagged_list);
        ic->user_data = array = g_ptr_array_new ();
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        camel_imap4_command_unref (ic);
        for (i = 0; i < array->len; i++) {
                lsub = array->pdata[i];
-               
+
                if (!strcmp (lsub->name, mailbox))
                        fi->flags |= CAMEL_FOLDER_SUBSCRIBED;
-               
+
                g_free (lsub->name);
                g_free (lsub);
        }
-       
+
        g_ptr_array_free (array, TRUE);
 }
 
@@ -1259,78 +1259,78 @@ imap4_build_folder_info (CamelStore *store, const char *top, guint32 flags, GPtr
        char *name, *p;
        CamelURL *url;
        int i;
-       
+
        if (array->len == 0) {
                g_ptr_array_free (array, TRUE);
                return NULL;
        }
-       
+
        g_ptr_array_sort (array, (GCompareFunc) list_sort);
-       
+
        list_remove_duplicates (array);
-       
+
        url = camel_url_copy (engine->url);
-       
+
        if (!strcmp (top, "") && (flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE)) {
                /* clear the folder-info cache */
                camel_store_summary_clear ((CamelStoreSummary *) ((CamelIMAP4Store *) store)->summary);
        }
-       
+
        for (i = 0; i < array->len; i++) {
                list = array->pdata[i];
                fi = g_malloc0 (sizeof (CamelFolderInfo));
-               
+
                p = name = camel_utf7_utf8 (list->name);
                while (*p != '\0') {
                        if (*p == list->delim)
                                *p = '/';
                        p++;
                }
-               
+
                p = strrchr (name, '/');
                camel_url_set_fragment (url, name);
-               
+
                fi->full_name = name;
                fi->name = g_strdup (p ? p + 1: name);
                fi->uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
                fi->flags = list->flags | (lsub ? CAMEL_FOLDER_SUBSCRIBED : 0);
                fi->unread = -1;
                fi->total = -1;
-               
+
                if (!g_ascii_strcasecmp (fi->full_name, "INBOX"))
                        fi->flags |= CAMEL_FOLDER_SYSTEM | CAMEL_FOLDER_TYPE_INBOX;
-               
+
                /* SELECTED folder, just get it from the folder */
                if (folder && !strcmp (folder->full_name, fi->full_name)) {
                        camel_object_get (folder, NULL, CAMEL_FOLDER_TOTAL, &fi->total, CAMEL_FOLDER_UNREAD, &fi->unread, 0);
                } else if (!(flags & CAMEL_STORE_FOLDER_INFO_FAST)) {
                        imap4_status (store, fi);
                }
-               
+
                if (!(fi->flags & CAMEL_FOLDER_SUBSCRIBED))
                        imap4_subscription_info (store, fi);
-               
+
                array->pdata[i] = fi;
-               
+
                camel_imap4_store_summary_note_info (((CamelIMAP4Store *) store)->summary, fi);
-               
+
                if (!g_ascii_strcasecmp (fi->full_name, "INBOX")) {
                        g_free (fi->name);
                        fi->name = g_strdup (_("Inbox"));
                }
-               
+
                g_free (list->name);
                g_free (list);
        }
-       
+
        fi = camel_folder_info_build (array, top, '/', TRUE);
-       
+
        camel_url_free (url);
-       
+
        g_ptr_array_free (array, TRUE);
-       
+
        camel_store_summary_save ((CamelStoreSummary *) ((CamelIMAP4Store *) store)->summary);
-       
+
        return fi;
 }
 
@@ -1347,20 +1347,20 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
        char *pattern;
        char wildcard;
        int id, i;
-       
+
        if (top == NULL)
                top = "";
-       
+
        if (!(namespace = camel_url_get_param (((CamelService *) store)->url, "namespace")))
                namespace = "";
-       
+
        if (!strcmp (top, ""))
                base = namespace;
        else
                base = top;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
 #ifdef USE_FOLDER_INFO_CACHE_LOGIC_FOR_SPEED
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL
            || engine->state == CAMEL_IMAP4_ENGINE_DISCONNECTED) {
@@ -1373,7 +1373,7 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
                                fi = inbox;
                        }
                }
-               
+
                if (fi == NULL && ((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
                        /* folder info hasn't yet been cached and the store hasn't been
                         * connected yet, but the network is available so we can connect
@@ -1401,20 +1401,20 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
                return fi;
        }
 #endif
-       
+
 #ifdef USE_FOLDER_INFO_CACHE_LOGIC_FOR_SPEED
  check_online:
 #endif
-       
+
        if (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)
                cmd = "LSUB";
        else
                cmd = "LIST";
-       
+
        wildcard = (flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) ? '*' : '%';
        pattern = imap4_folder_utf7_name (store, base, wildcard);
        array = g_ptr_array_new ();
-       
+
        if (base == namespace && *namespace) {
                /* Make sure to get INBOX: we always use LIST so the user sees his/her INBOX even
                   if it isn't subscribed and the user has enabled "Only show subscribed folders" */
@@ -1422,29 +1422,29 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
                camel_imap4_command_register_untagged (ic1, "LIST", camel_imap4_untagged_list);
                ic1->user_data = array;
        }
-       
+
        if (*top != '\0') {
                size_t len;
                char sep;
-               
+
                len = strlen (pattern);
                sep = pattern[len - 2];
                pattern[len - 2] = '\0';
-               
+
                ic0 = camel_imap4_engine_queue (engine, NULL, "%s \"\" %S\r\n", cmd, pattern);
                camel_imap4_command_register_untagged (ic0, cmd, camel_imap4_untagged_list);
                ic0->user_data = array;
-               
+
                pattern[len - 2] = sep;
        }
-       
+
        ic = camel_imap4_engine_queue (engine, NULL, "%s \"\" %S\r\n", cmd, pattern);
        camel_imap4_command_register_untagged (ic, cmd, camel_imap4_untagged_list);
        ic->user_data = array;
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                if (ic1 && ic1->status != CAMEL_IMAP4_COMMAND_COMPLETE)
                        camel_exception_xfer (ex, &ic1->ex);
@@ -1452,62 +1452,62 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
                        camel_exception_xfer (ex, &ic0->ex);
                else
                        camel_exception_xfer (ex, &ic->ex);
-               
+
                if (ic1 != NULL)
                        camel_imap4_command_unref (ic1);
-               
+
                if (ic0 != NULL)
                        camel_imap4_command_unref (ic0);
-               
+
                camel_imap4_command_unref (ic);
-               
+
                for (i = 0; i < array->len; i++) {
                        list = array->pdata[i];
                        g_free (list->name);
                        g_free (list);
                }
-               
+
                g_ptr_array_free (array, TRUE);
                g_free (pattern);
-               
+
                goto done;
        }
-       
+
        if (ic1 != NULL)
                camel_imap4_command_unref (ic1);
-       
+
        if (ic0 != NULL)
                camel_imap4_command_unref (ic0);
-       
+
        if (ic->result != CAMEL_IMAP4_RESULT_OK) {
                camel_imap4_command_unref (ic);
-               
+
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot get %s information for pattern `%s' on IMAP server %s: %s"),
                                      cmd, pattern, engine->url->host, ic->result == CAMEL_IMAP4_RESULT_BAD ?
                                      _("Bad command") : _("Unknown"));
-               
+
                for (i = 0; i < array->len; i++) {
                        list = array->pdata[i];
                        g_free (list->name);
                        g_free (list);
                }
-               
+
                g_ptr_array_free (array, TRUE);
-               
+
                g_free (pattern);
-               
+
                goto done;
        }
-       
+
        g_free (pattern);
-       
+
        fi = imap4_build_folder_info (store, top, flags, array);
-       
+
  done:
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
-       
+
        return fi;
 }
 
@@ -1521,36 +1521,36 @@ imap4_subscribe_folder (CamelStore *store, const char *folder_name, CamelExcepti
        CamelURL *url;
        const char *p;
        int id;
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot subscribe to IMAP folders in offline mode."));
                return;
        }
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        utf7_name = imap4_folder_utf7_name (store, folder_name, '\0');
        ic = camel_imap4_engine_queue (engine, NULL, "SUBSCRIBE %S\r\n", utf7_name);
        g_free (utf7_name);
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return;
        }
-       
+
        switch (ic->result) {
        case CAMEL_IMAP4_RESULT_OK:
                /* subscribed */
                url = camel_url_copy (engine->url);
                camel_url_set_fragment (url, folder_name);
-               
+
                p = strrchr (folder_name, '/');
-               
+
                fi = g_malloc0 (sizeof (CamelFolderInfo));
                fi->full_name = g_strdup (folder_name);
                fi->name = g_strdup (p ? p + 1: folder_name);
@@ -1559,9 +1559,9 @@ imap4_subscribe_folder (CamelStore *store, const char *folder_name, CamelExcepti
                fi->flags = CAMEL_FOLDER_NOCHILDREN;
                fi->unread = -1;
                fi->total = -1;
-               
+
                camel_imap4_store_summary_note_info (((CamelIMAP4Store *) store)->summary, fi);
-               
+
                camel_object_trigger_event (store, "folder_subscribed", fi);
                camel_folder_info_free (fi);
                break;
@@ -1577,9 +1577,9 @@ imap4_subscribe_folder (CamelStore *store, const char *folder_name, CamelExcepti
                                      folder_name);
                break;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
 
@@ -1593,36 +1593,36 @@ imap4_unsubscribe_folder (CamelStore *store, const char *folder_name, CamelExcep
        CamelURL *url;
        const char *p;
        int id;
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot unsubscribe from IMAP folders in offline mode."));
                return;
        }
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        utf7_name = imap4_folder_utf7_name (store, folder_name, '\0');
        ic = camel_imap4_engine_queue (engine, NULL, "UNSUBSCRIBE %S\r\n", utf7_name);
        g_free (utf7_name);
-       
+
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                camel_exception_xfer (ex, &ic->ex);
                camel_imap4_command_unref (ic);
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return;
        }
-       
+
        switch (ic->result) {
        case CAMEL_IMAP4_RESULT_OK:
                /* unsubscribed */
                url = camel_url_copy (engine->url);
                camel_url_set_fragment (url, folder_name);
-               
+
                p = strrchr (folder_name, '/');
-               
+
                fi = g_malloc0 (sizeof (CamelFolderInfo));
                fi->full_name = g_strdup (folder_name);
                fi->name = g_strdup (p ? p + 1: folder_name);
@@ -1631,9 +1631,9 @@ imap4_unsubscribe_folder (CamelStore *store, const char *folder_name, CamelExcep
                fi->flags = 0;
                fi->unread = -1;
                fi->total = -1;
-               
+
                camel_imap4_store_summary_unnote_info (((CamelIMAP4Store *) store)->summary, fi);
-               
+
                camel_object_trigger_event (store, "folder_unsubscribed", fi);
                camel_folder_info_free (fi);
                break;
@@ -1649,9 +1649,9 @@ imap4_unsubscribe_folder (CamelStore *store, const char *folder_name, CamelExcep
                                      folder_name);
                break;
        }
-       
+
        camel_imap4_command_unref (ic);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
 
@@ -1662,12 +1662,12 @@ imap4_noop (CamelStore *store, CamelException *ex)
        CamelFolder *folder = (CamelFolder *) engine->folder;
        CamelIMAP4Command *ic;
        int id;
-       
+
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
                return;
-       
+
        CAMEL_SERVICE_REC_LOCK (store, connect_lock);
-       
+
        if (folder) {
                camel_folder_sync (folder, FALSE, ex);
                if (camel_exception_is_set (ex)) {
@@ -1675,18 +1675,18 @@ imap4_noop (CamelStore *store, CamelException *ex)
                        return;
                }
        }
-       
+
        ic = camel_imap4_engine_queue (engine, NULL, "NOOP\r\n");
        while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                ;
-       
+
        if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE)
                camel_exception_xfer (ex, &ic->ex);
-       
+
        camel_imap4_command_unref (ic);
-       
+
        if (folder && !camel_exception_is_set (ex))
                camel_imap4_summary_flush_updates (folder->summary, ex);
-       
+
        CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
 }
index 8922bed..c092a3e 100644 (file)
@@ -41,7 +41,7 @@ struct _CamelIMAP4Engine;
 
 struct _CamelIMAP4Store {
        CamelOfflineStore parent_object;
-       
+
        struct _CamelIMAP4StoreSummary *summary;
        struct _CamelIMAP4Engine *engine;
        char *storage_path;
@@ -49,7 +49,7 @@ struct _CamelIMAP4Store {
 
 struct _CamelIMAP4StoreClass {
        CamelOfflineStoreClass parent_class;
-       
+
 };
 
 
index 7ae63ad..646696e 100644 (file)
@@ -57,7 +57,7 @@ CamelType
 camel_imap4_stream_get_type (void)
 {
        static CamelType type = 0;
-       
+
        if (!type) {
                type = camel_type_register (CAMEL_STREAM_TYPE,
                                            "CamelIMAP4Stream",
@@ -68,7 +68,7 @@ camel_imap4_stream_get_type (void)
                                            (CamelObjectInitFunc) camel_imap4_stream_init,
                                            (CamelObjectFinalizeFunc) camel_imap4_stream_finalize);
        }
-       
+
        return type;
 }
 
@@ -76,9 +76,9 @@ static void
 camel_imap4_stream_class_init (CamelIMAP4StreamClass *klass)
 {
        CamelStreamClass *stream_class = (CamelStreamClass *) klass;
-       
+
        parent_class = (CamelStreamClass *) camel_type_get_global_classfuncs (CAMEL_STREAM_TYPE);
-       
+
        /* virtual method overload */
        stream_class->read = stream_read;
        stream_class->write = stream_write;
@@ -91,18 +91,18 @@ static void
 camel_imap4_stream_init (CamelIMAP4Stream *imap4, CamelIMAP4StreamClass *klass)
 {
        imap4->stream = NULL;
-       
+
        imap4->mode = CAMEL_IMAP4_STREAM_MODE_TOKEN;
        imap4->disconnected = FALSE;
        imap4->have_unget = FALSE;
        imap4->eol = FALSE;
-       
+
        imap4->literal = 0;
-       
+
        imap4->inbuf = imap4->realbuf + IMAP4_READ_PRELEN;
        imap4->inptr = imap4->inbuf;
        imap4->inend = imap4->inbuf;
-       
+
        imap4->tokenbuf = g_malloc (IMAP4_TOKEN_LEN);
        imap4->tokenptr = imap4->tokenbuf;
        imap4->tokenleft = IMAP4_TOKEN_LEN;
@@ -112,10 +112,10 @@ static void
 camel_imap4_stream_finalize (CamelObject *object)
 {
        CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) object;
-       
+
        if (imap4->stream)
                camel_object_unref (imap4->stream);
-       
+
        g_free (imap4->tokenbuf);
 }
 
@@ -126,19 +126,19 @@ imap4_fill (CamelIMAP4Stream *imap4)
        unsigned char *inbuf, *inptr, *inend;
        ssize_t nread;
        size_t inlen;
-       
+
        if (imap4->disconnected) {
                errno = EINVAL;
                return -1;
        }
-       
+
        inbuf = imap4->inbuf;
        inptr = imap4->inptr;
        inend = imap4->inend;
        inlen = inend - inptr;
-       
+
        g_assert (inptr <= inend);
-       
+
        /* attempt to align 'inend' with realbuf + SCAN_HEAD */
        if (inptr >= inbuf) {
                inbuf -= inlen < IMAP4_READ_PRELEN ? inlen : IMAP4_READ_PRELEN;
@@ -147,7 +147,7 @@ imap4_fill (CamelIMAP4Stream *imap4)
                inbuf += inlen;
        } else if (inptr > imap4->realbuf) {
                size_t shift;
-               
+
                shift = MIN (inptr - imap4->realbuf, inend - inbuf);
                memmove (inptr - shift, inptr, inlen);
                inptr -= shift;
@@ -156,18 +156,18 @@ imap4_fill (CamelIMAP4Stream *imap4)
                /* we can't shift... */
                inbuf = inend;
        }
-       
+
        imap4->inptr = inptr;
        imap4->inend = inbuf;
        inend = imap4->realbuf + IMAP4_READ_PRELEN + IMAP4_READ_BUFLEN - 1;
-       
+
        if ((nread = camel_stream_read (imap4->stream, inbuf, inend - inbuf)) == -1)
                return -1;
        else if (nread == 0)
                imap4->disconnected = TRUE;
-       
+
        imap4->inend += nread;
-       
+
        return imap4->inend - imap4->inptr;
 }
 
@@ -176,37 +176,37 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
 {
        CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
        ssize_t len, nread = 0;
-       
+
        if (imap4->mode == CAMEL_IMAP4_STREAM_MODE_LITERAL) {
                /* don't let our caller read past the end of the literal */
                n = MIN (n, imap4->literal);
        }
-       
+
        if (imap4->inptr < imap4->inend) {
                len = MIN (n, imap4->inend - imap4->inptr);
                memcpy (buffer, imap4->inptr, len);
                imap4->inptr += len;
                nread = len;
        }
-       
+
        if (nread < n) {
                if ((len = camel_stream_read (imap4->stream, buffer + nread, n - nread)) == 0)
                        imap4->disconnected = TRUE;
                else if (len == -1)
                        return -1;
-               
+
                nread += len;
        }
-       
+
        if (imap4->mode == CAMEL_IMAP4_STREAM_MODE_LITERAL) {
                imap4->literal -= nread;
-               
+
                if (imap4->literal == 0) {
                        imap4->mode = CAMEL_IMAP4_STREAM_MODE_TOKEN;
                        imap4->eol = TRUE;
                }
        }
-       
+
        return nread;
 }
 
@@ -215,15 +215,15 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
 {
        CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
        ssize_t nwritten;
-       
+
        if (imap4->disconnected) {
                errno = EINVAL;
                return -1;
        }
-       
+
        if ((nwritten = camel_stream_write (imap4->stream, buffer, n)) == 0)
                imap4->disconnected = TRUE;
-       
+
        return nwritten;
 }
 
@@ -231,7 +231,7 @@ static int
 stream_flush (CamelStream *stream)
 {
        CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
-       
+
        return camel_stream_flush (imap4->stream);
 }
 
@@ -239,15 +239,15 @@ static int
 stream_close (CamelStream *stream)
 {
        CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
-       
+
        if (camel_stream_close (imap4->stream) == -1)
                return -1;
-       
+
        camel_object_unref (imap4->stream);
        imap4->stream = NULL;
-       
+
        imap4->disconnected = TRUE;
-       
+
        return 0;
 }
 
@@ -255,16 +255,16 @@ static gboolean
 stream_eos (CamelStream *stream)
 {
        CamelIMAP4Stream *imap4 = (CamelIMAP4Stream *) stream;
-       
+
        if (imap4->eol)
                return TRUE;
-       
+
        if (imap4->disconnected && imap4->inptr == imap4->inend)
                return TRUE;
-       
+
        if (camel_stream_eos (imap4->stream))
                return TRUE;
-       
+
        return FALSE;
 }
 
@@ -279,13 +279,13 @@ CamelStream *
 camel_imap4_stream_new (CamelStream *stream)
 {
        CamelIMAP4Stream *imap4;
-       
+
        g_return_val_if_fail (CAMEL_IS_STREAM (stream), NULL);
-       
+
        imap4 = (CamelIMAP4Stream *) camel_object_new (CAMEL_TYPE_IMAP4_STREAM);
        camel_object_ref (stream);
        imap4->stream = stream;
-       
+
        return (CamelStream *) imap4;
 }
 
@@ -336,23 +336,23 @@ camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *to
        size_t literal = 0;
        guint32 nz_number;
        int ret;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_STREAM (stream), -1);
        g_return_val_if_fail (stream->mode != CAMEL_IMAP4_STREAM_MODE_LITERAL, -1);
        g_return_val_if_fail (token != NULL, -1);
-       
+
        if (stream->have_unget) {
                memcpy (token, &stream->unget, sizeof (camel_imap4_token_t));
                stream->have_unget = FALSE;
                return 0;
        }
-       
+
        token_clear (stream);
-       
+
        inptr = stream->inptr;
        inend = stream->inend;
        *inend = '\0';
-       
+
        do {
                if (inptr == inend) {
                        if ((ret = imap4_fill (stream)) < 0) {
@@ -362,31 +362,31 @@ camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *to
                                token->token = CAMEL_IMAP4_TOKEN_NO_DATA;
                                return 0;
                        }
-                       
+
                        inptr = stream->inptr;
                        inend = stream->inend;
                        *inend = '\0';
                }
-               
+
                while (*inptr == ' ' || *inptr == '\r')
                        inptr++;
        } while (inptr == inend);
-       
+
        do {
                if (inptr < inend) {
                        if (*inptr == '"') {
                                /* qstring token */
                                escaped = FALSE;
                                start = inptr;
-                               
+
                                /* eat the beginning " */
                                inptr++;
-                               
+
                                p = inptr;
                                while (inptr < inend) {
                                        if (*inptr == '"' && !escaped)
                                                break;
-                                       
+
                                        if (*inptr == '\\' && !escaped) {
                                                token_save (stream, p, inptr - p);
                                                escaped = TRUE;
@@ -397,82 +397,82 @@ camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *to
                                                escaped = FALSE;
                                        }
                                }
-                               
+
                                token_save (stream, p, inptr - p);
-                               
+
                                if (inptr == inend) {
                                        stream->inptr = start;
                                        goto refill;
                                }
-                               
+
                                /* eat the ending " */
                                inptr++;
-                               
+
                                /* nul-terminate the atom token */
                                token_save (stream, "", 1);
-                               
+
                                token->token = CAMEL_IMAP4_TOKEN_QSTRING;
                                token->v.qstring = stream->tokenbuf;
-                               
+
                                d(fprintf (stderr, "token: \"%s\"\n", token->v.qstring));
-                               
+
                                break;
                        } else if (strchr ("+*()[]\n", *inptr)) {
                                /* special character token */
                                token->token = *inptr++;
-                               
+
                                if (camel_debug ("imap4:stream")) {
                                        if (token->token != '\n')
                                                fprintf (stderr, "token: %c\n", token->token);
                                        else
                                                fprintf (stderr, "token: \\n\n");
                                }
-                               
+
                                break;
                        } else if (*inptr == '{') {
                                /* literal identifier token */
                                if ((p = strchr (inptr, '}')) && strchr (p, '\n')) {
                                        inptr++;
-                                       
+
                                        while (isdigit ((int) *inptr) && literal < UINT_MAX / 10)
                                                literal = (literal * 10) + (*inptr++ - '0');
-                                       
+
                                        if (*inptr != '}') {
                                                if (isdigit ((int) *inptr))
                                                        g_warning ("illegal literal identifier: literal too large");
                                                else if (*inptr != '+')
                                                        g_warning ("illegal literal identifier: garbage following size");
-                                               
+
                                                while (*inptr != '}')
                                                        inptr++;
                                        }
-                                       
+
                                        /* skip over '}' */
                                        inptr++;
-                                       
+
                                        /* skip over any trailing whitespace */
                                        while (*inptr == ' ' || *inptr == '\r')
                                                inptr++;
-                                       
+
                                        if (*inptr != '\n') {
                                                g_warning ("illegal token following literal identifier: %s", inptr);
-                                               
+
                                                /* skip ahead to the eoln */
                                                inptr = strchr (inptr, '\n');
                                        }
-                                       
+
                                        /* skip over '\n' */
                                        inptr++;
-                                       
+
                                        token->token = CAMEL_IMAP4_TOKEN_LITERAL;
                                        token->v.literal = literal;
-                                       
+
                                        d(fprintf (stderr, "token: {%lu}\n", literal));
-                                       
+
                                        stream->mode = CAMEL_IMAP4_STREAM_MODE_LITERAL;
                                        stream->literal = literal;
                                        stream->eol = FALSE;
-                                       
+
                                        break;
                                } else {
                                        stream->inptr = inptr;
@@ -484,37 +484,37 @@ camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *to
                                nz_number = strtoul ((char *) inptr, (char **) &start, 10);
                                if (start == inend)
                                        goto refill;
-                               
+
                                if (*start == ':' || *start == ',') {
                                        /* workaround for 'set' tokens (APPENDUID / COPYUID) */
                                        goto atom_token;
                                }
-                               
+
                                inptr = start;
                                token->token = CAMEL_IMAP4_TOKEN_NUMBER;
                                token->v.number = nz_number;
-                               
+
                                d(fprintf (stderr, "token: %lu\n", nz_number));
-                               
+
                                break;
                        } else if (is_atom (*inptr)) {
                        atom_token:
                                /* simple atom token */
                                start = inptr;
-                               
+
                                while (inptr < inend && is_atom (*inptr))
                                        inptr++;
-                               
+
                                if (inptr == inend) {
                                        stream->inptr = start;
                                        goto refill;
                                }
-                               
+
                                token_save (stream, start, inptr - start);
-                               
+
                                /* nul-terminate the atom token */
                                token_save (stream, "", 1);
-                               
+
                                if (!strcmp (stream->tokenbuf, "NIL")) {
                                        /* special atom token */
                                        token->token = CAMEL_IMAP4_TOKEN_NIL;
@@ -524,30 +524,30 @@ camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *to
                                        token->v.atom = stream->tokenbuf;
                                        d(fprintf (stderr, "token: %s\n", token->v.atom));
                                }
-                               
+
                                break;
                        } else if (*inptr == '\\') {
                                /* possible flag token ("\" atom) */
                                start = inptr++;
-                               
+
                                while (inptr < inend && is_atom (*inptr))
                                        inptr++;
-                               
+
                                if (inptr == inend) {
                                        stream->inptr = start;
                                        goto refill;
                                }
-                               
+
                                /* handle the \* case */
                                if ((inptr - start) == 1 && *inptr == '*')
                                        inptr++;
-                               
+
                                if ((inptr - start) > 1) {
                                        token_save (stream, start, inptr - start);
-                                       
+
                                        /* nul-terminate the flag token */
                                        token_save (stream, "", 1);
-                                       
+
                                        token->token = CAMEL_IMAP4_TOKEN_FLAG;
                                        token->v.atom = stream->tokenbuf;
                                        d(fprintf (stderr, "token: %s\n", token->v.atom));
@@ -567,20 +567,20 @@ camel_imap4_stream_next_token (CamelIMAP4Stream *stream, camel_imap4_token_t *to
                } else {
                refill:
                        token_clear (stream);
-                       
+
                        if (imap4_fill (stream) <= 0) {
                                token->token = CAMEL_IMAP4_TOKEN_ERROR;
                                return -1;
                        }
-                       
+
                        inptr = stream->inptr;
                        inend = stream->inend;
                        *inend = '\0';
                }
        } while (inptr < inend);
-       
+
        stream->inptr = inptr;
-       
+
        return 0;
 }
 
@@ -602,12 +602,12 @@ camel_imap4_stream_unget_token (CamelIMAP4Stream *stream, camel_imap4_token_t *t
 {
        if (stream->have_unget)
                return -1;
-       
+
        if (token->token != CAMEL_IMAP4_TOKEN_NO_DATA) {
                memcpy (&stream->unget, token, sizeof (camel_imap4_token_t));
                stream->have_unget = TRUE;
        }
-       
+
        return 0;
 }
 
@@ -630,46 +630,46 @@ camel_imap4_stream_line (CamelIMAP4Stream *stream, unsigned char **line, size_t
 {
        register unsigned char *inptr;
        unsigned char *inend;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_STREAM (stream), -1);
        g_return_val_if_fail (stream->mode != CAMEL_IMAP4_STREAM_MODE_LITERAL, -1);
        g_return_val_if_fail (line != NULL, -1);
        g_return_val_if_fail (len != NULL, -1);
-       
+
        inptr = stream->inptr;
        inend = stream->inend;
-       
+
        *inend = '\0';
        if (inptr == inend || ((inend - inptr) < 2 && *inptr != '\n')) {
                if (imap4_fill (stream) == -1 && stream->inptr == stream->inend)
                        return -1;
        }
-       
+
        *line = stream->inptr;
        inptr = stream->inptr;
        inend = stream->inend;
        *inend = '\n';
-       
+
        while (*inptr != '\n')
                inptr++;
-       
+
        *len = (inptr - stream->inptr);
-       
+
        if (inptr > stream->inptr && inptr[-1] == '\r')
                inptr[-1] = '\0';
-       
+
        if (inptr < inend) {
                /* got the eoln */
                inptr[0] = '\0';
                *len += 1;
-               
+
                stream->inptr = inptr + 1;
-               
+
                return 0;
        }
-       
+
        stream->inptr = inptr;
-       
+
        return 1;
 }
 
@@ -692,40 +692,40 @@ camel_imap4_stream_literal (CamelIMAP4Stream *stream, unsigned char **literal, s
 {
        unsigned char *inptr, *inend;
        size_t nread;
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_STREAM (stream), -1);
        g_return_val_if_fail (stream->mode == CAMEL_IMAP4_STREAM_MODE_LITERAL, -1);
        g_return_val_if_fail (literal != NULL, -1);
        g_return_val_if_fail (len != NULL, -1);
-       
+
        if (stream->eol) {
                *len = 0;
                return 0;
        }
-       
+
        if ((stream->inend - stream->inptr) < 1) {
                /* keep our buffer full to the optimal size */
                if (imap4_fill (stream) == -1 && stream->inptr == stream->inend)
                        return -1;
        }
-       
+
        *literal = inptr = stream->inptr;
        inend = stream->inend;
        if ((inend - inptr) > stream->literal)
                inend = inptr + stream->literal;
        else
                inend = stream->inend;
-       
+
        *len = nread = inend - inptr;
-       
+
        stream->literal -= nread;
        stream->inptr += nread;
-       
+
        if (stream->literal == 0) {
                stream->mode = CAMEL_IMAP4_STREAM_MODE_TOKEN;
                stream->eol = TRUE;
                return 0;
        }
-       
+
        return 1;
 }
index f1d36cc..534a7cb 100644 (file)
@@ -75,33 +75,33 @@ enum {
 
 struct _CamelIMAP4Stream {
        CamelStream parent_object;
-       
+
        CamelStream *stream;
-       
+
        guint disconnected:1;  /* disconnected state */
        guint have_unget:1;    /* have an unget token */
        guint mode:1;          /* TOKEN vs LITERAL */
        guint eol:1;           /* end-of-literal */
-       
+
        size_t literal;
-       
+
        /* i/o buffers */
        unsigned char realbuf[IMAP4_READ_PRELEN + IMAP4_READ_BUFLEN + 1];
        unsigned char *inbuf;
        unsigned char *inptr;
        unsigned char *inend;
-       
+
        /* token buffers */
        unsigned char *tokenbuf;
        unsigned char *tokenptr;
        unsigned int tokenleft;
-       
+
        camel_imap4_token_t unget;
 };
 
 struct _CamelIMAP4StreamClass {
        CamelStreamClass parent_class;
-       
+
        /* Virtual methods */
 };
 
index d73a698..99546ce 100644 (file)
@@ -76,7 +76,7 @@ CamelType
 camel_imap4_summary_get_type (void)
 {
        static CamelType type = 0;
-       
+
        if (!type) {
                type = camel_type_register (CAMEL_FOLDER_SUMMARY_TYPE,
                                            "CamelIMAP4Summary",
@@ -87,7 +87,7 @@ camel_imap4_summary_get_type (void)
                                            (CamelObjectInitFunc) camel_imap4_summary_init,
                                            (CamelObjectFinalizeFunc) camel_imap4_summary_finalize);
        }
-       
+
        return type;
 }
 
@@ -96,9 +96,9 @@ static void
 camel_imap4_summary_class_init (CamelIMAP4SummaryClass *klass)
 {
        CamelFolderSummaryClass *summary_class = (CamelFolderSummaryClass *) klass;
-       
+
        parent_class = (CamelFolderSummaryClass *) camel_type_get_global_classfuncs (camel_folder_summary_get_type ());
-       
+
        summary_class->summary_header_load = imap4_header_load;
        summary_class->summary_header_save = imap4_header_save;
        summary_class->message_info_new_from_header = imap4_message_info_new_from_header;
@@ -113,15 +113,15 @@ static void
 camel_imap4_summary_init (CamelIMAP4Summary *summary, CamelIMAP4SummaryClass *klass)
 {
        CamelFolderSummary *folder_summary = (CamelFolderSummary *) summary;
-       
+
        folder_summary->flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_DELETED |
                CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN;
-       
+
        folder_summary->message_info_size = sizeof (CamelIMAP4MessageInfo);
        folder_summary->content_info_size = sizeof (CamelIMAP4MessageContentInfo);
-       
+
        ((CamelFolderSummary *) summary)->flags |= CAMEL_IMAP4_SUMMARY_HAVE_MLIST;
-       
+
        summary->update_flags = TRUE;
        summary->uidvalidity_changed = FALSE;
 }
@@ -137,10 +137,10 @@ CamelFolderSummary *
 camel_imap4_summary_new (CamelFolder *folder)
 {
        CamelFolderSummary *summary;
-       
+
        summary = (CamelFolderSummary *) camel_object_new (CAMEL_TYPE_IMAP4_SUMMARY);
        summary->folder = folder;
-       
+
        return summary;
 }
 
@@ -148,35 +148,35 @@ static int
 imap4_header_load (CamelFolderSummary *summary, FILE *fin)
 {
        CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
-       
+
        if (CAMEL_FOLDER_SUMMARY_CLASS (parent_class)->summary_header_load (summary, fin) == -1)
                return -1;
-       
+
        if (camel_file_util_decode_fixed_int32 (fin, &imap4_summary->version) == -1)
                return -1;
-       
+
        if (imap4_summary->version > CAMEL_IMAP4_SUMMARY_VERSION) {
                g_warning ("Unknown IMAP4 summary version\n");
                errno = EINVAL;
                return -1;
        }
-       
+
        if (imap4_summary->version == 2) {
                /* check that we have Mailing-List info */
                int have_mlist;
-               
+
                if (camel_file_util_decode_fixed_int32 (fin, &have_mlist) == -1)
                        return -1;
-               
+
                if (have_mlist)
                        summary->flags |= CAMEL_IMAP4_SUMMARY_HAVE_MLIST;
                else
                        summary->flags ^= CAMEL_IMAP4_SUMMARY_HAVE_MLIST;
        }
-       
+
        if (camel_file_util_decode_fixed_int32 (fin, &imap4_summary->uidvalidity) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -184,16 +184,16 @@ static int
 imap4_header_save (CamelFolderSummary *summary, FILE *fout)
 {
        CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
-       
+
        if (CAMEL_FOLDER_SUMMARY_CLASS (parent_class)->summary_header_save (summary, fout) == -1)
                return -1;
-       
+
        if (camel_file_util_encode_fixed_int32 (fout, CAMEL_IMAP4_SUMMARY_VERSION) == -1)
                return -1;
-       
+
        if (camel_file_util_encode_fixed_int32 (fout, imap4_summary->uidvalidity) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -207,24 +207,24 @@ envelope_decode_address (CamelIMAP4Engine *engine, GString *addrs, CamelExceptio
        const char *domain = NULL;
        int part = 0;
        size_t n;
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        if (token.token == CAMEL_IMAP4_TOKEN_NIL) {
                return 0;
        } else if (token.token != '(') {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        if (addrs->len > 0)
                g_string_append (addrs, ", ");
-       
+
        do {
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        goto exception;
-               
+
                literal = NULL;
                switch (token.token) {
                case CAMEL_IMAP4_TOKEN_NIL:
@@ -246,7 +246,7 @@ envelope_decode_address (CamelIMAP4Engine *engine, GString *addrs, CamelExceptio
                case CAMEL_IMAP4_TOKEN_LITERAL:
                        if (camel_imap4_engine_literal (engine, &literal, &n, ex) == -1)
                                goto exception;
-                       
+
                        switch (part) {
                        case 0:
                                name = camel_header_decode_string (literal, NULL);
@@ -264,39 +264,39 @@ envelope_decode_address (CamelIMAP4Engine *engine, GString *addrs, CamelExceptio
                        camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                        goto exception;
                }
-               
+
                part++;
        } while (part < 4);
-       
+
        addr = g_strdup_printf ("%s@%s", user, domain);
        g_free (literal);
        g_free (user);
-       
+
        cia = camel_header_address_new_name (name, addr);
        g_free (name);
        g_free (addr);
-       
+
        addr = camel_header_address_list_format (cia);
        camel_header_address_unref (cia);
-       
+
        g_string_append (addrs, addr);
        g_free (addr);
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        if (token.token != ')') {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        return 0;
-       
+
  exception:
-       
+
        g_free (name);
        g_free (user);
-       
+
        return -1;
 }
 
@@ -305,10 +305,10 @@ envelope_decode_addresses (CamelIMAP4Engine *engine, char **addrlist, CamelExcep
 {
        camel_imap4_token_t token;
        GString *addrs;
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        if (token.token == CAMEL_IMAP4_TOKEN_NIL) {
                *addrlist = NULL;
                return 0;
@@ -316,18 +316,18 @@ envelope_decode_addresses (CamelIMAP4Engine *engine, char **addrlist, CamelExcep
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        addrs = g_string_new ("");
-       
+
        do {
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1) {
                        g_string_free (addrs, TRUE);
                        return -1;
                }
-               
+
                if (token.token == '(') {
                        camel_imap4_stream_unget_token (engine->istream, &token);
-                       
+
                        if (envelope_decode_address (engine, addrs, ex) == -1) {
                                g_string_free (addrs, TRUE);
                                return -1;
@@ -339,10 +339,10 @@ envelope_decode_addresses (CamelIMAP4Engine *engine, char **addrlist, CamelExcep
                        return -1;
                }
        } while (1);
-       
+
        *addrlist = addrs->str;
        g_string_free (addrs, FALSE);
-       
+
        return 0;
 }
 
@@ -353,10 +353,10 @@ envelope_decode_date (CamelIMAP4Engine *engine, time_t *date, CamelException *ex
        camel_imap4_token_t token;
        const char *nstring;
        size_t n;
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        switch (token.token) {
        case CAMEL_IMAP4_TOKEN_NIL:
                *date = (time_t) -1;
@@ -370,18 +370,18 @@ envelope_decode_date (CamelIMAP4Engine *engine, time_t *date, CamelException *ex
        case CAMEL_IMAP4_TOKEN_LITERAL:
                if (camel_imap4_engine_literal (engine, &literal, &n, ex) == -1)
                        return -1;
-               
+
                nstring = literal;
                break;
        default:
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        *date = camel_header_decode_date (nstring, NULL);
-       
+
        g_free (literal);
-       
+
        return 0;
 }
 
@@ -391,10 +391,10 @@ envelope_decode_nstring (CamelIMAP4Engine *engine, char **nstring, gboolean rfc2
        camel_imap4_token_t token;
        unsigned char *literal;
        size_t n;
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        switch (token.token) {
        case CAMEL_IMAP4_TOKEN_NIL:
                *nstring = NULL;
@@ -414,19 +414,19 @@ envelope_decode_nstring (CamelIMAP4Engine *engine, char **nstring, gboolean rfc2
        case CAMEL_IMAP4_TOKEN_LITERAL:
                if (camel_imap4_engine_literal (engine, &literal, &n, ex) == -1)
                        return -1;
-               
+
                if (rfc2047) {
                        *nstring = camel_header_decode_string (literal, NULL);
                        g_free (literal);
                } else
                        *nstring = literal;
-               
+
                break;
        default:
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        return 0;
 }
 
@@ -437,39 +437,39 @@ decode_references (const char *refstr, const char *irtstr)
        CamelSummaryReferences *references;
        unsigned char md5sum[16];
        guint32 i, n;
-       
+
        refs = camel_header_references_decode (refstr);
        irt = camel_header_references_inreplyto_decode (irtstr);
-       
+
        if (!refs && !irt)
                return NULL;
-       
+
        if (irt) {
                /* The References field is populated from the `References' and/or `In-Reply-To'
                   headers. If both headers exist, take the first thing in the In-Reply-To header
                   that looks like a Message-ID, and append it to the References header. */
-               
+
                if (refs) {
                        r = irt;
                        while (r->next != NULL)
                                r = r->next;
                        r->next = refs;
                }
-               
+
                refs = irt;
        }
-       
+
        n = camel_header_references_list_size (&refs);
        references = g_malloc (sizeof (CamelSummaryReferences) + (sizeof (CamelSummaryMessageID) * (n - 1)));
        references->size = n;
-       
+
        for (i = 0, r = refs; r != NULL; i++, r = r->next) {
                md5_get_digest (r->id, strlen (r->id), md5sum);
                memcpy (references->references[i].id.hash, md5sum, sizeof (CamelSummaryMessageID));
        }
-       
+
        camel_header_references_list_clear (&refs);
-       
+
        return references;
 }
 
@@ -479,72 +479,72 @@ decode_envelope (CamelIMAP4Engine *engine, CamelMessageInfo *info, camel_imap4_t
        CamelIMAP4MessageInfo *iinfo = (CamelIMAP4MessageInfo *) info;
        unsigned char md5sum[16];
        char *nstring, *msgid;
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        if (token->token != '(') {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                return -1;
        }
-       
+
        if (envelope_decode_date (engine, &iinfo->info.date_sent, ex) == -1)
                goto exception;
-       
+
        /* subject */
        if (envelope_decode_nstring (engine, &nstring, TRUE, ex) == -1)
                goto exception;
        iinfo->info.subject = camel_pstring_strdup (nstring);
        g_free(nstring);
-       
+
        /* from */
        if (envelope_decode_addresses (engine, &nstring, ex) == -1)
                goto exception;
        iinfo->info.from = camel_pstring_strdup (nstring);
        g_free(nstring);
-       
+
        /* sender */
        if (envelope_decode_addresses (engine, &nstring, ex) == -1)
                goto exception;
        g_free (nstring);
-       
+
        /* reply-to */
        if (envelope_decode_addresses (engine, &nstring, ex) == -1)
                goto exception;
        g_free (nstring);
-       
+
        /* to */
        if (envelope_decode_addresses (engine, &nstring, ex) == -1)
                goto exception;
        iinfo->info.to = camel_pstring_strdup (nstring);
        g_free(nstring);
-       
+
        /* cc */
        if (envelope_decode_addresses (engine, &nstring, ex) == -1)
                goto exception;
        iinfo->info.cc = camel_pstring_strdup (nstring);
        g_free(nstring);
-       
+
        /* bcc */
        if (envelope_decode_addresses (engine, &nstring, ex) == -1)
                goto exception;
        g_free (nstring);
-       
+
        /* in-reply-to */
        if (envelope_decode_nstring (engine, &nstring, FALSE, ex) == -1)
                goto exception;
-       
+
        if (nstring != NULL) {
                if (!iinfo->info.references)
                        iinfo->info.references = decode_references (NULL, nstring);
-               
+
                g_free (nstring);
        }
-       
+
        /* message-id */
        if (envelope_decode_nstring (engine, &nstring, FALSE, ex) == -1)
                goto exception;
-       
+
        if (nstring != NULL) {
                if ((msgid = camel_header_msgid_decode (nstring))) {
                        md5_get_digest (msgid, strlen (msgid), md5sum);
@@ -553,19 +553,19 @@ decode_envelope (CamelIMAP4Engine *engine, CamelMessageInfo *info, camel_imap4_t
                }
                g_free (nstring);
        }
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        if (token->token != ')') {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                goto exception;
        }
-       
+
        return 0;
-       
+
  exception:
-       
+
        return -1;
 }
 
@@ -579,9 +579,9 @@ decode_time (const char **in, int *hour, int *min, int *sec)
 {
        register const unsigned char *inptr = (const unsigned char *) *in;
        int *val, colons = 0;
-       
+
        *hour = *min = *sec = 0;
-       
+
        val = hour;
        for ( ; *inptr && !isspace ((int) *inptr); inptr++) {
                if (*inptr == ':') {
@@ -601,9 +601,9 @@ decode_time (const char **in, int *hour, int *min, int *sec)
                else
                        *val = (*val * 10) + (*inptr - '0');
        }
-       
+
        *in = inptr;
-       
+
        return TRUE;
 }
 
@@ -611,10 +611,10 @@ static time_t
 mktime_utc (struct tm *tm)
 {
        time_t tt;
-       
+
        tm->tm_isdst = -1;
        tt = mktime (tm);
-       
+
 #if defined (HAVE_TM_GMTOFF)
        tt += tm->tm_gmtoff;
 #elif defined (HAVE_TIMEZONE)
@@ -627,7 +627,7 @@ mktime_utc (struct tm *tm)
        } else
                tt -= timezone;
 #endif
-       
+
        return tt;
 }
 
@@ -639,52 +639,52 @@ decode_internaldate (const char *in)
        struct tm tm;
        time_t date;
        char *buf;
-       
+
        memset ((void *) &tm, 0, sizeof (struct tm));
-       
+
        tm.tm_mday = strtoul (inptr, &buf, 10);
        if (buf == inptr || *buf != '-')
                return (time_t) -1;
-       
+
        inptr = buf + 1;
        if (inptr[3] != '-')
                return (time_t) -1;
-       
+
        for (n = 0; n < 12; n++) {
                if (!g_ascii_strncasecmp (inptr, tm_months[n], 3))
                        break;
        }
-       
+
        if (n >= 12)
                return (time_t) -1;
-       
+
        tm.tm_mon = n;
-       
+
        inptr += 4;
-       
+
        n = strtoul (inptr, &buf, 10);
        if (buf == inptr || *buf != ' ')
                return (time_t) -1;
-       
+
        tm.tm_year = n - 1900;
-       
+
        inptr = buf + 1;
        if (!decode_time (&inptr, &hour, &min, &sec))
                return (time_t) -1;
-       
+
        tm.tm_hour = hour;
        tm.tm_min = min;
        tm.tm_sec = sec;
-       
+
        n = strtol (inptr, NULL, 10);
-       
+
        date = mktime_utc (&tm);
-       
+
        /* date is now GMT of the time we want, but not offset by the timezone ... */
-       
+
        /* this should convert the time to the GMT equiv time */
        date -= ((n / 100) * 60 * 60) + (n % 100) * 60;
-       
+
        return date;
 }
 
@@ -719,15 +719,15 @@ imap4_fetch_all_free (struct imap4_fetch_all_t *fetch)
 {
        struct imap4_envelope_t *envelope;
        int i;
-       
+
        for (i = 0; i < fetch->added->len; i++) {
                if (!(envelope = fetch->added->pdata[i]))
                        continue;
-               
+
                camel_message_info_free (envelope->info);
                g_free (envelope);
        }
-       
+
        g_ptr_array_free (fetch->added, TRUE);
        g_hash_table_destroy (fetch->uid_hash);
        camel_folder_change_info_free (fetch->changes);
@@ -739,7 +739,7 @@ courier_imap_is_a_piece_of_shit (CamelFolderSummary *summary, guint32 msg)
 {
        CamelSession *session = ((CamelService *) summary->folder->parent_store)->session;
        char *warning;
-       
+
        warning = g_strdup_printf ("IMAP server did not respond with an untagged FETCH response "
                                   "for message #%lu. This is illegal according to rfc3501 (and "
                                   "the older rfc2060). You will need to contact your\n"
@@ -747,7 +747,7 @@ courier_imap_is_a_piece_of_shit (CamelFolderSummary *summary, guint32 msg)
                                   "Hint: If your IMAP server is Courier-IMAP, it is likely that this "
                                   "message is simply unreadable by the IMAP server and will need "
                                   "to be given read permissions.", msg);
-       
+
        camel_session_alert_user (session, CAMEL_SESSION_ALERT_WARNING, warning, FALSE);
        g_free (warning);
 }
@@ -759,45 +759,45 @@ imap4_fetch_all_add (struct imap4_fetch_all_t *fetch)
        struct imap4_envelope_t *envelope;
        CamelMessageInfo *info;
        guint32 i;
-       
+
        changes = fetch->changes;
-       
+
        for (i = 0; i < fetch->added->len; i++) {
                if (!(envelope = fetch->added->pdata[i])) {
                        courier_imap_is_a_piece_of_shit (fetch->summary, i + fetch->first);
                        break;
                }
-               
+
                if (envelope->changed != IMAP4_FETCH_ALL) {
                        d(fprintf (stderr, "Hmmm, IMAP4 server didn't give us everything for message %d\n", i + 1));
                        camel_message_info_free (envelope->info);
                        g_free (envelope);
                        continue;
                }
-               
+
                if ((info = camel_folder_summary_uid (fetch->summary, camel_message_info_uid (envelope->info)))) {
                        camel_message_info_free (envelope->info);
                        camel_message_info_free (info);
                        g_free (envelope);
                        continue;
                }
-               
+
                camel_folder_change_info_add_uid (changes, camel_message_info_uid (envelope->info));
-               
+
                if ((((CamelMessageInfoBase *) envelope->info)->flags & CAMEL_IMAP4_MESSAGE_RECENT))
                        camel_folder_change_info_recent_uid (changes, camel_message_info_uid (envelope->info));
-               
+
                camel_folder_summary_add (fetch->summary, envelope->info);
                g_free (envelope);
        }
-       
+
        g_ptr_array_free (fetch->added, TRUE);
        g_hash_table_destroy (fetch->uid_hash);
-       
+
        if (camel_folder_change_info_changed (changes))
                camel_object_trigger_event (fetch->summary->folder, "folder_changed", changes);
        camel_folder_change_info_free (changes);
-       
+
        g_free (fetch);
 }
 
@@ -810,9 +810,9 @@ imap4_fetch_all_update (struct imap4_fetch_all_t *fetch)
        CamelMessageInfo *info;
        guint32 flags;
        int total, i;
-       
+
        changes = fetch->changes;
-       
+
        total = camel_folder_summary_count (fetch->summary);
        for (i = 0; i < total; i++) {
                info = camel_folder_summary_index (fetch->summary, i);
@@ -826,34 +826,34 @@ imap4_fetch_all_update (struct imap4_fetch_all_t *fetch)
                        /* update it with the new flags */
                        new_iinfo = (CamelIMAP4MessageInfo *) envelope->info;
                        iinfo = (CamelIMAP4MessageInfo *) info;
-                       
+
                        flags = iinfo->info.flags;
                        iinfo->info.flags = camel_imap4_merge_flags (iinfo->server_flags, iinfo->info.flags, new_iinfo->server_flags);
                        iinfo->server_flags = new_iinfo->server_flags;
                        if (iinfo->info.flags != flags)
                                camel_folder_change_info_change_uid (changes, camel_message_info_uid (info));
                }
-               
+
                camel_message_info_free (info);
        }
-       
+
        for (i = 0; i < fetch->added->len; i++) {
                if (!(envelope = fetch->added->pdata[i])) {
                        courier_imap_is_a_piece_of_shit (fetch->summary, i + fetch->first);
                        continue;
                }
-               
+
                camel_message_info_free (envelope->info);
                g_free (envelope);
        }
-       
+
        g_ptr_array_free (fetch->added, TRUE);
        g_hash_table_destroy (fetch->uid_hash);
-       
+
        if (camel_folder_change_info_changed (changes))
                camel_object_trigger_event (fetch->summary->folder, "folder_changed", changes);
        camel_folder_change_info_free (changes);
-       
+
        g_free (fetch);
 }
 
@@ -869,7 +869,7 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
        guint32 changed = 0;
        const char *iuid;
        char uid[12];
-       
+
        if (index < fetch->first) {
                /* we already have this message envelope cached -
                 * server is probably notifying us of a FLAGS change
@@ -880,7 +880,7 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
        } else {
                if (index > (added->len + fetch->first - 1))
                        g_ptr_array_set_size (added, index - fetch->first + 1);
-               
+
                if (!(envelope = added->pdata[index - fetch->first])) {
                        iinfo = (CamelIMAP4MessageInfo *) (info = camel_message_info_new (summary));
                        envelope = g_new (struct imap4_envelope_t, 1);
@@ -891,59 +891,59 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
                        iinfo = (CamelIMAP4MessageInfo *) (info = envelope->info);
                }
        }
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        /* parse the FETCH response list */
        if (token->token != '(') {
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                return -1;
        }
-       
+
        do {
                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                        goto exception;
-               
+
                if (token->token == ')' || token->token == '\n')
                        break;
-               
+
                if (token->token != CAMEL_IMAP4_TOKEN_ATOM)
                        goto unexpected;
-               
+
                if (!strcmp (token->v.atom, "ENVELOPE")) {
                        if (envelope) {
                                if (decode_envelope (engine, info, token, ex) == -1)
                                        goto exception;
-                               
+
                                changed |= IMAP4_FETCH_ENVELOPE;
                        } else {
                                CamelMessageInfo *tmp;
                                int rv;
-                               
+
                                g_warning ("Hmmm, server is sending us ENVELOPE data for a message we didn't ask for (message %lu)\n",
                                           index);
                                tmp = camel_message_info_new (summary);
                                rv = decode_envelope (engine, tmp, token, ex);
                                camel_message_info_free(tmp);
-                               
+
                                if (rv == -1)
                                        goto exception;
                        }
                } else if (!strcmp (token->v.atom, "FLAGS")) {
                        guint32 server_flags = 0;
-                       
+
                        if (camel_imap4_parse_flags_list (engine, &server_flags, ex) == -1)
                                return -1;
-                       
+
                        iinfo->info.flags = camel_imap4_merge_flags (iinfo->server_flags, iinfo->info.flags, server_flags);
                        iinfo->server_flags = server_flags;
-                       
+
                        changed |= IMAP4_FETCH_FLAGS;
                } else if (!strcmp (token->v.atom, "INTERNALDATE")) {
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        switch (token->token) {
                        case CAMEL_IMAP4_TOKEN_NIL:
                                iinfo->info.date_received = (time_t) -1;
@@ -955,25 +955,25 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
                        default:
                                goto unexpected;
                        }
-                       
+
                        changed |= IMAP4_FETCH_INTERNALDATE;
                } else if (!strcmp (token->v.atom, "RFC822.SIZE")) {
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        if (token->token != CAMEL_IMAP4_TOKEN_NUMBER)
                                goto unexpected;
-                       
+
                        iinfo->info.size = token->v.number;
-                       
+
                        changed |= IMAP4_FETCH_RFC822SIZE;
                } else if (!strcmp (token->v.atom, "UID")) {
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        if (token->token != CAMEL_IMAP4_TOKEN_NUMBER || token->v.number == 0)
                                goto unexpected;
-                       
+
                        sprintf (uid, "%lu", token->v.number);
                        iuid = camel_message_info_uid (info);
                        if (iuid != NULL && iuid[0] != '\0') {
@@ -996,22 +996,22 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
                        const char *refs, *str;
                        char *mlist;
                        size_t n;
-                       
+
                        /* '(' */
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        if (token->token != '(')
                                goto unexpected;
-                       
+
                        /* header name list */
                        do {
                                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                        goto exception;
-                               
+
                                if (token->token == ')')
                                        break;
-                               
+
                                switch (token->token) {
                                case CAMEL_IMAP4_TOKEN_ATOM:
                                case CAMEL_IMAP4_TOKEN_QSTRING:
@@ -1019,44 +1019,44 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
                                case CAMEL_IMAP4_TOKEN_LITERAL:
                                        if (camel_imap4_engine_literal (engine, &literal, &n, ex) == -1)
                                                return -1;
-                                       
+
                                        g_free (literal);
                                        break;
                                default:
                                        goto unexpected;
                                }
-                               
+
                                /* we don't care what the list was... */
                        } while (1);
-                       
+
                        /* ']' */
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        if (token->token != ']')
                                goto unexpected;
-                       
+
                        /* literal */
                        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                                goto exception;
-                       
+
                        if (token->token != CAMEL_IMAP4_TOKEN_LITERAL)
                                goto unexpected;
-                       
+
                        parser = camel_mime_parser_new ();
                        camel_mime_parser_init_with_stream (parser, (CamelStream *) engine->istream);
-                       
+
                        switch (camel_mime_parser_step (parser, NULL, NULL)) {
                        case CAMEL_MIME_PARSER_STATE_HEADER:
                        case CAMEL_MIME_PARSER_STATE_MESSAGE:
                        case CAMEL_MIME_PARSER_STATE_MULTIPART:
                                h = camel_mime_parser_headers_raw (parser);
-                               
+
                                /* find our mailing-list header */
                                mlist = camel_header_raw_check_mailing_list (&h);
                                iinfo->info.mlist = camel_pstring_strdup (mlist);
                                g_free (mlist);
-                               
+
                                /* check if we possibly have attachments */
                                if ((str = camel_header_raw_find (&h, "Content-Type", NULL))) {
                                        content_type = camel_content_type_decode (str);
@@ -1065,7 +1065,7 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
                                                iinfo->info.flags |= CAMEL_MESSAGE_ATTACHMENTS;
                                        camel_content_type_unref (content_type);
                                }
-                               
+
                                /* check for References: */
                                g_free (iinfo->info.references);
                                refs = camel_header_raw_find (&h, "References", NULL);
@@ -1074,14 +1074,14 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
                        default:
                                break;
                        }
-                       
+
                        camel_object_unref (parser);
                } else {
                        /* wtf? */
                        d(fprintf (stderr, "huh? %s?...\n", token->v.atom));
                }
        } while (1);
-       
+
        if (envelope) {
                envelope->changed |= changed;
                if ((envelope->changed & fetch->need) == fetch->need)
@@ -1089,18 +1089,18 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind
        } else if (changed & IMAP4_FETCH_FLAGS) {
                camel_folder_change_info_change_uid (fetch->changes, camel_message_info_uid (info));
        }
-       
+
        if (token->token != ')')
                goto unexpected;
-       
+
        return 0;
-       
+
  unexpected:
-       
+
        camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
-       
+
  exception:
-       
+
        return -1;
 }
 
@@ -1120,9 +1120,9 @@ imap4_summary_fetch_all (CamelFolderSummary *summary, guint32 seqid, const char
        CamelIMAP4Command *ic;
        const char *query;
        guint32 total;
-       
+
        engine = ((CamelIMAP4Store *) folder->parent_store)->engine;
-       
+
        total = (imap4_summary->exists - seqid) + 1;
        fetch = g_new (struct imap4_fetch_all_t, 1);
        fetch->uid_hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1133,17 +1133,17 @@ imap4_summary_fetch_all (CamelFolderSummary *summary, guint32 seqid, const char
        fetch->need = IMAP4_FETCH_ALL;
        fetch->total = total;
        fetch->count = 0;
-       
+
        if (((CamelIMAP4Folder *) folder)->enable_mlist)
                query = "UID FETCH %s:* (" IMAP4_ALL " BODY.PEEK[HEADER.FIELDS (" MORE_HEADER_FIELDS ")])\r\n";
        else
                query = "UID FETCH %s:* (" IMAP4_ALL " BODY.PEEK[HEADER.FIELDS (" BASE_HEADER_FIELDS ")])\r\n";
-       
+
        ic = camel_imap4_engine_queue (engine, folder, query, uid);
-       
+
        camel_imap4_command_register_untagged (ic, "FETCH", untagged_fetch_all);
        ic->user_data = fetch;
-       
+
        return ic;
 }
 
@@ -1157,16 +1157,16 @@ imap4_summary_fetch_flags (CamelFolderSummary *summary)
        CamelIMAP4Command *ic;
        guint32 total;
        int scount;
-       
+
        engine = ((CamelIMAP4Store *) folder->parent_store)->engine;
-       
+
        scount = camel_folder_summary_count (summary);
        info[0] = camel_folder_summary_index (summary, 0);
        if (scount > 1)
                info[1] = camel_folder_summary_index (summary, scount - 1);
        else
                info[1] = NULL;
-       
+
        total = imap4_summary->exists < scount ? imap4_summary->exists : scount;
        fetch = g_new (struct imap4_fetch_all_t, 1);
        fetch->uid_hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1177,7 +1177,7 @@ imap4_summary_fetch_flags (CamelFolderSummary *summary)
        fetch->need = IMAP4_FETCH_UID | IMAP4_FETCH_FLAGS;
        fetch->total = total;
        fetch->count = 0;
-       
+
        if (info[1] != NULL) {
                ic = camel_imap4_engine_queue (engine, folder, "UID FETCH %s:%s (FLAGS)\r\n",
                                               camel_message_info_uid (info[0]),
@@ -1187,12 +1187,12 @@ imap4_summary_fetch_flags (CamelFolderSummary *summary)
                ic = camel_imap4_engine_queue (engine, folder, "UID FETCH %s:* (FLAGS)\r\n",
                                               camel_message_info_uid (info[0]));
        }
-       
+
        camel_message_info_free (info[0]);
-       
+
        camel_imap4_command_register_untagged (ic, "FETCH", untagged_fetch_all);
        ic->user_data = fetch;
-       
+
        return ic;
 }
 
@@ -1200,11 +1200,11 @@ static CamelMessageInfo *
 imap4_message_info_new_from_header (CamelFolderSummary *summary, struct _camel_header_raw *header)
 {
        CamelMessageInfo *info;
-       
+
        info = CAMEL_FOLDER_SUMMARY_CLASS (parent_class)->message_info_new_from_header (summary, header);
-       
+
        ((CamelIMAP4MessageInfo *) info)->server_flags = 0;
-       
+
        return info;
 }
 
@@ -1213,21 +1213,21 @@ imap4_message_info_load (CamelFolderSummary *summary, FILE *fin)
 {
        CamelIMAP4MessageInfo *minfo;
        CamelMessageInfo *info;
-       
+
        if (!(info = CAMEL_FOLDER_SUMMARY_CLASS (parent_class)->message_info_load (summary, fin)))
                return NULL;
-       
+
        minfo = (CamelIMAP4MessageInfo *) info;
-       
+
        if (camel_file_util_decode_uint32 (fin, &minfo->server_flags) == -1)
                goto exception;
-       
+
        return info;
-       
+
  exception:
-       
+
        camel_message_info_free(info);
-       
+
        return NULL;
 }
 
@@ -1235,13 +1235,13 @@ static int
 imap4_message_info_save (CamelFolderSummary *summary, FILE *fout, CamelMessageInfo *info)
 {
        CamelIMAP4MessageInfo *minfo = (CamelIMAP4MessageInfo *) info;
-       
+
        if (CAMEL_FOLDER_SUMMARY_CLASS (parent_class)->message_info_save (summary, fout, info) == -1)
                return -1;
-       
+
        if (camel_file_util_encode_uint32 (fout, minfo->server_flags) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -1250,13 +1250,13 @@ imap4_message_info_clone (CamelFolderSummary *summary, const CamelMessageInfo *m
 {
        const CamelIMAP4MessageInfo *src = (const CamelIMAP4MessageInfo *) mi;
        CamelIMAP4MessageInfo *dest;
-       
+
        dest = (CamelIMAP4MessageInfo *) CAMEL_FOLDER_SUMMARY_CLASS (parent_class)->message_info_clone (summary, mi);
        dest->server_flags = src->server_flags;
-       
+
        /* FIXME: parent clone should do this */
        dest->info.content = camel_folder_summary_content_info_new (summary);
-       
+
        return (CamelMessageInfo *) dest;
 }
 
@@ -1284,9 +1284,9 @@ void
 camel_imap4_summary_set_exists (CamelFolderSummary *summary, guint32 exists)
 {
        CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
-       
+
        g_return_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary));
-       
+
        imap4_summary->exists = exists;
 }
 
@@ -1294,9 +1294,9 @@ void
 camel_imap4_summary_set_recent (CamelFolderSummary *summary, guint32 recent)
 {
        CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
-       
+
        g_return_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary));
-       
+
        imap4_summary->recent = recent;
 }
 
@@ -1304,9 +1304,9 @@ void
 camel_imap4_summary_set_unseen (CamelFolderSummary *summary, guint32 unseen)
 {
        CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
-       
+
        g_return_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary));
-       
+
        imap4_summary->unseen = unseen;
 }
 
@@ -1314,7 +1314,7 @@ void
 camel_imap4_summary_set_uidnext (CamelFolderSummary *summary, guint32 uidnext)
 {
        g_return_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary));
-       
+
        summary->nextuid = uidnext;
 }
 
@@ -1324,22 +1324,22 @@ imap4_summary_clear (CamelFolderSummary *summary, gboolean uncache)
        CamelFolderChangeInfo *changes;
        CamelMessageInfo *info;
        int i, count;
-       
+
        changes = camel_folder_change_info_new ();
        count = camel_folder_summary_count (summary);
        for (i = 0; i < count; i++) {
                if (!(info = camel_folder_summary_index (summary, i)))
                        continue;
-               
+
                camel_folder_change_info_remove_uid (changes, camel_message_info_uid (info));
                camel_message_info_free(info);
        }
-       
+
        camel_folder_summary_clear (summary);
-       
+
        if (uncache)
                camel_data_cache_clear (((CamelIMAP4Folder *) summary->folder)->cache, "cache", NULL);
-       
+
        if (camel_folder_change_info_changed (changes))
                camel_object_trigger_event (summary->folder, "folder_changed", changes);
        camel_folder_change_info_free (changes);
@@ -1349,16 +1349,16 @@ void
 camel_imap4_summary_set_uidvalidity (CamelFolderSummary *summary, guint32 uidvalidity)
 {
        CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
-       
+
        g_return_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary));
-       
+
        if (imap4_summary->uidvalidity == uidvalidity)
                return;
-       
+
        imap4_summary_clear (summary, TRUE);
-       
+
        imap4_summary->uidvalidity = uidvalidity;
-       
+
        imap4_summary->uidvalidity_changed = TRUE;
 }
 
@@ -1369,24 +1369,24 @@ camel_imap4_summary_expunge (CamelFolderSummary *summary, int seqid)
        CamelFolderChangeInfo *changes;
        CamelMessageInfo *info;
        const char *uid;
-       
+
        g_return_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary));
-       
+
        seqid--;
        if (!(info = camel_folder_summary_index (summary, seqid)))
                return;
-       
+
        imap4_summary->exists--;
-       
+
        uid = camel_message_info_uid (info);
        camel_data_cache_remove (((CamelIMAP4Folder *) summary->folder)->cache, "cache", uid, NULL);
-       
+
        changes = camel_folder_change_info_new ();
        camel_folder_change_info_remove_uid (changes, uid);
-       
+
        camel_message_info_free(info);
        camel_folder_summary_remove_index (summary, seqid);
-       
+
        camel_object_trigger_event (summary->folder, "folder_changed", changes);
        camel_folder_change_info_free (changes);
 }
@@ -1396,13 +1396,13 @@ static int
 info_uid_sort (const CamelMessageInfo **info0, const CamelMessageInfo **info1)
 {
        guint32 uid0, uid1;
-       
+
        uid0 = strtoul (camel_message_info_uid (*info0), NULL, 10);
        uid1 = strtoul (camel_message_info_uid (*info1), NULL, 10);
-       
+
        if (uid0 == uid1)
                return 0;
-       
+
        return uid0 < uid1 ? -1 : 1;
 }
 #endif
@@ -1419,26 +1419,26 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *
        guint32 iuid, seqid = 0;
        int scount, id;
        char uid[16];
-       
+
        g_return_val_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary), -1);
-       
+
        /* FIXME: what do we do if replaying the journal fails? */
        camel_offline_journal_replay (journal, NULL);
-       
+
        if (imap4_folder->enable_mlist && !(summary->flags & CAMEL_IMAP4_SUMMARY_HAVE_MLIST)) {
                /* need to refetch all summary info to get info->mlist */
                imap4_summary_clear (summary, FALSE);
        }
-       
+
        summary->flags = (summary->flags & ~CAMEL_IMAP4_SUMMARY_HAVE_MLIST);
        if (imap4_folder->enable_mlist)
                summary->flags |= CAMEL_IMAP4_SUMMARY_HAVE_MLIST;
        else
                summary->flags ^= CAMEL_IMAP4_SUMMARY_HAVE_MLIST;
-       
+
        engine = ((CamelIMAP4Store *) summary->folder->parent_store)->engine;
        scount = camel_folder_summary_count (summary);
-       
+
        if (imap4_summary->uidvalidity_changed) {
                /* need to refetch everything */
                g_assert (scount == 0);
@@ -1448,11 +1448,11 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *
                 * have since been expunged from the server by another
                 * client */
                ic = imap4_summary_fetch_flags (summary);
-               
+
                camel_operation_start (NULL, _("Scanning for changed messages"));
                while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                        ;
-               
+
                if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                        camel_imap4_journal_readd_failed ((CamelIMAP4Journal *) journal);
                        imap4_fetch_all_free (ic->user_data);
@@ -1461,11 +1461,11 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *
                        camel_operation_end (NULL);
                        return -1;
                }
-               
+
                imap4_fetch_all_update (ic->user_data);
                camel_imap4_command_unref (ic);
                camel_operation_end (NULL);
-               
+
                scount = camel_folder_summary_count (summary);
                if (imap4_summary->exists < scount) {
                        /* broken server? wtf? this should never happen... */
@@ -1484,7 +1484,7 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *
                /* need to fetch new envelopes */
                first = scount + 1;
        }
-       
+
        if (seqid != 0 && seqid <= imap4_summary->exists) {
                if (scount > 0) {
                        info = camel_folder_summary_index (summary, scount - 1);
@@ -1494,13 +1494,13 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *
                } else {
                        strcpy (uid, "1");
                }
-               
+
                ic = imap4_summary_fetch_all (summary, seqid, uid);
-               
+
                camel_operation_start (NULL, _("Fetching envelopes of new messages"));
                while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
                        ;
-               
+
                if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) {
                        camel_imap4_journal_readd_failed ((CamelIMAP4Journal *) journal);
                        imap4_fetch_all_free (ic->user_data);
@@ -1509,16 +1509,16 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *
                        camel_operation_end (NULL);
                        return -1;
                }
-               
+
                imap4_fetch_all_add (ic->user_data);
                camel_imap4_command_unref (ic);
                camel_operation_end (NULL);
        }
-       
+
        imap4_summary->update_flags = FALSE;
        imap4_summary->uidvalidity_changed = FALSE;
-       
+
        camel_imap4_journal_readd_failed ((CamelIMAP4Journal *) journal);
-       
+
        return 0;
 }
index 3b336e6..8738a42 100644 (file)
@@ -51,33 +51,33 @@ enum {
 
 struct _CamelIMAP4MessageInfo {
        CamelMessageInfoBase info;
-       
+
        guint32 server_flags;
 };
 
 struct _CamelIMAP4MessageContentInfo {
        CamelMessageContentInfo info;
-       
+
 };
 
 struct _CamelIMAP4Summary {
        CamelFolderSummary parent_object;
-       
+
        guint32 version;
-       
+
        guint32 exists;
        guint32 recent;
        guint32 unseen;
-       
+
        guint32 uidvalidity;
-       
+
        guint uidvalidity_changed:1;
        guint update_flags:1;
 };
 
 struct _CamelIMAP4SummaryClass {
        CamelFolderSummaryClass parent_class;
-       
+
 };
 
 
index 928057a..af7dfac 100644 (file)
@@ -73,9 +73,9 @@ guint32
 camel_imap4_merge_flags (guint32 original, guint32 local, guint32 server)
 {
        flags_diff_t diff;
-       
+
        camel_imap4_flags_diff (&diff, original, local);
-       
+
        return camel_imap4_flags_merge (&diff, server);
 }
 
@@ -84,7 +84,7 @@ void
 camel_imap4_namespace_clear (CamelIMAP4Namespace **ns)
 {
        CamelIMAP4Namespace *node, *next;
-       
+
        node = *ns;
        while (node != NULL) {
                next = node->next;
@@ -92,7 +92,7 @@ camel_imap4_namespace_clear (CamelIMAP4Namespace **ns)
                g_free (node);
                node = next;
        }
-       
+
        *ns = NULL;
 }
 
@@ -100,10 +100,10 @@ static CamelIMAP4Namespace *
 imap4_namespace_copy (const CamelIMAP4Namespace *ns)
 {
        CamelIMAP4Namespace *list, *node, *tail;
-       
+
        list = NULL;
        tail = (CamelIMAP4Namespace *) &list;
-       
+
        while (ns != NULL) {
                tail->next = node = g_malloc (sizeof (CamelIMAP4Namespace));
                node->path = g_strdup (ns->path);
@@ -111,9 +111,9 @@ imap4_namespace_copy (const CamelIMAP4Namespace *ns)
                ns = ns->next;
                tail = node;
        }
-       
+
        tail->next = NULL;
-       
+
        return list;
 }
 
@@ -121,12 +121,12 @@ CamelIMAP4NamespaceList *
 camel_imap4_namespace_list_copy (const CamelIMAP4NamespaceList *nsl)
 {
        CamelIMAP4NamespaceList *new;
-       
+
        new = g_malloc (sizeof (CamelIMAP4NamespaceList));
        new->personal = imap4_namespace_copy (nsl->personal);
        new->other = imap4_namespace_copy (nsl->other);
        new->shared = imap4_namespace_copy (nsl->shared);
-       
+
        return new;
 }
 
@@ -147,21 +147,21 @@ camel_imap4_get_path_delim (CamelIMAP4StoreSummary *s, const char *full_name)
        const char *slash;
        size_t len;
        char *top;
-       
+
        g_return_val_if_fail (s->namespaces != NULL, '/');
-       
+
        if ((slash = strchr (full_name, '/')))
                len = (slash - full_name);
        else
                len = strlen (full_name);
-       
+
        top = g_alloca (len + 1);
        memcpy (top, full_name, len);
        top[len] = '\0';
-       
+
        if (!g_ascii_strcasecmp (top, "INBOX"))
                strcpy (top, "INBOX");
-       
+
  retry:
        namespace = s->namespaces->personal;
        while (namespace != NULL) {
@@ -169,27 +169,27 @@ camel_imap4_get_path_delim (CamelIMAP4StoreSummary *s, const char *full_name)
                        return namespace->sep;
                namespace = namespace->next;
        }
-       
+
        namespace = s->namespaces->other;
        while (namespace != NULL) {
                if (!strcmp (namespace->path, top))
                        return namespace->sep;
                namespace = namespace->next;
        }
-       
+
        namespace = s->namespaces->shared;
        while (namespace != NULL) {
                if (!strcmp (namespace->path, top))
                        return namespace->sep;
                namespace = namespace->next;
        }
-       
+
        if (top[0] != '\0') {
                /* look for a default namespace? */
                top[0] = '\0';
                goto retry;
        }
-       
+
        return '/';
 }
 
@@ -212,7 +212,7 @@ static void
 uidset_range_free (struct _uidset_range *range)
 {
        struct _uidset_range *next;
-       
+
        while (range != NULL) {
                next = range->next;
                g_free (range);
@@ -228,7 +228,7 @@ uidset_init (struct _uidset *uidset, CamelFolderSummary *summary, size_t maxlen)
        uidset->ranges->last = (guint32) -1;
        uidset->ranges->next = NULL;
        uidset->ranges->buflen = 0;
-       
+
        uidset->tail = uidset->ranges;
        uidset->summary = summary;
        uidset->maxlen = maxlen;
@@ -245,17 +245,17 @@ uidset_add (struct _uidset *uidset, CamelMessageInfo *info)
        size_t uidlen, len;
        const char *colon;
        guint32 index;
-       
+
        /* Note: depends on integer overflow for initial 'add' */
        for (index = tail->last + 1; index < messages->len; index++) {
                if (info == messages->pdata[index])
                        break;
        }
-       
+
        g_assert (index < messages->len);
-       
+
        uidlen = strlen (iuid);
-       
+
        if (tail->buflen == 0) {
                /* first add */
                tail->first = tail->last = index;
@@ -268,21 +268,21 @@ uidset_add (struct _uidset *uidset, CamelMessageInfo *info)
                        /* make sure we've got enough room to add this one... */
                        if ((uidset->setlen + uidlen + 1) > uidset->maxlen)
                                return -1;
-                       
+
                        tail->buf[tail->buflen++] = ':';
                        uidset->setlen++;
                } else {
                        colon = strchr (tail->buf, ':') + 1;
-                       
+
                        len = strlen (colon);
                        uidset->setlen -= len;
                        tail->buflen -= len;
                }
-               
+
                strcpy (tail->buf + tail->buflen, iuid);
                uidset->setlen += uidlen;
                tail->buflen += uidlen;
-               
+
                tail->last = index;
        } else if ((uidset->setlen + uidlen + 1) < uidset->maxlen) {
                /* the beginning of a new range */
@@ -297,12 +297,12 @@ uidset_add (struct _uidset *uidset, CamelMessageInfo *info)
                /* can't add this one... */
                return -1;
        }
-       
+
        d(fprintf (stderr, "added uid %s to uidset (summary index = %lu)\n", iuid, index));
-       
+
        if (uidset->setlen < uidset->maxlen)
                return 0;
-       
+
        return 1;
 }
 
@@ -312,9 +312,9 @@ uidset_to_string (struct _uidset *uidset)
        struct _uidset_range *range;
        GString *string;
        char *str;
-       
+
        string = g_string_new ("");
-       
+
        range = uidset->ranges;
        while (range != NULL) {
                g_string_append (string, range->buf);
@@ -322,10 +322,10 @@ uidset_to_string (struct _uidset *uidset)
                if (range)
                        g_string_append_c (string, ',');
        }
-       
+
        str = string->str;
        g_string_free (string, FALSE);
-       
+
        return str;
 }
 
@@ -336,24 +336,24 @@ camel_imap4_get_uid_set (CamelIMAP4Engine *engine, CamelFolderSummary *summary,
        size_t maxlen;
        int rv = 0;
        int i;
-       
+
        if (engine->maxlentype == CAMEL_IMAP4_ENGINE_MAXLEN_LINE)
                maxlen = engine->maxlen - linelen;
        else
                maxlen = engine->maxlen;
-       
+
        uidset_init (&uidset, summary, maxlen);
-       
+
        for (i = cur; i < infos->len && rv != 1; i++) {
                if ((rv = uidset_add (&uidset, infos->pdata[i])) == -1)
                        break;
        }
-       
+
        if (i > cur)
                *set = uidset_to_string (&uidset);
-       
+
        uidset_range_free (uidset.ranges);
-       
+
        return (i - cur);
 }
 
@@ -362,14 +362,14 @@ void
 camel_imap4_utils_set_unexpected_token_error (CamelException *ex, CamelIMAP4Engine *engine, camel_imap4_token_t *token)
 {
        GString *errmsg;
-       
+
        if (ex == NULL)
                return;
-       
+
        errmsg = g_string_new ("");
        g_string_append_printf (errmsg, _("Unexpected token in response from IMAP server %s: "),
                                engine->url->host);
-       
+
        switch (token->token) {
        case CAMEL_IMAP4_TOKEN_NIL:
                g_string_append (errmsg, "NIL");
@@ -396,9 +396,9 @@ camel_imap4_utils_set_unexpected_token_error (CamelException *ex, CamelIMAP4Engi
                g_string_append_c (errmsg, (unsigned char) (token->token & 0xff));
                break;
        }
-       
+
        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, errmsg->str);
-       
+
        g_string_free (errmsg, TRUE);
 }
 
@@ -414,7 +414,7 @@ static struct {
        { "\\Seen",      CAMEL_MESSAGE_SEEN         },
        { "\\Recent",    CAMEL_IMAP4_MESSAGE_RECENT },
        { "\\*",         CAMEL_MESSAGE_USER         },
-       
+
        /* user flags */
        { "Junk",        CAMEL_MESSAGE_JUNK         },
        { "NonJunk",     0                          },
@@ -426,19 +426,19 @@ camel_imap4_parse_flags_list (CamelIMAP4Engine *engine, guint32 *flags, CamelExc
        camel_imap4_token_t token;
        guint32 new = 0;
        int i;
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        if (token.token != '(') {
                d(fprintf (stderr, "Expected to find a '(' token starting the flags list\n"));
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                return -1;
-       
+
        while (token.token == CAMEL_IMAP4_TOKEN_ATOM || token.token == CAMEL_IMAP4_TOKEN_FLAG) {
                /* parse the flags list */
                for (i = 0; i < G_N_ELEMENTS (imap4_flags); i++) {
@@ -447,22 +447,22 @@ camel_imap4_parse_flags_list (CamelIMAP4Engine *engine, guint32 *flags, CamelExc
                                break;
                        }
                }
-               
+
                if (i == G_N_ELEMENTS (imap4_flags))
                        d(fprintf (stderr, "Encountered unknown flag: %s\n", token.v.atom));
-               
+
                if (camel_imap4_engine_next_token (engine, &token, ex) == -1)
                        return -1;
        }
-       
+
        if (token.token != ')') {
                d(fprintf (stderr, "Expected to find a ')' token terminating the flags list\n"));
                camel_imap4_utils_set_unexpected_token_error (ex, engine, &token);
                return -1;
        }
-       
+
        *flags = new;
-       
+
        return 0;
 }
 
@@ -490,17 +490,17 @@ camel_imap4_untagged_list (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guin
        char delim;
        size_t n;
        int i;
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        /* parse the flag list */
        if (token->token != '(')
                goto unexpected;
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        while (token->token == CAMEL_IMAP4_TOKEN_FLAG || token->token == CAMEL_IMAP4_TOKEN_ATOM) {
                for (i = 0; i < G_N_ELEMENTS (list_flags); i++) {
                        if (!g_ascii_strcasecmp (list_flags[i].name, token->v.atom)) {
@@ -508,18 +508,18 @@ camel_imap4_untagged_list (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guin
                                break;
                        }
                }
-               
+
                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                        return -1;
        }
-       
+
        if (token->token != ')')
                goto unexpected;
-       
+
        /* parse the path delimiter */
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        switch (token->token) {
        case CAMEL_IMAP4_TOKEN_NIL:
                delim = '\0';
@@ -530,15 +530,15 @@ camel_imap4_untagged_list (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guin
        default:
                goto unexpected;
        }
-       
+
        /* parse the folder name */
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        list = g_new (camel_imap4_list_t, 1);
        list->flags = flags;
        list->delim = delim;
-       
+
        switch (token->token) {
        case CAMEL_IMAP4_TOKEN_ATOM:
                list->name = g_strdup (token->v.atom);
@@ -550,7 +550,7 @@ camel_imap4_untagged_list (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guin
                literal = g_string_new ("");
                while ((i = camel_imap4_stream_literal (engine->istream, &buf, &n)) == 1)
                        g_string_append_len (literal, buf, n);
-               
+
                if (i == -1) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                              _("IMAP server %s unexpectedly disconnected: %s"),
@@ -558,7 +558,7 @@ camel_imap4_untagged_list (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guin
                        g_string_free (literal, TRUE);
                        return -1;
                }
-               
+
                g_string_append_len (literal, buf, n);
                list->name = literal->str;
                g_string_free (literal, FALSE);
@@ -567,15 +567,15 @@ camel_imap4_untagged_list (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guin
                g_free (list);
                goto unexpected;
        }
-       
+
        g_ptr_array_add (array, list);
-       
+
        return camel_imap4_engine_eat_line (engine, ex);
-       
+
  unexpected:
-       
+
        camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
-       
+
        return -1;
 }
 
@@ -596,14 +596,14 @@ void
 camel_imap4_status_free (camel_imap4_status_t *status)
 {
        camel_imap4_status_attr_t *attr, *next;
-       
+
        attr = status->attr_list;
        while (attr != NULL) {
                next = attr->next;
                g_free (attr);
                attr = next;
        }
-       
+
        g_free (status->mailbox);
        g_free (status);
 }
@@ -619,10 +619,10 @@ camel_imap4_untagged_status (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, gu
        size_t len;
        int type;
        int i;
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        switch (token->token) {
        case CAMEL_IMAP4_TOKEN_ATOM:
                mailbox = g_strdup (token->v.atom);
@@ -641,26 +641,26 @@ camel_imap4_untagged_status (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, gu
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                return -1;
        }
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1) {
                g_free (mailbox);
                return -1;
        }
-       
+
        if (token->token != '(') {
                d(fprintf (stderr, "Expected to find a '(' token after the mailbox token in the STATUS response\n"));
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                g_free (mailbox);
                return -1;
        }
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1) {
                g_free (mailbox);
                return -1;
        }
-       
+
        tail = (camel_imap4_status_attr_t *) &list;
-       
+
        while (token->token == CAMEL_IMAP4_TOKEN_ATOM) {
                /* parse the status messages list */
                type = CAMEL_IMAP4_STATUS_UNKNOWN;
@@ -670,62 +670,62 @@ camel_imap4_untagged_status (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, gu
                                break;
                        }
                }
-               
+
                if (type == CAMEL_IMAP4_STATUS_UNKNOWN)
                        fprintf (stderr, "unrecognized token in STATUS list: %s\n", token->v.atom);
-               
+
                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                        goto exception;
-               
+
                if (token->token != CAMEL_IMAP4_TOKEN_NUMBER)
                        break;
-               
+
                attr = g_new (camel_imap4_status_attr_t, 1);
                attr->next = NULL;
                attr->type = type;
                attr->value = token->v.number;
-               
+
                tail->next = attr;
                tail = attr;
-               
+
                if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                        goto exception;
        }
-       
+
        status = g_new (camel_imap4_status_t, 1);
        status->mailbox = mailbox;
        status->attr_list = list;
        list = NULL;
-       
+
        g_ptr_array_add (array, status);
-       
+
        if (token->token != ')') {
                d(fprintf (stderr, "Expected to find a ')' token terminating the untagged STATUS response\n"));
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                return -1;
        }
-       
+
        if (camel_imap4_engine_next_token (engine, token, ex) == -1)
                return -1;
-       
+
        if (token->token != '\n') {
                d(fprintf (stderr, "Expected to find a '\\n' token after the STATUS response\n"));
                camel_imap4_utils_set_unexpected_token_error (ex, engine, token);
                return -1;
        }
-       
+
        return 0;
-       
+
  exception:
-       
+
        g_free (mailbox);
-       
+
        attr = list;
        while (attr != NULL) {
                list = attr->next;
                g_free (attr);
                attr = list;
        }
-       
+
        return -1;
 }
index c7729c2..f1eb355 100644 (file)
@@ -72,7 +72,7 @@ camel_imapp_driver_get_type (void)
                        (CamelObjectInitFunc) object_init,
                        (CamelObjectFinalizeFunc) object_finalise);
        }
-       
+
        return type;
 }
 
@@ -84,7 +84,7 @@ camel_imapp_driver_new(CamelIMAPPStream *stream)
 
        driver = CAMEL_IMAPP_DRIVER (camel_object_new (CAMEL_IMAPP_DRIVER_TYPE));
        ie = driver->engine = camel_imapp_engine_new(stream);
-       
+
        camel_imapp_engine_add_handler(ie, "FETCH", (CamelIMAPPEngineFunc)driver_resp_fetch, driver);
        camel_imapp_engine_add_handler(ie, "EXPUNGE", (CamelIMAPPEngineFunc)driver_resp_expunge, driver);
        camel_imapp_engine_add_handler(ie, "EXISTS", (CamelIMAPPEngineFunc)driver_resp_exists, driver);
@@ -170,7 +170,7 @@ camel_imapp_driver_select(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder
        }
 
        summary = ((CamelFolder *)folder)->summary;
-       
+
        ic = camel_imapp_engine_command_new(id->engine, "SELECT", NULL, "SELECT %t", folder->raw_name);
        camel_imapp_engine_command_queue(id->engine, ic);
        while (camel_imapp_engine_iterate(id->engine, ic)>0)
@@ -311,7 +311,7 @@ imapp_write_flags(CamelIMAPPDriver *id, guint32 orset, gboolean on, CamelFolderS
        count = camel_folder_summary_count(summary);
        for (j=0;j<sizeof(flag_table)/sizeof(flag_table[0]);j++) {
                int flush;
-               
+
                if ((orset & flag_table[j].flag) == 0)
                        continue;
 
@@ -329,7 +329,7 @@ imapp_write_flags(CamelIMAPPDriver *id, guint32 orset, gboolean on, CamelFolderS
                                     || (!on && (((flags ^ sflags) & ~flags) & flag_table[j].flag))) {
                                        if (ic == NULL)
                                                ic = camel_imapp_engine_command_new(id->engine, "STORE", NULL, "UID STORE ");
-                                       flush = imapp_uidset_add(&ss, ic, camel_message_info_uid(info));                                
+                                       flush = imapp_uidset_add(&ss, ic, camel_message_info_uid(info));
                                }
                                camel_message_info_free((CamelMessageInfo *)info);
                        }
@@ -511,7 +511,7 @@ camel_imapp_driver_list(CamelIMAPPDriver *id, const char *name, guint32 flags)
 
                        if (id->list_commands) {
                                GSList *top = id->list_commands;
-                               
+
                                id->list_commands = top->next;
                                ic = top->data;
                                g_slist_free_1(top);
@@ -578,7 +578,7 @@ driver_resp_list(CamelIMAPPEngine *ie, guint32 idx, CamelIMAPPDriver *id)
                        if (depth < 10
                            && (linfo->name[0] == 0 || linfo->name[strlen(linfo->name)-1] != c)) {
                                CamelIMAPPCommand *ic;
-                               
+
                                ic = camel_imapp_engine_command_new(id->engine, "LIST", NULL, "LIST \"\" %t%c%%", linfo->name, c);
                                id->list_commands = g_slist_prepend(id->list_commands, ic);
                                camel_imapp_engine_command_queue(id->engine, ic);
@@ -610,12 +610,12 @@ driver_status(CamelIMAPPEngine *ie, struct _status_info *sinfo, CamelIMAPPDriver
        case IMAP_UIDVALIDITY:
                sdata->uidvalidity = sinfo->u.uidvalidity;
                break;
-#if 0  
+#if 0
                        /* not defined yet ... */
        case IMAP_UIDNEXT:
                printf("got uidnext for folder: %d\n", sinfo->u.uidnext);
                break;
-#endif 
+#endif
        case IMAP_UNSEEN:
                sdata->unseen = sinfo->u.unseen;
                break;
@@ -709,7 +709,7 @@ driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata)
                                info->info.uid = g_strdup(uidtmp);
                                printf("inserting empty uid %s\n", uidtmp);
                        }
-               
+
                        camel_folder_summary_add(summary, (CamelMessageInfo *)info);
                }
                info = (CamelIMAPPMessageInfo *)camel_folder_summary_index(summary, id-1);
index 87fa1d7..b85180c 100644 (file)
@@ -17,7 +17,7 @@
 #include "camel-imapp-stream.h"
 #include "camel-imapp-utils.h"
 
-#define e(x) 
+#define e(x)
 #define c(x)                   /* command build debug */
 
 static void imap_engine_command_addv(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, const char *fmt, va_list ap);
@@ -88,7 +88,7 @@ camel_imapp_engine_get_type (void)
                        (CamelObjectInitFunc) object_init,
                        (CamelObjectFinalizeFunc) object_finalise);
        }
-       
+
        return type;
 }
 
@@ -285,7 +285,7 @@ camel_imapp_engine_add_handler(CamelIMAPPEngine *imap, const char *response, Cam
        struct _handler *h;
        const unsigned char *p;
        unsigned char *o, c;
-       
+
        h = g_malloc0(sizeof(*h) + strlen(response));
        h->func = func;
        h->data = data;
@@ -349,7 +349,7 @@ iterate_untagged(CamelIMAPPEngine *imap)
        int tok;
        struct _handler *h;
        struct _status_info *sinfo;
-       
+
        e(printf("got untagged response\n"));
        id = 0;
        tok = camel_imapp_stream_token(imap->stream, &token, &len);
@@ -403,12 +403,12 @@ iterate_untagged(CamelIMAPPEngine *imap)
                        if (imap->select_response)
                                imap->select_response->uidvalidity = sinfo->u.uidvalidity;
                        break;
-#if 0  
+#if 0
                        /* not defined yet ... */
                case IMAP_UIDNEXT:
                        printf("got uidnext for folder: %d\n", sinfo->u.uidnext);
                        break;
-#endif 
+#endif
                case IMAP_UNSEEN:
                        if (imap->select_response)
                                imap->select_response->unseen = sinfo->u.unseen;
@@ -444,7 +444,7 @@ iterate_continuation(CamelIMAPPEngine *imap)
 {
        CamelIMAPPCommand *ic;
        CamelIMAPPCommandPart *cp;
-       
+
        printf("got continuation response\n");
 
        ic = imap->literal;
@@ -471,29 +471,29 @@ iterate_continuation(CamelIMAPPEngine *imap)
                char *resp;
                unsigned char *token;
                int tok, len;
-               
+
                tok = camel_imapp_stream_token(imap->stream, &token, &len);
                resp = camel_sasl_challenge_base64((CamelSasl *)cp->ob, token, ex);
                if (camel_exception_is_set(ex))
                        camel_exception_throw_ex(ex);
                camel_exception_free(ex);
-               
+
                printf("got auth continuation, feeding token '%s' back to auth mech\n", resp);
-               
+
                camel_stream_write((CamelStream *)imap->stream, resp, strlen(resp));
-               
+
                /* we want to keep getting called until we get a status reponse from the server
                   ignore what sasl tells us */
                imap->literal = ic;
-               
+
                break; }
        default:
                /* should we just ignore? */
                camel_exception_throw(1, "continuation response for non-continuation request");
        }
-       
+
        camel_imapp_engine_skip(imap);
-       
+
        cp = cp->next;
        if (cp->next) {
                ic->current = cp;
@@ -508,7 +508,7 @@ iterate_continuation(CamelIMAPPEngine *imap)
                printf("%p: queueing continuation\n", ic);
                camel_stream_printf((CamelStream *)imap->stream, "\r\n");
        }
-       
+
        if (imap->literal == NULL) {
                ic = (CamelIMAPPCommand *)e_dlist_remhead(&imap->queue);
                if (ic) {
@@ -556,7 +556,7 @@ iterate_completion(CamelIMAPPEngine *imap, unsigned char *token)
        } else {
                camel_exception_throw(1, "got response tag unexpectedly: %s", token);
        }
-       
+
        if (imap->literal != NULL) {
                printf("Warning: continuation command '%s' finished with outstanding continuation\n", imap->literal->name);
                ic = imap->literal;
@@ -565,13 +565,13 @@ iterate_completion(CamelIMAPPEngine *imap, unsigned char *token)
                e_dlist_addtail(&imap->done, (EDListNode *)ic);
                imap->literal = NULL;
        }
-       
+
        ic = (CamelIMAPPCommand *)e_dlist_remhead(&imap->queue);
        if (ic) {
                printf("found outstanding op, queueing\n");
                camel_imapp_engine_command_queue(imap, ic);
        }
-       
+
        return 1;
 }
 
@@ -785,7 +785,7 @@ imap_engine_command_add_part(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic, came
        CamelIMAPPCommandPart *cp;
        CamelStreamNull *null;
        unsigned int ob_size = 0;
-       
+
        switch(type & CAMEL_IMAPP_COMMAND_MASK) {
        case CAMEL_IMAPP_COMMAND_DATAWRAPPER:
        case CAMEL_IMAPP_COMMAND_STREAM:
@@ -851,7 +851,7 @@ imap_engine_command_complete(CamelIMAPPEngine *imap, CamelIMAPPCommand *ic)
        c(printf("command has %d parts\n", len(&ic->parts)));
        if (ic->mem->buffer->len > 0)
                imap_engine_command_add_part(imap, ic, CAMEL_IMAPP_COMMAND_SIMPLE, NULL);
-       
+
        c(printf("command has %d parts\n", len(&ic->parts)));
 
        camel_object_unref((CamelObject *)ic->mem);
@@ -1009,7 +1009,7 @@ cie_worker(void *data)
        /* see if we need to pre-queue a select command to select the right folder first */
        if (ic->select && (imap->last_select == NULL || strcmp(ic->select, imap->last_select) != 0)) {
                CamelIMAPPCommand *select;
-               
+
                /* of course ... we can't do anything like store/search if we have to select
                   first, because it'll mess up all the sequence numbers ... hrm ... bugger */
 
@@ -1019,7 +1019,7 @@ cie_worker(void *data)
                camel_imapp_engine_command_queue(imap, select);
                /* how does it get freed? handle inside engine? */
        }
-       
+
        /* first, check if command can be sent yet ... queue if not */
        if (imap->literal != NULL) {
                printf("%p: queueing while literal active\n", ic);
index 1599ea5..37fa7e3 100644 (file)
@@ -75,7 +75,7 @@ struct _CamelIMAPPSelectResponse {
        guint32 recent;
        guint32 uidvalidity;
        guint32 unseen;
-       guint32 permanentflags; 
+       guint32 permanentflags;
 };
 
 enum {
index 2efce1c..27104a6 100644 (file)
@@ -36,7 +36,7 @@
 #include "camel-imapp-exception.h"
 #include "camel-imapp-stream.h"
 
-#define t(x) 
+#define t(x)
 #define io(x) x
 
 static CamelObjectClass *parent_class = NULL;
@@ -71,7 +71,7 @@ stream_read(CamelStream *stream, char *buffer, size_t n)
        }
 
        is->literal -= max;
-       
+
        return max;
 }
 
index e567a4d..9688682 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-folder.c : class for a imap folder */
 
-/* 
+/*
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -60,13 +60,13 @@ static void
 imap_folder_class_init (CamelIMAPPFolderClass *camel_imapp_folder_class)
 {
        CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS(camel_imapp_folder_class);
-       
+
        parent_class = CAMEL_FOLDER_CLASS(camel_folder_get_type());
-       
+
        /* virtual method overload */
        camel_folder_class->refresh_info = imap_refresh_info;
        camel_folder_class->sync = imap_sync;
-       
+
        camel_folder_class->get_message = imap_get_message;
 }
 
@@ -78,7 +78,7 @@ imap_folder_init(CamelObject *o, CamelObjectClass *klass)
 
        folder->folder_flags |= (CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
                                 CAMEL_FOLDER_HAS_SEARCH_CAPABILITY);
-       
+
        folder->permanent_flags = CAMEL_MESSAGE_ANSWERED |
                CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_DRAFT |
                CAMEL_MESSAGE_FLAGGED | CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_USER;
@@ -92,7 +92,7 @@ CamelType
 camel_imapp_folder_get_type (void)
 {
        static CamelType camel_imapp_folder_type = CAMEL_INVALID_TYPE;
-       
+
        if (!camel_imapp_folder_type) {
                camel_imapp_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelIMAPPFolder",
                                                              sizeof (CamelIMAPPFolder),
@@ -102,7 +102,7 @@ camel_imapp_folder_get_type (void)
                                                              imap_folder_init,
                                                              (CamelObjectFinalizeFunc) imap_finalize);
        }
-       
+
        return camel_imapp_folder_type;
 }
 
@@ -121,7 +121,7 @@ camel_imapp_folder_new(CamelStore *store, const char *path)
        char *root;
 
        d(printf("opening imap folder '%s'\n", path));
-       
+
        folder = CAMEL_FOLDER (camel_object_new (CAMEL_IMAPP_FOLDER_TYPE));
        camel_folder_construct(folder, store, path, path);
 
@@ -171,7 +171,7 @@ camel_imapp_folder_close(CamelIMAPPFolder *folder, CamelException *ex)
 }
 #endif
 
-static void 
+static void
 imap_refresh_info (CamelFolder *folder, CamelException *ex)
 {
        printf("imapp refresh info?\n");
index ff98e06..a6ec0e0 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-folder.h : Class for a IMAP folder */
 
-/* 
+/*
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 8f80eae..de28e82 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-pop3-provider.c: pop3 provider registration code */
 
-/* 
+/*
  * Authors :
  *   Dan Winship <danw@ximian.com>
  *   Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -45,30 +45,30 @@ CamelProviderConfEntry imapp_conf_entries[] = {
 
 static CamelProvider imapp_provider = {
        "imapp",
-       
+
        N_("IMAP+"),
-       
+
        N_("Experimental IMAP 4(.1) client\n"
           "This is untested and unsupported code, you want to use plain imap instead.\n\n"
           " !!! DO NOT USE THIS FOR PRODUCTION EMAIL  !!!\n"),
        "mail",
-       
+
        CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
        CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL,
-       
+
        CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
-       
+
        imapp_conf_entries,
-       
+
        /* ... */
 };
 
 CamelServiceAuthType camel_imapp_password_authtype = {
        N_("Password"),
-       
+
        N_("This option will connect to the IMAP server using a "
           "plaintext password."),
-       
+
        "",
        TRUE
 };
index fa598cf..48fa482 100644 (file)
@@ -106,7 +106,7 @@ CamelType
 camel_imapp_store_summary_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                camel_imapp_store_summary_parent = (CamelStoreSummaryClass *)camel_store_summary_get_type();
                type = camel_type_register((CamelType)camel_imapp_store_summary_parent, "CamelIMAPPStoreSummary",
@@ -117,7 +117,7 @@ camel_imapp_store_summary_get_type (void)
                                           (CamelObjectInitFunc) camel_imapp_store_summary_init,
                                           (CamelObjectFinalizeFunc) camel_imapp_store_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -125,7 +125,7 @@ camel_imapp_store_summary_get_type (void)
  * camel_imapp_store_summary_new:
  *
  * Create a new CamelIMAPPStoreSummary object.
- * 
+ *
  * Return value: A new CamelIMAPPStoreSummary widget.
  **/
 CamelIMAPPStoreSummary *
@@ -138,14 +138,14 @@ camel_imapp_store_summary_new (void)
 
 /**
  * camel_imapp_store_summary_full_name:
- * @s: 
- * @path: 
- * 
+ * @s:
+ * @path:
+ *
  * Retrieve a summary item by full name.
  *
  * A referenced to the summary item is returned, which may be
  * ref'd or free'd as appropriate.
- * 
+ *
  * Return value: The summary item, or NULL if the @full_name name
  * is not available.
  * It must be freed using camel_store_summary_info_free().
@@ -317,7 +317,7 @@ camel_imapp_store_summary_add_from_full(CamelIMAPPStoreSummary *s, const char *f
                } else {
                        if (full_name[len] == ns->sep)
                                len++;
-                       
+
                        prefix = camel_imapp_store_summary_full_to_path(s, full_name+len, ns->sep);
                        if (*ns->path) {
                                pathu8 = g_strdup_printf ("%s/%s", ns->path, prefix);
@@ -530,7 +530,7 @@ summary_header_save(CamelStoreSummary *s, FILE *out)
        if (camel_imapp_store_summary_parent->summary_header_save((CamelStoreSummary *)s, out) == -1
            || camel_file_util_encode_fixed_int32(out, CAMEL_IMAPP_STORE_SUMMARY_VERSION) == -1
            || camel_file_util_encode_fixed_int32(out, is->capabilities) == -1
-           || camel_file_util_encode_fixed_int32(out, count) == -1)        
+           || camel_file_util_encode_fixed_int32(out, count) == -1)
                return -1;
 
        if (is->namespace && namespace_save(s, out, is->namespace) == -1)
index b7252c6..50b2ee3 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-store.c : class for a imap store */
 
-/* 
+/*
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2000-2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -93,7 +93,7 @@ camel_imapp_store_class_init (CamelIMAPPStoreClass *camel_imapp_store_class)
        CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS(camel_imapp_store_class);
 
        parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs(camel_store_get_type()));
-       
+
        /* virtual method overload */
        camel_service_class->construct = imap_construct;
        /*camel_service_class->get_name = imap_get_name;*/
@@ -160,7 +160,7 @@ static void imap_construct(CamelService *service, CamelSession *session, CamelPr
        CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
        if (camel_exception_is_set(ex))
                return;
-       
+
        CAMEL_TRY {
                store->summary = camel_imapp_store_summary_new();
                root = camel_session_get_storage_path(service->session, service, ex);
@@ -214,7 +214,7 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls)
                        port = "143";
                }
 
-#ifdef HAVE_SSL        
+#ifdef HAVE_SSL
                if (camel_url_get_param (service->url, "use_ssl")) {
                        if (try_starttls)
                                tcp_stream = camel_tcp_stream_ssl_new_raw (service->session, service->url->host, STARTTLS_FLAGS);
@@ -228,7 +228,7 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls)
                } else {
                        tcp_stream = camel_tcp_stream_raw_new ();
                }
-#else  
+#else
                tcp_stream = camel_tcp_stream_raw_new ();
 #endif /* HAVE_SSL */
 
@@ -241,7 +241,7 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls)
 
                if (ex->id)
                        camel_exception_throw_ex(ex);
-       
+
                ret = camel_tcp_stream_connect(CAMEL_TCP_STREAM(tcp_stream), ai);
                camel_freeaddrinfo(ai);
                if (ret == -1) {
@@ -291,7 +291,7 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
 #ifdef HAVE_SSL
        const char *use_ssl;
        int i, ssl_mode;
-       
+
        use_ssl = camel_url_get_param (service->url, "use_ssl");
        if (use_ssl) {
                for (i = 0; ssl_options[i].value; i++)
@@ -300,7 +300,7 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
                ssl_mode = ssl_options[i].mode;
        } else
                ssl_mode = USE_SSL_NEVER;
-       
+
        if (ssl_mode == USE_SSL_ALWAYS) {
                /* First try the ssl port */
                if (!connect_to_server (service, ssl_mode, FALSE, ex)) {
@@ -312,7 +312,7 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
                                return FALSE;
                        }
                }
-               
+
                return TRUE;
        } else if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
                /* If the server supports STARTTLS, use it */
@@ -361,7 +361,7 @@ store_get_pass(CamelIMAPPStore *store)
                CamelException ex;
 
                camel_exception_init(&ex);
-               
+
                prompt = g_strdup_printf (_("%sPlease enter the IMAP password for %s@%s"),
                                          store->login_error?store->login_error:"",
                                          ((CamelService *)store)->url->user,
@@ -390,7 +390,7 @@ static void
 store_get_login(struct _CamelIMAPPDriver *driver, char **login, char **pass, CamelIMAPPStore *store)
 {
        store_get_pass(store);
-       
+
        *login = g_strdup(((CamelService *)store)->url->user);
        *pass = g_strdup(((CamelService *)store)->url->passwd);
 }
@@ -406,7 +406,7 @@ imap_connect (CamelService *service, CamelException *ex)
 
                if (store->cache == NULL) {
                        char *root;
-                       
+
                        root = camel_session_get_storage_path(service->session, service, ex);
                        if (root) {
                                store->cache = camel_data_cache_new(root, 0, ex);
@@ -466,7 +466,7 @@ imap_disconnect (CamelService *service, gboolean clean, CamelException *ex)
        CamelIMAPPStore *store = CAMEL_IMAPP_STORE (service);
 
        /* FIXME: logout */
-       
+
        if (!CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex))
                return FALSE;
 
@@ -475,7 +475,7 @@ imap_disconnect (CamelService *service, gboolean clean, CamelException *ex)
                camel_object_unref(store->driver);
                store->driver = NULL;
        }
-       
+
        return TRUE;
 }
 
@@ -667,7 +667,7 @@ folder_info_dump(CamelFolderInfo *fi, int depth)
                        folder_info_dump(fi->child, depth+2);
                fi = fi->next;
        }
-       
+
 }
 
 static CamelFolderInfo *
@@ -757,7 +757,7 @@ imap_get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExc
        } CAMEL_CATCH (e) {
                camel_exception_xfer(ex, e);
        } CAMEL_DONE;
-       
+
        camel_imapp_engine_command_free(istore->driver->engine, ic);
 
        printf("got folder list:\n");
index 6b225ea..714f72e 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-imap-store.h : class for an imap store */
 
-/* 
+/*
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index aef861a..32ae28b 100644 (file)
@@ -36,7 +36,7 @@
 #include "camel-imapp-exception.h"
 #include "camel-imapp-stream.h"
 
-#define t(x) 
+#define t(x)
 #define io(x) x
 
 static void setup_table(void);
@@ -98,7 +98,7 @@ stream_read(CamelStream *stream, char *buffer, size_t n)
        }
 
        is->literal -= max;
-       
+
        return max;
 }
 
@@ -243,14 +243,14 @@ static unsigned char imap_specials[256] = {
 /* 50 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
 /* 60 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 /* 70 */1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0,
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 };
 
 #define imap_is_atom(c) ((imap_specials[(c)&0xff] & 0x01) != 0)
index 54f94b4..008a33c 100644 (file)
@@ -135,7 +135,7 @@ summary_header_load(CamelFolderSummary *s, FILE *in)
        }
 
        return 0;
-}      
+}
 
 static int
 summary_header_save(CamelFolderSummary *s, FILE *out)
index f4b511d..cd35931 100644 (file)
@@ -26,7 +26,7 @@
 struct _imap_keyword { char *name; camel_imapp_id_t id; };
 /*
  gperf input file
- best hash generated using: gperf -o -s-2 -k1,'$' -t -H imap_hash -N imap_tokenise -L ANSI-C 
+ best hash generated using: gperf -o -s-2 -k1,'$' -t -H imap_hash -N imap_tokenise -L ANSI-C
 */
 
 #define TOTAL_KEYWORDS 23
@@ -337,7 +337,7 @@ imap_free_body(struct _CamelMessageContentInfo *cinfo)
                imap_free_body(list);
                list = next;
        }
-       
+
        if (cinfo->type)
                camel_content_type_unref(cinfo->type);
        g_free(cinfo->id);
@@ -362,7 +362,7 @@ imap_parse_param_list(CamelIMAPPStream *is, struct _camel_header_param **plist)
                        if (tok == ')')
                                break;
                        camel_imapp_stream_ungettoken(is, tok, token, len);
-                       
+
                        camel_imapp_stream_astring(is, &token);
                        param = alloca(strlen(token)+1);
                        strcpy(param, token);
@@ -404,7 +404,7 @@ imap_parse_ext_optional(CamelIMAPPStream *is)
                        dinfo->refcount = 1;
                        /* should be string */
                        camel_imapp_stream_astring(is, &token);
-               
+
                        dinfo->disposition = g_strdup(token);
                        imap_parse_param_list(is, &dinfo->params);
                case IMAP_TOK_TOKEN:
@@ -413,13 +413,13 @@ imap_parse_ext_optional(CamelIMAPPStream *is)
                default:
                        camel_exception_throw(1, "body_fld_disp: expecting nil or list");
                }
-       
+
                p(printf("body_fld_lang\n"));
 
                /* body_fld_lang   ::= nstring / "(" 1#string ")" */
-       
+
                /* we just drop the lang string/list, save it somewhere? */
-       
+
                tok = camel_imapp_stream_token(is, &token, &len);
                switch (tok) {
                case '(':
@@ -462,7 +462,7 @@ imap_parse_body_fields(CamelIMAPPStream *is)
 {
        unsigned char *token, *type;
        struct _CamelMessageContentInfo *cinfo;
-               
+
        /* body_fields     ::= body_fld_param SPACE body_fld_id SPACE
           body_fld_desc SPACE body_fld_enc SPACE
           body_fld_octets */
@@ -479,20 +479,20 @@ imap_parse_body_fields(CamelIMAPPStream *is)
                camel_imapp_stream_astring(is, &token);
                cinfo->type = camel_content_type_new(type, token);
                imap_parse_param_list(is, &cinfo->type->params);
-       
+
                /* body_fld_id     ::= nstring */
                camel_imapp_stream_nstring(is, &token);
                cinfo->id = g_strdup(token);
-       
+
                /* body_fld_desc   ::= nstring */
                camel_imapp_stream_nstring(is, &token);
                cinfo->description = g_strdup(token);
-       
+
                /* body_fld_enc    ::= (<"> ("7BIT" / "8BIT" / "BINARY" / "BASE64"/
                   "QUOTED-PRINTABLE") <">) / string */
                camel_imapp_stream_astring(is, &token);
                cinfo->encoding = g_strdup(token);
-       
+
                /* body_fld_octets ::= number */
                cinfo->size = camel_imapp_stream_number(is);
        } CAMEL_CATCH(ex) {
@@ -686,7 +686,7 @@ imap_parse_envelope(CamelIMAPPStream *is)
 
        return (CamelMessageInfo *)minfo;
 }
-       
+
 struct _CamelMessageContentInfo *
 imap_parse_body(CamelIMAPPStream *is)
 {
@@ -756,7 +756,7 @@ imap_parse_body(CamelIMAPPStream *is)
                } else {
                        /* body_type_1part ::= (body_type_basic / body_type_msg / body_type_text)
                           [SPACE body_ext_1part]
-                          
+
                           body_type_basic ::= media_basic SPACE body_fields
                           body_type_text  ::= media_text SPACE body_fields SPACE body_fld_lines
                           body_type_msg   ::= media_message SPACE body_fields SPACE envelope
@@ -1041,7 +1041,7 @@ imap_parse_fetch(CamelIMAPPStream *is)
                                                camel_imapp_stream_ungettoken(is, tok, token, len);
                                        }
                                        camel_imapp_stream_nstring_stream(is, &finfo->body);
-                                       finfo->got |= FETCH_BODY;                                       
+                                       finfo->got |= FETCH_BODY;
                                } else {
                                        camel_exception_throw(1, "unknown body response");
                                }
@@ -1137,7 +1137,7 @@ imap_parse_status(CamelIMAPPStream *is)
                                sinfo->condition = IMAP_UNKNOWN;
                                printf("Got unknown response code: %s: ignored\n", token);
                        }
-                       
+
                        /* ignore anything we dont know about */
                        do {
                                tok = camel_imapp_stream_token(is, &token, &len);
@@ -1197,7 +1197,7 @@ imap_parse_list(CamelIMAPPStream *is)
        struct _list_info * volatile linfo;
 
        linfo = g_malloc0(sizeof(*linfo));
-       
+
        CAMEL_TRY {
                /* mailbox_list    ::= "(" #("\Marked" / "\Noinferiors" /
                   "\Noselect" / "\Unmarked" / flag_extension) ")"
index aec3964..be79e04 100644 (file)
@@ -117,7 +117,7 @@ void imap_free_status(struct _status_info *sinfo);
 
 /* ********************************************************************** */
 
-/* should this just return a FolderInfo? 
+/* should this just return a FolderInfo?
    should this just return the name & flags & separator by reference? */
 struct _list_info {
        guint32 flags:24;
index afb0569..9f063c7 100644 (file)
@@ -165,9 +165,9 @@ local_finalize(CamelObject * object)
        g_free(local_folder->index_path);
 
        camel_folder_change_info_free(local_folder->changes);
-       
+
        g_mutex_free(local_folder->priv->search_lock);
-       
+
        g_free(local_folder->priv);
 }
 
@@ -216,7 +216,7 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
        int forceindex, len;
        CamelURL *url;
        CamelLocalStore *ls = (CamelLocalStore *)parent_store;
-       
+
        folder = (CamelFolder *)lf;
 
        name = g_path_get_basename(full_name);
@@ -307,16 +307,16 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
        if ((flags & CAMEL_STORE_FOLDER_CREATE) != 0) {
                url = camel_url_copy (((CamelService *) parent_store)->url);
                camel_url_set_fragment (url, full_name);
-       
+
                fi = g_new0 (CamelFolderInfo, 1);
                fi->full_name = g_strdup (full_name);
                fi->name = g_strdup (name);
                fi->uri = camel_url_to_string (url, 0);
                fi->unread = camel_folder_get_unread_message_count(folder);
                fi->flags = CAMEL_FOLDER_NOCHILDREN;
-       
+
                camel_url_free (url);
-       
+
                camel_object_trigger_event(CAMEL_OBJECT (parent_store), "folder_created", fi);
                camel_folder_info_free(fi);
        }
@@ -391,7 +391,7 @@ local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
                                                                              ((CamelService *)folder->parent_store)->url->protocol);
                                else
                                        /* a full path + protocol */
-                                       folder->description = g_strdup_printf(_("%s (%s)"), path, 
+                                       folder->description = g_strdup_printf(_("%s (%s)"), path,
                                                                              ((CamelService *)folder->parent_store)->url->protocol);
                        }
                        *arg->ca_str = folder->description;
@@ -517,7 +517,7 @@ static void
 local_delete(CamelFolder *folder)
 {
        CamelLocalFolder *lf = (CamelLocalFolder *)folder;
-       
+
        if (lf->index)
                camel_index_delete(lf->index);
 
index eb0622e..44333b3 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 1999 Ximian (www.ximian.com/).
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -69,8 +69,8 @@ typedef struct {
 typedef struct {
        CamelFolderClass parent_class;
 
-       /* Virtual methods */   
-       
+       /* Virtual methods */
+
        /* summary factory, only used at init */
        CamelLocalSummary *(*create_summary)(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
 
index 831bea2..ec2f7b1 100644 (file)
@@ -1,11 +1,11 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- * 
+ *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2000 Ximian (www.ximian.com).
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -167,9 +167,9 @@ local_url_hash (const void *v)
 {
        const CamelURL *u = v;
        guint hash = 0;
-       
+
 #define ADD_HASH(s) if (s) hash ^= g_str_hash (s);
-       
+
        ADD_HASH (u->protocol);
        ADD_HASH (u->user);
        ADD_HASH (u->authmech);
@@ -179,7 +179,7 @@ local_url_hash (const void *v)
        ADD_HASH (u->path);
        ADD_HASH (u->query);
        hash ^= u->port;
-       
+
        return hash;
 }
 
@@ -192,7 +192,7 @@ check_equal (char *s1, char *s2)
                else
                        return FALSE;
        }
-       
+
        if (s2 == NULL)
                return FALSE;
 
index 49273aa..7151e7c 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 2000 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -72,7 +72,7 @@ camel_local_store_class_init (CamelLocalStoreClass *camel_local_store_class)
 {
        CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS (camel_local_store_class);
        CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS (camel_local_store_class);
-       
+
        parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
 
        /* virtual method overload */
@@ -104,7 +104,7 @@ CamelType
 camel_local_store_get_type (void)
 {
        static CamelType camel_local_store_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_local_store_type == CAMEL_INVALID_TYPE)       {
                camel_local_store_type = camel_type_register (CAMEL_STORE_TYPE, "CamelLocalStore",
                                                             sizeof (CamelLocalStore),
@@ -114,7 +114,7 @@ camel_local_store_get_type (void)
                                                             NULL,
                                                             (CamelObjectFinalizeFunc) camel_local_store_finalize);
        }
-       
+
        return camel_local_store_type;
 }
 
@@ -151,7 +151,7 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
        strcpy(path, ((CamelLocalStore *)store)->toplevel_dir);
        if (G_IS_DIR_SEPARATOR(path[len-1]))
                path[len-1] = '\0';
-       
+
        if (!g_path_is_absolute(path)) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
                                     _("Store root %s is not an absolute path"), path);
@@ -174,7 +174,7 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
                                      path, g_strerror (errno));
                return NULL;
        }
-       
+
        /* need to create the dir heirarchy */
        if (g_mkdir_with_parents (path, 0777) == -1 && errno != EEXIST) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
@@ -182,7 +182,7 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
                                      path, g_strerror (errno));
                return NULL;
        }
-       
+
        return (CamelFolder *) 0xdeadbeef;
 }
 
@@ -441,7 +441,7 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
        CamelFolder *lf;
        char *name;
        char *str;
-       
+
        /* remove metadata only */
        name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
        str = g_strdup_printf("%s.ev-summary", name);
@@ -484,10 +484,10 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
        } else {
                camel_exception_clear (&lex);
        }
-       
+
        if (str == NULL)
                str = g_strdup_printf ("%s.cmeta", name);
-       
+
        if (g_unlink (str) == -1 && errno != ENOENT) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Could not delete folder meta file `%s': %s"),
@@ -496,19 +496,19 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
                g_free (str);
                return;
        }
-       
+
        g_free (str);
        g_free (name);
-       
+
        fi = g_new0 (CamelFolderInfo, 1);
        fi->full_name = g_strdup (folder_name);
        fi->name = g_path_get_basename (folder_name);
        fi->uri = g_strdup_printf ("%s:%s#%s", ((CamelService *) store)->url->protocol,
                                   CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
        fi->unread = -1;
-       
+
        camel_object_trigger_event (store, "folder_deleted", fi);
-       
+
        camel_folder_info_free (fi);
 }
 
index 52750c0..7d68e47 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-mbox-store.h : class for an mbox store */
 
-/* 
+/*
  *
  * Copyright (C) 2000 Ximian, Inc. <bertrand@helixcode.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -33,7 +33,7 @@
 G_BEGIN_DECLS
 
 typedef struct {
-       CamelStore parent_object;       
+       CamelStore parent_object;
 
        char *toplevel_dir;
 } CamelLocalStore;
index 7c69c9e..268198b 100644 (file)
@@ -68,7 +68,7 @@ CamelType
 camel_local_summary_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_folder_summary_get_type(), "CamelLocalSummary",
                                           sizeof (CamelLocalSummary),
@@ -78,7 +78,7 @@ camel_local_summary_get_type(void)
                                           (CamelObjectInitFunc) camel_local_summary_init,
                                           (CamelObjectFinalizeFunc) camel_local_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -86,7 +86,7 @@ static void
 camel_local_summary_class_init(CamelLocalSummaryClass *klass)
 {
        CamelFolderSummaryClass *sklass = (CamelFolderSummaryClass *) klass;
-       
+
        camel_local_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS(camel_type_get_global_classfuncs(camel_folder_summary_get_type()));
 
        sklass->summary_header_load = summary_header_load;
@@ -280,7 +280,7 @@ camel_local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changei
                }
 
                printf("\nMemory used by summary:\n\n");
-               printf("Total of %d messages\n", camel_folder_summary_count(s)); 
+               printf("Total of %d messages\n", camel_folder_summary_count(s));
                printf("Total: %d bytes (ave %f)\n", stats.citotal + stats.mitotal,
                       (double)(stats.citotal+stats.mitotal)/(double)camel_folder_summary_count(s));
                printf("Message Info: %d (ave %f)\n", stats.mitotal, (double)stats.mitotal/(double)stats.micount);
@@ -305,17 +305,17 @@ camel_local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const Cam
 
 /**
  * camel_local_summary_write_headers:
- * @fd: 
- * @header: 
- * @xevline: 
+ * @fd:
+ * @header:
+ * @xevline:
  * @status:
  * @xstatus:
- * 
+ *
  * Write a bunch of headers to the file @fd.  IF xevline is non NULL, then
  * an X-Evolution header line is created at the end of all of the headers.
  * If @status is non NULL, then a Status header line is also written.
  * The headers written are termianted with a blank line.
- * 
+ *
  * Return value: -1 on error, otherwise the number of bytes written.
  **/
 int
@@ -408,7 +408,7 @@ local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeIn
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Could not save summary: %s: %s"),
                                      cls->folder_path, g_strerror (errno));
-               
+
                g_warning ("Could not save summary for %s: %s", cls->folder_path, strerror (errno));
        }
 
@@ -425,7 +425,7 @@ local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMess
        char *xev;
 
        d(printf("Adding message to summary\n"));
-       
+
        mi = (CamelLocalMessageInfo *)camel_folder_summary_add_from_message((CamelFolderSummary *)cls, msg);
        if (mi) {
                d(printf("Added, uid = %s\n", mi->uid));
@@ -437,7 +437,7 @@ local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMess
                                camel_message_info_set_user_flag((CamelMessageInfo *)mi, flag->name, TRUE);
                                flag = flag->next;
                        }
-                       
+
                        while (tag) {
                                camel_message_info_set_user_tag((CamelMessageInfo *)mi, tag->name, tag->value);
                                tag = tag->next;
@@ -494,7 +494,7 @@ local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessage
 
        if (flag || tag) {
                val = g_string_new ("");
-               
+
                if (flag) {
                        while (flag) {
                                g_string_append (val, flag->name);
@@ -522,7 +522,7 @@ local_summary_encode_x_evolution(CamelLocalSummary *cls, const CamelLocalMessage
        }
        ret = out->str;
        g_string_free (out, FALSE);
-       
+
        return ret;
 }
 
@@ -552,7 +552,7 @@ local_summary_decode_x_evolution(CamelLocalSummary *cls, const char *xev, CamelL
        if (mi == NULL)
                return 0;
 
-       /* check for additional data */ 
+       /* check for additional data */
        header = strchr(xev, ';');
        if (header) {
                params = camel_header_param_list_decode(header+1);
@@ -639,7 +639,7 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
                        /* shortcut, no need to look it up in the index library */
                        doindex = TRUE;
                }
-               
+
                if (cls->index
                    && (doindex
                        || cls->index_force
@@ -651,6 +651,6 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
                        camel_folder_summary_set_index(s, NULL);
                }
        }
-       
+
        return (CamelMessageInfo *)mi;
 }
index a331799..eff3621 100644 (file)
@@ -54,7 +54,7 @@ struct _CamelLocalSummary {
        guint32 version;        /* file version being loaded */
 
        char *folder_path;      /* name of matching folder */
-       
+
        CamelIndex *index;
        unsigned int index_force:1; /* do we force index during creation? */
        unsigned int check_force:1; /* does a check force a full check? */
index 82d7d40..25d73a2 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 1999, 2003 Ximian Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -130,7 +130,7 @@ CamelType camel_maildir_folder_get_type(void)
                                                           (CamelObjectInitFunc) maildir_init,
                                                           (CamelObjectFinalizeFunc) maildir_finalize);
        }
+
        return camel_maildir_folder_type;
 }
 
@@ -167,14 +167,14 @@ maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const Ca
        CamelMessageInfo *mi;
        CamelMaildirMessageInfo *mdi;
        char *name, *dest = NULL;
-       
+
        d(printf("Appending message\n"));
 
        /* add it to the summary/assign the uid, etc */
        mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
        if (camel_exception_is_set (ex))
                return;
-       
+
        mdi = (CamelMaildirMessageInfo *)mi;
 
        d(printf("Appending message: uid is %s filename is %s\n", camel_message_info_uid(mi), mdi->filename));
@@ -184,11 +184,11 @@ maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const Ca
        output_stream = camel_stream_fs_new_with_name (name, O_WRONLY|O_CREAT, 0600);
        if (output_stream == NULL)
                goto fail_write;
-       
+
        if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *)message, output_stream) == -1
            || camel_stream_close (output_stream) == -1)
                goto fail_write;
-       
+
        /* now move from tmp to cur (bypass new, does it matter?) */
        dest = g_strdup_printf("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
        if (rename (name, dest) == -1)
@@ -196,22 +196,22 @@ maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const Ca
 
        g_free (dest);
        g_free (name);
-       
+
        camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed",
                                    ((CamelLocalFolder *)maildir_folder)->changes);
        camel_folder_change_info_clear (((CamelLocalFolder *)maildir_folder)->changes);
-       
+
        if (appended_uid)
                *appended_uid = g_strdup(camel_message_info_uid(mi));
 
        return;
-       
+
  fail_write:
-       
+
        /* remove the summary info so we are not out-of-sync with the mh folder */
        camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (folder->summary),
                                         camel_message_info_uid (mi));
-       
+
        if (errno == EINTR)
                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
                                     _("Maildir append message canceled"));
@@ -219,12 +219,12 @@ maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const Ca
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot append message to maildir folder: %s: %s"),
                                      name, g_strerror (errno));
-       
+
        if (output_stream) {
                camel_object_unref (CAMEL_OBJECT (output_stream));
                unlink (name);
        }
-       
+
        g_free (name);
        g_free (dest);
 }
index 2c49086..0b2625e 100644 (file)
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 1999 Ximian Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -39,9 +39,9 @@ typedef struct {
 
 typedef struct {
        CamelLocalFolderClass parent_class;
-       
+
        /* Virtual methods */
-       
+
 } CamelMaildirFolderClass;
 
 /* public methods */
index e98e1cc..e3fc54b 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -351,7 +351,7 @@ static guint scan_hash(const void *d)
 static gboolean scan_equal(const void *a, const void *b)
 {
        const struct _scan_node *v1 = a, *v2 = b;
-       
+
        return v1->inode == v2->inode && v1->dnode == v2->dnode;
 }
 
index ec977bb..377b322 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -33,12 +33,12 @@ G_BEGIN_DECLS
 
 typedef struct {
        CamelLocalStore parent_object;
-       
+
 } CamelMaildirStore;
 
 typedef struct {
        CamelLocalStoreClass parent_class;
-       
+
 } CamelMaildirStoreClass;
 
 /* public methods */
index 6ef7610..7b74802 100644 (file)
@@ -80,7 +80,7 @@ CamelType
 camel_maildir_summary_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_local_summary_get_type (), "CamelMaildirSummary",
                                           sizeof(CamelMaildirSummary),
@@ -90,7 +90,7 @@ camel_maildir_summary_get_type (void)
                                           (CamelObjectInitFunc)camel_maildir_summary_init,
                                           (CamelObjectFinalizeFunc)camel_maildir_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -156,7 +156,7 @@ camel_maildir_summary_finalise(CamelObject *obj)
  * @index: Index if one is reqiured.
  *
  * Create a new CamelMaildirSummary object.
- * 
+ *
  * Return value: A new #CamelMaildirSummary object.
  **/
 CamelMaildirSummary    *camel_maildir_summary_new(struct _CamelFolder *folder, const char *filename, const char *maildirdir, CamelIndex *index)
@@ -197,7 +197,7 @@ char *camel_maildir_summary_info_to_name(const CamelMaildirMessageInfo *info)
                        *p++ = flagbits[i].flag;
        }
        *p = 0;
-       
+
        return g_strdup(buf);
 }
 
@@ -434,7 +434,7 @@ static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelExc
        while ( (d = readdir(dir)) ) {
                if (d->d_name[0] == '.')
                        continue;
-               
+
                /* map the filename -> uid */
                uid = strchr(d->d_name, ':');
                if (uid) {
@@ -596,7 +596,7 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
                        uid = g_strndup(d->d_name, uid-d->d_name);
                else
                        uid = g_strdup(d->d_name);
-               
+
                info = g_hash_table_lookup(left, uid);
                if (info) {
                        camel_message_info_free(info);
@@ -633,7 +633,7 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
 #else
 # ifdef DOEPOOLV
                                info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name, FALSE);
-# else 
+# else
                                g_free(mdi->filename);
                                mdi->filename = g_strdup(d->d_name);
 # endif
index ed3ed44..5bea915 100644 (file)
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 1999, 2003 Ximian Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -241,24 +241,24 @@ mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const Camel
        filter_from = (CamelMimeFilter *) camel_mime_filter_from_new();
        camel_stream_filter_add((CamelStreamFilter *) filter_stream, filter_from);
        camel_object_unref (filter_from);
-       
+
        if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *) message, filter_stream) == -1 ||
            camel_stream_write (filter_stream, "\n", 1) == -1 ||
            camel_stream_flush (filter_stream) == -1)
                goto fail_write;
-       
+
        /* filter stream ref's the output stream itself, so we need to unref it too */
        camel_object_unref (filter_stream);
        camel_object_unref (output_stream);
        g_free(fromline);
-       
+
        /* now we 'fudge' the summary  to tell it its uptodate, because its idea of uptodate has just changed */
        /* the stat really shouldn't fail, we just wrote to it */
        if (g_stat (lf->folder_path, &st) == 0) {
                ((CamelFolderSummary *) mbs)->time = st.st_mtime;
                mbs->folder_size = st.st_size;
        }
-       
+
        /* unlock as soon as we can */
        camel_local_folder_unlock(lf);
 
@@ -280,30 +280,30 @@ fail_write:
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot append message to mbox file: %s: %s"),
                                      lf->folder_path, g_strerror (errno));
-       
+
        if (output_stream) {
                /* reset the file to original size */
                do {
                        retval = ftruncate (((CamelStreamFs *) output_stream)->fd, mbs->folder_size);
                } while (retval == -1 && errno == EINTR);
-               
+
                camel_object_unref (output_stream);
        }
-       
+
        if (filter_stream)
                camel_object_unref (filter_stream);
-       
+
        g_free(fromline);
-       
+
        /* remove the summary info so we are not out-of-sync with the mbox */
        camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (mbs), camel_message_info_uid (mi));
-       
+
        /* and tell the summary it's up-to-date */
        if (g_stat (lf->folder_path, &st) == 0) {
                ((CamelFolderSummary *) mbs)->time = st.st_mtime;
                mbs->folder_size = st.st_size;
        }
-       
+
 fail:
        /* make sure we unlock the folder - before we start triggering events into appland */
        camel_local_folder_unlock(lf);
@@ -337,7 +337,7 @@ mbox_get_message(CamelFolder *folder, const gchar * uid, CamelException *ex)
                camel_local_folder_unlock(lf);
                return NULL;
        }
-       
+
 retry:
        /* get the message summary info */
        info = (CamelMboxMessageInfo *) camel_folder_summary_uid(folder->summary, uid);
@@ -354,7 +354,7 @@ retry:
 
        frompos = info->frompos;
        camel_message_info_free((CamelMessageInfo *)info);
-       
+
        /* we use an fd instead of a normal stream here - the reason is subtle, camel_mime_part will cache
           the whole message in memory if the stream is non-seekable (which it is when built from a parser
           with no stream).  This means we dont have to lock the mbox for the life of the message, but only
@@ -398,7 +398,7 @@ retry:
                                     _("The folder appears to be irrecoverably corrupted."));
                goto fail;
        }
-       
+
        message = camel_mime_message_new();
        if (camel_mime_part_construct_from_parser((CamelMimePart *)message, parser) == -1) {
                camel_exception_setv(ex, errno==EINTR?CAMEL_EXCEPTION_USER_CANCEL:CAMEL_EXCEPTION_SYSTEM,
@@ -416,12 +416,12 @@ fail:
 
        if (parser)
                camel_object_unref((CamelObject *)parser);
-       
+
        /* use the opportunity to notify of changes (particularly if we had a rebuild) */
        if (camel_folder_change_info_changed(lf->changes)) {
                camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
                camel_folder_change_info_clear(lf->changes);
        }
-       
+
        return message;
 }
index 6e6f3bc..205d7da 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 1999 Ximian .
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -41,8 +41,8 @@ typedef struct {
 typedef struct {
        CamelLocalFolderClass parent_class;
 
-       /* Virtual methods */   
-       
+       /* Virtual methods */
+
 } CamelMboxFolderClass;
 
 /* public methods */
index 23f08aa..7d00cfd 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright(C) 2000 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -45,7 +45,7 @@
 #include "camel-mbox-folder.h"
 #include "camel-mbox-store.h"
 
-#define d(x) 
+#define d(x)
 
 static CamelLocalStoreClass *parent_class = NULL;
 
@@ -68,13 +68,13 @@ camel_mbox_store_class_init(CamelMboxStoreClass *camel_mbox_store_class)
        CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS(camel_mbox_store_class);
 
        parent_class =(CamelLocalStoreClass *)camel_type_get_global_classfuncs(camel_local_store_get_type());
-       
+
        /* virtual method overload */
        camel_store_class->get_folder = get_folder;
        camel_store_class->delete_folder = delete_folder;
        camel_store_class->rename_folder = rename_folder;
        camel_store_class->create_folder = create_folder;
-       
+
        camel_store_class->get_folder_info = get_folder_info;
        camel_store_class->free_folder_info = camel_store_free_folder_info_full;
 
@@ -86,7 +86,7 @@ CamelType
 camel_mbox_store_get_type(void)
 {
        static CamelType camel_mbox_store_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_mbox_store_type == CAMEL_INVALID_TYPE)        {
                camel_mbox_store_type = camel_type_register(CAMEL_LOCAL_STORE_TYPE, "CamelMboxStore",
                                                            sizeof(CamelMboxStore),
@@ -96,7 +96,7 @@ camel_mbox_store_get_type(void)
                                                            NULL,
                                                            NULL);
        }
-       
+
        return camel_mbox_store_type;
 }
 
@@ -108,7 +108,7 @@ static gboolean
 ignore_file(const char *filename, gboolean sbd)
 {
        int flen, len, i;
-       
+
        /* TODO: Should probably just be 1 regex */
        flen = strlen(filename);
        if (flen > 0 && filename[flen-1] == '~')
@@ -119,10 +119,10 @@ ignore_file(const char *filename, gboolean sbd)
                if (len < flen && !strcmp(filename + flen - len, extensions[i]))
                        return TRUE;
        }
-       
+
        if (sbd && flen > 4 && !strcmp(filename + flen - 4, ".sbd"))
                return TRUE;
-       
+
        return FALSE;
 }
 
@@ -131,17 +131,17 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
 {
        struct stat st;
        char *name;
-       
+
        if (!((CamelStoreClass *) parent_class)->get_folder(store, folder_name, flags, ex))
                return NULL;
-       
+
        name = camel_local_store_get_full_path(store, folder_name);
-       
+
        if (g_stat(name, &st) == -1) {
                char *basename;
                char *dirname;
                int fd;
-               
+
                if (errno != ENOENT) {
                        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Cannot get folder `%s': %s"),
@@ -149,7 +149,7 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
                        g_free(name);
                        return NULL;
                }
-               
+
                if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
                        camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
                                             _("Cannot get folder `%s': folder does not exist."),
@@ -157,10 +157,10 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
                        g_free(name);
                        return NULL;
                }
-               
+
                /* sanity check the folder name */
                basename = g_path_get_basename (folder_name);
-               
+
                if (basename[0] == '.' || ignore_file (basename, TRUE)) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Cannot create a folder by this name."));
@@ -169,7 +169,7 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
                        return NULL;
                }
                g_free (basename);
-               
+
                dirname = g_path_get_dirname(name);
                if (g_mkdir_with_parents(dirname, 0777) == -1 && errno != EEXIST) {
                        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
@@ -179,9 +179,9 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
                        g_free(name);
                        return NULL;
                }
-               
+
                g_free(dirname);
-               
+
                fd = g_open(name, O_LARGEFILE | O_WRONLY | O_CREAT | O_APPEND | O_BINARY, 0666);
                if (fd == -1) {
                        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
@@ -190,7 +190,7 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
                        g_free(name);
                        return NULL;
                }
-               
+
                g_free(name);
                close(fd);
        } else if (!S_ISREG(st.st_mode)) {
@@ -207,7 +207,7 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
                return NULL;
        } else
                g_free(name);
-       
+
        return camel_mbox_folder_new(store, folder_name, flags, ex);
 }
 
@@ -219,10 +219,10 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
        CamelFolder *lf;
        char *name, *path;
        struct stat st;
-       
+
        name = camel_local_store_get_full_path(store, folder_name);
        path = g_strdup_printf("%s.sbd", name);
-       
+
        if (g_rmdir(path) == -1 && errno != ENOENT) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Could not delete folder `%s':\n%s"),
@@ -231,9 +231,9 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
                g_free(name);
                return;
        }
-       
+
        g_free(path);
-       
+
        if (g_stat(name, &st) == -1) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Could not delete folder `%s':\n%s"),
@@ -241,14 +241,14 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
                g_free(name);
                return;
        }
-       
+
        if (!S_ISREG(st.st_mode)) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
                                     _("`%s' is not a regular file."), name);
                g_free(name);
                return;
        }
-       
+
        if (st.st_size != 0) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_NON_EMPTY,
                                     _("Folder `%s' is not empty. Not deleted."),
@@ -256,7 +256,7 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
                g_free(name);
                return;
        }
-       
+
        if (g_unlink(name) == -1 && errno != ENOENT) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Could not delete folder `%s':\n%s"),
@@ -264,7 +264,7 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
                g_free(name);
                return;
        }
-       
+
        /* FIXME: we have to do our own meta cleanup here rather than
         * calling our parent class' delete_folder() method since our
         * naming convention is different. Need to find a way for
@@ -279,9 +279,9 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
                g_free(name);
                return;
        }
-       
+
        g_free(path);
-       
+
        path = camel_local_store_get_meta_path(store, folder_name, ".ev-summary-meta");
        if (g_unlink(path) == -1 && errno != ENOENT) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
@@ -291,7 +291,7 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
                g_free(name);
                return;
        }
-       
+
        g_free(path);
 
        path = camel_local_store_get_meta_path(store, folder_name, ".ibex");
@@ -303,7 +303,7 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
                g_free(name);
                return;
        }
-       
+
        g_free(path);
 
        path = NULL;
@@ -315,31 +315,31 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
        } else {
                camel_exception_clear(&lex);
        }
-       
+
        if (path == NULL)
                path = camel_local_store_get_meta_path(store, folder_name, ".cmeta");
-       
+
        if (g_unlink(path) == -1 && errno != ENOENT) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("Could not delete folder meta file `%s': %s"),
                                     path, g_strerror(errno));
-               
+
                g_free(path);
                g_free(name);
                return;
        }
-       
+
        g_free(path);
        g_free(name);
-       
+
        fi = g_new0(CamelFolderInfo, 1);
        fi->full_name = g_strdup(folder_name);
        fi->name = g_path_get_basename(folder_name);
        fi->uri = g_strdup_printf("mbox:%s#%s",((CamelService *) store)->url->path, folder_name);
        fi->unread = -1;
-       
+
        camel_object_trigger_event(store, "folder_deleted", fi);
-       
+
        camel_folder_info_free(fi);
 }
 
@@ -353,62 +353,62 @@ create_folder(CamelStore *store, const char *parent_name, const char *folder_nam
        char *path, *name, *dir;
        CamelFolder *folder;
        struct stat st;
-       
+
        if (!g_path_is_absolute(toplevel_dir)) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
                                     _("Store root %s is not an absolute path"), toplevel_dir);
                return NULL;
        }
-       
+
        if (folder_name[0] == '.' || ignore_file(folder_name, TRUE)) {
                camel_exception_set(ex, CAMEL_EXCEPTION_SYSTEM,
                                    _("Cannot create a folder by this name."));
                return NULL;
        }
-       
+
        if (parent_name && *parent_name)
                name = g_strdup_printf("%s/%s", parent_name, folder_name);
        else
                name = g_strdup(folder_name);
-       
+
        path = camel_local_store_get_full_path(store, name);
-       
+
        dir = g_path_get_dirname(path);
        if (g_mkdir_with_parents(dir, 0777) == -1 && errno != EEXIST) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create directory `%s': %s."),
                                     dir, g_strerror(errno));
-               
+
                g_free(path);
                g_free(name);
                g_free(dir);
-               
+
                return NULL;
        }
-       
+
        g_free(dir);
-       
+
        if (g_stat(path, &st) == 0 || errno != ENOENT) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
                                     _("Cannot create folder: %s: %s"),
                                     path, errno ? g_strerror(errno) :
                                     _("Folder already exists"));
-               
+
                g_free(path);
                g_free(name);
-               
+
                return NULL;
        }
-       
+
        g_free(path);
-       
+
        folder =((CamelStoreClass *)((CamelObject *) store)->klass)->get_folder(store, name, CAMEL_STORE_FOLDER_CREATE, ex);
        if (folder) {
                camel_object_unref(folder);
                info =((CamelStoreClass *)((CamelObject *) store)->klass)->get_folder_info(store, name, 0, ex);
        }
-       
+
        g_free(name);
-       
+
        return info;
 }
 
@@ -420,7 +420,7 @@ xrename(CamelStore *store, const char *old_name, const char *new_name, const cha
        struct stat st;
        int ret = -1;
        int err = 0;
-       
+
        if (ext != NULL) {
                oldpath = camel_local_store_get_meta_path(ls, old_name, ext);
                newpath = camel_local_store_get_meta_path(ls, new_name, ext);
@@ -428,7 +428,7 @@ xrename(CamelStore *store, const char *old_name, const char *new_name, const cha
                oldpath = camel_local_store_get_full_path(ls, old_name);
                newpath = camel_local_store_get_full_path(ls, new_name);
        }
-       
+
        if (g_stat(oldpath, &st) == -1) {
                if (missingok && errno == ENOENT) {
                        ret = 0;
@@ -466,10 +466,10 @@ xrename(CamelStore *store, const char *old_name, const char *new_name, const cha
                ret = -1;
 #endif
        }
-       
+
        g_free(oldpath);
        g_free(newpath);
-       
+
        return ret;
 }
 
@@ -479,18 +479,18 @@ rename_folder(CamelStore *store, const char *old, const char *new, CamelExceptio
        CamelLocalFolder *folder = NULL;
        char *oldibex, *newibex, *newdir;
        int errnosav;
-       
+
        if (new[0] == '.' || ignore_file(new, TRUE)) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                                     _("The new folder name is illegal."));
                return;
        }
-       
+
        /* try to rollback failures, has obvious races */
-       
+
        oldibex = camel_local_store_get_meta_path(store, old, ".ibex");
        newibex = camel_local_store_get_meta_path(store, new, ".ibex");
-       
+
        newdir = g_path_get_dirname(newibex);
        if (g_mkdir_with_parents(newdir, 0777) == -1) {
                if (errno != EEXIST) {
@@ -500,14 +500,14 @@ rename_folder(CamelStore *store, const char *old, const char *new, CamelExceptio
                        g_free(oldibex);
                        g_free(newibex);
                        g_free(newdir);
-                       
+
                        return;
                }
-               
+
                g_free(newdir);
                newdir = NULL;
        }
-       
+
        folder = camel_object_bag_get(store->folders, old);
        if (folder && folder->index) {
                if (camel_index_rename(folder->index, newibex) == -1 && errno != ENOENT) {
@@ -521,7 +521,7 @@ rename_folder(CamelStore *store, const char *old, const char *new, CamelExceptio
                        goto ibex_failed;
                }
        }
-       
+
        if (xrename(store, old, new, ".ev-summary", TRUE) == -1) {
                errnosav = errno;
                goto summary_failed;
@@ -536,30 +536,30 @@ rename_folder(CamelStore *store, const char *old, const char *new, CamelExceptio
                errnosav = errno;
                goto cmeta_failed;
        }
-       
+
        if (xrename(store, old, new, ".sbd", TRUE) == -1) {
                errnosav = errno;
                goto subdir_failed;
        }
-       
+
        if (xrename(store, old, new, NULL, FALSE) == -1) {
                errnosav = errno;
                goto base_failed;
        }
-       
+
        g_free(oldibex);
        g_free(newibex);
-       
+
        if (folder)
                camel_object_unref(folder);
-       
+
        return;
-       
+
 base_failed:
        xrename(store, new, old, ".sbd", TRUE);
 subdir_failed:
        xrename(store, new, old, ".cmeta", TRUE);
-cmeta_failed:  
+cmeta_failed:
        xrename(store, new, old, ".ev-summary", TRUE);
        xrename(store, new, old, ".ev-summary-meta", TRUE);
 summary_failed:
@@ -574,14 +574,14 @@ ibex_failed:
                g_rmdir(newdir);
                g_free(newdir);
        }
-       
+
        camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
                             _("Could not rename '%s' to %s: %s"),
                             old, new, g_strerror(errnosav));
-       
+
        g_free(newibex);
        g_free(oldibex);
-       
+
        if (folder)
                camel_object_unref(folder);
 }
@@ -596,7 +596,7 @@ static guint
 inode_hash(const void *d)
 {
        const struct _inode *v = d;
-       
+
        return v->inode ^ v->dnode;
 }
 
@@ -604,7 +604,7 @@ static gboolean
 inode_equal(const void *a, const void *b)
 {
        const struct _inode *v1 = a, *v2 = b;
-       
+
        return v1->inode == v2->inode && v1->dnode == v2->dnode;
 }
 
@@ -636,7 +636,7 @@ fill_fi(CamelStore *store, CamelFolderInfo *fi, guint32 flags)
                /* This should be fast enough not to have to test for INFO_FAST */
                path = camel_local_store_get_meta_path(store, fi->full_name, ".ev-summary");
                folderpath = camel_local_store_get_full_path(store, fi->full_name);
-               
+
                mbs = (CamelMboxSummary *)camel_mbox_summary_new(NULL, path, folderpath, NULL);
                if (camel_folder_summary_header_load((CamelFolderSummary *)mbs) != -1) {
                        fi->unread = ((CamelFolderSummary *)mbs)->unread_count;
@@ -657,56 +657,56 @@ scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo
        GHashTable *folder_hash;
        const char *dent;
        GDir *dir;
-       
+
        tail = folders = NULL;
-       
+
        if (!(dir = g_dir_open(root, 0, NULL)))
                return NULL;
-       
+
        folder_hash = g_hash_table_new(g_str_hash, g_str_equal);
-       
+
        /* FIXME: it would be better if we queue'd up the recursive
         * scans till the end so that we can limit the number of
         * directory descriptors open at any given time... */
-       
+
        while ((dent = g_dir_read_name(dir))) {
                char *short_name, *full_name, *path, *ext;
                struct stat st;
-               
+
                if (dent[0] == '.')
                        continue;
-               
+
                if (ignore_file(dent, FALSE))
                        continue;
-               
+
                path = g_strdup_printf("%s/%s", root, dent);
                if (g_stat(path, &st) == -1) {
                        g_free(path);
                        continue;
                }
-#ifndef G_OS_WIN32             
+#ifndef G_OS_WIN32
                if (S_ISDIR(st.st_mode)) {
                        struct _inode in = { st.st_dev, st.st_ino };
-                       
+
                        if (g_hash_table_lookup(visited, &in)) {
                                g_free(path);
                                continue;
                        }
                }
-#endif         
+#endif
                short_name = g_strdup(dent);
                if ((ext = strrchr(short_name, '.')) && !strcmp(ext, ".sbd"))
                        *ext = '\0';
-               
+
                if (name != NULL)
                        full_name = g_strdup_printf("%s/%s", name, short_name);
                else
                        full_name = g_strdup(short_name);
-                               
+
                if ((fi = g_hash_table_lookup(folder_hash, short_name)) != NULL) {
                        g_free(short_name);
                        g_free(full_name);
-                       
+
                        if (S_ISDIR(st.st_mode)) {
                                fi->flags =(fi->flags & ~CAMEL_FOLDER_NOCHILDREN) | CAMEL_FOLDER_CHILDREN;
                        } else {
@@ -715,9 +715,9 @@ scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo
                } else {
                        fi = g_new0(CamelFolderInfo, 1);
                        fi->parent = parent;
-                       
+
                        camel_url_set_fragment (url, full_name);
-                       
+
                        fi->uri = camel_url_to_string (url, 0);
                        fi->name = short_name;
                        fi->full_name = full_name;
@@ -728,26 +728,26 @@ scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo
                                fi->flags = CAMEL_FOLDER_NOSELECT;
                        else
                                fi->flags = CAMEL_FOLDER_NOCHILDREN;
-                       
+
                        if (tail == NULL)
                                folders = fi;
                        else
                                tail->next = fi;
-                       
+
                        tail = fi;
-                       
+
                        g_hash_table_insert(folder_hash, fi->name, fi);
                }
-               
+
                if (!S_ISDIR(st.st_mode)) {
                        fill_fi(store, fi, flags);
                } else if ((flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE)) {
                        struct _inode in = { st.st_dev, st.st_ino };
-                       
+
                        if (g_hash_table_lookup(visited, &in) == NULL) {
 #ifndef G_OS_WIN32
                                struct _inode *inew = g_new(struct _inode, 1);
-                               
+
                                *inew = in;
                                g_hash_table_insert(visited, inew, inew);
 #endif
@@ -757,14 +757,14 @@ scan_dir(CamelStore *store, CamelURL *url, GHashTable *visited, CamelFolderInfo
                                        fi->flags =(fi->flags & ~CAMEL_FOLDER_CHILDREN) | CAMEL_FOLDER_NOCHILDREN;
                        }
                }
-               
+
                g_free(path);
        }
-       
+
        g_dir_close(dir);
-       
+
        g_hash_table_destroy(folder_hash);
-       
+
        return folders;
 }
 
@@ -780,23 +780,23 @@ get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExceptio
        char *basename;
        struct stat st;
        CamelURL *url;
-       
+
        top = top ? top : "";
        path = camel_local_store_get_full_path(store, top);
-       
+
        if (*top == '\0') {
                /* requesting root dir scan */
                if (g_stat(path, &st) == -1 || !S_ISDIR(st.st_mode)) {
                        g_free(path);
                        return NULL;
                }
-               
+
                visited = g_hash_table_new(inode_hash, inode_equal);
 #ifndef G_OS_WIN32
                inode = g_malloc0(sizeof(*inode));
                inode->dnode = st.st_dev;
                inode->inode = st.st_ino;
-               
+
                g_hash_table_insert(visited, inode, inode);
 #endif
                url = camel_url_copy (((CamelService *) store)->url);
@@ -805,23 +805,23 @@ get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExceptio
                g_hash_table_destroy(visited);
                camel_url_free (url);
                g_free (path);
-               
+
                return fi;
        }
-       
+
        /* requesting scan of specific folder */
        if (g_stat(path, &st) == -1 || !S_ISREG(st.st_mode)) {
                g_free(path);
                return NULL;
        }
-       
+
        visited = g_hash_table_new(inode_hash, inode_equal);
-       
+
        basename = g_path_get_basename(top);
-       
+
        url = camel_url_copy (((CamelService *) store)->url);
        camel_url_set_fragment (url, top);
-       
+
        fi = g_new0(CamelFolderInfo, 1);
        fi->parent = NULL;
        fi->uri = camel_url_to_string (url, 0);
@@ -829,7 +829,7 @@ get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExceptio
        fi->full_name = g_strdup(top);
        fi->unread = -1;
        fi->total = -1;
-       
+
        subdir = g_strdup_printf("%s.sbd", path);
        if (g_stat(subdir, &st) == 0) {
                if  (S_ISDIR(st.st_mode))
@@ -838,20 +838,20 @@ get_folder_info(CamelStore *store, const char *top, guint32 flags, CamelExceptio
                        fill_fi(store, fi, flags);
        } else
                fill_fi(store, fi, flags);
-       
+
        camel_url_free (url);
-       
+
        if (fi->child)
                fi->flags |= CAMEL_FOLDER_CHILDREN;
        else
                fi->flags |= CAMEL_FOLDER_NOCHILDREN;
-       
+
        g_free(subdir);
-       
+
        g_hash_table_foreach(visited, inode_free, NULL);
        g_hash_table_destroy(visited);
        g_free(path);
-       
+
        return fi;
 }
 
@@ -861,33 +861,33 @@ mbox_get_full_path(CamelLocalStore *ls, const char *full_name)
        const char *inptr = full_name;
        int subdirs = 0;
        char *path, *p;
-       
+
        while (*inptr != '\0') {
                if (G_IS_DIR_SEPARATOR (*inptr))
                        subdirs++;
                inptr++;
        }
-       
+
        path = g_malloc (strlen (ls->toplevel_dir) + (inptr - full_name) + (4 * subdirs) + 1);
        p = g_stpcpy (path, ls->toplevel_dir);
-       
+
        inptr = full_name;
        while (*inptr != '\0') {
                while (!G_IS_DIR_SEPARATOR (*inptr) && *inptr != '\0')
                        *p++ = *inptr++;
-               
+
                if (G_IS_DIR_SEPARATOR (*inptr)) {
                        p = g_stpcpy (p, ".sbd/");
                        inptr++;
-                       
+
                        /* strip extranaeous '/'s */
                        while (G_IS_DIR_SEPARATOR (*inptr))
                                inptr++;
                }
        }
-       
+
        *p = '\0';
-       
+
        return path;
 }
 
@@ -897,21 +897,21 @@ mbox_get_meta_path(CamelLocalStore *ls, const char *full_name, const char *ext)
 /*#define USE_HIDDEN_META_FILES*/
 #ifdef USE_HIDDEN_META_FILES
        char *name, *slash;
-       
+
        name = g_alloca (strlen (full_name) + strlen (ext) + 2);
        if ((slash = strrchr (full_name, '/')))
                sprintf (name, "%.*s.%s%s", slash - full_name + 1, full_name, slash + 1, ext);
        else
                sprintf (name, ".%s%s", full_name, ext);
-       
+
        return mbox_get_full_path(ls, name);
 #else
        char *full_path, *path;
-       
+
        full_path = mbox_get_full_path(ls, full_name);
        path = g_strdup_printf ("%s%s", full_path, ext);
        g_free (full_path);
-       
+
        return path;
 #endif
 }
index bf124c1..23bdf2c 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 2000 Ximian, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -32,8 +32,8 @@
 G_BEGIN_DECLS
 
 typedef struct {
-       CamelLocalStore parent_object;  
-       
+       CamelLocalStore parent_object;
+
 } CamelMboxStore;
 
 typedef struct {
index a0c5d93..2d2c55f 100644 (file)
@@ -88,7 +88,7 @@ CamelType
 camel_mbox_summary_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_local_summary_get_type(), "CamelMboxSummary",
                                           sizeof (CamelMboxSummary),
@@ -98,7 +98,7 @@ camel_mbox_summary_get_type(void)
                                           (CamelObjectInitFunc) camel_mbox_summary_init,
                                           (CamelObjectFinalizeFunc) camel_mbox_summary_finalise);
        }
-       
+
        return type;
 }
 static gboolean
@@ -145,7 +145,7 @@ camel_mbox_summary_class_init(CamelMboxSummaryClass *klass)
 {
        CamelFolderSummaryClass *sklass = (CamelFolderSummaryClass *)klass;
        CamelLocalSummaryClass *lklass = (CamelLocalSummaryClass *)klass;
-       
+
        camel_mbox_summary_parent = (CamelLocalSummaryClass *)camel_type_get_global_classfuncs(camel_local_summary_get_type());
 
        sklass->summary_header_load = summary_header_load;
@@ -163,7 +163,7 @@ camel_mbox_summary_class_init(CamelMboxSummaryClass *klass)
 #ifdef STATUS_PINE
        sklass->info_set_flags = mbox_info_set_flags;
 #endif
-       
+
        lklass->encode_x_evolution = mbox_summary_encode_x_evolution;
        lklass->check = mbox_summary_check;
        lklass->sync = mbox_summary_sync;
@@ -179,7 +179,7 @@ static void
 camel_mbox_summary_init(CamelMboxSummary *obj)
 {
        struct _CamelFolderSummary *s = (CamelFolderSummary *)obj;
-       
+
        /* subclasses need to set the right instance data sizes */
        s->message_info_size = sizeof(CamelMboxMessageInfo);
        s->content_info_size = sizeof(CamelMboxMessageContentInfo);
@@ -198,7 +198,7 @@ camel_mbox_summary_finalise(CamelObject *obj)
  * camel_mbox_summary_new:
  *
  * Create a new CamelMboxSummary object.
- * 
+ *
  * Return value: A new CamelMboxSummary widget.
  **/
 CamelMboxSummary *
@@ -227,7 +227,7 @@ mbox_summary_encode_x_evolution (CamelLocalSummary *cls, const CamelLocalMessage
        p = uidstr = camel_message_info_uid(mi);
        while (*p && isdigit(*p))
                p++;
-       
+
        if (*p == 0 && sscanf(uidstr, "%u", &uid) == 1) {
                return g_strdup_printf("%08x-%04x", uid, mi->info.flags & 0xffff);
        } else {
@@ -344,7 +344,7 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
 
                mi->frompos = -1;
        }
-       
+
        return (CamelMessageInfo *)mi;
 }
 
@@ -359,7 +359,7 @@ message_info_new_from_parser(CamelFolderSummary *s, CamelMimeParser *mp)
 
                mbi->frompos = camel_mime_parser_tell_start_from(mp);
        }
-       
+
        return mi;
 }
 
@@ -373,11 +373,11 @@ message_info_load(CamelFolderSummary *s, FILE *in)
        mi = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_load(s, in);
        if (mi) {
                CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
-               
+
                if (camel_file_util_decode_off_t(in, &mbi->frompos) == -1)
                        goto error;
        }
-       
+
        return mi;
 error:
        camel_message_info_free(mi);
@@ -441,7 +441,7 @@ summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *chan
                camel_operation_end(NULL);
                return -1;
        }
-       
+
        if (fstat(fd, &st) == 0)
                size = st.st_size;
 
@@ -479,7 +479,7 @@ summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *chan
        while (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) {
                CamelMessageInfo *info;
                off_t pc = camel_mime_parser_tell_start_from (mp) + 1;
-               
+
                camel_operation_progress (NULL, (int) (((float) pc / size) * 100));
 
                info = camel_folder_summary_add_from_parser(s, mp);
@@ -510,7 +510,7 @@ summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *chan
                camel_message_info_free(mi);
        }
        mbs->changes = NULL;
-       
+
        /* update the file size/mtime in the summary */
        if (ok != -1) {
                if (g_stat(cls->folder_path, &st) == 0) {
@@ -664,15 +664,15 @@ mbox_summary_sync_full(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChang
        tmpname = NULL;
 
        camel_operation_end(NULL);
-               
+
        return 0;
  error:
        if (fd != -1)
                close(fd);
-       
+
        if (fdout != -1)
                close(fdout);
-       
+
        if (tmpname)
                g_unlink(tmpname);
 
@@ -818,7 +818,7 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
        camel_object_unref((CamelObject *)mp);
 
        camel_operation_end(NULL);
-       
+
        return 0;
  error:
        if (fd != -1)
@@ -1074,11 +1074,11 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
                        camel_message_info_free((CamelMessageInfo *)info);
                }
        }
-               
+
        return 0;
  error:
        g_free(xevnew);
-       
+
        if (mp)
                camel_object_unref((CamelObject *)mp);
        if (info)
@@ -1122,7 +1122,7 @@ encode_status(guint32 flags, char status[8])
 {
        size_t i;
        char *p;
-       
+
        p = status;
        for (i = 0; i < G_N_ELEMENTS (status_flags); i++)
                if (status_flags[i].flag & flags)
@@ -1138,14 +1138,14 @@ decode_status(const char *status)
        guint32 flags = 0;
        size_t i;
        char c;
-       
+
        p = status;
        while ((c = *p++)) {
                for (i = 0; i < G_N_ELEMENTS (status_flags); i++)
                        if (status_flags[i].tag == c)
                                flags |= status_flags[i].flag;
        }
-       
+
        return flags;
 }
 
index dd2b555..d740ade 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 1999, 2003 Ximian Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -138,39 +138,39 @@ mh_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMe
        mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
        if (camel_exception_is_set (ex))
                return;
-       
+
        d(printf("Appending message: uid is %s\n", camel_message_info_uid(mi)));
-       
+
        /* write it out, use the uid we got from the summary */
        name = g_strdup_printf("%s/%s", lf->folder_path, camel_message_info_uid(mi));
        output_stream = camel_stream_fs_new_with_name(name, O_WRONLY|O_CREAT, 0600);
        if (output_stream == NULL)
                goto fail_write;
-       
+
        if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *)message, output_stream) == -1
            || camel_stream_close (output_stream) == -1)
                goto fail_write;
-       
+
        /* close this? */
        camel_object_unref (CAMEL_OBJECT (output_stream));
 
        g_free(name);
-       
+
        camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed",
                                    ((CamelLocalFolder *)mh_folder)->changes);
        camel_folder_change_info_clear (((CamelLocalFolder *)mh_folder)->changes);
-       
+
        if (appended_uid)
                *appended_uid = g_strdup(camel_message_info_uid(mi));
 
        return;
-       
+
  fail_write:
-       
+
        /* remove the summary info so we are not out-of-sync with the mh folder */
        camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (folder->summary),
                                         camel_message_info_uid (mi));
-       
+
        if (errno == EINTR)
                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
                                     _("MH append message canceled"));
@@ -178,12 +178,12 @@ mh_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMe
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot append message to mh folder: %s: %s"),
                                      name, g_strerror (errno));
-       
+
        if (output_stream) {
                camel_object_unref (CAMEL_OBJECT (output_stream));
                unlink (name);
        }
-       
+
        g_free (name);
 }
 
index 032ddf6..92fda55 100644 (file)
@@ -5,8 +5,8 @@
  *
  * Copyright (C) 1999 Ximian Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -39,9 +39,9 @@ typedef struct {
 
 typedef struct {
        CamelLocalFolderClass parent_class;
-       
+
        /* Virtual methods */
-       
+
 } CamelMhFolderClass;
 
 /* public methods */
index d421b76..40159e6 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -121,7 +121,7 @@ folders_update(const char *root, int mode, const char *folder, const char *new)
 
        tmpnew = g_alloca (strlen (root) + 16);
        sprintf (tmpnew, "%s.folders~", root);
-       
+
        out = camel_stream_fs_new_with_name(tmpnew, O_WRONLY|O_CREAT|O_TRUNC, 0666);
        if (out == NULL)
                goto fail;
@@ -250,7 +250,7 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
                g_free (name);
                return NULL;
        }
-       
+
        g_free(name);
 
        return camel_mh_folder_new(store, folder_name, flags, ex);
@@ -354,9 +354,9 @@ folder_info_new (CamelStore *store, CamelURL *url, const char *root, const char
        char *base;
 
        base = strrchr(path, '/');
-       
+
        camel_url_set_fragment (url, path);
-       
+
        /* Build the folder info structure. */
        fi = g_malloc0(sizeof(*fi));
        fi->uri = camel_url_to_string (url, 0);
@@ -392,7 +392,7 @@ recursive_scan (CamelStore *store, CamelURL *url, CamelFolderInfo **fip, CamelFo
        if (path[0]) {
                fullpath = alloca (strlen (root) + strlen (path) + 2);
                sprintf (fullpath, "%s/%s", root, path);
-       } else 
+       } else
                fullpath = (char *)root;
 
        if (stat(fullpath, &st) == -1 || !S_ISDIR(st.st_mode))
@@ -497,7 +497,7 @@ folders_scan(CamelStore *store, CamelURL *url, const char *root, const char *top
                        if (strncmp(top, line, toplen) != 0
                            || (line[toplen] != 0 && line[toplen] != '/'))
                                continue;
-               
+
                        /* check is not sub-subdir if not recursive */
                        if ((flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) == 0
                            && (tmp = strrchr(line, '/'))
@@ -540,7 +540,7 @@ static guint inode_hash(const void *d)
 static gboolean inode_equal(const void *a, const void *b)
 {
        const struct _inode *v1 = a, *v2 = b;
-       
+
        return v1->inode == v2->inode && v1->dnode == v2->dnode;
 }
 
@@ -555,11 +555,11 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti
        CamelFolderInfo *fi = NULL;
        CamelURL *url;
        char *root;
-       
+
        root = ((CamelService *)store)->url->path;
-       
+
        url = camel_url_copy (((CamelService *) store)->url);
-       
+
        /* use .folders if we are supposed to */
        if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS) {
                folders_scan(store, url, root, top, &fi, flags);
@@ -584,8 +584,8 @@ get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelExcepti
                g_hash_table_foreach(visited, inode_free, NULL);
                g_hash_table_destroy(visited);
        }
-       
+
        camel_url_free (url);
-       
+
        return fi;
 }
index b696be7..bbe0559 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -43,7 +43,7 @@ typedef struct {
 
 typedef struct {
        CamelLocalStoreClass parent_class;
-       
+
 } CamelMhStoreClass;
 
 /* public methods */
index b381686..646a13d 100644 (file)
@@ -65,7 +65,7 @@ CamelType
 camel_mh_summary_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_local_summary_get_type (), "CamelMhSummary",
                                           sizeof(CamelMhSummary),
@@ -75,7 +75,7 @@ camel_mh_summary_get_type (void)
                                           (CamelObjectInitFunc)camel_mh_summary_init,
                                           (CamelObjectFinalizeFunc)camel_mh_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -117,7 +117,7 @@ camel_mh_summary_finalise(CamelObject *obj)
  * camel_mh_summary_new:
  *
  * Create a new CamelMhSummary object.
- * 
+ *
  * Return value: A new #CamelMhSummary object.
  **/
 CamelMhSummary *camel_mh_summary_new(struct _CamelFolder *folder, const char *filename, const char *mhdir, CamelIndex *index)
@@ -331,7 +331,7 @@ mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo
                                /* FIXME: put this in folder_summary::remove()? */
                                if (cls->index)
                                        camel_index_delete_name(cls->index, (char *)uid);
-                               
+
                                camel_folder_change_info_remove_uid(changes, uid);
                                camel_folder_summary_remove((CamelFolderSummary *)cls, (CamelMessageInfo *)info);
                        }
index ea75983..9f551b5 100644 (file)
@@ -1,11 +1,11 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- * 
+ *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2001-2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -168,10 +168,10 @@ spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
                }
                retry++;
        }
-       
+
        close (mf->lockfd);
        mf->lockfd = -1;
-       
+
        return -1;
 }
 
index 753542b..c2e26ab 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 2001 Ximian Inc (www.ximian.com/)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 802ced9..20f1a9d 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 2001 Ximian Inc (www.ximian.com/)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -76,7 +76,7 @@ camel_spool_store_class_init (CamelSpoolStoreClass *camel_spool_store_class)
 {
        CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS (camel_spool_store_class);
        CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS (camel_spool_store_class);
-       
+
        parent_class = CAMEL_STORE_CLASS(camel_mbox_store_get_type());
 
        /* virtual method overload */
@@ -98,7 +98,7 @@ CamelType
 camel_spool_store_get_type (void)
 {
        static CamelType camel_spool_store_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_spool_store_type == CAMEL_INVALID_TYPE)       {
                camel_spool_store_type = camel_type_register (camel_mbox_store_get_type(), "CamelSpoolStore",
                                                             sizeof (CamelSpoolStore),
@@ -108,7 +108,7 @@ camel_spool_store_get_type (void)
                                                             NULL,
                                                             NULL);
        }
-       
+
        return camel_spool_store_type;
 }
 
@@ -348,16 +348,16 @@ static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const ch
        }
 
        if (path != NULL) {
-               fi = spool_new_fi(store, parent, fip, path, CAMEL_FOLDER_NOSELECT);     
+               fi = spool_new_fi(store, parent, fip, path, CAMEL_FOLDER_NOSELECT);
                fip = &fi->child;
                parent = fi;
        }
-       
+
        while ( (d = readdir(dir)) ) {
                if (strcmp(d->d_name, ".") == 0
                    || strcmp(d->d_name, "..") == 0)
                        continue;
-               
+
                tmp = g_strdup_printf("%s/%s", name, d->d_name);
                if (stat(tmp, &st) == 0) {
                        if (path)
@@ -389,11 +389,11 @@ static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const ch
 
                        } else if (S_ISDIR(st.st_mode)) {
                                struct _inode in = { st.st_dev, st.st_ino };
-                       
+
                                /* see if we've visited already */
                                if (g_hash_table_lookup(visited, &in) == NULL) {
                                        struct _inode *inew = g_malloc(sizeof(*inew));
-                               
+
                                        *inew = in;
                                        g_hash_table_insert(visited, inew, inew);
 
@@ -425,7 +425,7 @@ static guint inode_hash(const void *d)
 static gboolean inode_equal(const void *a, const void *b)
 {
        const struct _inode *v1 = a, *v2 = b;
-       
+
        return v1->inode == v2->inode && v1->dnode == v2->dnode;
 }
 
index 708852d..3ba1c1b 100644 (file)
@@ -4,8 +4,8 @@
  *
  * Copyright (C) 2001 Ximian Inc (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -38,7 +38,7 @@ typedef enum _camel_spool_store_t {
 } camel_spool_store_t;
 
 typedef struct {
-       CamelMboxStore parent_object;   
+       CamelMboxStore parent_object;
 
        camel_spool_store_t type;
 } CamelSpoolStore;
index 810f18a..a49c1fa 100644 (file)
@@ -60,7 +60,7 @@ CamelType
 camel_spool_summary_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_mbox_summary_get_type(), "CamelSpoolSummary",
                                           sizeof (CamelSpoolSummary),
@@ -70,7 +70,7 @@ camel_spool_summary_get_type(void)
                                           (CamelObjectInitFunc) camel_spool_summary_init,
                                           (CamelObjectFinalizeFunc) camel_spool_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -92,7 +92,7 @@ static void
 camel_spool_summary_init(CamelSpoolSummary *obj)
 {
        struct _CamelFolderSummary *s = (CamelFolderSummary *)obj;
-       
+
        /* message info size is from mbox parent */
 
        /* and a unique file version */
@@ -278,15 +278,15 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
                unlink(tmpname);
 
        camel_operation_end(NULL);
-               
+
        return 0;
  error:
        if (fd != -1)
                close(fd);
-       
+
        if (fdout != -1)
                close(fdout);
-       
+
        if (tmpname[0] != '\0')
                unlink(tmpname);
 
@@ -320,7 +320,7 @@ spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, C
                d(printf("Have to add new headers, re-syncing from the start to accomplish this\n"));
                if (((CamelMboxSummaryClass *)((CamelObject *)cls)->klass)->sync_full((CamelMboxSummary *)cls, FALSE, changeinfo, ex) == -1)
                        return -1;
-               
+
                if (stat(cls->folder_path, &st) == -1) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                              _("Unknown error: %s"),
index b23ba22..896c227 100644 (file)
@@ -38,7 +38,7 @@ typedef struct _CamelSpoolSummaryClass CamelSpoolSummaryClass;
 
 struct _CamelSpoolSummary {
        CamelMboxSummary parent;
-       
+
 };
 
 struct _CamelSpoolSummaryClass {
index 99228c3..baf058a 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-auth.c : authentication for nntp */
 
-/* 
+/*
  *
  * Copyright (C) 2000 Ximian, Inc. <toshok@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -42,16 +42,16 @@ camel_nntp_auth_authenticate (CamelNNTPStore *store, CamelException *ex)
 
        if (!service->url->authmech && !service->url->passwd) {
                gchar *prompt;
-                       
+
                prompt = g_strdup_printf (_("Please enter the NNTP password for %s@%s"),
                                          service->url->user, service->url->host);
                service->url->passwd =
                        camel_session_get_password (session, prompt,
                                                    TRUE, service, "password", ex);
                g_free (prompt);
-                       
+
                if (!service->url->passwd) {
-                       camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 
+                       camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
                                             "You didn\'t enter a password.");
                        resp = 666;
                        goto done;
index ab690c3..0fc922c 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-auth.h : authentication for nntp */
 
-/* 
+/*
  *
- * Author : Chris Toshok <toshok@ximian.com> 
+ * Author : Chris Toshok <toshok@ximian.com>
  *
  * Copyright (C) 1999 Ximian .
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 1eec629..447bc65 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-folder.c : Class for a news folder
  *
- * Authors : Chris Toshok <toshok@ximian.com> 
+ * Authors : Chris Toshok <toshok@ximian.com>
  *           Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2001-2003 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -83,7 +83,7 @@ nntp_folder_refresh_info_online (CamelFolder *folder, CamelException *ex)
 
        nntp_store = (CamelNNTPStore *) folder->parent_store;
        nntp_folder = (CamelNNTPFolder *) folder;
-       
+
        CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
 
        camel_nntp_command(nntp_store, ex, nntp_folder, &line, NULL);
@@ -92,9 +92,9 @@ nntp_folder_refresh_info_online (CamelFolder *folder, CamelException *ex)
                changes = nntp_folder->changes;
                nntp_folder->changes = camel_folder_change_info_new();
        }
-       
+
        CAMEL_SERVICE_REC_UNLOCK(nntp_store, connect_lock);
-       
+
        if (changes) {
                camel_object_trigger_event ((CamelObject *) folder, "folder_changed", changes);
                camel_folder_change_info_free (changes);
@@ -148,15 +148,15 @@ nntp_folder_download_message (CamelNNTPFolder *nntp_folder, const char *id, cons
        } else if (ret != -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), msgid, line);
        }
-       
+
        return stream;
-       
+
  fail:
        if (errno == EINTR)
                camel_exception_setv (ex, CAMEL_EXCEPTION_USER_CANCEL, _("User canceled"));
        else
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"), msgid, g_strerror (errno));
-       
+
        return NULL;
 }
 
@@ -177,9 +177,9 @@ nntp_folder_cache_message (CamelDiscoFolder *disco_folder, const char *uid, Came
                return;
        }
        *msgid++ = 0;
-       
+
        CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
-       
+
        stream = nntp_folder_download_message ((CamelNNTPFolder *) disco_folder, article, msgid, ex);
        if (stream)
                camel_object_unref (stream);
@@ -199,7 +199,7 @@ nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *e
 
        nntp_store = (CamelNNTPStore *) folder->parent_store;
        nntp_folder = (CamelNNTPFolder *) folder;
-       
+
        article = alloca(strlen(uid)+1);
        strcpy(article, uid);
        msgid = strchr (article, ',');
@@ -211,7 +211,7 @@ nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *e
        *msgid++ = 0;
 
        CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
-       
+
        /* Lookup in cache, NEWS is global messageid's so use a global cache path */
        stream = camel_data_cache_get (nntp_store->cache, "cache", msgid, NULL);
        if (stream == NULL) {
@@ -225,7 +225,7 @@ nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *e
                if (stream == NULL)
                        goto fail;
        }
-       
+
        message = camel_mime_message_new ();
        if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) message, stream) == -1) {
                if (errno == EINTR)
@@ -244,14 +244,14 @@ fail:
        } else {
                changes = NULL;
        }
-       
+
        CAMEL_SERVICE_REC_UNLOCK(nntp_store, connect_lock);
-       
+
        if (changes) {
                camel_object_trigger_event ((CamelObject *) folder, "folder_changed", changes);
                camel_folder_change_info_free (changes);
        }
-               
+
        return message;
 }
 
@@ -260,17 +260,17 @@ nntp_folder_search_by_expression (CamelFolder *folder, const char *expression, C
 {
        CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
        GPtrArray *matches;
-       
+
        CAMEL_NNTP_FOLDER_LOCK(nntp_folder, search_lock);
-       
+
        if (nntp_folder->search == NULL)
                nntp_folder->search = camel_folder_search_new ();
-       
+
        camel_folder_search_set_folder (nntp_folder->search, folder);
        matches = camel_folder_search_search(nntp_folder->search, expression, NULL, ex);
-       
+
        CAMEL_NNTP_FOLDER_UNLOCK(nntp_folder, search_lock);
-       
+
        return matches;
 }
 
@@ -282,17 +282,17 @@ nntp_folder_search_by_uids (CamelFolder *folder, const char *expression, GPtrArr
 
        if (uids->len == 0)
                return g_ptr_array_new();
-       
+
        CAMEL_NNTP_FOLDER_LOCK(folder, search_lock);
-       
+
        if (nntp_folder->search == NULL)
                nntp_folder->search = camel_folder_search_new ();
-       
+
        camel_folder_search_set_folder (nntp_folder->search, folder);
        matches = camel_folder_search_search(nntp_folder->search, expression, uids, ex);
-       
+
        CAMEL_NNTP_FOLDER_UNLOCK(folder, search_lock);
-       
+
        return matches;
 }
 
@@ -300,11 +300,11 @@ static void
 nntp_folder_search_free (CamelFolder *folder, GPtrArray *result)
 {
        CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
-       
+
        camel_folder_search_free_result (nntp_folder->search, result);
 }
 
-static void           
+static void
 nntp_folder_append_message_online (CamelFolder *folder, CamelMimeMessage *mime_message,
                                   const CamelMessageInfo *info, char **appended_uid,
                                   CamelException *ex)
@@ -317,9 +317,9 @@ nntp_folder_append_message_online (CamelFolder *folder, CamelMimeMessage *mime_m
        unsigned int u;
        struct _camel_header_raw *header, *savedhdrs, *n, *tail;
        char *group, *line;
-       
+
        CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
-       
+
        /* send 'POST' command */
        ret = camel_nntp_command (nntp_store, ex, NULL, &line, "post");
        if (ret != 340) {
@@ -332,20 +332,20 @@ nntp_folder_append_message_online (CamelFolder *folder, CamelMimeMessage *mime_m
                CAMEL_SERVICE_REC_UNLOCK(nntp_store, connect_lock);
                return;
        }
-       
+
        /* the 'Newsgroups: ' header */
        group = g_strdup_printf ("Newsgroups: %s\r\n", folder->full_name);
-       
+
        /* setup stream filtering */
        crlffilter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS);
        filtered_stream = camel_stream_filter_new_with_stream (stream);
        camel_stream_filter_add (filtered_stream, crlffilter);
        camel_object_unref (crlffilter);
-       
+
        /* remove mail 'To', 'CC', and 'BCC' headers */
        savedhdrs = NULL;
        tail = (struct _camel_header_raw *) &savedhdrs;
-       
+
        header = (struct _camel_header_raw *) &CAMEL_MIME_PART (mime_message)->headers;
        n = header->next;
        while (n != NULL) {
@@ -357,10 +357,10 @@ nntp_folder_append_message_online (CamelFolder *folder, CamelMimeMessage *mime_m
                } else {
                        header = n;
                }
-               
+
                n = header->next;
        }
-       
+
        /* write the message */
        if (camel_stream_write(stream, group, strlen(group)) == -1
            || camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (mime_message), CAMEL_STREAM (filtered_stream)) == -1
@@ -380,7 +380,7 @@ nntp_folder_append_message_online (CamelFolder *folder, CamelMimeMessage *mime_m
        header->next = savedhdrs;
 
        CAMEL_SERVICE_REC_UNLOCK(nntp_store, connect_lock);
-       
+
        return;
 }
 
@@ -390,7 +390,7 @@ nntp_folder_append_message_offline (CamelFolder *folder, CamelMimeMessage *mime_
                                    CamelException *ex)
 {
        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
-                             _("You cannot post NNTP messages while working offline!"));       
+                             _("You cannot post NNTP messages while working offline!"));
 }
 
 /* I do not know what to do this exactly. Looking at the IMAP implementation for this, it
@@ -404,24 +404,24 @@ nntp_folder_transfer_message (CamelFolder *source, GPtrArray *uids, CamelFolder
                              _("You cannot copy messages from a NNTP folder!"));
 }
 
-static void           
+static void
 nntp_folder_init (CamelNNTPFolder *nntp_folder, CamelNNTPFolderClass *klass)
 {
        struct _CamelNNTPFolderPrivate *p;
-       
+
        nntp_folder->changes = camel_folder_change_info_new ();
        p = nntp_folder->priv = g_malloc0 (sizeof (*nntp_folder->priv));
        p->search_lock = g_mutex_new ();
        p->cache_lock = g_mutex_new ();
 }
 
-static void           
+static void
 nntp_folder_finalise (CamelNNTPFolder *nntp_folder)
 {
        struct _CamelNNTPFolderPrivate *p;
-       
+
        camel_folder_summary_save (((CamelFolder*) nntp_folder)->summary);
-       
+
        p = nntp_folder->priv;
        g_mutex_free (p->search_lock);
        g_mutex_free (p->cache_lock);
@@ -433,16 +433,16 @@ nntp_folder_class_init (CamelNNTPFolderClass *camel_nntp_folder_class)
 {
        CamelDiscoFolderClass *camel_disco_folder_class = CAMEL_DISCO_FOLDER_CLASS (camel_nntp_folder_class);
        CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_nntp_folder_class);
-       
+
        parent_class = CAMEL_DISCO_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_disco_folder_get_type ()));
        folder_class = CAMEL_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_folder_get_type ()));
-       
+
        /* virtual method definition */
-       
+
        /* virtual method overload */
        camel_disco_folder_class->sync_online = nntp_folder_sync_online;
        camel_disco_folder_class->sync_resyncing = nntp_folder_sync_offline;
-       camel_disco_folder_class->sync_offline = nntp_folder_sync_offline;        
+       camel_disco_folder_class->sync_offline = nntp_folder_sync_offline;
        camel_disco_folder_class->cache_message = nntp_folder_cache_message;
        camel_disco_folder_class->append_online = nntp_folder_append_message_online;
        camel_disco_folder_class->append_resyncing = nntp_folder_append_message_online;
@@ -451,7 +451,7 @@ nntp_folder_class_init (CamelNNTPFolderClass *camel_nntp_folder_class)
        camel_disco_folder_class->transfer_resyncing = nntp_folder_transfer_message;
        camel_disco_folder_class->transfer_offline = nntp_folder_transfer_message;
        camel_disco_folder_class->refresh_info_online = nntp_folder_refresh_info_online;
-       
+
        camel_folder_class->set_message_flags = nntp_folder_set_message_flags;
        camel_folder_class->get_message = nntp_folder_get_message;
        camel_folder_class->search_by_expression = nntp_folder_search_by_expression;
@@ -463,7 +463,7 @@ CamelType
 camel_nntp_folder_get_type (void)
 {
        static CamelType camel_nntp_folder_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_nntp_folder_type == CAMEL_INVALID_TYPE)       {
                camel_nntp_folder_type = camel_type_register (CAMEL_DISCO_FOLDER_TYPE, "CamelNNTPFolder",
                                                              sizeof (CamelNNTPFolder),
@@ -473,7 +473,7 @@ camel_nntp_folder_get_type (void)
                                                              (CamelObjectInitFunc) nntp_folder_init,
                                                              (CamelObjectFinalizeFunc) nntp_folder_finalise);
        }
-       
+
        return camel_nntp_folder_type;
 }
 
@@ -486,24 +486,24 @@ camel_nntp_folder_new (CamelStore *parent, const char *folder_name, CamelExcepti
        CamelService *service;
        CamelStoreInfo *si;
        gboolean subscribed = TRUE;
-       
+
        service = (CamelService *) parent;
        root = camel_session_get_storage_path (service->session, service, ex);
        if (root == NULL)
                return NULL;
-       
+
        /* If this doesn't work, stuff wont save, but let it continue anyway */
        g_mkdir_with_parents (root, 0777);
-       
+
        folder = (CamelFolder *) camel_object_new (CAMEL_NNTP_FOLDER_TYPE);
        nntp_folder = (CamelNNTPFolder *)folder;
-       
+
        camel_folder_construct (folder, parent, folder_name, folder_name);
        folder->folder_flags |= CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY|CAMEL_FOLDER_HAS_SEARCH_CAPABILITY;
-       
+
        nntp_folder->storage_path = g_build_filename (root, folder->full_name, NULL);
        g_free (root);
-       
+
        root = g_strdup_printf ("%s.cmeta", nntp_folder->storage_path);
        camel_object_set(nntp_folder, NULL, CAMEL_OBJECT_STATE_FILE, root, NULL);
        camel_object_state_read(nntp_folder);
@@ -513,13 +513,13 @@ camel_nntp_folder_new (CamelStore *parent, const char *folder_name, CamelExcepti
        folder->summary = (CamelFolderSummary *) camel_nntp_summary_new (folder, root);
        g_free(root);
        camel_folder_summary_load (folder->summary);
-       
+
        si = camel_store_summary_path ((CamelStoreSummary *) ((CamelNNTPStore*) parent)->summary, folder_name);
        if (si) {
                subscribed = (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) != 0;
                camel_store_summary_info_free ((CamelStoreSummary *) ((CamelNNTPStore*) parent)->summary, si);
        }
-       
+
        if (subscribed) {
                camel_folder_refresh_info(folder, ex);
                if (camel_exception_is_set(ex)) {
@@ -527,6 +527,6 @@ camel_nntp_folder_new (CamelStore *parent, const char *folder_name, CamelExcepti
                        folder = NULL;
                }
         }
-       
+
        return folder;
 }
index 2829804..f07fbc9 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-folder.h : NNTP group (folder) support. */
 
-/* 
+/*
  *
- * Author : Chris Toshok <toshok@ximian.com> 
+ * Author : Chris Toshok <toshok@ximian.com>
  *
  * Copyright (C) 2000 Ximian .
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -51,8 +51,8 @@ typedef struct _CamelNNTPFolder {
 typedef struct _CamelNNTPFolderClass {
        CamelDiscoFolderClass parent;
 
-       /* Virtual methods */   
-       
+       /* Virtual methods */
+
 } CamelNNTPFolderClass;
 
 /* public methods */
index e89af17..b0a6ab7 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-grouplist.c : getting/updating the list of newsgroups on the server. */
 
-/* 
- * Author : Chris Toshok <toshok@ximian.com> 
+/*
+ * Author : Chris Toshok <toshok@ximian.com>
  *
  * Copyright (C) 2000 Ximian .
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -75,7 +75,7 @@ camel_nntp_get_grouplist_from_server (CamelNNTPStore *store, CamelException *ex)
                        entry->low = atoi (split_line[2]);
 
                        g_strfreev (split_line);
-                       
+
                        list->group_list = g_list_prepend (list->group_list, entry);
                }
        }
index 68e501a..045a962 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-grouplist.h : getting/updating the list of newsgroups on the server. */
 
-/* 
- * Author : Chris Toshok <toshok@ximian.com> 
+/*
+ * Author : Chris Toshok <toshok@ximian.com>
  *
  * Copyright (C) 2000 Ximian .
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 19c3e4c..e3c41d8 100644 (file)
@@ -122,7 +122,7 @@ camel_nntp_newsrc_group_mark_range_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *gr
                for (i = 0; i < group->ranges->len; i ++) {
                        guint range_low = g_array_index (group->ranges, ArticleRange, i).low;
                        guint range_high = g_array_index (group->ranges, ArticleRange, i).high;
-                       
+
                        /* if it's already part of a range, return immediately. */
                        if (low >= range_low &&
                            low <= range_high &&
@@ -185,7 +185,7 @@ camel_nntp_newsrc_group_mark_range_read(CamelNNTPNewsrc *newsrc, NewsrcGroup *gr
                tmp_range.high = high;
                group->ranges = g_array_append_val (group->ranges, tmp_range);
                newsrc->dirty = TRUE;
-       } 
+       }
 }
 
 int
@@ -268,7 +268,7 @@ camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc, const char *group_na
 
        if (group) {
                for (i = 0; i < group->ranges->len; i++) {
-                       if (num >= g_array_index (group->ranges, ArticleRange, i).low && 
+                       if (num >= g_array_index (group->ranges, ArticleRange, i).low &&
                            num <= g_array_index (group->ranges, ArticleRange, i).high) {
                                ret = TRUE;
                                break;
@@ -281,7 +281,7 @@ camel_nntp_newsrc_article_is_read (CamelNNTPNewsrc *newsrc, const char *group_na
        return FALSE;
 }
 
-gboolean  
+gboolean
 camel_nntp_newsrc_group_is_subscribed (CamelNNTPNewsrc *newsrc, const char *group_name)
 {
        NewsrcGroup *group;
@@ -453,7 +453,7 @@ camel_nntp_newsrc_write_group_line(gpointer key, NewsrcGroup *group, struct news
        fprintf (fp, "\n");
 }
 
-void 
+void
 camel_nntp_newsrc_write_to_file(CamelNNTPNewsrc *newsrc, FILE *fp)
 {
        struct newsrc_fp newsrc_fp;
@@ -574,7 +574,7 @@ get_line (char *buf, char **p)
                        return NULL;
 
                (*p) ++;
-       
+
                /* if we just incremented to the end of the buffer, return NULL */
                if (**p == '\0')
                        return NULL;
@@ -614,7 +614,7 @@ camel_nntp_newsrc_read_for_server (const char *server)
        newsrc->filename = filename;
        newsrc->groups = g_hash_table_new (g_str_hash, g_str_equal);
        newsrc->lock = g_mutex_new();
-       
+
        if ((fd = g_open(filename, O_RDONLY, 0)) == -1) {
                g_warning ("~/.newsrc-%s not present.\n", server);
                return newsrc;
index cb9169e..5787d92 100644 (file)
@@ -5,8 +5,8 @@
  *
  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 3197e31..a27a447 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-provider.c: nntp provider registration code */
 
-/* 
+/*
  * Authors :
  *   Chris Toshok <toshok@ximian.com>
  *
  * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -89,7 +89,7 @@ camel_provider_module_init(void)
        news_provider.url_equal = nntp_url_equal;
        news_provider.authtypes = g_list_append (NULL, &camel_nntp_password_authtype);
        news_provider.translation_domain = GETTEXT_PACKAGE;
-       
+
        camel_provider_register(&news_provider);
 }
 
@@ -109,7 +109,7 @@ nntp_url_hash (gconstpointer key)
        add_hash (&hash, u->user);
        add_hash (&hash, u->host);
        hash ^= u->port;
-       
+
        return hash;
 }
 
@@ -122,7 +122,7 @@ check_equal (char *s1, char *s2)
                else
                        return FALSE;
        }
-       
+
        if (s2 == NULL)
                return FALSE;
 
@@ -133,7 +133,7 @@ static gint
 nntp_url_equal (gconstpointer a, gconstpointer b)
 {
        const CamelURL *u1 = a, *u2 = b;
-       
+
        return check_equal(u1->protocol, u2->protocol)
                && check_equal (u1->user, u2->user)
                && check_equal (u1->host, u2->host)
index f74753a..74e5011 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-resp-codes.h : #defines for all the response codes we care about */
 
-/* 
+/*
  *
  * Copyright (C) 2000 Ximian, Inc. <toshok@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 3b5f479..db52644 100644 (file)
@@ -108,7 +108,7 @@ CamelType
 camel_nntp_store_summary_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                camel_nntp_store_summary_parent = (CamelStoreSummaryClass *)camel_store_summary_get_type();
                type = camel_type_register((CamelType)camel_nntp_store_summary_parent, "CamelNNTPStoreSummary",
@@ -119,7 +119,7 @@ camel_nntp_store_summary_get_type (void)
                                           (CamelObjectInitFunc) camel_nntp_store_summary_init,
                                           (CamelObjectFinalizeFunc) camel_nntp_store_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -155,7 +155,7 @@ camel_nntp_store_summary_full_name(CamelNNTPStoreSummary *s, const char *full_na
 {
        int count, i;
        CamelNNTPStoreInfo *info;
-       
+
        count = camel_store_summary_count ((CamelStoreSummary *) s);
        for (i = 0; i < count; i++) {
                info = (CamelNNTPStoreInfo *)camel_store_summary_index ((CamelStoreSummary *) s, i);
@@ -165,7 +165,7 @@ camel_nntp_store_summary_full_name(CamelNNTPStoreSummary *s, const char *full_na
                        camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *)info);
                }
        }
-       
+
        return NULL;
 }
 
@@ -190,7 +190,7 @@ camel_nntp_store_summary_full_to_path (CamelNNTPStoreSummary *s, const char *ful
                *p = 0;
        } else
                path = (char *) full_name;
-       
+
        return camel_utf7_utf8 (path);
 }
 
@@ -214,7 +214,7 @@ camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *pat
        int state=0;
        char *subpath, *last = NULL;
        CamelStoreInfo *si;
-       
+
        /* check to see if we have a subpath of path already defined */
        subpath = g_alloca (strlen (path) + 1);
        strcpy (subpath, path);
@@ -226,20 +226,20 @@ camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *pat
                                *last = 0;
                }
        } while (si == NULL && last);
-       
+
        /* path is already present, use the raw version we have */
        if (si && strlen (subpath) == strlen (path)) {
                f = g_strdup (camel_nntp_store_info_full_name (s, si));
                camel_store_summary_info_free ((CamelStoreSummary *) s, si);
                return f;
        }
-       
+
        f = full = g_alloca (strlen (path)*2+1);
        if (si)
                p = path + strlen (subpath);
        else
                p = path;
-       
+
        while ((c = camel_utf8_getc ((const unsigned char **) &p))) {
                switch (state) {
                case 0:
@@ -263,7 +263,7 @@ camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *pat
                }
        }
        camel_utf8_putc ((unsigned char **) &f, c);
-       
+
        /* merge old path part if required */
        f = camel_utf8_utf7 (full);
        if (si) {
@@ -272,7 +272,7 @@ camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *pat
                camel_store_summary_info_free ((CamelStoreSummary *) s, si);
                f = full;
        }
-       
+
        return f;
 }
 
@@ -283,31 +283,31 @@ camel_nntp_store_summary_add_from_full (CamelNNTPStoreSummary *s, const char *fu
        char *pathu8;
        int len;
        char *full_name;
-       
+
        d(printf("adding full name '%s' '%c'\n", full, dir_sep));
-       
+
        len = strlen (full);
        full_name = g_alloca (len+1);
        strcpy(full_name, full);
        if (full_name[len-1] == dir_sep)
                full_name[len-1] = 0;
-       
+
        info = camel_nntp_store_summary_full_name (s, full_name);
        if (info) {
                camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
                d(printf("  already there\n"));
                return info;
        }
-       
+
        pathu8 = camel_nntp_store_summary_full_to_path (s, full_name, dir_sep);
-       
+
        info = (CamelNNTPStoreInfo *) camel_store_summary_add_from_path ((CamelStoreSummary *) s, pathu8);
        if (info) {
                d(printf("  '%s' -> '%s'\n", pathu8, full_name));
                camel_store_info_set_string((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_NNTP_STORE_INFO_FULL_NAME, full_name);
        } else
                d(printf("  failed\n"));
-       
+
        return info;
 }
 
@@ -316,21 +316,21 @@ summary_header_load (CamelStoreSummary *s, FILE *in)
 {
        CamelNNTPStoreSummary *is = (CamelNNTPStoreSummary *) s;
        gint32 version, nil;
-       
+
        if (camel_nntp_store_summary_parent->summary_header_load ((CamelStoreSummary *) s, in) == -1
            || camel_file_util_decode_fixed_int32 (in, &version) == -1)
                return -1;
-       
+
        is->version = version;
-       
+
        if (version < CAMEL_NNTP_STORE_SUMMARY_VERSION_0) {
                g_warning("Store summary header version too low");
                return -1;
        }
-       
+
        if (fread (is->last_newslist, 1, NNTP_DATE_SIZE, in) < NNTP_DATE_SIZE)
                return -1;
-       
+
        camel_file_util_decode_fixed_int32 (in, &nil);
 
        return 0;
@@ -340,14 +340,14 @@ static int
 summary_header_save (CamelStoreSummary *s, FILE *out)
 {
        CamelNNTPStoreSummary *is = (CamelNNTPStoreSummary *) s;
-       
+
        /* always write as latest version */
        if (camel_nntp_store_summary_parent->summary_header_save ((CamelStoreSummary *) s, out) == -1
            || camel_file_util_encode_fixed_int32 (out, CAMEL_NNTP_STORE_SUMMARY_VERSION) == -1
            || fwrite (is->last_newslist, 1, NNTP_DATE_SIZE, out) < NNTP_DATE_SIZE
            || camel_file_util_encode_fixed_int32 (out, 0) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -355,7 +355,7 @@ static CamelStoreInfo *
 store_info_load (CamelStoreSummary *s, FILE *in)
 {
        CamelNNTPStoreInfo *ni;
-       
+
        ni = (CamelNNTPStoreInfo *) camel_nntp_store_summary_parent->store_info_load (s, in);
        if (ni) {
                if (camel_file_util_decode_string (in, &ni->full_name) == -1) {
@@ -371,7 +371,7 @@ store_info_load (CamelStoreSummary *s, FILE *in)
                }
                /* set the URL */
        }
-       
+
        return (CamelStoreInfo *) ni;
 }
 
@@ -379,13 +379,13 @@ static int
 store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
 {
        CamelNNTPStoreInfo *isi = (CamelNNTPStoreInfo *)mi;
-       
+
        if (camel_nntp_store_summary_parent->store_info_save (s, out, mi) == -1
            || camel_file_util_encode_string (out, isi->full_name) == -1
            || camel_file_util_encode_uint32(out, isi->first) == -1
            || camel_file_util_encode_uint32(out, isi->last) == -1)
                return -1;
-       
+
        return 0;
 }
 
@@ -393,7 +393,7 @@ static void
 store_info_free (CamelStoreSummary *s, CamelStoreInfo *mi)
 {
        CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *) mi;
-       
+
        g_free (nsi->full_name);
        camel_nntp_store_summary_parent->store_info_free (s, mi);
 }
@@ -402,11 +402,11 @@ static const char *
 store_info_string(CamelStoreSummary *s, const CamelStoreInfo *mi, int type)
 {
        CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *)mi;
-       
+
        /* FIXME: Locks? */
-       
+
        g_assert (mi != NULL);
-       
+
        switch (type) {
        case CAMEL_NNTP_STORE_INFO_FULL_NAME:
                return nsi->full_name;
@@ -419,9 +419,9 @@ static void
 store_info_set_string(CamelStoreSummary *s, CamelStoreInfo *mi, int type, const char *str)
 {
        CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *)mi;
-       
+
        g_assert(mi != NULL);
-       
+
        switch (type) {
        case CAMEL_NNTP_STORE_INFO_FULL_NAME:
                d(printf("Set full name %s -> %s\n", nsi->full_name, str));
index 868a1c8..cddf8af 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  *
  * Copyright (C) 2001-2003 Ximian, Inc. <www.ximain.com>
  *
  * Authors: Christopher Toshok <toshok@ximian.com>
  *         Michael Zucchi <notzed@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -168,7 +168,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
        unsigned char *buf;
        unsigned int len;
        char *path;
-       
+
        CAMEL_SERVICE_REC_LOCK(store, connect_lock);
 
        if (ssl_mode != MODE_CLEAR) {
@@ -182,13 +182,13 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                      _("Could not connect to %s: %s"),
                                      service->url->host, _("SSL unavailable"));
-               
+
                goto fail;
 #endif /* HAVE_SSL */
        } else {
                tcp_stream = camel_tcp_stream_raw_new ();
        }
-       
+
        if (camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai) == -1) {
                if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
@@ -198,15 +198,15 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                                              _("Could not connect to %s: %s"),
                                              service->url->host,
                                              g_strerror (errno));
-               
+
                camel_object_unref (tcp_stream);
-               
+
                goto fail;
        }
-       
+
        store->stream = (CamelNNTPStream *) camel_nntp_stream_new (tcp_stream);
        camel_object_unref (tcp_stream);
-       
+
        /* Read the greeting, if any. */
        if (camel_nntp_stream_line (store->stream, &buf, &len) == -1) {
                if (errno == EINTR)
@@ -216,22 +216,22 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                              _("Could not read greeting from %s: %s"),
                                              service->url->host, g_strerror (errno));
-               
+
                camel_object_unref (store->stream);
                store->stream = NULL;
-               
+
                goto fail;
        }
-       
+
        len = strtoul (buf, (char **) &buf, 10);
        if (len != 200 && len != 201) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("NNTP server %s returned error code %d: %s"),
                                      service->url->host, len, buf);
-               
+
                camel_object_unref (store->stream);
                store->stream = NULL;
-               
+
                goto fail;
        }
 
@@ -240,7 +240,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
            && service->url->user[0]
            && camel_nntp_try_authenticate(store, ex) != NNTP_AUTH_ACCEPTED)
                goto fail;
-       
+
        /* set 'reader' mode & ignore return code, also ping the server, inn goes offline very quickly otherwise */
        if (camel_nntp_raw_command_auth (store, ex, (char **) &buf, "mode reader") == -1
            || camel_nntp_raw_command_auth (store, ex, (char **) &buf, "date") == -1)
@@ -248,16 +248,16 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
 
        if (xover_setup(store, ex) == -1)
                goto fail;
-       
+
        path = g_build_filename (store->storage_path, ".ev-journal", NULL);
        disco_store->diary = camel_disco_diary_new (disco_store, path, ex);
-       g_free (path);  
-       
+       g_free (path);
+
        retval = TRUE;
 
        g_free(store->current_folder);
        store->current_folder = NULL;
-       
+
  fail:
        CAMEL_SERVICE_REC_UNLOCK(store, connect_lock);
        return retval;
@@ -284,7 +284,7 @@ nntp_connect_online (CamelService *service, CamelException *ex)
        int mode, ret, i;
        char *serv;
        const char *port;
-       
+
        if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
                for (i = 0; ssl_options[i].value; i++)
                        if (!strcmp (ssl_options[i].value, ssl_mode))
@@ -297,13 +297,13 @@ nntp_connect_online (CamelService *service, CamelException *ex)
                serv = "nntp";
                port = NNTP_PORT;
        }
-       
+
        if (service->url->port) {
                serv = g_alloca (16);
                sprintf (serv, "%d", service->url->port);
                port = NULL;
        }
-       
+
        memset (&hints, 0, sizeof (hints));
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_family = PF_UNSPEC;
@@ -314,11 +314,11 @@ nntp_connect_online (CamelService *service, CamelException *ex)
        }
        if (ai == NULL)
                return FALSE;
-       
+
        ret = connect_to_server (service, ai, mode, ex);
-       
+
        camel_freeaddrinfo (ai);
-       
+
        return ret;
 }
 
@@ -328,28 +328,28 @@ nntp_connect_offline (CamelService *service, CamelException *ex)
        CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(service);
        CamelDiscoStore *disco_store = (CamelDiscoStore *) nntp_store;
        char *path;
-       
+
        if (nntp_store->storage_path == NULL)
                return FALSE;
-       
+
        /* setup store-wide cache */
        if (nntp_store->cache == NULL) {
                nntp_store->cache = camel_data_cache_new (nntp_store->storage_path, 0, ex);
                if (nntp_store->cache == NULL)
                        return FALSE;
-               
+
                /* Default cache expiry - 2 weeks old, or not visited in 5 days */
                camel_data_cache_set_expire_age (nntp_store->cache, 60*60*24*14);
                camel_data_cache_set_expire_access (nntp_store->cache, 60*60*24*5);
-       }       
-       
+       }
+
        path = g_build_filename (nntp_store->storage_path, ".ev-journal", NULL);
        disco_store->diary = camel_disco_diary_new (disco_store, path, ex);
        g_free (path);
-       
+
        if (!disco_store->diary)
                return FALSE;
-       
+
        return TRUE;
 }
 
@@ -358,26 +358,26 @@ nntp_disconnect_online (CamelService *service, gboolean clean, CamelException *e
 {
        CamelNNTPStore *store = CAMEL_NNTP_STORE (service);
        char *line;
-       
+
        CAMEL_SERVICE_REC_LOCK(store, connect_lock);
-       
+
        if (clean) {
                camel_nntp_raw_command (store, ex, &line, "quit");
                camel_exception_clear(ex);
        }
-       
+
        if (!service_class->disconnect (service, clean, ex)) {
                CAMEL_SERVICE_REC_UNLOCK(store, connect_lock);
                return FALSE;
        }
-       
+
        camel_object_unref (store->stream);
        store->stream = NULL;
        g_free(store->current_folder);
        store->current_folder = NULL;
 
        CAMEL_SERVICE_REC_UNLOCK(store, connect_lock);
-       
+
        return TRUE;
 }
 
@@ -385,15 +385,15 @@ static gboolean
 nntp_disconnect_offline (CamelService *service, gboolean clean, CamelException *ex)
 {
        CamelDiscoStore *disco = CAMEL_DISCO_STORE(service);
-       
+
        if (!service_class->disconnect (service, clean, ex))
                return FALSE;
-       
+
        if (disco->diary) {
                camel_object_unref (disco->diary);
                disco->diary = NULL;
        }
-       
+
        return TRUE;
 }
 
@@ -404,7 +404,7 @@ nntp_store_get_name (CamelService *service, gboolean brief)
                return g_strdup_printf ("%s", service->url->host);
        else
                return g_strdup_printf (_("USENET News via %s"), service->url->host);
-       
+
 }
 
 extern CamelServiceAuthType camel_nntp_password_authtype;
@@ -420,13 +420,13 @@ nntp_get_folder(CamelStore *store, const char *folder_name, guint32 flags, Camel
 {
        CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
        CamelFolder *folder;
-       
+
        CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
-       
+
        folder = camel_nntp_folder_new(store, folder_name, ex);
-       
+
        CAMEL_SERVICE_REC_UNLOCK(nntp_store, connect_lock);
-       
+
        return folder;
 }
 
@@ -440,20 +440,20 @@ nntp_newsgroup_name_short (const char *name)
 {
        char *resptr, *tmp;
        const char *ptr2;
-       
+
        resptr = tmp = g_malloc0 (strlen (name) + 1);
-       
+
        while ((ptr2 = strchr (name, '.'))) {
                if (ptr2 == name) {
                        name++;
                        continue;
                }
-               
+
                *resptr++ = *name;
                *resptr++ = '.';
                name = ptr2 + 1;
        }
-       
+
        strcpy (resptr, name);
        return tmp;
 }
@@ -471,14 +471,14 @@ nntp_folder_info_from_store_info (CamelNNTPStore *store, gboolean short_notation
        CamelFolderInfo *fi = g_malloc0(sizeof(*fi));
        CamelURL *url;
        char *path;
-       
+
        fi->full_name = g_strdup (si->path);
-       
+
        if (short_notation)
                fi->name = nntp_newsgroup_name_short (si->path);
        else
                fi->name = g_strdup (si->path);
-       
+
        fi->unread = si->unread;
        fi->total = si->total;
        fi->flags = si->flags;
@@ -487,7 +487,7 @@ nntp_folder_info_from_store_info (CamelNNTPStore *store, gboolean short_notation
        url = camel_url_new_with_base (base_url, path);
        fi->uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
        camel_url_free (url);
-       
+
        return fi;
 }
 
@@ -500,20 +500,20 @@ nntp_folder_info_from_name (CamelNNTPStore *store, gboolean short_notation, cons
        char *path;
 
        fi->full_name = g_strdup (name);
-       
+
        if (short_notation)
                fi->name = nntp_newsgroup_name_short (name);
        else
                fi->name = g_strdup (name);
-       
+
        fi->unread = -1;
-       
+
        path = alloca(strlen(fi->full_name)+2);
        sprintf(path, "/%s", fi->full_name);
        url = camel_url_new_with_base (base_url, path);
        fi->uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
        camel_url_free (url);
-       
+
        return fi;
 }
 
@@ -588,11 +588,11 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const char *top, g
        int i;
        CamelStoreInfo *si;
        CamelFolderInfo *first = NULL, *last = NULL, *fi = NULL;
-       
+
        /* since we do not do a tree, any request that is not for root is sure to give no results */
        if (top != NULL && top[0] != 0)
                return NULL;
-       
+
        for (i=0;(si = camel_store_summary_index ((CamelStoreSummary *) store->summary, i));i++) {
                if (si == NULL)
                        continue;
@@ -633,7 +633,7 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const char *top, g
                }
                camel_store_summary_info_free ((CamelStoreSummary *) store->summary, si);
        }
-       
+
        return first;
 }
 
@@ -652,7 +652,7 @@ nntp_store_get_cached_folder_info (CamelNNTPStore *store, const char *orig_top,
        char *tmpname;
        char *top = g_strconcat(orig_top?orig_top:"", ".", NULL);
        int toplen = strlen(top);
-       
+
        for (i = 0; (si = camel_store_summary_index ((CamelStoreSummary *) store->summary, i)); i++) {
                if ((subscribed_or_flag || (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED))
                    && (root_or_flag || strncmp (si->path, top, toplen) == 0)) {
@@ -670,7 +670,7 @@ nntp_store_get_cached_folder_info (CamelNNTPStore *store, const char *orig_top,
                                   the item we added last, we need to add a portion of this item to
                                   the list as a placeholder */
                                if (!last ||
-                                   strncmp(si->path, last->full_name, strlen(last->full_name)) != 0 || 
+                                   strncmp(si->path, last->full_name, strlen(last->full_name)) != 0 ||
                                    si->path[strlen(last->full_name)] != '.') {
                                        tmpname = g_strdup(si->path);
                                        *(strchr(tmpname + toplen, '.')) = '\0';
@@ -697,7 +697,7 @@ nntp_store_get_cached_folder_info (CamelNNTPStore *store, const char *orig_top,
                }
                camel_store_summary_info_free((CamelStoreSummary *)store->summary, si);
        }
-       
+
        g_free(top);
        return first;
 }
@@ -711,12 +711,12 @@ nntp_get_date(CamelNNTPStore *nntp_store, CamelException *ex)
        char *ptr;
 
        nntp_store->summary->last_newslist[0] = 0;
-       
+
        if (ret == 111) {
                ptr = line + 3;
                while (*ptr == ' ' || *ptr == '\t')
                        ptr++;
-               
+
                if (strlen (ptr) == NNTP_DATE_SIZE) {
                        memcpy (nntp_store->summary->last_newslist, ptr, NNTP_DATE_SIZE);
                        return TRUE;
@@ -751,10 +751,10 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guin
        CamelFolderInfo *fi = NULL;
 
        CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
-       
+
        if (top == NULL)
                top = "";
-       
+
        if (online && (top == NULL || top[0] == 0)) {
                /* we may need to update */
                if (summary->last_newslist[0] != 0) {
@@ -767,7 +767,7 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guin
                        /* Some servers don't support date (!), so fallback if they dont */
                        if (!nntp_get_date (nntp_store, NULL))
                                goto do_complete_list_nodate;
-                       
+
                        ret = camel_nntp_command (nntp_store, ex, NULL, (char **) &line, "newgroups %s", date);
                        if (ret == -1)
                                goto error;
@@ -809,15 +809,15 @@ nntp_store_get_folder_info_all(CamelNNTPStore *nntp_store, const char *top, guin
                        g_hash_table_foreach(all, store_info_remove, nntp_store->summary);
                        g_hash_table_destroy(all);
                }
-               
+
                /* sort the list */
                g_ptr_array_sort (CAMEL_STORE_SUMMARY (nntp_store->summary)->folders, store_info_sort);
                if (ret < 0)
                        goto error;
-               
+
                camel_store_summary_save ((CamelStoreSummary *) nntp_store->summary);
        }
-       
+
        fi = nntp_store_get_cached_folder_info (nntp_store, top, flags, ex);
  error:
        CAMEL_SERVICE_REC_UNLOCK(nntp_store, connect_lock);
@@ -830,19 +830,19 @@ nntp_get_folder_info (CamelStore *store, const char *top, guint32 flags, gboolea
 {
        CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(store);
        CamelFolderInfo *first = NULL;
-       
+
        dd(printf("g_f_i: fast %d subscr %d recursive %d online %d top \"%s\"\n",
                flags & CAMEL_STORE_FOLDER_INFO_FAST,
                flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
                flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE,
                online,
                top?top:""));
-       
+
        if (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)
                first = nntp_store_get_subscribed_folder_info (nntp_store, top, flags, ex);
        else
                first = nntp_store_get_folder_info_all (nntp_store, top, flags, online, ex);
-       
+
        return first;
 }
 
@@ -864,7 +864,7 @@ nntp_store_folder_subscribed (CamelStore *store, const char *folder_name)
        CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
        CamelStoreInfo *si;
        int truth = FALSE;
-       
+
        si = camel_store_summary_path ((CamelStoreSummary *) nntp_store->summary, folder_name);
        if (si) {
                truth = (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) != 0;
@@ -881,9 +881,9 @@ nntp_store_subscribe_folder (CamelStore *store, const char *folder_name,
        CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(store);
        CamelStoreInfo *si;
        CamelFolderInfo *fi;
-       
+
        CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
-       
+
        si = camel_store_summary_path(CAMEL_STORE_SUMMARY(nntp_store->summary), folder_name);
        if (!si) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
@@ -902,7 +902,7 @@ nntp_store_subscribe_folder (CamelStore *store, const char *folder_name,
                        return;
                }
        }
-       
+
        CAMEL_SERVICE_REC_UNLOCK(nntp_store, connect_lock);
 }
 
@@ -914,9 +914,9 @@ nntp_store_unsubscribe_folder (CamelStore *store, const char *folder_name,
        CamelFolderInfo *fi;
        CamelStoreInfo *fitem;
        CAMEL_SERVICE_REC_LOCK(nntp_store, connect_lock);
-       
+
        fitem = camel_store_summary_path(CAMEL_STORE_SUMMARY(nntp_store->summary), folder_name);
-       
+
        if (!fitem) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
                                      _("You cannot unsubscribe to this newsgroup:\n\n"
@@ -933,7 +933,7 @@ nntp_store_unsubscribe_folder (CamelStore *store, const char *folder_name,
                        return;
                }
        }
-       
+
        CAMEL_SERVICE_REC_UNLOCK(nntp_store, connect_lock);
 }
 
@@ -971,19 +971,19 @@ nntp_store_finalize (CamelObject *object)
        CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (object);
        struct _CamelNNTPStorePrivate *p = nntp_store->priv;
        struct _xover_header *xover, *xn;
-       
+
        camel_service_disconnect ((CamelService *)object, TRUE, NULL);
-       
+
        if (nntp_store->summary) {
                camel_store_summary_save ((CamelStoreSummary *) nntp_store->summary);
                camel_object_unref (nntp_store->summary);
-       }       
+       }
 
        camel_object_unref (nntp_store->mem);
        nntp_store->mem = NULL;
        if (nntp_store->stream)
                camel_object_unref (nntp_store->stream);
-       
+
        if (nntp_store->base_url)
                g_free (nntp_store->base_url);
        if (nntp_store->storage_path)
@@ -998,7 +998,7 @@ nntp_store_finalize (CamelObject *object)
 
        if (nntp_store->cache)
                camel_object_unref(nntp_store->cache);
-       
+
        g_free(p);
 }
 
@@ -1011,12 +1011,12 @@ nntp_store_class_init (CamelNNTPStoreClass *camel_nntp_store_class)
 
        parent_class = CAMEL_DISCO_STORE_CLASS (camel_type_get_global_classfuncs (camel_disco_store_get_type ()));
        service_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ()));
-       
+
        /* virtual method overload */
        camel_service_class->construct = nntp_construct;
        camel_service_class->query_auth_types = nntp_store_query_auth_types;
        camel_service_class->get_name = nntp_store_get_name;
-       
+
        camel_disco_store_class->can_work_offline = nntp_can_work_offline;
        camel_disco_store_class->connect_online = nntp_connect_online;
        camel_disco_store_class->connect_offline = nntp_connect_offline;
@@ -1025,13 +1025,13 @@ nntp_store_class_init (CamelNNTPStoreClass *camel_nntp_store_class)
        camel_disco_store_class->get_folder_online = nntp_get_folder;
        camel_disco_store_class->get_folder_resyncing = nntp_get_folder;
        camel_disco_store_class->get_folder_offline = nntp_get_folder;
-       
+
        camel_disco_store_class->get_folder_info_online = nntp_get_folder_info_online;
        camel_disco_store_class->get_folder_info_resyncing = nntp_get_folder_info_online;
        camel_disco_store_class->get_folder_info_offline = nntp_get_folder_info_offline;
-       
+
        camel_store_class->free_folder_info = camel_store_free_folder_info_full;
-       
+
        camel_store_class->folder_subscribed = nntp_store_folder_subscribed;
        camel_store_class->subscribe_folder = nntp_store_subscribe_folder;
        camel_store_class->unsubscribe_folder = nntp_store_unsubscribe_folder;
@@ -1050,33 +1050,33 @@ nntp_construct (CamelService *service, CamelSession *session,
        CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(service);
        CamelURL *summary_url;
        char *tmp;
-       
+
        /* construct the parent first */
        CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex);
        if (camel_exception_is_set (ex))
                return;
-       
+
        /* find out the storage path, base url */
        nntp_store->storage_path = camel_session_get_storage_path (session, service, ex);
        if (!nntp_store->storage_path)
                return;
-       
+
        /* FIXME */
        nntp_store->base_url = camel_url_to_string (service->url, (CAMEL_URL_HIDE_PASSWORD |
                                                                   CAMEL_URL_HIDE_PARAMS |
                                                                   CAMEL_URL_HIDE_AUTH));
-       
+
        tmp = g_build_filename (nntp_store->storage_path, ".ev-store-summary", NULL);
        nntp_store->summary = camel_nntp_store_summary_new ();
-       camel_store_summary_set_filename ((CamelStoreSummary *) nntp_store->summary, tmp);      
+       camel_store_summary_set_filename ((CamelStoreSummary *) nntp_store->summary, tmp);
        summary_url = camel_url_new (nntp_store->base_url, NULL);
        camel_store_summary_set_uri_base ((CamelStoreSummary *) nntp_store->summary, summary_url);
        g_free (tmp);
-       
+
        camel_url_free (summary_url);
        if (camel_store_summary_load ((CamelStoreSummary *)nntp_store->summary) == 0)
                ;
-       
+
        /* get options */
        if (camel_url_get_param (url, "show_short_notation"))
                nntp_store->do_short_folder_notation = TRUE;
@@ -1091,7 +1091,7 @@ nntp_construct (CamelService *service, CamelSession *session,
        nntp_store->cache = camel_data_cache_new(nntp_store->storage_path, 0, ex);
        if (nntp_store->cache == NULL)
                return;
-               
+
        /* Default cache expiry - 2 weeks old, or not visited in 5 days */
        camel_data_cache_set_expire_age(nntp_store->cache, 60*60*24*14);
        camel_data_cache_set_expire_access(nntp_store->cache, 60*60*24*5);
@@ -1103,11 +1103,11 @@ nntp_store_init (gpointer object, gpointer klass)
        CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE(object);
        CamelStore *store = CAMEL_STORE (object);
        struct _CamelNNTPStorePrivate *p;
-       
+
        store->flags = CAMEL_STORE_SUBSCRIPTIONS;
-       
+
        nntp_store->mem = (CamelStreamMem *)camel_stream_mem_new();
-       
+
        p = nntp_store->priv = g_malloc0(sizeof(*p));
 }
 
@@ -1115,7 +1115,7 @@ CamelType
 camel_nntp_store_get_type (void)
 {
        static CamelType camel_nntp_store_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_nntp_store_type == CAMEL_INVALID_TYPE) {
                camel_nntp_store_type =
                        camel_type_register (CAMEL_DISCO_STORE_TYPE,
@@ -1127,7 +1127,7 @@ camel_nntp_store_get_type (void)
                                             (CamelObjectInitFunc) nntp_store_init,
                                             (CamelObjectFinalizeFunc) nntp_store_finalize);
        }
-       
+
        return camel_nntp_store_type;
 }
 
@@ -1138,7 +1138,7 @@ camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex)
        CamelSession *session = camel_service_get_session (service);
        int ret;
        char *line = NULL;
-       
+
        if (!service->url->user) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_INVALID_PARAM,
                                     _("Authentication requested but no username provided"));
@@ -1167,7 +1167,7 @@ camel_nntp_try_authenticate (CamelNNTPStore *store, CamelException *ex)
                                                    prompt, "password", CAMEL_SESSION_PASSWORD_SECRET, ex);
                g_free(prompt);
                g_free(base);
-               
+
                if (!service->url->passwd)
                        return -1;
        }
@@ -1198,11 +1198,11 @@ camel_nntp_raw_commandv (CamelNNTPStore *store, CamelException *ex, char **line,
        char *s;
        int d;
        unsigned int u, u2;
-       
+
        g_assert(store->stream->mode != CAMEL_NNTP_STREAM_DATA);
 
        camel_nntp_stream_set_mode(store->stream, CAMEL_NNTP_STREAM_LINE);
-       
+
        ps = p = fmt;
        while ((c = *p++)) {
                switch (c) {
@@ -1241,27 +1241,27 @@ camel_nntp_raw_commandv (CamelNNTPStore *store, CamelException *ex, char **line,
                        }
                }
        }
-       
+
        camel_stream_write ((CamelStream *) store->mem, ps, p-ps-1);
        dd(printf("NNTP_COMMAND: '%.*s'\n", (int)store->mem->buffer->len, store->mem->buffer->data));
        camel_stream_write ((CamelStream *) store->mem, "\r\n", 2);
-       
+
        if (camel_stream_write((CamelStream *) store->stream, store->mem->buffer->data, store->mem->buffer->len) == -1)
                goto ioerror;
 
        /* FIXME: hack */
        camel_stream_reset ((CamelStream *) store->mem);
        g_byte_array_set_size (store->mem->buffer, 0);
-       
+
        if (camel_nntp_stream_line (store->stream, (unsigned char **) line, &u) == -1)
                goto ioerror;
-       
+
        u = strtoul (*line, NULL, 10);
-       
+
        /* Handle all switching to data mode here, to make callers job easier */
        if (u == 215 || (u >= 220 && u <=224) || (u >= 230 && u <= 231))
                camel_nntp_stream_set_mode(store->stream, CAMEL_NNTP_STREAM_DATA);
-       
+
        return u;
 
 ioerror:
@@ -1319,13 +1319,13 @@ camel_nntp_command (CamelNNTPStore *store, CamelException *ex, CamelNNTPFolder *
        va_list ap;
        int ret, retry;
        unsigned int u;
-       
+
        if (((CamelDiscoStore *)store)->status == CAMEL_DISCO_STORE_OFFLINE) {
                camel_exception_setv(ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED,
                                     _("Not connected."));
                return -1;
        }
-       
+
        retry = 0;
        do {
                retry ++;
index c181976..77695fe 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-store.h : class for an nntp store */
 
-/* 
+/*
  *
  * Copyright (C) 2000 Ximian, Inc. <toshok@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -66,23 +66,23 @@ struct _xover_header {
 };
 
 struct _CamelNNTPStore {
-       CamelDiscoStore parent_object;  
-       
+       CamelDiscoStore parent_object;
+
        struct _CamelNNTPStorePrivate *priv;
-       
+
        guint32 extensions;
-       
+
        unsigned int posting_allowed:1;
        unsigned int do_short_folder_notation:1;
        unsigned int folder_hierarchy_relative:1;
 
        struct _CamelNNTPStoreSummary *summary;
-       
+
        struct _CamelNNTPStream *stream;
        struct _CamelStreamMem *mem;
-       
+
        struct _CamelDataCache *cache;
-       
+
        char *current_folder, *storage_path, *base_url;
 
        struct _xover_header *xover;
index bb26bfb..44ae226 100644 (file)
@@ -73,7 +73,7 @@ CamelType
 camel_nntp_summary_get_type(void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register(camel_folder_summary_get_type(), "CamelNNTPSummary",
                                           sizeof (CamelNNTPSummary),
@@ -83,7 +83,7 @@ camel_nntp_summary_get_type(void)
                                           (CamelObjectInitFunc) camel_nntp_summary_init,
                                           (CamelObjectFinalizeFunc) camel_nntp_summary_finalise);
        }
-       
+
        return type;
 }
 
@@ -91,7 +91,7 @@ static void
 camel_nntp_summary_class_init(CamelNNTPSummaryClass *klass)
 {
        CamelFolderSummaryClass *sklass = (CamelFolderSummaryClass *) klass;
-       
+
        camel_nntp_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS(camel_type_get_global_classfuncs(camel_folder_summary_get_type()));
 
        sklass->message_info_new_from_header  = message_info_new_from_header;
@@ -132,7 +132,7 @@ camel_nntp_summary_new(struct _CamelFolder *folder, const char *path)
 
        camel_folder_summary_set_filename((CamelFolderSummary *)cns, path);
        camel_folder_summary_set_build_content((CamelFolderSummary *)cns, FALSE);
-       
+
        return cns;
 }
 
@@ -155,7 +155,7 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
                mi->uid = cns->priv->uid;
                cns->priv->uid = NULL;
        }
-       
+
        return (CamelMessageInfo *)mi;
 }
 
@@ -336,7 +336,7 @@ add_range_head(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high,
                n = strtoul(line, &line, 10);
                if (n != i)
                        g_warning("retrieved message '%u' when i expected '%u'?\n", n, i);
-               
+
                /* FIXME: use camel-mime-utils.c function for parsing msgid? */
                if ((msgid = strchr(line, '<')) && (line = strchr(msgid+1, '>'))){
                        line[1] = 0;
@@ -447,7 +447,7 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelNNTPStore *store, char *lin
                                        count--;
                                        i--;
                                }
-                               
+
                                camel_message_info_free(mi);
                        }
                }
@@ -484,7 +484,7 @@ update:
                                camel_message_info_free(mi);
                        }
                }
-               
+
                if (si->info.unread != unread
                    || si->info.total != count
                    || si->first != f
index 9a9e7fc..672249f 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-grouplist.h : getting/updating the list of newsgroups on the server. */
 
-/* 
- * Author : Chris Toshok <toshok@ximian.com> 
+/*
+ * Author : Chris Toshok <toshok@ximian.com>
  *
  * Copyright (C) 2000 Ximian .
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 1ad13f9..56116d6 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-utils.c : utilities used by the nntp code. */
 
-/* 
- * Author : Chris Toshok <toshok@ximian.com> 
+/*
+ * Author : Chris Toshok <toshok@ximian.com>
  *
  * Copyright (C) 2000 Ximian .
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -74,7 +74,7 @@ get_XOVER_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
                                date = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_DATE].index];
                                message_id = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_MESSAGE_ID].index];
                                bytes = split_line [nntp_store->overview_field [CAMEL_NNTP_OVER_BYTES].index];
-                               
+
                                /* if the overview format flagged this
                                    field as "full", skip over the
                                    preceding field name and colon */
@@ -157,7 +157,7 @@ get_HEAD_headers(CamelNNTPStore *nntp_store, CamelFolder *folder,
                                char *line;
                                int line_length;
 
-                               line = camel_stream_buffer_read_line ( 
+                               line = camel_stream_buffer_read_line (
                                                      CAMEL_STREAM_BUFFER ( nntp_istream ));
                                line_length = strlen ( line );
 
@@ -223,23 +223,23 @@ uid_num (CamelFolderSummary *summary, int index)
        char *brk;
        CamelMessageInfo *minfo;
        int ret;
-       
+
        minfo = camel_folder_summary_index(summary, index);
        if(minfo == NULL)
                return 0;
 
        tmp = g_strdup(camel_message_info_uid(minfo));
        camel_message_info_free(minfo);
-       
+
        if((brk = strchr(tmp, ',')) == NULL)
                ret = 0;
        else {
                *brk = 0;
                ret = atoi(tmp);
        }
-       
+
        g_free(tmp);
-       
+
        return ret;
 }
 
@@ -267,19 +267,19 @@ camel_nntp_get_headers (CamelStore *store,
                if(last_summary < first_message)
                        camel_folder_summary_clear(folder->summary);
                else {
-                       while(uid_num(folder->summary, 0) < first_message) 
+                       while(uid_num(folder->summary, 0) < first_message)
                                camel_folder_summary_remove_index(folder->summary, 0);
-                       
+
                        if(last_summary >= last_message)
                                return;
-                       
+
                        first_message = last_summary;
                }
        }
-                       
+
        if (status == NNTP_NO_SUCH_GROUP) {
                /* XXX throw invalid group exception */
-               camel_exception_setv (ex, 
+               camel_exception_setv (ex,
                                      CAMEL_EXCEPTION_FOLDER_INVALID,
                                      "group %s not found on server",
                                      folder->name);
@@ -295,6 +295,6 @@ camel_nntp_get_headers (CamelStore *store,
 #if 0
                get_HEAD_headers (nntp_store, folder, first_message, last_message, ex);
 #endif
-       }               
+       }
 
 }
index e023e76..8ad9e16 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-nntp-utils.h : Utilities for the NNTP provider */
 
-/* 
+/*
  *
- * Author : Chris Toshok <toshok@ximian.com> 
+ * Author : Chris Toshok <toshok@ximian.com>
  *
  * Copyright (C) 1999 Ximian .
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index c554acb..ceadce2 100644 (file)
@@ -73,7 +73,7 @@ camel_pop3_engine_finalise(CamelPOP3Engine *pe)
 
        if (pe->stream)
                camel_object_unref(pe->stream);
-       
+
        g_list_free(pe->auth);
        if (pe->apop)
                g_free(pe->apop);
@@ -105,12 +105,12 @@ read_greeting (CamelPOP3Engine *pe)
        extern CamelServiceAuthType camel_pop3_apop_authtype;
        unsigned char *line, *apop, *apopend;
        unsigned int len;
-       
+
        /* first, read the greeting */
        if (camel_pop3_stream_line (pe->stream, &line, &len) == -1
            || strncmp ((char *) line, (char *) "+OK", 3) != 0)
                return -1;
-       
+
        if ((apop = (unsigned char *) strchr ((char *) line + 3, '<'))
            && (apopend = (unsigned char *) strchr ((char *) apop, '>'))) {
                apopend[1] = 0;
@@ -118,9 +118,9 @@ read_greeting (CamelPOP3Engine *pe)
                pe->capa = CAMEL_POP3_CAP_APOP;
                pe->auth = g_list_append (pe->auth, &camel_pop3_apop_authtype);
        }
-       
+
        pe->auth = g_list_prepend (pe->auth, &camel_pop3_password_authtype);
-       
+
        return 0;
 }
 
@@ -144,14 +144,14 @@ camel_pop3_engine_new(CamelStream *source, guint32 flags)
        pe->stream = (CamelPOP3Stream *)camel_pop3_stream_new(source);
        pe->state = CAMEL_POP3_ENGINE_AUTH;
        pe->flags = flags;
-       
+
        if (read_greeting (pe) == -1) {
                camel_object_unref (pe);
                return NULL;
        }
-       
+
        get_capabilities (pe);
-       
+
        return pe;
 }
 
@@ -166,7 +166,7 @@ void
 camel_pop3_engine_reget_capabilities (CamelPOP3Engine *engine)
 {
        g_return_if_fail (CAMEL_IS_POP3_ENGINE (engine));
-       
+
        get_capabilities (engine);
 }
 
@@ -228,22 +228,22 @@ static void
 get_capabilities(CamelPOP3Engine *pe)
 {
        CamelPOP3Command *pc;
-       
+
        if (!(pe->flags & CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS)) {
                pc = camel_pop3_engine_command_new(pe, CAMEL_POP3_COMMAND_MULTI, cmd_capa, NULL, "CAPA\r\n");
                while (camel_pop3_engine_iterate(pe, pc) > 0)
                        ;
                camel_pop3_engine_command_free(pe, pc);
-               
+
                if (pe->state == CAMEL_POP3_ENGINE_TRANSACTION && !(pe->capa & CAMEL_POP3_CAP_UIDL)) {
                        /* check for UIDL support manually */
                        pc = camel_pop3_engine_command_new (pe, CAMEL_POP3_COMMAND_SIMPLE, NULL, NULL, "UIDL 1\r\n");
                        while (camel_pop3_engine_iterate (pe, pc) > 0)
                                ;
-                       
+
                        if (pc->state == CAMEL_POP3_COMMAND_OK)
                                pe->capa |= CAMEL_POP3_CAP_UIDL;
-                       
+
                        camel_pop3_engine_command_free (pe, pc);
                }
        }
@@ -331,7 +331,7 @@ camel_pop3_engine_iterate(CamelPOP3Engine *pe, CamelPOP3Command *pcwait)
 
        /* Set next command */
        pe->current = (CamelPOP3Command *)e_dlist_remhead(&pe->active);
-       
+
        /* check the queue for sending any we can now send also */
        pw = (CamelPOP3Command *)pe->queue.head;
        pn = pw->next;
@@ -394,7 +394,7 @@ camel_pop3_engine_command_new(CamelPOP3Engine *pe, guint32 flags, CamelPOP3Comma
        pc->func = func;
        pc->func_data = data;
        pc->flags = flags;
-       
+
        va_start(ap, fmt);
        pc->data = g_strdup_vprintf(fmt, ap);
        pc->state = CAMEL_POP3_COMMAND_IDLE;
index ac2a98e..c12832d 100644 (file)
@@ -93,9 +93,9 @@ struct _CamelPOP3Command {
 
 struct _CamelPOP3Engine {
        CamelObject parent;
-       
+
        guint32 flags;
-       
+
        camel_pop3_engine_t state;
 
        GList *auth;            /* authtypes supported */
index 9eaa450..eefa754 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-pop3-folder.c : class for a pop3 folder */
 
-/* 
+/*
  * Authors:
  *   Dan Winship <danw@ximian.com>
  *   Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -61,17 +61,17 @@ static void
 camel_pop3_folder_class_init (CamelPOP3FolderClass *camel_pop3_folder_class)
 {
        CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS(camel_pop3_folder_class);
-       
+
        parent_class = CAMEL_FOLDER_CLASS(camel_folder_get_type());
-       
+
        /* virtual method overload */
        camel_folder_class->refresh_info = pop3_refresh_info;
        camel_folder_class->sync = pop3_sync;
-       
+
        camel_folder_class->get_message_count = pop3_get_message_count;
        camel_folder_class->get_uids = pop3_get_uids;
        camel_folder_class->free_uids = camel_folder_free_shallow;
-       
+
        camel_folder_class->get_message = pop3_get_message;
        camel_folder_class->set_message_flags = pop3_set_message_flags;
 }
@@ -80,7 +80,7 @@ CamelType
 camel_pop3_folder_get_type (void)
 {
        static CamelType camel_pop3_folder_type = CAMEL_INVALID_TYPE;
-       
+
        if (!camel_pop3_folder_type) {
                camel_pop3_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelPOP3Folder",
                                                              sizeof (CamelPOP3Folder),
@@ -90,7 +90,7 @@ camel_pop3_folder_get_type (void)
                                                              NULL,
                                                              (CamelObjectFinalizeFunc) pop3_finalize);
        }
-       
+
        return camel_pop3_folder_type;
 }
 
@@ -109,11 +109,11 @@ pop3_finalize (CamelObject *object)
                                        ;
                                camel_pop3_engine_command_free(pop3_store->engine, fi[0]->cmd);
                        }
-                       
+
                        g_free(fi[0]->uid);
                        g_free(fi[0]);
                }
-               
+
                g_ptr_array_free(pop3_folder->uids, TRUE);
                g_hash_table_destroy(pop3_folder->uids_uid);
        }
@@ -125,17 +125,17 @@ camel_pop3_folder_new (CamelStore *parent, CamelException *ex)
        CamelFolder *folder;
 
        d(printf("opening pop3 INBOX folder\n"));
-       
+
        folder = CAMEL_FOLDER (camel_object_new (CAMEL_POP3_FOLDER_TYPE));
        camel_folder_construct (folder, parent, "inbox", "inbox");
-       
+
        /* mt-ok, since we dont have the folder-lock for new() */
        camel_folder_refresh_info (folder, ex);/* mt-ok */
        if (camel_exception_is_set (ex)) {
                camel_object_unref (CAMEL_OBJECT (folder));
                folder = NULL;
        }
-       
+
        return folder;
 }
 
@@ -216,7 +216,7 @@ cmd_uidl(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
        unsigned int id;
        CamelPOP3FolderInfo *fi;
        CamelPOP3Folder *folder = data;
-       
+
        do {
                ret = camel_pop3_stream_line(stream, &line, &len);
                if (ret>=0) {
@@ -236,7 +236,7 @@ cmd_uidl(CamelPOP3Engine *pe, CamelPOP3Stream *stream, void *data)
        } while (ret>0);
 }
 
-static void 
+static void
 pop3_refresh_info (CamelFolder *folder, CamelException *ex)
 {
        CamelPOP3Store *pop3_store = CAMEL_POP3_STORE (folder->parent_store);
@@ -268,9 +268,9 @@ pop3_refresh_info (CamelFolder *folder, CamelException *ex)
        }
 
        /* TODO: check every id has a uid & commands returned OK too? */
-       
+
        camel_pop3_engine_command_free(pop3_store->engine, pcl);
-       
+
        if (pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) {
                camel_pop3_engine_command_free(pop3_store->engine, pcu);
        } else {
@@ -287,7 +287,7 @@ pop3_refresh_info (CamelFolder *folder, CamelException *ex)
 
        /* dont need this anymore */
        g_hash_table_destroy(pop3_folder->uids_id);
-       
+
        camel_operation_end (NULL);
        return;
 }
@@ -304,19 +304,19 @@ pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
        pop3_store = CAMEL_POP3_STORE (folder->parent_store);
 
        if(pop3_store->delete_after && !expunge)
-       {       
+       {
                d(printf("%s(%d): pop3_store->delete_after = [%d], expunge=[%d]\n",
                         __FILE__, __LINE__, pop3_store->delete_after, expunge));
                camel_operation_start(NULL, _("Expunging old messages"));
-               camel_pop3_delete_old(folder, pop3_store->delete_after,ex);     
-       }       
+               camel_pop3_delete_old(folder, pop3_store->delete_after,ex);
+       }
 
        if (!expunge) {
                return;
-       }       
-       
+       }
+
        camel_operation_start(NULL, _("Expunging deleted messages"));
-       
+
        for (i = 0; i < pop3_folder->uids->len; i++) {
                fi = pop3_folder->uids->pdata[i];
                /* busy already?  wait for that to finish first */
@@ -369,7 +369,7 @@ camel_pop3_delete_old(CamelFolder *folder, int days_to_delete,      CamelException *e
        CamelMessageInfo *minfo;
 
        pop3_folder = CAMEL_POP3_FOLDER (folder);
-       pop3_store = CAMEL_POP3_STORE (CAMEL_FOLDER(pop3_folder)->parent_store);        
+       pop3_store = CAMEL_POP3_STORE (CAMEL_FOLDER(pop3_folder)->parent_store);
        temp = time(&temp);
 
        d(printf("%s(%d): pop3_folder->uids->len=[%d]\n", __FILE__, __LINE__, pop3_folder->uids->len));
@@ -384,7 +384,7 @@ camel_pop3_delete_old(CamelFolder *folder, int days_to_delete,      CamelException *e
                        int day_lag = time_diff/(60*60*24);
 
                        d(printf("%s(%d): message_time= [%ld]\n", __FILE__, __LINE__, message_time));
-                       d(printf("%s(%d): day_lag=[%d] \t days_to_delete=[%d]\n", 
+                       d(printf("%s(%d): day_lag=[%d] \t days_to_delete=[%d]\n",
                                 __FILE__, __LINE__, day_lag, days_to_delete));
 
                        if( day_lag > days_to_delete)
@@ -393,12 +393,12 @@ camel_pop3_delete_old(CamelFolder *folder, int days_to_delete,    CamelException *e
                                        while (camel_pop3_engine_iterate(pop3_store->engine, fi->cmd) > 0) {
                                                ; /* do nothing - iterating until end */
                                        }
-                                       
+
                                        camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
                                        fi->cmd = NULL;
                                }
                                d(printf("%s(%d): Deleting old messages\n", __FILE__, __LINE__));
-                               fi->cmd = camel_pop3_engine_command_new(pop3_store->engine, 
+                               fi->cmd = camel_pop3_engine_command_new(pop3_store->engine,
                                                                        0,
                                                                        NULL,
                                                                        NULL,
@@ -431,7 +431,7 @@ camel_pop3_delete_old(CamelFolder *folder, int days_to_delete,      CamelException *e
        camel_pop3_store_expunge (pop3_store, ex);
 
        return 0;
-       
+
 }
 
 static void
@@ -472,7 +472,7 @@ done:
        } else {
                fi->err = 0;
        }
-       
+
        camel_object_unref((CamelObject *)fi->stream);
        fi->stream = NULL;
 }
@@ -526,7 +526,7 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                        goto fail;
                }
        }
-       
+
        /* check to see if we have safely written flag set */
        if (pop3_store->cache == NULL
            || (stream = camel_data_cache_get(pop3_store->cache, "cache", fi->uid, NULL)) == NULL
@@ -552,7 +552,7 @@ pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                        last = MIN(i+10, pop3_folder->uids->len);
                        for (;i<last;i++) {
                                CamelPOP3FolderInfo *pfi = pop3_folder->uids->pdata[i];
-                               
+
                                if (pfi->uid && pfi->cmd == NULL) {
                                        pfi->stream = camel_data_cache_add(pop3_store->cache, "cache", pfi->uid, NULL);
                                        if (pfi->stream) {
@@ -637,7 +637,7 @@ static gint
 pop3_get_message_count (CamelFolder *folder)
 {
        CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
-       
+
        return pop3_folder->uids->len;
 }
 
@@ -653,6 +653,6 @@ pop3_get_uids (CamelFolder *folder)
                if (fi[0]->uid)
                        g_ptr_array_add(uids, fi[0]->uid);
        }
-       
+
        return uids;
 }
index 317aa55..11d06c3 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-pop3-folder.h : Class for a POP3 folder */
 
-/* 
+/*
  * Authors:
  *   Dan Winship <danw@ximian.com>
  *   Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -57,8 +57,8 @@ typedef struct {
 typedef struct {
        CamelFolderClass parent_class;
 
-       /* Virtual methods */   
-       
+       /* Virtual methods */
+
 } CamelPOP3FolderClass;
 
 /* public methods */
index cb1dde2..1846ff3 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-pop3-provider.c: pop3 provider registration code */
 
-/* 
+/*
  * Authors :
  *   Dan Winship <danw@ximian.com>
  *   Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -51,20 +51,20 @@ static CamelProviderConfEntry pop3_conf_entries[] = {
 
 static CamelProvider pop3_provider = {
        "pop",
-       
+
        N_("POP"),
-       
+
        N_("For connecting to and downloading mail from POP servers."),
-       
+
        "mail",
-       
+
        CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
        CAMEL_PROVIDER_SUPPORTS_SSL,
-       
+
        CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
-       
+
        pop3_conf_entries,
-       
+
        /* ... */
 };
 
index 55cd5b0..2ad77ad 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-pop3-store.c : class for a pop3 store */
 
-/* 
+/*
  * Authors:
  *   Dan Winship <danw@ximian.com>
  *   Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2000-2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -69,7 +69,7 @@ static gboolean pop3_connect (CamelService *service, CamelException *ex);
 static gboolean pop3_disconnect (CamelService *service, gboolean clean, CamelException *ex);
 static GList *query_auth_types (CamelService *service, CamelException *ex);
 
-static CamelFolder *get_folder (CamelStore *store, const char *folder_name, 
+static CamelFolder *get_folder (CamelStore *store, const char *folder_name,
                                guint32 flags, CamelException *ex);
 
 static CamelFolder *get_trash  (CamelStore *store, CamelException *ex);
@@ -83,7 +83,7 @@ camel_pop3_store_class_init (CamelPOP3StoreClass *camel_pop3_store_class)
                CAMEL_STORE_CLASS (camel_pop3_store_class);
 
        parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ()));
-       
+
        /* virtual method overload */
        camel_service_class->query_auth_types = query_auth_types;
        camel_service_class->connect = pop3_connect;
@@ -157,7 +157,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
        int clean_quit = TRUE;
        int ret;
        const gchar *delete_days;
-       
+
        if (ssl_mode != MODE_CLEAR) {
 #ifdef HAVE_SSL
                if (ssl_mode == MODE_TLS) {
@@ -169,13 +169,13 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                      _("Could not connect to %s: %s"),
                                      service->url->host, _("SSL unavailable"));
-               
+
                return FALSE;
 #endif /* HAVE_SSL */
        } else {
                tcp_stream = camel_tcp_stream_raw_new ();
        }
-       
+
        if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) {
                if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
@@ -185,24 +185,24 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                                              _("Could not connect to %s: %s"),
                                              service->url->host,
                                              g_strerror (errno));
-               
+
                camel_object_unref (tcp_stream);
-               
+
                return FALSE;
        }
-       
+
        /* parent class connect initialization */
        if (CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex) == FALSE) {
                camel_object_unref (tcp_stream);
                return FALSE;
        }
-       
+
        if (camel_url_get_param (service->url, "disable_extensions"))
                flags |= CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS;
-       
-       if ((delete_days = (gchar *) camel_url_get_param(service->url,"delete_after"))) 
+
+       if ((delete_days = (gchar *) camel_url_get_param(service->url,"delete_after")))
                store->delete_after =  atoi(delete_days);
-       
+
        if (!(store->engine = camel_pop3_engine_new (tcp_stream, flags))) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to read a valid greeting from POP server %s"),
@@ -210,12 +210,12 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                camel_object_unref (tcp_stream);
                return FALSE;
        }
-       
+
        if (ssl_mode != MODE_TLS) {
                camel_object_unref (tcp_stream);
                return TRUE;
        }
-       
+
 #ifdef HAVE_SSL
        if (!(store->engine->capa & CAMEL_POP3_CAP_STLS)) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -223,27 +223,27 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                                      service->url->host, _("STLS not supported by server"));
                goto stls_exception;
        }
-       
+
        /* as soon as we send a STLS command, all hope is lost of a clean QUIT if problems arise */
        clean_quit = FALSE;
-       
+
        pc = camel_pop3_engine_command_new (store->engine, 0, NULL, NULL, "STLS\r\n");
        while (camel_pop3_engine_iterate (store->engine, NULL) > 0)
                ;
-       
+
        ret = pc->state == CAMEL_POP3_COMMAND_OK;
        camel_pop3_engine_command_free (store->engine, pc);
-       
+
        if (ret == FALSE) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to connect to POP server %s in secure mode: %s"),
                                      service->url->host, store->engine->line);
                goto stls_exception;
        }
-       
+
        /* Okay, now toggle SSL/TLS mode */
        ret = camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream));
-       
+
        if (ret == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to connect to POP server %s in secure mode: %s"),
@@ -256,15 +256,15 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                              service->url->host, _("TLS is not available in this build"));
        goto stls_exception;
 #endif /* HAVE_SSL */
-       
+
        camel_object_unref (tcp_stream);
-       
+
        /* rfc2595, section 4 states that after a successful STLS
            command, the client MUST discard prior CAPA responses */
        camel_pop3_engine_reget_capabilities (store->engine);
-       
+
        return TRUE;
-       
+
  stls_exception:
        if (clean_quit) {
                /* try to disconnect cleanly */
@@ -273,11 +273,11 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                        ;
                camel_pop3_engine_command_free (store->engine, pc);
        }
-       
+
        camel_object_unref (CAMEL_OBJECT (store->engine));
        camel_object_unref (CAMEL_OBJECT (tcp_stream));
        store->engine = NULL;
-       
+
        return FALSE;
 }
 
@@ -315,13 +315,13 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
                serv = "pop3";
                port = POP3S_PORT;
        }
-       
+
        if (service->url->port) {
                serv = g_alloca (16);
                sprintf (serv, "%d", service->url->port);
                port = NULL;
        }
-       
+
        memset (&hints, 0, sizeof (hints));
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_family = PF_UNSPEC;
@@ -330,14 +330,14 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
                camel_exception_clear (ex);
                ai = camel_getaddrinfo(service->url->host, port, &hints, ex);
        }
-       
+
        if (ai == NULL)
                return FALSE;
-       
+
        ret = connect_to_server (service, ai, mode, ex);
-       
+
        camel_freeaddrinfo (ai);
-       
+
        return ret;
 }
 
@@ -441,7 +441,7 @@ try_sasl(CamelPOP3Store *store, const char *mech, CamelException *ex)
        }
        camel_object_unref((CamelObject *)sasl);
        return 0;
-       
+
  ioerror:
        if (errno == EINTR) {
                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Canceled"));
@@ -461,18 +461,18 @@ pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *err
        CamelPOP3Store *store = (CamelPOP3Store *)service;
        CamelPOP3Command *pcu = NULL, *pcp = NULL;
        int status;
-       
+
        /* override, testing only */
        /*printf("Forcing authmech to 'login'\n");
        service->url->authmech = g_strdup("LOGIN");*/
-       
+
        if (!service->url->passwd) {
                char *prompt;
                guint32 flags = CAMEL_SESSION_PASSWORD_SECRET;
-               
+
                if (reprompt)
                        flags |= CAMEL_SESSION_PASSWORD_REPROMPT;
-               
+
                prompt = g_strdup_printf (_("%sPlease enter the POP password for %s on host %s"),
                                          errmsg ? errmsg : "",
                                          service->url->user,
@@ -506,14 +506,14 @@ pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *err
                        }
                        d++;
                }
-               
+
                secret = g_alloca(strlen(store->engine->apop)+strlen(service->url->passwd)+1);
                sprintf(secret, "%s%s",  store->engine->apop, service->url->passwd);
                md5_get_digest(secret, strlen (secret), md5sum);
 
                for (s = md5sum, d = md5asc; d < md5asc + 32; s++, d += 2)
                        sprintf (d, "%.2x", *s);
-               
+
                pcp = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "APOP %s %s\r\n",
                                                    service->url->user, md5asc);
        } else {
@@ -527,17 +527,17 @@ pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *err
                                return try_sasl(store, service->url->authmech, ex) == -1;
                        l = l->next;
                }
-               
+
                camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
                                      _("Unable to connect to POP server %s: "
                                        "No support for requested authentication mechanism."),
                                      CAMEL_SERVICE (store)->url->host);
                return FALSE;
        }
-       
+
        while ((status = camel_pop3_engine_iterate(store->engine, pcp)) > 0)
                ;
-       
+
        if (status == -1) {
                if (errno == EINTR) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Canceled"));
@@ -560,12 +560,12 @@ pop3_try_authenticate (CamelService *service, gboolean reprompt, const char *err
                                        "Error sending password: %s"),
                                      CAMEL_SERVICE (store)->url->host,
                                      store->engine->line ? (char *)store->engine->line : _("Unknown error"));
-       
+
        camel_pop3_engine_command_free(store->engine, pcp);
-       
+
        if (pcu)
                camel_pop3_engine_command_free(store->engine, pcu);
-       
+
        return status;
 }
 
@@ -577,9 +577,9 @@ pop3_connect (CamelService *service, CamelException *ex)
        CamelSession *session;
        char *errbuf = NULL;
        int status;
-       
+
        session = camel_service_get_session (service);
-       
+
        if (store->cache == NULL) {
                char *root;
 
@@ -594,15 +594,15 @@ pop3_connect (CamelService *service, CamelException *ex)
                        }
                }
        }
-       
+
        if (!connect_to_server_wrapper (service, ex))
                return FALSE;
-       
+
        while (1) {
                status = pop3_try_authenticate (service, reprompt, errbuf, ex);
                g_free (errbuf);
                errbuf = NULL;
-               
+
                /* we only re-prompt if we failed to authenticate, any other error and we just abort */
                if (status == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE) {
                        errbuf = g_strdup_printf ("%s\n\n", camel_exception_get_description (ex));
@@ -613,18 +613,18 @@ pop3_connect (CamelService *service, CamelException *ex)
                } else
                        break;
        }
-       
+
        g_free (errbuf);
-       
+
        if (status == -1 || camel_exception_is_set(ex)) {
                camel_service_disconnect(service, TRUE, ex);
                return FALSE;
        }
-       
+
        /* Now that we are in the TRANSACTION state, try regetting the capabilities */
        store->engine->state = CAMEL_POP3_ENGINE_TRANSACTION;
        camel_pop3_engine_reget_capabilities (store->engine);
-       
+
        return TRUE;
 }
 
@@ -632,22 +632,22 @@ static gboolean
 pop3_disconnect (CamelService *service, gboolean clean, CamelException *ex)
 {
        CamelPOP3Store *store = CAMEL_POP3_STORE (service);
-       
+
        if (clean) {
                CamelPOP3Command *pc;
-               
+
                pc = camel_pop3_engine_command_new(store->engine, 0, NULL, NULL, "QUIT\r\n");
                while (camel_pop3_engine_iterate(store->engine, NULL) > 0)
                        ;
                camel_pop3_engine_command_free(store->engine, pc);
        }
-       
+
        if (!CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex))
                return FALSE;
-       
+
        camel_object_unref((CamelObject *)store->engine);
        store->engine = NULL;
-       
+
        return TRUE;
 }
 
index 12bead5..f5fd48f 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-pop3-store.h : class for an pop3 store */
 
-/* 
+/*
  * Authors:
  *   Dan Winship <danw@ximian.com>
  *   Michael Zucchi <notzed@ximian.com>
  *
  * Copyright (C) 2000-2002 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -44,7 +44,7 @@ typedef struct {
        CamelPOP3Engine *engine; /* pop processing engine */
 
        struct _CamelDataCache *cache;
-       
+
        guint delete_after;
 } CamelPOP3Store;
 
index 42b3618..b69cad8 100644 (file)
@@ -147,12 +147,12 @@ static ssize_t
 stream_write(CamelStream *stream, const char *buffer, size_t n)
 {
        CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
-       
+
        if (strncmp (buffer, "PASS ", 5) != 0)
                dd(printf("POP3_STREAM_WRITE(%d):\n%.*s\n", (int)n, (int)n, buffer));
        else
                dd(printf("POP3_STREAM_WRITE(%d):\nPASS xxxxxxxx\n", (int)n));
-       
+
        return camel_stream_write(is->source, buffer, n);
 }
 
index 91fc2a4..bc7da89 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-sendmail-provider.c: sendmail provider registration code */
 
-/* 
+/*
  * Authors :
  *   Dan Winship <danw@ximian.com>
  *
  * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -53,7 +53,7 @@ void
 camel_provider_module_init(void)
 {
        sendmail_provider.object_types[CAMEL_PROVIDER_TRANSPORT] = camel_sendmail_transport_get_type();
-       
+
        sendmail_provider.url_hash = camel_url_hash;
        sendmail_provider.url_equal = camel_url_equal;
        sendmail_provider.translation_domain = GETTEXT_PACKAGE;
index 72d6263..4a25c50 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-sendmail-transport.c: Sendmail-based transport class. */
 
-/* 
+/*
  *
  * Authors: Dan Winship <danw@ximian.com>
  *
  * Copyright 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -68,7 +68,7 @@ CamelType
 camel_sendmail_transport_get_type (void)
 {
        static CamelType camel_sendmail_transport_type = CAMEL_INVALID_TYPE;
-       
+
        if (camel_sendmail_transport_type == CAMEL_INVALID_TYPE)        {
                camel_sendmail_transport_type =
                        camel_type_register (CAMEL_TRANSPORT_TYPE, "CamelSendmailTransport",
@@ -79,7 +79,7 @@ camel_sendmail_transport_get_type (void)
                                             (CamelObjectInitFunc) NULL,
                                             NULL);
        }
-       
+
        return camel_sendmail_transport_type;
 }
 
@@ -97,10 +97,10 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
        sigset_t mask, omask;
        CamelStream *out;
        pid_t pid;
-       
+
        if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (from), 0, NULL, &from_addr))
                return FALSE;
-       
+
        len = camel_address_length (recipients);
        argv = g_malloc ((len + 6) * sizeof (char *));
        argv[0] = "sendmail";
@@ -108,7 +108,7 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
        argv[2] = "-f";
        argv[3] = from_addr;
        argv[4] = "--";
-       
+
        for (i = 0; i < len; i++) {
                if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (recipients), i, NULL, &addr)) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -116,16 +116,16 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
                        g_free (argv);
                        return FALSE;
                }
-               
+
                argv[i + 5] = addr;
        }
-       
+
        argv[i + 5] = NULL;
-       
+
        /* unlink the bcc headers */
        savedbcc = NULL;
        tail = (struct _camel_header_raw *) &savedbcc;
-       
+
        header = (struct _camel_header_raw *) &CAMEL_MIME_PART (message)->headers;
        n = header->next;
        while (n != NULL) {
@@ -137,29 +137,29 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
                } else {
                        header = n;
                }
-               
+
                n = header->next;
        }
-       
+
        if (pipe (fd) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Could not create pipe to sendmail: "
                                        "%s: mail not sent"),
                                      g_strerror (errno));
-               
+
                /* restore the bcc headers */
                header->next = savedbcc;
-               
+
                return FALSE;
        }
-       
+
        /* Block SIGCHLD so the calling application doesn't notice
         * sendmail exiting before we do.
         */
        sigemptyset (&mask);
        sigaddset (&mask, SIGCHLD);
        sigprocmask (SIG_BLOCK, &mask, &omask);
-       
+
        pid = fork ();
        switch (pid) {
        case -1:
@@ -171,10 +171,10 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
                close (fd[1]);
                sigprocmask (SIG_SETMASK, &omask, NULL);
                g_free (argv);
-               
+
                /* restore the bcc headers */
                header->next = savedbcc;
-               
+
                return FALSE;
        case 0:
                /* Child process */
@@ -184,23 +184,23 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
                  dup2 (nullfd, STDERR_FILENO);*/
                close (nullfd);
                close (fd[1]);
-               
+
                execv (SENDMAIL_PATH, (char **)argv);
                _exit (255);
        }
        g_free (argv);
-       
+
        /* Parent process. Write the message out. */
        close (fd[0]);
        out = camel_stream_fs_new_with_fd (fd[1]);
-       
+
        /* workaround for lame sendmail implementations that can't handle CRLF eoln sequences */
        filter = camel_stream_filter_new_with_stream (out);
        crlf = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
        camel_stream_filter_add (filter, crlf);
        camel_object_unref (crlf);
        camel_object_unref (out);
-       
+
        out = (CamelStream *) filter;
        if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), out) == -1
            || camel_stream_close (out) == -1) {
@@ -208,30 +208,30 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Could not send message: %s"),
                                      g_strerror (errno));
-               
+
                /* Wait for sendmail to exit. */
                while (waitpid (pid, &wstat, 0) == -1 && errno == EINTR)
                        ;
-               
+
                sigprocmask (SIG_SETMASK, &omask, NULL);
-               
+
                /* restore the bcc headers */
                header->next = savedbcc;
-               
+
                return FALSE;
        }
-       
+
        camel_object_unref (CAMEL_OBJECT (out));
-       
+
        /* Wait for sendmail to exit. */
        while (waitpid (pid, &wstat, 0) == -1 && errno == EINTR)
                ;
-       
+
        sigprocmask (SIG_SETMASK, &omask, NULL);
-       
+
        /* restore the bcc headers */
        header->next = savedbcc;
-       
+
        if (!WIFEXITED (wstat)) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("sendmail exited with signal %s: "
@@ -252,7 +252,7 @@ sendmail_send_to (CamelTransport *transport, CamelMimeMessage *message,
                }
                return FALSE;
        }
-       
+
        return TRUE;
 }
 
index 3a6eb1e..7173b16 100644 (file)
@@ -1,15 +1,15 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-sendmail-transport.h: Sendmail-based transport class */
 
-/* 
+/*
  *
- * Author : 
+ * Author :
  *  Dan Winship <danw@ximian.com>
  *
  * Copyright 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 1461e6d..0a0f3d2 100644 (file)
@@ -59,7 +59,7 @@ camel_provider_module_init(void)
        smtp_provider.url_hash = camel_url_hash;
        smtp_provider.url_equal = camel_url_equal;
        smtp_provider.translation_domain = GETTEXT_PACKAGE;
-       
+
        camel_provider_register(&smtp_provider);
 }
 
index 8770692..38c5fd2 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-smtp-transport.c : class for a smtp transport */
 
-/* 
+/*
  * Authors: Jeffrey Stedfast <fejj@ximian.com>
  *
  * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -102,16 +102,16 @@ camel_smtp_transport_class_init (CamelSmtpTransportClass *camel_smtp_transport_c
                CAMEL_TRANSPORT_CLASS (camel_smtp_transport_class);
        CamelServiceClass *camel_service_class =
                CAMEL_SERVICE_CLASS (camel_smtp_transport_class);
-       
+
        parent_class = CAMEL_TRANSPORT_CLASS (camel_type_get_global_classfuncs (camel_transport_get_type ()));
-       
+
        /* virtual method overload */
        camel_service_class->construct = smtp_construct;
        camel_service_class->connect = smtp_connect;
        camel_service_class->disconnect = smtp_disconnect;
        camel_service_class->query_auth_types = query_auth_types;
        camel_service_class->get_name = get_name;
-       
+
        camel_transport_class->send_to = smtp_send_to;
 }
 
@@ -119,7 +119,7 @@ static void
 camel_smtp_transport_init (gpointer object)
 {
        CamelSmtpTransport *smtp = CAMEL_SMTP_TRANSPORT (object);
-       
+
        smtp->flags = 0;
        smtp->connected = FALSE;
 }
@@ -128,7 +128,7 @@ CamelType
 camel_smtp_transport_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (CAMEL_TRANSPORT_TYPE,
                                            "CamelSmtpTransport",
@@ -139,7 +139,7 @@ camel_smtp_transport_get_type (void)
                                            (CamelObjectInitFunc) camel_smtp_transport_init,
                                            NULL);
        }
-       
+
        return type;
 }
 
@@ -202,7 +202,7 @@ smtp_error_string (int error)
                return _("Start mail input; end with <CRLF>.<CRLF>");
        case 554:
                return _("Transaction failed");
-               
+
        /* AUTH error codes: */
        case 432:
                return _("A password transition is needed");
@@ -214,7 +214,7 @@ smtp_error_string (int error)
                return _("Temporary authentication failure");
        case 530:
                return _("Authentication required");
-               
+
        default:
                return _("Unknown");
        }
@@ -238,14 +238,14 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
        CamelStream *tcp_stream;
        char *respbuf = NULL;
        int ret;
-       
+
        if (!CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex))
                return FALSE;
-       
+
        /* set some smtp transport defaults */
        transport->flags = 0;
        transport->authtypes = NULL;
-       
+
        if (ssl_mode != MODE_CLEAR) {
 #ifdef HAVE_SSL
                if (ssl_mode == MODE_TLS) {
@@ -257,13 +257,13 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                      _("Could not connect to %s: %s"),
                                      service->url->host, _("SSL unavailable"));
-               
+
                return FALSE;
 #endif /* HAVE_SSL */
        } else {
                tcp_stream = camel_tcp_stream_raw_new ();
        }
-       
+
        if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) {
                if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
@@ -272,20 +272,20 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                              _("Could not connect to %s: %s"),
                                              service->url->host, g_strerror (errno));
-               
+
                camel_object_unref (tcp_stream);
-               
+
                return FALSE;
        }
-       
+
        transport->connected = TRUE;
-       
+
        /* get the localaddr - needed later by smtp_helo */
        transport->localaddr = camel_tcp_stream_get_local_address (CAMEL_TCP_STREAM (tcp_stream), &transport->localaddrlen);
-       
+
        transport->ostream = tcp_stream;
        transport->istream = camel_stream_buffer_new (tcp_stream, CAMEL_STREAM_BUFFER_READ);
-       
+
        /* Read the greeting, note whether the server is ESMTP or not. */
        do {
                /* Check for "220" */
@@ -298,37 +298,37 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                }
        } while (*(respbuf+3) == '-'); /* if we got "220-" then loop again */
        g_free (respbuf);
-       
+
        /* Try sending EHLO */
        transport->flags |= CAMEL_SMTP_TRANSPORT_IS_ESMTP;
        if (!smtp_helo (transport, ex)) {
                if (!transport->connected)
                        return FALSE;
-               
+
                /* Fall back to HELO */
                camel_exception_clear (ex);
                transport->flags &= ~CAMEL_SMTP_TRANSPORT_IS_ESMTP;
                if (!smtp_helo (transport, ex) && !transport->connected)
                        return FALSE;
        }
-       
+
        /* clear any EHLO/HELO exception and assume that any SMTP errors encountered were non-fatal */
        camel_exception_clear (ex);
-       
+
        if (ssl_mode != MODE_TLS) {
                /* we're done */
                return TRUE;
        }
-       
+
 #ifdef HAVE_SSL
        if (!(transport->flags & CAMEL_SMTP_TRANSPORT_STARTTLS)) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Failed to connect to SMTP server %s in secure mode: %s"),
                                      service->url->host, _("STARTTLS not supported"));
-               
+
                goto exception_cleanup;
        }
-       
+
        d(fprintf (stderr, "sending : STARTTLS\r\n"));
        if (camel_stream_write (tcp_stream, "STARTTLS\r\n", 10) == -1) {
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
@@ -336,23 +336,23 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                                      g_strerror (errno));
                goto exception_cleanup;
        }
-       
+
        respbuf = NULL;
-       
+
        do {
                /* Check for "220 Ready for TLS" */
                g_free (respbuf);
                respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-               
+
                d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-               
+
                if (!respbuf || strncmp (respbuf, "220", 3)) {
                        smtp_set_exception (transport, FALSE, respbuf, _("STARTTLS command failed"), ex);
                        g_free (respbuf);
                        goto exception_cleanup;
                }
        } while (*(respbuf+3) == '-'); /* if we got "220-" then loop again */
-       
+
        /* Okay, now toggle SSL/TLS mode */
        if (camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream)) == -1) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -366,23 +366,23 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
                              service->url->host, _("SSL is not available in this build"));
        goto exception_cleanup;
 #endif /* HAVE_SSL */
-       
+
        /* We are supposed to re-EHLO after a successful STARTTLS to
            re-fetch any supported extensions. */
        if (!smtp_helo (transport, ex) && !transport->connected)
                return FALSE;
-       
+
        return TRUE;
-       
+
  exception_cleanup:
-       
+
        camel_object_unref (transport->istream);
        transport->istream = NULL;
        camel_object_unref (transport->ostream);
        transport->ostream = NULL;
-       
+
        transport->connected = FALSE;
-       
+
        return FALSE;
 }
 
@@ -407,7 +407,7 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
        int mode, ret, i;
        char *serv;
        const char *port;
-       
+
        if ((ssl_mode = camel_url_get_param (service->url, "use_ssl"))) {
                for (i = 0; ssl_options[i].value; i++)
                        if (!strcmp (ssl_options[i].value, ssl_mode))
@@ -420,13 +420,13 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
                serv = "smtp";
                port = SMTP_PORT;
        }
-       
+
        if (service->url->port) {
                serv = g_alloca (16);
                sprintf (serv, "%d", service->url->port);
                port = NULL;
        }
-       
+
        memset (&hints, 0, sizeof (hints));
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_family = PF_UNSPEC;
@@ -435,14 +435,14 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex)
                camel_exception_clear (ex);
                ai = camel_getaddrinfo(service->url->host, port, &hints, ex);
        }
-       
+
        if (ai == NULL)
                return FALSE;
-       
+
        ret = connect_to_server (service, ai, mode, ex);
-       
+
        camel_freeaddrinfo (ai);
-       
+
        return ret;
 }
 
@@ -451,29 +451,29 @@ smtp_connect (CamelService *service, CamelException *ex)
 {
        CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
        gboolean has_authtypes;
-       
+
        /* We (probably) need to check popb4smtp before we connect ... */
        if (service->url->authmech && !strcmp (service->url->authmech, "POPB4SMTP")) {
                int truth;
                GByteArray *chal;
                CamelSasl *sasl;
-               
+
                sasl = camel_sasl_new ("smtp", "POPB4SMTP", service);
                chal = camel_sasl_challenge (sasl, NULL, ex);
                truth = camel_sasl_authenticated (sasl);
                if (chal)
                        g_byte_array_free (chal, TRUE);
                camel_object_unref (sasl);
-               
+
                if (!truth)
                        return FALSE;
-               
+
                return connect_to_server_wrapper (service, ex);
        }
-       
+
        if (!connect_to_server_wrapper (service, ex))
                return FALSE;
-       
+
        /* check to see if AUTH is required, if so...then AUTH ourselves */
        has_authtypes = transport->authtypes ? g_hash_table_size (transport->authtypes) > 0 : FALSE;
        if (service->url->authmech && (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) && has_authtypes) {
@@ -481,7 +481,7 @@ smtp_connect (CamelService *service, CamelException *ex)
                CamelServiceAuthType *authtype;
                gboolean authenticated = FALSE;
                char *errbuf = NULL;
-               
+
                if (!g_hash_table_lookup (transport->authtypes, service->url->authmech)) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                              _("SMTP server %s does not support requested "
@@ -490,7 +490,7 @@ smtp_connect (CamelService *service, CamelException *ex)
                        camel_service_disconnect (service, TRUE, NULL);
                        return FALSE;
                }
-               
+
                authtype = camel_sasl_authtype (service->url->authmech);
                if (!authtype) {
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
@@ -499,7 +499,7 @@ smtp_connect (CamelService *service, CamelException *ex)
                        camel_service_disconnect (service, TRUE, NULL);
                        return FALSE;
                }
-               
+
                if (!authtype->need_password) {
                        /* authentication mechanism doesn't need a password,
                           so if it fails there's nothing we can do */
@@ -509,7 +509,7 @@ smtp_connect (CamelService *service, CamelException *ex)
                                return FALSE;
                        }
                }
-               
+
                /* keep trying to login until either we succeed or the user cancels */
                while (!authenticated) {
                        if (errbuf) {
@@ -518,27 +518,27 @@ smtp_connect (CamelService *service, CamelException *ex)
                                g_free (service->url->passwd);
                                service->url->passwd = NULL;
                        }
-                       
+
                        if (!service->url->passwd) {
                                char *prompt;
-                               
+
                                prompt = g_strdup_printf (_("%sPlease enter the SMTP password for %s on host %s"),
                                                          errbuf ? errbuf : "", service->url->user,
                                                          service->url->host);
-                               
+
                                service->url->passwd = camel_session_get_password (session, service, NULL,
                                                                                   prompt, "password", CAMEL_SESSION_PASSWORD_SECRET, ex);
-                               
+
                                g_free (prompt);
                                g_free (errbuf);
                                errbuf = NULL;
-                               
+
                                if (!service->url->passwd) {
                                        camel_service_disconnect (service, TRUE, NULL);
                                        return FALSE;
                                }
                        }
-                       
+
                        authenticated = smtp_auth (transport, authtype->authproto, ex);
                        if (!authenticated) {
                                errbuf = g_strdup_printf (_("Unable to authenticate "
@@ -548,7 +548,7 @@ smtp_connect (CamelService *service, CamelException *ex)
                        }
                }
        }
-       
+
        return TRUE;
 }
 
@@ -562,40 +562,40 @@ static gboolean
 smtp_disconnect (CamelService *service, gboolean clean, CamelException *ex)
 {
        CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
-       
+
        /*if (!service->connected)
         *      return TRUE;
         */
-       
+
        if (transport->connected && clean) {
                /* send the QUIT command to the SMTP server */
                smtp_quit (transport, ex);
        }
-       
+
        if (!CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex))
                return FALSE;
-       
+
        if (transport->authtypes) {
                g_hash_table_foreach (transport->authtypes, authtypes_free, NULL);
                g_hash_table_destroy (transport->authtypes);
                transport->authtypes = NULL;
        }
-       
+
        if (transport->istream) {
                camel_object_unref (transport->istream);
                transport->istream = NULL;
        }
-       
+
        if (transport->ostream) {
                camel_object_unref (transport->ostream);
                transport->ostream = NULL;
        }
-       
+
        g_free(transport->localaddr);
        transport->localaddr = NULL;
-       
+
        transport->connected = FALSE;
-       
+
        return TRUE;
 }
 
@@ -604,34 +604,34 @@ esmtp_get_authtypes (const unsigned char *buffer)
 {
        const unsigned char *start, *end;
        GHashTable *table = NULL;
-       
+
        /* advance to the first token */
        start = buffer;
        while (isspace ((int) *start) || *start == '=')
                start++;
-       
+
        if (!*start)
                return NULL;
-       
+
        table = g_hash_table_new (g_str_hash, g_str_equal);
-       
+
        for ( ; *start; ) {
                char *type;
-               
+
                /* advance to the end of the token */
                end = start;
                while (*end && !isspace ((int) *end))
                        end++;
-               
+
                type = g_strndup (start, end - start);
                g_hash_table_insert (table, type, type);
-               
+
                /* advance to the next token */
                start = end;
                while (isspace ((int) *start))
                        start++;
        }
-       
+
        return table;
 }
 
@@ -641,23 +641,23 @@ query_auth_types (CamelService *service, CamelException *ex)
        CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
        CamelServiceAuthType *authtype;
        GList *types, *t, *next;
-       
+
        if (!connect_to_server_wrapper (service, ex))
                return NULL;
-       
+
        types = g_list_copy (service->provider->authtypes);
        for (t = types; t; t = next) {
                authtype = t->data;
                next = t->next;
-               
+
                if (!g_hash_table_lookup (transport->authtypes, authtype->authproto)) {
                        types = g_list_remove_link (types, t);
                        g_list_free_1 (t);
                }
        }
-       
+
        smtp_disconnect (service, TRUE, NULL);
-       
+
        return types;
 }
 
@@ -682,31 +682,31 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
        gboolean has_8bit_parts;
        const char *addr;
        int i, len;
-       
+
        if (!smtp_transport->connected) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED,
                                      _("Cannot send message: service not connected."));
                return FALSE;
        }
-       
+
        if (!camel_internet_address_get (CAMEL_INTERNET_ADDRESS (from), 0, NULL, &addr)) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      _("Cannot send message: sender address not valid."));
                return FALSE;
        }
-       
+
        camel_operation_start (NULL, _("Sending message"));
-       
+
        /* find out if the message has 8bit mime parts */
        has_8bit_parts = camel_mime_message_has_8bit_parts (message);
-       
+
        /* rfc1652 (8BITMIME) requires that you notify the ESMTP daemon that
           you'll be sending an 8bit mime message at "MAIL FROM:" time. */
        if (!smtp_mail (smtp_transport, addr, has_8bit_parts, ex)) {
                camel_operation_end (NULL);
                return FALSE;
        }
-       
+
        len = camel_address_length (recipients);
        if (len == 0) {
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -714,18 +714,18 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
                camel_operation_end (NULL);
                return FALSE;
        }
-       
+
        cia = CAMEL_INTERNET_ADDRESS (recipients);
        for (i = 0; i < len; i++) {
                char *enc;
-               
+
                if (!camel_internet_address_get (cia, i, NULL, &addr)) {
                        camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
                                             _("Cannot send message: one or more invalid recipients"));
                        camel_operation_end (NULL);
                        return FALSE;
                }
-               
+
                enc = camel_internet_address_encode_address(NULL, NULL, addr);
                if (!smtp_rcpt (smtp_transport, enc, ex)) {
                        g_free(enc);
@@ -734,18 +734,18 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
                }
                g_free(enc);
        }
-       
+
        if (!smtp_data (smtp_transport, message, ex)) {
                camel_operation_end (NULL);
                return FALSE;
        }
-       
+
        /* reset the service for our next transfer session */
        if (!smtp_rset (smtp_transport, ex))
                camel_exception_clear (ex);
-       
+
        camel_operation_end (NULL);
-       
+
        return TRUE;
 }
 
@@ -753,14 +753,14 @@ static const char *
 smtp_next_token (const char *buf)
 {
        const unsigned char *token;
-       
+
        token = (const unsigned char *) buf;
        while (*token && !isspace ((int) *token))
                token++;
-       
+
        while (*token && isspace ((int) *token))
                token++;
-       
+
        return (const char *) token;
 }
 
@@ -794,9 +794,9 @@ smtp_decode_status_code (const char *in, size_t len)
        unsigned char *inptr, *outptr;
        const unsigned char *inend;
        char *outbuf;
-       
+
        outptr = outbuf = g_malloc (len + 1);
-       
+
        inptr = (unsigned char *) in;
        inend = inptr + len;
        while (inptr < inend) {
@@ -809,9 +809,9 @@ smtp_decode_status_code (const char *in, size_t len)
                } else
                        *outptr++ = *inptr++;
        }
-       
+
        *outptr = '\0';
-       
+
        return outbuf;
 }
 
@@ -822,7 +822,7 @@ smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const ch
        char *buffer = NULL;
        GString *string;
        int error;
-       
+
        if (!respbuf || !(transport->flags & CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES)) {
        fake_status_code:
                error = respbuf ? atoi (respbuf) : 0;
@@ -837,7 +837,7 @@ smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const ch
                                g_string_free (string, TRUE);
                                goto fake_status_code;
                        }
-                       
+
                        g_string_append (string, token);
                        if (*(rbuf + 3) == '-') {
                                g_free (buffer);
@@ -847,21 +847,21 @@ smtp_set_exception (CamelSmtpTransport *transport, gboolean disconnect, const ch
                                g_free (buffer);
                                buffer = NULL;
                        }
-                       
+
                        rbuf = buffer;
                } while (rbuf);
-               
+
                buffer = smtp_decode_status_code (string->str, string->len);
                g_string_free (string, TRUE);
                if (!buffer)
                        goto fake_status_code;
-               
+
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      "%s: %s", message, buffer);
-               
+
                g_free (buffer);
        }
-       
+
        if (!respbuf) {
                /* we got disconnected */
                if (disconnect)
@@ -878,24 +878,24 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
        const char *token, *numeric = NULL;
        struct sockaddr *addr;
        socklen_t addrlen;
-       
+
        /* these are flags that we set, so unset them in case we
           are being called a second time (ie, after a STARTTLS) */
        transport->flags &= ~(CAMEL_SMTP_TRANSPORT_8BITMIME |
                              CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES |
                              CAMEL_SMTP_TRANSPORT_STARTTLS);
-       
+
        if (transport->authtypes) {
                g_hash_table_foreach (transport->authtypes, authtypes_free, NULL);
                g_hash_table_destroy (transport->authtypes);
                transport->authtypes = NULL;
        }
-       
+
        camel_operation_start_transient (NULL, _("SMTP Greeting"));
-       
+
        addr = transport->localaddr;
        addrlen = transport->localaddrlen;
-       
+
        if (camel_getnameinfo (addr, addrlen, &name, NULL, NI_NUMERICHOST, NULL) != 0) {
                name = g_strdup ("localhost.localdomain");
        } else {
@@ -904,44 +904,44 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
                else
                        numeric = "";
        }
-       
+
        token = (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) ? "EHLO" : "HELO";
        if (numeric)
                cmdbuf = g_strdup_printf("%s [%s%s]\r\n", token, numeric, name);
        else
                cmdbuf = g_strdup_printf("%s %s\r\n", token, name);
        g_free (name);
-       
+
        d(fprintf (stderr, "sending : %s", cmdbuf));
        if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
                g_free (cmdbuf);
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                      _("HELO command failed: %s"), g_strerror (errno));
                camel_operation_end (NULL);
-               
+
                camel_service_disconnect ((CamelService *) transport, FALSE, NULL);
-               
+
                return FALSE;
        }
        g_free (cmdbuf);
-       
+
        do {
                /* Check for "250" */
                g_free (respbuf);
                respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-               
+
                d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-               
+
                if (!respbuf || strncmp (respbuf, "250", 3)) {
                        smtp_set_exception (transport, FALSE, respbuf, _("HELO command failed"), ex);
                        camel_operation_end (NULL);
                        g_free (respbuf);
-                       
+
                        return FALSE;
                }
-               
+
                token = respbuf + 4;
-               
+
                if (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) {
                        if (!strncmp (token, "8BITMIME", 8)) {
                                d(fprintf (stderr, "This server supports 8bit MIME\n"));
@@ -966,29 +966,29 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
                                         * format. We want to let the standard way have priority over the
                                         * broken way.
                                         **/
-                                       
+
                                        if (token[4] == '=')
                                                transport->flags |= CAMEL_SMTP_TRANSPORT_AUTH_EQUAL;
                                        else
                                                transport->flags &= ~CAMEL_SMTP_TRANSPORT_AUTH_EQUAL;
-                                       
+
                                        /* parse for supported AUTH types */
                                        token += 5;
-                                       
+
                                        if (transport->authtypes) {
                                                g_hash_table_foreach (transport->authtypes, authtypes_free, NULL);
                                                g_hash_table_destroy (transport->authtypes);
                                        }
-                                       
+
                                        transport->authtypes = esmtp_get_authtypes (token);
                                }
                        }
                }
        } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
        g_free (respbuf);
-       
+
        camel_operation_end (NULL);
-       
+
        return TRUE;
 }
 
@@ -998,9 +998,9 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
        char *cmdbuf, *respbuf = NULL, *challenge;
        gboolean auth_challenge = FALSE;
        CamelSasl *sasl = NULL;
-       
+
        camel_operation_start_transient (NULL, _("SMTP Authentication"));
-       
+
        sasl = camel_sasl_new ("smtp", mech, CAMEL_SERVICE (transport));
        if (!sasl) {
                camel_operation_end (NULL);
@@ -1008,7 +1008,7 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
                                      _("Error creating SASL authentication object."));
                return FALSE;
        }
-       
+
        challenge = camel_sasl_challenge_base64 (sasl, NULL, ex);
        if (challenge) {
                auth_challenge = TRUE;
@@ -1017,7 +1017,7 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
        } else {
                cmdbuf = g_strdup_printf ("AUTH %s\r\n", mech);
        }
-       
+
        d(fprintf (stderr, "sending : %s", cmdbuf));
        if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
                g_free (cmdbuf);
@@ -1026,24 +1026,24 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
                goto lose;
        }
        g_free (cmdbuf);
-       
+
        respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
        d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-       
+
        while (!camel_sasl_authenticated (sasl)) {
                if (!respbuf) {
                        camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                              _("AUTH command failed: %s"), g_strerror (errno));
                        goto lose;
                }
-               
+
                /* the server challenge/response should follow a 334 code */
                if (strncmp (respbuf, "334", 3) != 0) {
                        smtp_set_exception (transport, FALSE, respbuf, _("AUTH command failed"), ex);
                        g_free (respbuf);
                        goto lose;
                }
-               
+
                if (FALSE) {
                broken_smtp_server:
                        d(fprintf (stderr, "Your SMTP server's implementation of the %s SASL\n"
@@ -1052,15 +1052,15 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
                                   "for the first time (specifically Section 4).\n",
                                   mech));
                }
-               
+
                /* eat whtspc */
                for (challenge = respbuf + 4; isspace (*challenge); challenge++);
-               
+
                challenge = camel_sasl_challenge_base64 (sasl, challenge, ex);
                g_free (respbuf);
                if (challenge == NULL)
                        goto break_and_lose;
-               
+
                /* send our challenge */
                cmdbuf = g_strdup_printf ("%s\r\n", challenge);
                g_free (challenge);
@@ -1070,12 +1070,12 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
                        goto lose;
                }
                g_free (cmdbuf);
-               
+
                /* get the server's response */
                respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
                d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
        }
-       
+
        /* check that the server says we are authenticated */
        if (!respbuf || strncmp (respbuf, "235", 3)) {
                if (respbuf && auth_challenge && !strncmp (respbuf, "334", 3)) {
@@ -1085,13 +1085,13 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
                g_free (respbuf);
                goto lose;
        }
-       
+
        g_free (respbuf);
        camel_object_unref (sasl);
        camel_operation_end (NULL);
-       
+
        return TRUE;
-       
+
  break_and_lose:
        /* Get the server out of "waiting for continuation data" mode. */
        d(fprintf (stderr, "sending : *\n"));
@@ -1099,16 +1099,16 @@ smtp_auth (CamelSmtpTransport *transport, const char *mech, CamelException *ex)
        respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
        d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
        g_free (respbuf);
-       
+
  lose:
        if (!camel_exception_is_set (ex)) {
                camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                     _("Bad authentication response from server.\n"));
        }
-       
+
        camel_object_unref (sasl);
        camel_operation_end (NULL);
-       
+
        return FALSE;
 }
 
@@ -1117,33 +1117,33 @@ smtp_mail (CamelSmtpTransport *transport, const char *sender, gboolean has_8bit_
 {
        /* we gotta tell the smtp server who we are. (our email addy) */
        char *cmdbuf, *respbuf = NULL;
-       
+
        if (transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME && has_8bit_parts)
                cmdbuf = g_strdup_printf ("MAIL FROM:<%s> BODY=8BITMIME\r\n", sender);
        else
                cmdbuf = g_strdup_printf ("MAIL FROM:<%s>\r\n", sender);
-       
+
        d(fprintf (stderr, "sending : %s", cmdbuf));
-       
+
        if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
                g_free (cmdbuf);
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                      _("MAIL FROM command failed: %s: mail not sent"),
                                      g_strerror (errno));
-               
+
                camel_service_disconnect ((CamelService *) transport, FALSE, NULL);
-               
+
                return FALSE;
        }
        g_free (cmdbuf);
-       
+
        do {
                /* Check for "250 Sender OK..." */
                g_free (respbuf);
                respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-               
+
                d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-               
+
                if (!respbuf || strncmp (respbuf, "250", 3)) {
                        smtp_set_exception (transport, TRUE, respbuf, _("MAIL FROM command failed"), ex);
                        g_free (respbuf);
@@ -1151,7 +1151,7 @@ smtp_mail (CamelSmtpTransport *transport, const char *sender, gboolean has_8bit_
                }
        } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
        g_free (respbuf);
-       
+
        return TRUE;
 }
 
@@ -1161,33 +1161,33 @@ smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException
        /* we gotta tell the smtp server who we are going to be sending
         * our email to */
        char *cmdbuf, *respbuf = NULL;
-       
+
        cmdbuf = g_strdup_printf ("RCPT TO:<%s>\r\n", recipient);
-       
+
        d(fprintf (stderr, "sending : %s", cmdbuf));
-       
+
        if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
                g_free (cmdbuf);
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                      _("RCPT TO command failed: %s: mail not sent"),
                                      g_strerror (errno));
-               
+
                camel_service_disconnect ((CamelService *) transport, FALSE, NULL);
-               
+
                return FALSE;
        }
        g_free (cmdbuf);
-       
+
        do {
                /* Check for "250 Recipient OK..." */
                g_free (respbuf);
                respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-               
+
                d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-               
+
                if (!respbuf || strncmp (respbuf, "250", 3)) {
                        char *message;
-                       
+
                        message = g_strdup_printf (_("RCPT TO <%s> failed"), recipient);
                        smtp_set_exception (transport, TRUE, respbuf, message, ex);
                        g_free (message);
@@ -1196,7 +1196,7 @@ smtp_rcpt (CamelSmtpTransport *transport, const char *recipient, CamelException
                }
        } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
        g_free (respbuf);
-       
+
        return TRUE;
 }
 
@@ -1209,37 +1209,37 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
        CamelStreamFilter *filtered_stream;
        CamelMimeFilter *crlffilter;
        int ret;
-       
+
        /* If the server doesn't support 8BITMIME, set our required encoding to be 7bit */
        if (!(transport->flags & CAMEL_SMTP_TRANSPORT_8BITMIME))
                enctype = CAMEL_BESTENC_7BIT;
-       
+
        /* FIXME: should we get the best charset too?? */
        /* Changes the encoding of all mime parts to fit within our required
           encoding type and also force any text parts with long lines (longer
           than 998 octets) to wrap by QP or base64 encoding them. */
        camel_mime_message_set_best_encoding (message, CAMEL_BESTENC_GET_ENCODING, enctype);
-       
+
        cmdbuf = g_strdup ("DATA\r\n");
-       
+
        d(fprintf (stderr, "sending : %s", cmdbuf));
-       
+
        if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
                g_free (cmdbuf);
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                      _("DATA command failed: %s: mail not sent"),
                                      g_strerror (errno));
-               
+
                camel_service_disconnect ((CamelService *) transport, FALSE, NULL);
-               
+
                return FALSE;
        }
        g_free (cmdbuf);
-       
+
        respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-       
+
        d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-       
+
        if (!respbuf || strncmp (respbuf, "354", 3)) {
                /* we should have gotten instructions on how to use the DATA command:
                 * 354 Enter mail, end with "." on a line by itself
@@ -1248,20 +1248,20 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
                g_free (respbuf);
                return FALSE;
        }
-       
+
        g_free (respbuf);
        respbuf = NULL;
-       
+
        /* setup stream filtering */
        crlffilter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_ENCODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS);
        filtered_stream = camel_stream_filter_new_with_stream (transport->ostream);
        camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (crlffilter));
        camel_object_unref (crlffilter);
-       
+
        /* unlink the bcc headers */
        savedbcc = NULL;
        tail = (struct _camel_header_raw *) &savedbcc;
-       
+
        header = (struct _camel_header_raw *) &CAMEL_MIME_PART (message)->headers;
        n = header->next;
        while (n != NULL) {
@@ -1273,52 +1273,52 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
                } else {
                        header = n;
                }
-               
+
                n = header->next;
        }
-       
+
        /* write the message */
        ret = camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), CAMEL_STREAM (filtered_stream));
-       
+
        /* restore the bcc headers */
        header->next = savedbcc;
-       
+
        if (ret == -1) {
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                      _("DATA command failed: %s: mail not sent"),
                                      g_strerror (errno));
-               
+
                camel_object_unref (filtered_stream);
-               
+
                camel_service_disconnect ((CamelService *) transport, FALSE, NULL);
-               
+
                return FALSE;
        }
-       
+
        camel_stream_flush (CAMEL_STREAM (filtered_stream));
        camel_object_unref (filtered_stream);
-       
+
        /* terminate the message body */
-       
+
        d(fprintf (stderr, "sending : \\r\\n.\\r\\n\n"));
-       
+
        if (camel_stream_write (transport->ostream, "\r\n.\r\n", 5) == -1) {
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                      _("DATA command failed: %s: mail not sent"),
                                      g_strerror (errno));
-               
+
                camel_service_disconnect ((CamelService *) transport, FALSE, NULL);
-               
+
                return FALSE;
        }
-       
+
        do {
                /* Check for "250 Sender OK..." */
                g_free (respbuf);
                respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-               
+
                d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-               
+
                if (!respbuf || strncmp (respbuf, "250", 3)) {
                        smtp_set_exception (transport, TRUE, respbuf, _("DATA command failed"), ex);
                        g_free (respbuf);
@@ -1326,7 +1326,7 @@ smtp_data (CamelSmtpTransport *transport, CamelMimeMessage *message, CamelExcept
                }
        } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
        g_free (respbuf);
-       
+
        return TRUE;
 }
 
@@ -1335,29 +1335,29 @@ smtp_rset (CamelSmtpTransport *transport, CamelException *ex)
 {
        /* we are going to reset the smtp server (just to be nice) */
        char *cmdbuf, *respbuf = NULL;
-       
+
        cmdbuf = g_strdup ("RSET\r\n");
-       
+
        d(fprintf (stderr, "sending : %s", cmdbuf));
-       
+
        if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
                g_free (cmdbuf);
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                      _("RSET command failed: %s"), g_strerror (errno));
-               
+
                camel_service_disconnect ((CamelService *) transport, FALSE, NULL);
-               
+
                return FALSE;
        }
        g_free (cmdbuf);
-       
+
        do {
                /* Check for "250" */
                g_free (respbuf);
                respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-               
+
                d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-               
+
                if (!respbuf || strncmp (respbuf, "250", 3)) {
                        smtp_set_exception (transport, TRUE, respbuf, _("RSET command failed"), ex);
                        g_free (respbuf);
@@ -1365,7 +1365,7 @@ smtp_rset (CamelSmtpTransport *transport, CamelException *ex)
                }
        } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
        g_free (respbuf);
-       
+
        return TRUE;
 }
 
@@ -1374,27 +1374,27 @@ smtp_quit (CamelSmtpTransport *transport, CamelException *ex)
 {
        /* we are going to reset the smtp server (just to be nice) */
        char *cmdbuf, *respbuf = NULL;
-       
+
        cmdbuf = g_strdup ("QUIT\r\n");
-       
+
        d(fprintf (stderr, "sending : %s", cmdbuf));
-       
+
        if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
                g_free (cmdbuf);
                camel_exception_setv (ex, errno == EINTR ? CAMEL_EXCEPTION_USER_CANCEL : CAMEL_EXCEPTION_SYSTEM,
                                      _("QUIT command failed: %s"), g_strerror (errno));
-               
+
                return FALSE;
        }
        g_free (cmdbuf);
-       
+
        do {
                /* Check for "221" */
                g_free (respbuf);
                respbuf = camel_stream_buffer_read_line (CAMEL_STREAM_BUFFER (transport->istream));
-               
+
                d(fprintf (stderr, "received: %s\n", respbuf ? respbuf : "(null)"));
-               
+
                if (!respbuf || strncmp (respbuf, "221", 3)) {
                        smtp_set_exception (transport, FALSE, respbuf, _("QUIT command failed"), ex);
                        g_free (respbuf);
@@ -1402,6 +1402,6 @@ smtp_quit (CamelSmtpTransport *transport, CamelException *ex)
                }
        } while (*(respbuf+3) == '-'); /* if we got "221-" then loop again */
        g_free (respbuf);
-       
+
        return TRUE;
 }
index 988eac3..3fdc264 100644 (file)
@@ -1,14 +1,14 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* camel-smtp-transport.h : class for an smtp transfer */
 
-/* 
+/*
  * Authors:
  *   Jeffrey Stedfast <fejj@stampede.org>
  *
  * Copyright (C) 2000 Ximian, Inc. (www.ximian.com)
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -44,15 +44,15 @@ G_BEGIN_DECLS
 
 typedef struct {
        CamelTransport parent_object;
-       
+
        CamelStream *istream, *ostream;
-       
+
        guint32 flags;
-       
+
        gboolean connected;
        struct sockaddr *localaddr;
        socklen_t localaddrlen;
-       
+
        GHashTable *authtypes;
 } CamelSmtpTransport;
 
index 09454a9..29af44c 100644 (file)
@@ -16,7 +16,7 @@
 #define MAX_LOOP (10000)
 #define MAX_THREADS (5)
 
-#define d(x) 
+#define d(x)
 
 #define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
 
@@ -84,13 +84,13 @@ int main(int argc, char **argv)
 
                        camel_test_push("provider %s", local_providers[j]);
                        path = g_strdup_printf("%s:///tmp/camel-test/%s", local_providers[j], local_providers[j]);
-               
+
                        for (i=0;i<MAX_THREADS;i++)
                                pthread_create(&threads[i], 0, worker, NULL);
-                       
-                       for (i=0;i<MAX_THREADS;i++) 
+
+                       for (i=0;i<MAX_THREADS;i++)
                                pthread_join(threads[i], NULL);
-                       
+
                        test_free(path);
 
                        camel_test_pull();
index 462a04f..46088d8 100644 (file)
@@ -15,7 +15,7 @@
 #define MAX_LOOP (10000)
 #define MAX_THREADS (5)
 
-#define d(x) 
+#define d(x)
 
 #define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
 
index f789482..e4a5fb2 100644 (file)
@@ -70,7 +70,7 @@ static struct {
        char *expr;
 } searches[] = {
        { { 1, 1, 0 }, "(header-matches \"subject\" \"Test1 message99 subject\")" },
-       
+
        { { 100, 50, 0 }, "(header-contains \"subject\" \"subject\")" },
        { { 100, 50, 0 }, "(header-contains \"subject\" \"Subject\")" },
 
@@ -81,35 +81,35 @@ static struct {
        { { 100/13+1, 50/13+1, 0 }, "(user-flag \"every13\")" },
        { { 1, 1, 0 }, "(= \"7tag1\" (user-tag \"every7\"))" },
        { { 100/11+1, 50/11+1, 0 }, "(= \"11tag\" (user-tag \"every11\"))" },
-       
+
        { { 100/13 + 100/17 + 1, 50/13 + 50/17 + 2, 0 }, "(user-flag \"every13\" \"every17\")" },
        { { 100/13 + 100/17 + 1, 50/13 + 50/17 + 2, 0 }, "(or (user-flag \"every13\") (user-flag \"every17\"))" },
        { { 1, 0, 0 }, "(and (user-flag \"every13\") (user-flag \"every17\"))" },
-       
+
        { { 0, 0, 0 }, "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"Test2\"))" },
        /* we get 11 here as the header-contains is a substring match */
        { { 11, 6, 0 }, "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"subject\"))" },
        { { 1, 1, 0 }, "(and (header-contains \"subject\" \"Test19\") (header-contains \"subject\" \"subject\"))" },
        { { 0, 0, 0 }, "(and (header-contains \"subject\" \"Test191\") (header-contains \"subject\" \"subject\"))" },
        { { 1, 1, 0 }, "(and (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"message99\"))" },
-       
+
        { { 22, 11, 0 }, "(or (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"Test2\"))" },
        { { 2, 1, 0 }, "(or (header-contains \"subject\" \"Test16\") (header-contains \"subject\" \"Test99\"))" },
        { { 1, 1, 0 }, "(or (header-contains \"subject\" \"Test123\") (header-contains \"subject\" \"Test99\"))" },
        { { 100, 50, 0 }, "(or (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"subject\"))" },
        { { 11, 6, 0 }, "(or (header-contains \"subject\" \"Test1\") (header-contains \"subject\" \"message99\"))" },
-       
+
        /* 72000 is 24*60*100 == half the 'sent date' of the messages */
        { { 100/2, 50/2, 0 }, "(> 72000 (get-sent-date))" },
        { { 100/2-1, 50/2, 0 }, "(< 72000 (get-sent-date))" },
        { { 1, 0, 0 }, "(= 72000 (get-sent-date))" },
        { { 0, 0, 0 }, "(= 72001 (get-sent-date))" },
-       
+
        { { (100/2-1)/17+1, (50/2-1)/17+1, 0 }, "(and (user-flag \"every17\") (< 72000 (get-sent-date)))" },
        { { (100/2-1)/17+1, (50/2-1)/17, 0 }, "(and (user-flag \"every17\") (> 72000 (get-sent-date)))" },
        { { (100/2-1)/13+1, (50/2-1)/13+1, 0 }, "(and (user-flag \"every13\") (< 72000 (get-sent-date)))" },
        { { (100/2-1)/13+1, (50/2-1)/13+1, 0 }, "(and (user-flag \"every13\") (> 72000 (get-sent-date)))" },
-       
+
        { { 100/2+100/2/17, 50/2+50/2/17, 0 }, "(or (user-flag \"every17\") (< 72000 (get-sent-date)))" },
        { { 100/2+100/2/17+1, 50/2+50/2/17+1, 0 }, "(or (user-flag \"every17\") (> 72000 (get-sent-date)))" },
        { { 100/2+100/2/13, 50/2+50/2/13+1, 0 }, "(or (user-flag \"every13\") (< 72000 (get-sent-date)))" },
index eb7f5a6..b2bc105 100644 (file)
@@ -16,7 +16,7 @@
 #define MAX_MESSAGES (100)
 #define MAX_THREADS (10)
 
-#define d(x) 
+#define d(x)
 
 #define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
 
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
                        store = camel_session_get_store(session, path, ex);
                        check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
                        test_free(path);
-                       
+
                        if (index == 0)
                                folder = camel_store_get_folder(store, "testbox", CAMEL_STORE_FOLDER_CREATE, ex);
                        else
index 4e4f417..d1e2d6d 100644 (file)
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
                mailboxes[i].folder = folder = camel_store_get_folder(store, mailboxes[i].name, CAMEL_STORE_FOLDER_CREATE, ex);
                check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
                check(folder != NULL);
-               
+
                /* we need an empty folder for this to work */
                test_folder_counts(folder, 0, 0);
                pull();
@@ -139,7 +139,7 @@ int main(int argc, char **argv)
        mbox = camel_stream_fs_new_with_name("/tmp/camel-test/inbox", O_WRONLY|O_CREAT|O_EXCL, 0600);
        for (j=0;j<100;j++) {
                char *content, *subject;
-                       
+
                push("creating test message");
                msg = test_message_create_simple();
                content = g_strdup_printf("data%d content\n", j);
@@ -148,20 +148,20 @@ int main(int argc, char **argv)
                test_free(content);
                subject = g_strdup_printf("Test%d message%d subject", j, 100-j);
                camel_mime_message_set_subject(msg, subject);
-               
+
                camel_mime_message_set_date(msg, j*60*24, 0);
                pull();
-               
+
                camel_stream_printf(mbox, "From \n");
                check(camel_data_wrapper_write_to_stream((CamelDataWrapper *)msg, mbox) != -1);
-#if 0          
+#if 0
                push("appending simple message %d", j);
                camel_folder_append_message(folder, msg, NULL, ex);
                check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
                pull();
-#endif                         
+#endif
                test_free(subject);
-               
+
                check_unref(msg, 1);
        }
        check(camel_stream_close(mbox) != -1);
index 5727551..0ccae32 100644 (file)
@@ -14,7 +14,7 @@ test_address_compare(CamelInternetAddress *addr, CamelInternetAddress *addr2)
 
        check(camel_address_length(CAMEL_ADDRESS(addr)) == camel_address_length(CAMEL_ADDRESS(addr2)));
        for (j=0;j<camel_address_length(CAMEL_ADDRESS(addr));j++) {
-               
+
                check(camel_internet_address_get(addr, j, &r1, &a1) == TRUE);
                check(camel_internet_address_get(addr2, j, &r2, &a2) == TRUE);
 
index 41622cb..8693592 100644 (file)
@@ -48,9 +48,9 @@ static void
 dump_action(int id, struct _state *s, void *d)
 {
        struct _stack *node;
-       
+
        printf("\nThread %d:\n", id);
-       
+
        node = s->state;
        if (node) {
                printf("Current action:\n");
@@ -70,7 +70,7 @@ static void die(int sig)
                indie = 1;
                printf("\n\nReceived fatal signal %d\n", sig);
                g_hash_table_foreach(info_table, (GHFunc)dump_action, 0);
-               
+
                if (camel_test_verbose > 2) {
                        printf("Attach debugger to pid %d to debug\n", getpid());
                        sleep(1000);
@@ -95,36 +95,36 @@ current_state(void)
        }
        return info;
 }
-       
+
 
 void camel_test_init(int argc, char **argv)
 {
        struct stat st;
        char *path;
        int i;
-       
+
        setup = 1;
-       
+
        /* yeah, we do need ot thread init, even though camel isn't compiled with enable threads */
        g_thread_init (NULL);
-       
+
        path = g_strdup_printf ("/tmp/camel-test");
        if (mkdir (path, 0700) == -1 && errno != EEXIST)
                abort ();
-       
+
        if (stat (path, &st) == -1)
                abort ();
-       
+
        if (!S_ISDIR (st.st_mode) || access (path, R_OK | W_OK | X_OK) == -1)
                abort ();
-       
+
        camel_init (path, FALSE);
        g_free (path);
-       
+
        camel_type_init ();
-       
+
        info_table = g_hash_table_new(0, 0);
-       
+
        signal(SIGSEGV, die);
        signal(SIGABRT, die);
 
index ff3485f..98f8113 100644 (file)
@@ -129,26 +129,26 @@ hexdump (const unsigned char *in, int inlen)
        const unsigned char *inptr = in, *start = inptr;
        const unsigned char *inend = in + inlen;
        int octets;
-       
+
        while (inptr < inend) {
                octets = 0;
                while (inptr < inend && octets < 16) {
                        printf ("%.2X ", *inptr++);
                        octets++;
                }
-               
+
                while (octets < 16) {
                        printf ("   ");
                        octets++;
                }
-               
+
                printf ("       ");
-               
+
                while (start < inptr) {
                        fputc (isprint ((int) *start) ? *start : '.', stdout);
                        start++;
                }
-               
+
                fputc ('\n', stdout);
        }
 }
@@ -165,15 +165,15 @@ test_message_compare_content(CamelDataWrapper *dw, const char *text, int len)
 
        content = (CamelStreamMem *)camel_stream_mem_new();
        camel_data_wrapper_decode_to_stream(dw, (CamelStream *)content);
-       
+
        if (content->buffer->len != len) {
                printf ("original text:\n");
                hexdump (text, len);
-               
+
                printf ("new text:\n");
                hexdump (content->buffer->data, content->buffer->len);
        }
-       
+
        check_msg(content->buffer->len == len, "buffer->len = %d, len = %d", content->buffer->len, len);
        check_msg(memcmp(content->buffer->data, text, content->buffer->len) == 0, "len = %d", len);
 
@@ -187,22 +187,22 @@ test_message_compare (CamelMimeMessage *msg)
 {
        CamelMimeMessage *msg2;
        CamelStreamMem *mem1, *mem2;
-       
+
        mem1 = (CamelStreamMem *) camel_stream_mem_new ();
        check_msg(camel_data_wrapper_write_to_stream ((CamelDataWrapper *) msg, (CamelStream *) mem1) != -1, "write_to_stream 1 failed");
        camel_stream_reset ((CamelStream *) mem1);
-       
+
        msg2 = camel_mime_message_new ();
        check_msg(camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) msg2, (CamelStream *) mem1) != -1, "construct_from_stream 1 failed");
        camel_stream_reset ((CamelStream *) mem1);
-       
+
        mem2 = (CamelStreamMem *) camel_stream_mem_new ();
        check_msg(camel_data_wrapper_write_to_stream ((CamelDataWrapper *) msg2, (CamelStream *) mem2) != -1, "write_to_stream 2 failed");
        camel_stream_reset ((CamelStream *) mem2);
-       
+
        if (mem1->buffer->len != mem2->buffer->len) {
                CamelDataWrapper *content;
-               
+
                printf ("mem1 stream:\n%.*s\n", mem1->buffer->len, mem1->buffer->data);
                printf ("mem2 stream:\n%.*s\n\n", mem2->buffer->len, mem2->buffer->data);
 
@@ -215,16 +215,16 @@ test_message_compare (CamelMimeMessage *msg)
        }
 
        check_unref(msg2, 1);
-       
+
        check_msg (mem1->buffer->len == mem2->buffer->len,
                   "mem1->buffer->len = %d, mem2->buffer->len = %d",
                   mem1->buffer->len, mem2->buffer->len);
-       
+
        check_msg (memcmp (mem1->buffer->data, mem2->buffer->data, mem1->buffer->len) == 0, "msg/stream compare");
-       
+
        camel_object_unref (mem1);
        camel_object_unref (mem2);
-       
+
        return 0;
 }
 
@@ -260,7 +260,7 @@ message_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int depth)
        printf("%s part encoding: %s\n", s, camel_transfer_encoding_to_string(part->encoding));
 
        containee = camel_medium_get_content_object (CAMEL_MEDIUM (part));
-       
+
        if (containee == NULL)
                return;
 
@@ -269,13 +269,13 @@ message_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int depth)
        printf ("%sContent-Type: %s\n", s, mime_type);
        g_free (mime_type);
        printf("%s encoding: %s\n", s, camel_transfer_encoding_to_string(((CamelDataWrapper *)containee)->encoding));
-       
+
        /* using the object types is more accurate than using the mime/types */
        if (CAMEL_IS_MULTIPART (containee)) {
                parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
                for (i = 0; i < parts; i++) {
                        CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
-                       
+
                        message_dump_rec(msg, part, depth+1);
                }
        } else if (CAMEL_IS_MIME_MESSAGE (containee)) {
index bf23fbe..29fa0e4 100644 (file)
@@ -15,7 +15,7 @@ CamelType
 camel_test_session_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (
                        camel_session_get_type (),
@@ -27,7 +27,7 @@ camel_test_session_get_type (void)
                        NULL,
                        NULL);
        }
-       
+
        return type;
 }
 
@@ -35,10 +35,10 @@ CamelSession *
 camel_test_session_new (const char *path)
 {
        CamelSession *session;
-       
+
        session = CAMEL_SESSION (camel_object_new (CAMEL_TEST_SESSION_TYPE));
-       
+
        camel_session_construct (session, path);
-       
+
        return session;
 }
index e69ef65..fdc5b47 100644 (file)
@@ -7,12 +7,12 @@
 
 typedef struct _CamelTestSession {
        CamelSession parent_object;
-       
+
 } CamelTestSession;
 
 typedef struct _CamelTestSessionClass {
        CamelSessionClass parent_class;
-       
+
 } CamelTestSessionClass;
 
 CamelType camel_test_session_get_type (void);
index 8dcf84c..41eb73d 100644 (file)
@@ -139,7 +139,7 @@ int main(int argc, char **argv)
                        test_message_write_file(msg, "test1.msg");
                        check_unref(msg, 1);
                        pull();
-       
+
                        push("read from test1.msg");
                        msg2 = test_message_read_file("test1.msg");
                        pull();
@@ -163,7 +163,7 @@ int main(int argc, char **argv)
                text = texts[j].text;
                len = texts[j].len;
                for (i=0;i<CAMEL_TRANSFER_NUM_ENCODINGS;i++) {
-                       
+
                        push("test simple message, encoding %s", camel_transfer_encoding_to_string(i));
                        msg = test_message_create_simple();
 
@@ -178,7 +178,7 @@ int main(int argc, char **argv)
                        test_message_write_file(msg, "test1.msg");
                        check_unref(msg, 1);
                        pull();
-       
+
                        push("read from test1.msg");
                        msg2 = test_message_read_file("test1.msg");
                        pull();
index d8659a0..7e31fe0 100644 (file)
@@ -305,7 +305,7 @@ int main(int argc, char **argv)
                check(strcmp(format, test_address[i].utf8) == 0);
                test_free(format);
                pull();
-               
+
                push("Comparing re-encoded output");
                addr2 = CAMEL_INTERNET_ADDRESS(camel_internet_address_new());
                enc = camel_address_encode(CAMEL_ADDRESS(addr));
index ac82895..eeac76a 100644 (file)
@@ -99,7 +99,7 @@ int main(int argc, char **argv)
        unlink("test3.msg");
        test_message_write_file(msg, "test3.msg");
        pull();
-       
+
        push("read from test3.msg");
        msg2 = test_message_read_file("test3.msg");
        pull();
index ea3ebdf..ebac5f0 100644 (file)
@@ -44,21 +44,21 @@ dump_mime_struct (CamelMimePart *mime_part, int depth)
        CamelDataWrapper *content;
        char *mime_type;
        int i = 0;
-       
+
        while (i < depth) {
                printf ("   ");
                i++;
        }
-       
+
        content = camel_medium_get_content_object ((CamelMedium *) mime_part);
-       
+
        mime_type = camel_data_wrapper_get_mime_type (content);
        printf ("Content-Type: %s\n", mime_type);
        g_free (mime_type);
-       
+
        if (CAMEL_IS_MULTIPART (content)) {
                guint num, index = 0;
-               
+
                num = camel_multipart_get_number ((CamelMultipart *) content);
                while (index < num) {
                        mime_part = camel_multipart_get_part ((CamelMultipart *) content, index);
@@ -76,54 +76,54 @@ int main (int argc, char **argv)
        struct dirent *dent;
        DIR *dir;
        int fd;
-       
+
        camel_test_init (argc, argv);
-       
+
        camel_test_start ("Message Test Suite");
-       
+
        if (!(dir = opendir ("../data/messages")))
                return 77;
-       
+
        while ((dent = readdir (dir)) != NULL) {
                CamelMimeMessage *message;
                CamelStream *stream;
                char *filename;
                struct stat st;
-               
+
                if (dent->d_name[0] == '.')
                        continue;
-               
+
                filename = g_strdup_printf ("../data/messages/%s", dent->d_name);
                if (stat (filename, &st) == -1 || !S_ISREG (st.st_mode)) {
                        g_free (filename);
                        continue;
                }
-               
+
                if ((fd = open (filename, O_RDONLY)) == -1) {
                        g_free (filename);
                        continue;
                }
-               
+
                push ("testing message `%s`", filename);
                g_free (filename);
-               
+
                stream = camel_stream_fs_new_with_fd (fd);
                message = camel_mime_message_new ();
                camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) message, stream);
                camel_stream_reset (stream);
-               
+
                /*dump_mime_struct ((CamelMimePart *) message, 0);*/
                test_message_compare (message);
-               
+
                camel_object_unref (message);
                camel_object_unref (stream);
-               
+
                pull ();
        }
-       
+
        closedir (dir);
-       
+
        camel_test_end ();
-       
+
        return 0;
 }
index f928c15..2824086 100644 (file)
@@ -20,7 +20,7 @@
 
 #define CHUNK_SIZE 4096
 
-int 
+int
 main (int argc, char **argv)
 {
        ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
@@ -32,25 +32,25 @@ main (int argc, char **argv)
        struct dirent *dent;
        int i, test = 0;
        DIR *dir;
-       
+
        camel_test_init(argc, argv);
-       
+
        dir = opendir (SOURCEDIR);
        if (!dir)
                return 1;
-       
+
        while ((dent = readdir (dir))) {
                char *infile, *outfile, *charset, *work;
                const char *ext;
-               
+
                ext = strrchr (dent->d_name, '.');
                if (!(!strncmp (dent->d_name, "charset-", 8) && ext && !strcmp (ext, ".in")))
                        continue;
-               
+
                work = g_strdup_printf ("Charset filter, test case %d (%s)", test++, dent->d_name);
                camel_test_start (work);
                g_free (work);
-               
+
                infile = g_strdup_printf ("%s/%s", SOURCEDIR, dent->d_name);
                if (!(source = camel_stream_fs_new_with_name (infile, 0, O_RDONLY))) {
                        camel_test_fail ("Failed to open input case in \"%s\"", infile);
@@ -58,88 +58,88 @@ main (int argc, char **argv)
                        continue;
                }
                g_free (infile);
-               
+
                outfile = g_strdup_printf ("%s/%.*s.out", SOURCEDIR, ext - dent->d_name, dent->d_name);
-               
+
                if (!(correct = camel_stream_fs_new_with_name (outfile, 0, O_RDONLY))) {
                        camel_test_fail ("Failed to open correct output in \"%s\"", outfile);
                        g_free (outfile);
                        continue;
                }
                g_free (outfile);
-               
+
                if (!(filter = camel_stream_filter_new_with_stream (CAMEL_STREAM (source)))) {
                        camel_test_fail ("Couldn't create CamelStreamFilter??");
                        continue;
                }
-               
+
                charset = g_strdup (dent->d_name + 8);
                ext = strchr (charset, '.');
                *((char *) ext) = '\0';
-               
+
                if (!(f = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "UTF-8"))) {
                        camel_test_fail ("Couldn't create CamelMimeFilterCharset??");
                        g_free (charset);
                        continue;
                }
                g_free (charset);
-               
+
                camel_stream_filter_add (filter, f);
                camel_object_unref (f);
-               
+
                camel_test_push ("Running filter and comparing to correct result");
-               
+
                comp_progress = 0;
-               
+
                while (1) {
                        comp_correct_chunk = camel_stream_read (correct, comp_correct, CHUNK_SIZE);
                        comp_filter_chunk = 0;
-                       
+
                        if (comp_correct_chunk == 0)
                                break;
-                       
+
                        while (comp_filter_chunk < comp_correct_chunk) {
                                ssize_t delta;
-                               
-                               delta = camel_stream_read (CAMEL_STREAM (filter), 
-                                                          comp_filter + comp_filter_chunk, 
+
+                               delta = camel_stream_read (CAMEL_STREAM (filter),
+                                                          comp_filter + comp_filter_chunk,
                                                           CHUNK_SIZE - comp_filter_chunk);
-                               
+
                                if (delta == 0) {
                                        camel_test_fail ("Chunks are different sizes: correct is %d, "
                                                         "filter is %d, %d bytes into stream",
                                                         comp_correct_chunk, comp_filter_chunk, comp_progress);
                                }
-                               
+
                                comp_filter_chunk += delta;
                        }
-                       
+
                        for (i = 0; i < comp_filter_chunk; i++) {
                                if (comp_correct[i] != comp_filter[i]) {
                                        camel_test_fail ("Difference: correct is %c, filter is %c, "
                                                         "%d bytes into stream",
-                                                        comp_correct[i], 
+                                                        comp_correct[i],
                                                         comp_filter[i],
                                                         comp_progress + i);
                                }
                        }
-                       
+
                        comp_progress += comp_filter_chunk;
                }
-               
+
                camel_test_pull ();
-               
+
                /* inefficient */
                camel_test_push ("Cleaning up");
                camel_object_unref (CAMEL_OBJECT (filter));
                camel_object_unref (CAMEL_OBJECT (correct));
                camel_object_unref (CAMEL_OBJECT (source));
                camel_test_pull ();
-               
+
                camel_test_end ();
        }
-       
+
        closedir (dir);
-       
+
        return 0;
 }
index bbf443b..601feac 100644 (file)
@@ -25,7 +25,7 @@ enum {
        CRLF_DONE
 };
 
-int 
+int
 main (int argc, char **argv)
 {
        CamelStream *source;
@@ -37,20 +37,20 @@ main (int argc, char **argv)
        ssize_t comp_progress, comp_correct_chunk, comp_filter_chunk;
        int comp_i;
        char comp_correct[CHUNK_SIZE], comp_filter[CHUNK_SIZE];
-       
+
        camel_test_init(argc, argv);
-       
+
        for (i = 0; i < NUM_CASES; i++) {
                int j;
-               
+
                work = g_strdup_printf ("CRLF/DOT filter, test case %d", i);
                camel_test_start (work);
                g_free (work);
-               
+
                for (j = CRLF_ENCODE; j < CRLF_DONE; j++) {
                        CamelMimeFilterCRLFDirection direction;
                        char *infile = NULL, *outfile = NULL;
-                       
+
                        switch (j) {
                        case CRLF_ENCODE:
                                camel_test_push ("Test of the encoder");
@@ -67,7 +67,7 @@ main (int argc, char **argv)
                        default:
                                break;
                        }
-                       
+
                        camel_test_push ("Initializing objects");
                        source = camel_stream_fs_new_with_name (infile, 0, O_RDONLY);
                        if (!source) {
@@ -76,7 +76,7 @@ main (int argc, char **argv)
                                continue;
                        }
                        g_free (infile);
-                       
+
                        correct = camel_stream_fs_new_with_name (outfile, 0, O_RDONLY);
                        if (!correct) {
                                camel_test_fail ("Failed to open correct output in \"%s\"", outfile);
@@ -84,64 +84,64 @@ main (int argc, char **argv)
                                continue;
                        }
                        g_free (outfile);
-                       
+
                        filter = camel_stream_filter_new_with_stream (CAMEL_STREAM (source));
                        if (!filter) {
                                camel_test_fail ("Couldn't create CamelStreamFilter??");
                                continue;
                        }
-                       
+
                        sh = camel_mime_filter_crlf_new (direction, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS);
                        if (!sh) {
                                camel_test_fail ("Couldn't create CamelMimeFilterCrlf??");
                                continue;
                        }
-                       
+
                        camel_stream_filter_add (filter, sh);
                        camel_test_pull ();
-                       
+
                        camel_test_push ("Running filter and comparing to correct result");
-                       
+
                        comp_progress = 0;
-                       
+
                        while (1) {
                                comp_correct_chunk = camel_stream_read (correct, comp_correct, CHUNK_SIZE);
                                comp_filter_chunk = 0;
-                               
+
                                if (comp_correct_chunk == 0)
                                        break;
-                               
+
                                while (comp_filter_chunk < comp_correct_chunk) {
                                        ssize_t delta;
-                                       
-                                       delta = camel_stream_read (CAMEL_STREAM (filter), 
-                                                                  comp_filter + comp_filter_chunk, 
+
+                                       delta = camel_stream_read (CAMEL_STREAM (filter),
+                                                                  comp_filter + comp_filter_chunk,
                                                                   CHUNK_SIZE - comp_filter_chunk);
-                                       
+
                                        if (delta == 0) {
                                                camel_test_fail ("Chunks are different sizes: correct is %d, "
                                                                 "filter is %d, %d bytes into stream",
                                                                 comp_correct_chunk, comp_filter_chunk, comp_progress);
                                        }
-                                       
+
                                        comp_filter_chunk += delta;
                                }
-                               
+
                                for (comp_i = 0; comp_i < comp_filter_chunk; comp_i++) {
                                        if (comp_correct[comp_i] != comp_filter[comp_i]) {
                                                camel_test_fail ("Difference: correct is %c, filter is %c, "
                                                                 "%d bytes into stream",
-                                                                comp_correct[comp_i], 
+                                                                comp_correct[comp_i],
                                                                 comp_filter[comp_i],
                                                                 comp_progress + comp_i);
                                        }
                                }
-                               
+
                                comp_progress += comp_filter_chunk;
                        }
-                       
+
                        camel_test_pull ();
-                       
+
                        /* inefficient */
                        camel_test_push ("Cleaning up");
                        camel_object_unref (CAMEL_OBJECT (filter));
@@ -149,12 +149,12 @@ main (int argc, char **argv)
                        camel_object_unref (CAMEL_OBJECT (source));
                        camel_object_unref (CAMEL_OBJECT (sh));
                        camel_test_pull ();
-                       
+
                        camel_test_pull ();
                }
-               
+
                camel_test_end ();
        }
-       
+
        return 0;
 }
index 5b7842f..c16f72e 100644 (file)
@@ -52,7 +52,7 @@ test_filter(CamelMimeFilter *f, const char *inname, const char *outname)
        check_count(indisk, 2);
        id = camel_stream_filter_add((CamelStreamFilter *)filter, f);
        check_count(f, 2);
-               
+
        check(camel_stream_write_to_stream(filter, (CamelStream *)in) > 0);
        check_msg(in->buffer->len == out->buffer->len
                  && memcmp(in->buffer->data, out->buffer->data, in->buffer->len) == 0,
@@ -99,13 +99,13 @@ test_filter(CamelMimeFilter *f, const char *inname, const char *outname)
        camel_test_pull();
 }
 
-int 
+int
 main (int argc, char **argv)
 {
        int i;
 
        camel_test_init(argc, argv);
-       
+
        camel_test_start("HTML Stream filtering");
 
        for (i=0;i<100;i++) {
index a0a68db..fec7ae4 100644 (file)
@@ -53,13 +53,13 @@ struct {
          "Tasmiania with fur\r\n=46rom here or there ?\r\n" },
 };
 
-int 
+int
 main (int argc, char **argv)
 {
        CamelStreamFilter *filter;
        CamelMimeFilter *sh;
        int i;
-       
+
        camel_test_init(argc, argv);
 
        camel_test_start("canonicalisation filter tests");
@@ -103,6 +103,6 @@ main (int argc, char **argv)
        }
 
        camel_test_end();
-       
+
        return 0;
 }
index b89a2eb..f0cfd50 100644 (file)
@@ -45,7 +45,7 @@ struct {
        { "=?iso-8859-1?q?th?= =?iso-8859-1?q?is?= is some text", "this is some text", 0 },
        { "=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=  =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=",
          "If you can read this you understand the example.", 0 },
-#if 0  
+#if 0
        /* And oddly enough, camel fails on these, removed for now */
 
        /* second half: brokenly encoded rfc2047 words */
@@ -79,11 +79,11 @@ int main (int argc, char ** argv)
 {
        char *decoded;
        int i;
-       
+
        camel_test_init (argc, argv);
-       
+
        camel_test_start ("rfc2047 decoding");
-       
+
        for (i = 0; i < G_N_ELEMENTS (test1); i++) {
                camel_test_push ("rfc2047 decoding[%d] '%s'", i, test1[i].encoded);
                decoded = camel_header_decode_string (test1[i].encoded, "iso-8859-1");
@@ -91,11 +91,11 @@ int main (int argc, char ** argv)
                g_free (decoded);
                camel_test_pull ();
        }
-       
+
        camel_test_end ();
-       
+
        camel_test_start ("rfc2047 ctext decoding");
-       
+
        for (i = 0; i < G_N_ELEMENTS (test2); i++) {
                camel_test_push ("rfc2047 ctext decoding[%d] '%s'", i, test2[i].encoded);
                decoded = camel_header_format_ctext (test2[i].encoded, "iso-8859-1");
@@ -103,8 +103,8 @@ int main (int argc, char ** argv)
                g_free (decoded);
                camel_test_pull ();
        }
-       
+
        camel_test_end ();
-       
+
        return 0;
 }
index 2ad74c3..bfeb3be 100644 (file)
@@ -90,28 +90,28 @@ int main (int argc, char **argv)
        char *html, *url, *p;
        int i, errors = 0;
        guint32 flags;
-       
+
        camel_test_init (argc, argv);
-       
+
        camel_test_start ("URL scanning");
-       
+
        flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES;
        for (i = 0; i < num_url_tests; i++) {
                camel_test_push ("'%s' => '%s'", url_tests[i].text, url_tests[i].url ? url_tests[i].url : "None");
-               
+
                html = camel_text_to_html (url_tests[i].text, flags, 0);
-               
+
                url = strstr (html, "href=\"");
                if (url) {
                        url += 6;
                        p = strchr (url, '"');
                        if (p)
                                *p = '\0';
-                       
+
                        while ((p = strstr (url, "&amp;")))
                                memmove (p + 1, p + 5, strlen (p + 5) + 1);
                }
-               
+
                if ((url && (!url_tests[i].url || strcmp (url, url_tests[i].url) != 0)) ||
                    (!url && url_tests[i].url)) {
                        printf ("FAILED on \"%s\" -> %s\n  (got %s)\n\n",
@@ -120,13 +120,13 @@ int main (int argc, char **argv)
                                url ? url : "(nothing)");
                        errors++;
                }
-               
+
                g_free (html);
        }
-       
+
        printf ("\n%d errors\n", errors);
-       
+
        camel_test_end ();
-       
+
        return errors;
 }
index 5f06471..04526d8 100644 (file)
@@ -51,12 +51,12 @@ static char test_msg[] = "Since we need to make sure that\nFrom lines work okay,
 
 typedef struct _CamelPgpSession {
        CamelSession parent_object;
-       
+
 } CamelPgpSession;
 
 typedef struct _CamelPgpSessionClass {
        CamelSessionClass parent_class;
-       
+
 } CamelPgpSessionClass;
 
 
@@ -76,7 +76,7 @@ class_init (CamelPgpSessionClass *camel_pgp_session_class)
 {
        CamelSessionClass *camel_session_class =
                CAMEL_SESSION_CLASS (camel_pgp_session_class);
-       
+
        /* virtual method override */
        camel_session_class->get_password = get_password;
 }
@@ -85,7 +85,7 @@ static CamelType
 camel_pgp_session_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (
                        camel_test_session_get_type (),
@@ -97,7 +97,7 @@ camel_pgp_session_get_type (void)
                        (CamelObjectInitFunc) init,
                        NULL);
        }
-       
+
        return type;
 }
 
@@ -112,11 +112,11 @@ static CamelSession *
 camel_pgp_session_new (const char *path)
 {
        CamelSession *session;
-       
+
        session = CAMEL_SESSION (camel_object_new (CAMEL_PGP_SESSION_TYPE));
-       
+
        camel_session_construct (session, path);
-       
+
        return session;
 }
 
@@ -134,81 +134,81 @@ int main (int argc, char **argv)
        int ret;
 
        camel_test_init (argc, argv);
-       
+
        /* clear out any camel-test data */
        system ("/bin/rm -rf /tmp/camel-test");
        system ("/bin/mkdir /tmp/camel-test");
        setenv ("GNUPGHOME", "/tmp/camel-test/.gnupg", 1);
-       
+
        /* import the gpg keys */
        if ((ret = system ("gpg < /dev/null > /dev/null 2>&1")) == -1)
                return 77;
        else if (WEXITSTATUS (ret) == 127)
                return 77;
-       
+
        system ("gpg --import ../data/camel-test.gpg.pub > /dev/null 2>&1");
        system ("gpg --import ../data/camel-test.gpg.sec > /dev/null 2>&1");
-       
+
        session = camel_pgp_session_new ("/tmp/camel-test");
-       
+
        ex = camel_exception_new ();
-       
+
        ctx = camel_gpg_context_new (session);
        camel_gpg_context_set_always_trust (CAMEL_GPG_CONTEXT (ctx), TRUE);
-       
+
        camel_test_start ("Test of PGP/MIME functions");
-       
+
        mime_part = camel_mime_part_new ();
        camel_mime_part_set_content (mime_part, test_msg, strlen (test_msg), "text/plain");
        camel_mime_part_set_description (mime_part, "Test of PGP/MIME multipart/signed stuff");
-       
+
        camel_test_push ("PGP/MIME signing");
        mps = camel_multipart_signed_new ();
        camel_multipart_signed_sign (mps, ctx, mime_part, "no.user@no.domain", CAMEL_CIPHER_HASH_SHA1, ex);
        check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
        camel_test_pull ();
-       
+
        camel_object_unref (mime_part);
        camel_exception_clear (ex);
-       
+
        camel_test_push ("PGP/MIME verify");
        valid = camel_multipart_signed_verify (mps, ctx, ex);
        check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
        check_msg (camel_cipher_validity_get_valid (valid), "%s", camel_cipher_validity_get_description (valid));
        camel_cipher_validity_free (valid);
        camel_test_pull ();
-       
+
        camel_object_unref (mps);
        camel_exception_clear (ex);
-       
+
        mime_part = camel_mime_part_new ();
        camel_mime_part_set_content (mime_part, test_msg, strlen (test_msg), "text/plain");
        camel_mime_part_set_description (mime_part, "Test of PGP/MIME multipart/encrypted stuff");
-       
+
        camel_test_push ("PGP/MIME encrypt");
        recipients = g_ptr_array_new ();
        g_ptr_array_add (recipients, "no.user@no.domain");
-       
+
        mpe = camel_multipart_encrypted_new ();
        camel_multipart_encrypted_encrypt (mpe, mime_part, ctx, "no.user@no.domain", recipients, ex);
        check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
        g_ptr_array_free (recipients, TRUE);
        camel_test_pull ();
-       
+
        camel_exception_clear (ex);
        camel_object_unref (mime_part);
-       
+
        camel_test_push ("PGP/MIME decrypt");
        mime_part = camel_multipart_encrypted_decrypt (mpe, ctx, ex);
        check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
        camel_object_unref (mime_part);
        camel_object_unref (mpe);
        camel_test_pull ();
-       
+
        camel_object_unref (CAMEL_OBJECT (ctx));
        camel_object_unref (CAMEL_OBJECT (session));
-       
+
        camel_test_end ();
-       
+
        return 0;
 }
index 2731a19..5fdaa0e 100644 (file)
 
 typedef struct _CamelPgpSession {
        CamelSession parent_object;
-       
+
 } CamelPgpSession;
 
 typedef struct _CamelPgpSessionClass {
        CamelSessionClass parent_class;
-       
+
 } CamelPgpSessionClass;
 
 
@@ -69,7 +69,7 @@ class_init (CamelPgpSessionClass *camel_pgp_session_class)
 {
        CamelSessionClass *camel_session_class =
                CAMEL_SESSION_CLASS (camel_pgp_session_class);
-       
+
        /* virtual method override */
        camel_session_class->get_password = get_password;
 }
@@ -78,7 +78,7 @@ static CamelType
 camel_pgp_session_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (
                        camel_test_session_get_type (),
@@ -90,7 +90,7 @@ camel_pgp_session_get_type (void)
                        (CamelObjectInitFunc) init,
                        NULL);
        }
-       
+
        return type;
 }
 
@@ -105,11 +105,11 @@ static CamelSession *
 camel_pgp_session_new (const char *path)
 {
        CamelSession *session;
-       
+
        session = CAMEL_SESSION (camel_object_new (CAMEL_PGP_SESSION_TYPE));
-       
+
        camel_session_construct (session, path);
-       
+
        return session;
 }
 
@@ -130,14 +130,14 @@ int main (int argc, char **argv)
 
        if (getenv("CAMEL_TEST_GPG") == NULL)
                return 77;
-       
+
        camel_test_init (argc, argv);
-       
+
        /* clear out any camel-test data */
        system ("/bin/rm -rf /tmp/camel-test");
        system ("/bin/mkdir /tmp/camel-test");
        setenv ("GNUPGHOME", "/tmp/camel-test/.gnupg", 1);
-       
+
        /* import the gpg keys */
        if ((ret = system ("gpg < /dev/null > /dev/null 2>&1")) == -1)
                return 77;
@@ -150,12 +150,12 @@ int main (int argc, char **argv)
        system ("gpg --import " TEST_DATA_DIR "/camel-test.gpg.sec > /dev/null 2>&1");
 
        session = camel_pgp_session_new ("/tmp/camel-test");
-       
+
        ex = camel_exception_new ();
-       
+
        ctx = camel_gpg_context_new (session);
        camel_gpg_context_set_always_trust (CAMEL_GPG_CONTEXT (ctx), TRUE);
-       
+
        camel_test_start ("Test of PGP functions");
 
        stream1 = camel_stream_mem_new ();
@@ -179,19 +179,19 @@ int main (int argc, char **argv)
                return 77;
        }
        camel_test_pull ();
-       
+
        camel_exception_clear (ex);
-       
+
        camel_test_push ("PGP verify");
        valid = camel_cipher_verify (ctx, sigpart, ex);
        check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
        check_msg (camel_cipher_validity_get_valid (valid), "%s", camel_cipher_validity_get_description (valid));
        camel_cipher_validity_free (valid);
        camel_test_pull ();
-       
+
        camel_object_unref(conpart);
        camel_object_unref(sigpart);
-       
+
        stream1 = camel_stream_mem_new ();
        camel_stream_write (stream1, "Hello, I am a test of encryption/decryption.", 44);
        camel_stream_reset (stream1);
@@ -205,9 +205,9 @@ int main (int argc, char **argv)
        camel_object_unref(dw);
 
        encpart = camel_mime_part_new();
-       
+
        camel_exception_clear (ex);
-       
+
        camel_test_push ("PGP encrypt");
        recipients = g_ptr_array_new ();
        g_ptr_array_add (recipients, "no.user@no.domain");
@@ -217,7 +217,7 @@ int main (int argc, char **argv)
        camel_test_pull ();
 
        camel_exception_clear (ex);
-       
+
        camel_test_push ("PGP decrypt");
        outpart = camel_mime_part_new();
        valid = camel_cipher_decrypt (ctx, encpart, outpart, ex);
@@ -245,11 +245,11 @@ int main (int argc, char **argv)
        camel_object_unref(outpart);
 
        camel_test_pull ();
-       
+
        camel_object_unref (CAMEL_OBJECT (ctx));
        camel_object_unref (CAMEL_OBJECT (session));
-       
+
        camel_test_end ();
-       
+
        return 0;
 }
index baedd36..9445dcf 100644 (file)
 
 typedef struct _CamelTestSession {
        CamelSession parent_object;
-       
+
 } CamelTestSession;
 
 typedef struct _CamelTestSessionClass {
        CamelSessionClass parent_class;
-       
+
 } CamelTestSessionClass;
 
 
@@ -41,7 +41,7 @@ class_init (CamelTestSessionClass *camel_test_session_class)
 {
        CamelSessionClass *camel_session_class =
                CAMEL_SESSION_CLASS (camel_test_session_class);
-       
+
        /* virtual method override */
        camel_session_class->get_password = get_password;
 }
@@ -50,7 +50,7 @@ static CamelType
 camel_test_session_get_type (void)
 {
        static CamelType type = CAMEL_INVALID_TYPE;
-       
+
        if (type == CAMEL_INVALID_TYPE) {
                type = camel_type_register (
                        camel_test_session_get_type (),
@@ -62,7 +62,7 @@ camel_test_session_get_type (void)
                        (CamelObjectInitFunc) init,
                        NULL);
        }
-       
+
        return type;
 }
 
@@ -77,11 +77,11 @@ static CamelSession *
 camel_test_session_new (const char *path)
 {
        CamelSession *session;
-       
+
        session = CAMEL_SESSION (camel_object_new (CAMEL_TEST_SESSION_TYPE));
-       
+
        camel_session_construct (session, path);
-       
+
        return session;
 }
 
@@ -96,34 +96,34 @@ int main (int argc, char **argv)
        GPtrArray *recipients;
        GByteArray *buf;
        char *before, *after;
-       
+
        camel_test_init (argc, argv);
-       
+
        ex = camel_exception_new ();
-       
+
        /* clear out any camel-test data */
        system ("/bin/rm -rf /tmp/camel-test");
-       
+
        session = camel_test_session_new ("/tmp/camel-test");
-       
+
        ctx = camel_smime_context_new (session);
-       
+
        camel_test_start ("Test of S/MIME PKCS7 functions");
-       
+
        stream1 = camel_stream_mem_new ();
        camel_stream_write (stream1, "Hello, I am a test stream.", 25);
        camel_stream_reset (stream1);
-       
+
        stream2 = camel_stream_mem_new ();
-       
+
        camel_test_push ("PKCS7 signing");
        camel_smime_sign (ctx, "smime@xtorshun.org", CAMEL_CIPHER_HASH_SHA1,
                          stream1, stream2, ex);
        check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
        camel_test_pull ();
-       
+
        camel_exception_clear (ex);
-       
+
        camel_test_push ("PKCS7 verify");
        camel_stream_reset (stream1);
        camel_stream_reset (stream2);
@@ -132,19 +132,19 @@ int main (int argc, char **argv)
        check_msg (camel_cipher_validity_get_valid (valid), "%s", camel_cipher_validity_get_description (valid));
        camel_cipher_validity_free (valid);
        camel_test_pull ();
-       
+
        camel_object_unref (CAMEL_OBJECT (stream1));
        camel_object_unref (CAMEL_OBJECT (stream2));
-       
+
        stream1 = camel_stream_mem_new ();
        stream2 = camel_stream_mem_new ();
        stream3 = camel_stream_mem_new ();
-       
+
        camel_stream_write (stream1, "Hello, I am a test of encryption/decryption.", 44);
        camel_stream_reset (stream1);
-       
+
        camel_exception_clear (ex);
-       
+
        camel_test_push ("PKCS7 encrypt");
        recipients = g_ptr_array_new ();
        g_ptr_array_add (recipients, "smime@xtorshun.org");
@@ -153,10 +153,10 @@ int main (int argc, char **argv)
        check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
        g_ptr_array_free (recipients, TRUE);
        camel_test_pull ();
-       
+
        camel_stream_reset (stream2);
        camel_exception_clear (ex);
-       
+
        camel_test_push ("PKCS7 decrypt");
        camel_smime_decrypt (ctx, stream2, stream3, ex);
        check_msg (!camel_exception_is_set (ex), "%s", camel_exception_get_description (ex));
@@ -168,11 +168,11 @@ int main (int argc, char **argv)
        g_free (before);
        g_free (after);
        camel_test_pull ();
-       
+
        camel_object_unref (CAMEL_OBJECT (ctx));
        camel_object_unref (CAMEL_OBJECT (session));
-       
+
        camel_test_end ();
-       
+
        return 0;
 }
index 452d452..0ca68c8 100644 (file)
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
                check_unref(ss, 1);
                check(close(fd) == -1);
                pull();
-               
+
                (void)unlink("stream.txt");
        }
 
index f85a8ce..de829cc 100644 (file)
@@ -52,14 +52,14 @@ int main(int argc, char **argv)
                        push("stream subrange %d-%d", ranges[i].lower, ranges[i].upper);
                        sus = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
                        check(sus != NULL);
-                       
+
                        test_seekable_substream_writepart((CamelStream *)sus, j);
                        test_seekable_substream_readpart((CamelStream *)sus);
-                       
+
                        sus2 = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
                        check(sus2 != NULL);
                        test_seekable_substream_readpart((CamelStream *)sus2);
-                       
+
                        check_unref(sus, 1);
                        check_unref(sus2, 1);
                        pull();
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
                        sus2 = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
                        check(sus2 != NULL);
                        test_seekable_substream_readpart((CamelStream *)sus2);
-                       
+
                        check_unref(sus, 1);
                        check_unref(sus2, 1);
                        pull();
index 62225ff..16be1a9 100644 (file)
@@ -553,6 +553,11 @@ The URI of the contact's calendar.
 
 </para>
 
+<!-- ##### ARG EContact:phone ##### -->
+<para>
+
+</para>
+
 <!-- ##### ARG EContact:photo ##### -->
 <para>
 
@@ -730,6 +735,7 @@ The URI of the contact's calendar.
 @E_CONTACT_IM_GADUGADU_WORK_3: 
 @E_CONTACT_IM_GADUGADU: 
 @E_CONTACT_GEO: 
+@E_CONTACT_TEL: 
 @E_CONTACT_FIELD_LAST: 
 @E_CONTACT_FIELD_FIRST: 
 @E_CONTACT_LAST_SIMPLE_STRING: 
index 83feadd..f69a543 100644 (file)
@@ -9,13 +9,11 @@ ECellRendererColor
 
 </para>
 
-
 <!-- ##### SECTION See_Also ##### -->
 <para>
 
 </para>
 
-
 <!-- ##### SECTION Stability_Level ##### -->
 
 
index 138c3c5..3f0e099 100644 (file)
@@ -26,7 +26,7 @@
 
 enum {
        ISO_UNSUPPORTED          = 0,
-       
+
        /* iso-8859-1 */
        ISO_DASH_D_DASH_D_LOWER  = (1 << 0),
        ISO_DASH_D_DASH_D        = (1 << 1),
@@ -34,7 +34,7 @@ enum {
        ISO_D_D                  = (1 << 3),
        ISO_UNDER_D_DASH_D       = (1 << 4),
        NO_ISO_D_DASH_D          = (1 << 5),
-       
+
        /* iso-10646-1 */
        /*ISO_DASH_D_DASH_D_LOWER  = (1 << 0),*/
        /*ISO_DASH_D_DASH_D        = (1 << 1),*/
@@ -43,7 +43,7 @@ enum {
        ISO_DASH_D                 = (1 << 4),
        ISO_D                      = (1 << 5),
        UCS4                       = (1 << 6),
-       
+
        /* iso-2022-jp */
        ISO_DASH_D_DASH_S_LOWER  = (1 << 0),
        ISO_DASH_D_DASH_S        = (1 << 1),
@@ -97,13 +97,13 @@ int main (int argc, char **argv)
        iconv_t cd;
        FILE *fp;
        int i;
-       
+
        fp = fopen ("iconv-detect.h", "w");
        if (fp == NULL)
                exit (255);
-       
+
        fprintf (fp, "/* This is an auto-generated header, DO NOT EDIT! */\n\n");
-       
+
        iso8859 = ISO_UNSUPPORTED;
        info = iso8859_tests;
        /*printf ("#define DEFAULT_ISO_FORMAT(iso,codepage)\t");*/
@@ -117,7 +117,7 @@ int main (int argc, char **argv)
                        break;
                }
        }
-       
+
        if (iso8859 == ISO_UNSUPPORTED) {
                fprintf (stderr, "System doesn't support any ISO-8859-1 formats\n");
                fprintf (fp, "#define ICONV_ISO_D_FORMAT \"%s\"\n", info[0].format);
@@ -127,7 +127,7 @@ int main (int argc, char **argv)
        } else {
                fprintf (fp, "#define ICONV_ISO_D_FORMAT \"%s\"\n", info[i].format);
        }
-       
+
        iso2022 = ISO_UNSUPPORTED;
        info = iso2022_tests;
        /*printf ("#define ISO_2022_FORMAT(iso,codepage)\t");*/
@@ -141,7 +141,7 @@ int main (int argc, char **argv)
                        break;
                }
        }
-       
+
        if (iso2022 == ISO_UNSUPPORTED) {
                fprintf (stderr, "System doesn't support any ISO-2022 formats\n");
                fprintf (fp, "#define ICONV_ISO_S_FORMAT \"%s\"\n", info[0].format);
@@ -151,7 +151,7 @@ int main (int argc, char **argv)
        } else {
                fprintf (fp, "#define ICONV_ISO_S_FORMAT \"%s\"\n", info[i].format);
        }
-       
+
        iso10646 = ISO_UNSUPPORTED;
        info = iso10646_tests;
        /*printf ("#define ISO_10646_FORMAT(iso,codepage)\t");*/
@@ -168,7 +168,7 @@ int main (int argc, char **argv)
                        break;
                }
        }
-       
+
        /* we don't need a printf format for iso-10646 because there is only 1 */
        if (iso10646 == ISO_UNSUPPORTED) {
                fprintf (stderr, "System doesn't support any ISO-10646-1 formats\n");
@@ -179,8 +179,8 @@ int main (int argc, char **argv)
        } else {
                fprintf (fp, "#define ICONV_10646 \"%s\"\n", info[i].charset);
        }
-       
+
        fclose (fp);
-       
+
        exit (0);
 }
index 86c477f..e08f6a2 100644 (file)
@@ -1003,7 +1003,7 @@ __db_backup_name(dbenv, name, txn, backup)
         * use the entire filename for the backup name.
         */
        len = strlen(name) + strlen(BACKUP_PREFIX) + MAX_LSN_TO_TEXT;
-           
+
        if ((ret = __os_malloc(dbenv, len, &retp)) != 0)
                return (ret);
 
index 327c494..9807b9d 100644 (file)
@@ -818,7 +818,7 @@ done:       /*
                         * has an open OPD cursor whose state might need to
                         * be preserved.
                         */
-                       if ((!(multi & DB_MULTIPLE_KEY) && 
+                       if ((!(multi & DB_MULTIPLE_KEY) &&
                            dbc_arg->internal->opd == NULL) ||
                            F_ISSET(dbc_arg, DBC_TRANSIENT))
                                dbc_n = dbc_arg;
index ece7e2c..e42662c 100644 (file)
@@ -526,7 +526,7 @@ fail:                                       \n\
        blr                             \n\
 success:                               \n\
        li      r3,1                    \n\
-       blr");  
+       blr");
 }
 #define        MUTEX_SET(tsl)  __db_mutex_set(tsl)
 #endif
index d75735d..a17a613 100644 (file)
@@ -9,7 +9,7 @@ By Steve Reid <sreid@sea-to-sky.net>
 100% Public Domain
 
 -----------------
-Modified 7/98 
+Modified 7/98
 By James H. Brown <jbrown@burgoyne.com>
 Still 100% Public Domain
 
@@ -31,7 +31,7 @@ Since the file IO in main() reads 16K at a time, any file 8K or larger would
 be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million
 "a"s).
 
-I also changed the declaration of variables i & j in SHA1Update to 
+I also changed the declaration of variables i & j in SHA1Update to
 unsigned long from unsigned int for the same reason.
 
 These changes should make no difference to any 32 bit implementations since
@@ -58,7 +58,7 @@ Still 100% public domain
 Modified 4/01
 By Saul Kravitz <Saul.Kravitz@celera.com>
 Still 100% PD
-Modified to run on Compaq Alpha hardware.  
+Modified to run on Compaq Alpha hardware.
 
 
 */
@@ -112,7 +112,7 @@ __db_SHAPrintContext(context, msg)
 {
   printf("%s (%d,%d) %x %x %x %x %x\n",
         msg,
-        context->count[0], context->count[1], 
+        context->count[0], context->count[1],
         context->state[0],
         context->state[1],
         context->state[2],
@@ -125,7 +125,7 @@ __db_SHAPrintContext(context, msg)
 
 /*
  * __db_SHA1Transform --
- * 
+ *
  * PUBLIC: void __db_SHA1Transform __P((u_int32_t *, unsigned char *));
  */
 void
@@ -190,7 +190,7 @@ static int is_bigendian = -1;
 
 /* SHA1Init - Initialize new context */
 
-/*   
+/*
  * __db_SHA1Init --
  *      Initialize new context
  *
@@ -289,6 +289,6 @@ unsigned char finalcount[8];
     __db_SHA1Transform(context->state, context->buffer);
 #endif
 }
-  
+
 /*************************************************************/
 
index 72872d6..fef57f0 100644 (file)
@@ -189,7 +189,7 @@ __db_win32_mutex_unlock(dbenv, mutexp)
        MUTEX_UNSET(&mutexp->tas);
 
        ret = 0;
-       
+
        if (mutexp->nwaiters > 0) {
                GET_HANDLE(mutexp, event);
 
index 0887c21..c343835 100644 (file)
@@ -1,4 +1,4 @@
-/* This file is Based on output from 
+/* This file is Based on output from
  * Perl/Pollution/Portability Version 2.0000 */
 
 #ifndef _P_P_PORTABILITY_H_
 #    define pTHX_
 #    define aTHX
 #    define aTHX_
-#endif         
+#endif
 
 #ifndef PTR2IV
 #    define PTR2IV(d)   (IV)(d)
 #endif
+
 #ifndef INT2PTR
 #    define INT2PTR(any,d)      (any)(d)
 #endif
 #    if defined(CRIPPLED_CC) || defined(USE_THREADS)
 static SV * newRV_noinc (SV * sv)
 {
-          SV *nsv = (SV*)newRV(sv);       
-          SvREFCNT_dec(sv);               
-          return nsv;                     
+          SV *nsv = (SV*)newRV(sv);
+          SvREFCNT_dec(sv);
+          return nsv;
 }
 #    else
 #      define newRV_noinc(sv)    \
@@ -255,7 +255,7 @@ SV *sv;
 #  define PERL_UNUSED_DECL __attribute__((unused))
 #else
 #  define PERL_UNUSED_DECL
-#endif    
+#endif
 
 #ifndef dNOOP
 #  define dNOOP extern int Perl___notused PERL_UNUSED_DECL
@@ -274,16 +274,16 @@ SV *sv;
 #define aMY_CXT_
 #define _aMY_CXT
 
-#endif 
+#endif
 
 #endif /* START_MY_CXT */
 
 
 #ifndef DBM_setFilter
 
-/* 
-   The DBM_setFilter & DBM_ckFilter macros are only used by 
-   the *DB*_File modules 
+/*
+   The DBM_setFilter & DBM_ckFilter macros are only used by
+   the *DB*_File modules
 */
 
 #define DBM_setFilter(db_type,code)                            \
index 0887c21..c343835 100644 (file)
@@ -1,4 +1,4 @@
-/* This file is Based on output from 
+/* This file is Based on output from
  * Perl/Pollution/Portability Version 2.0000 */
 
 #ifndef _P_P_PORTABILITY_H_
 #    define pTHX_
 #    define aTHX
 #    define aTHX_
-#endif         
+#endif
 
 #ifndef PTR2IV
 #    define PTR2IV(d)   (IV)(d)
 #endif
+
 #ifndef INT2PTR
 #    define INT2PTR(any,d)      (any)(d)
 #endif
 #    if defined(CRIPPLED_CC) || defined(USE_THREADS)
 static SV * newRV_noinc (SV * sv)
 {
-          SV *nsv = (SV*)newRV(sv);       
-          SvREFCNT_dec(sv);               
-          return nsv;                     
+          SV *nsv = (SV*)newRV(sv);
+          SvREFCNT_dec(sv);
+          return nsv;
 }
 #    else
 #      define newRV_noinc(sv)    \
@@ -255,7 +255,7 @@ SV *sv;
 #  define PERL_UNUSED_DECL __attribute__((unused))
 #else
 #  define PERL_UNUSED_DECL
-#endif    
+#endif
 
 #ifndef dNOOP
 #  define dNOOP extern int Perl___notused PERL_UNUSED_DECL
@@ -274,16 +274,16 @@ SV *sv;
 #define aMY_CXT_
 #define _aMY_CXT
 
-#endif 
+#endif
 
 #endif /* START_MY_CXT */
 
 
 #ifndef DBM_setFilter
 
-/* 
-   The DBM_setFilter & DBM_ckFilter macros are only used by 
-   the *DB*_File modules 
+/*
+   The DBM_setFilter & DBM_ckFilter macros are only used by
+   the *DB*_File modules
 */
 
 #define DBM_setFilter(db_type,code)                            \
index 03b17c1..09c9a38 100644 (file)
@@ -1,6 +1,6 @@
-/* 
+/*
 
- version.c -- Perl 5 interface to Berkeley DB 
+ version.c -- Perl 5 interface to Berkeley DB
 
  written by Paul Marquess <Paul.Marquess@btinternet.com>
  last modified 2nd Jan 2002
@@ -23,7 +23,7 @@
 */
 
 #define PERL_NO_GET_CONTEXT
-#include "EXTERN.h"  
+#include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
 
@@ -36,9 +36,9 @@ __getBerkeleyDBInfo(void)
 __getBerkeleyDBInfo()
 #endif
 {
-#ifdef dTHX    
+#ifdef dTHX
     dTHX;
-#endif    
+#endif
     SV * version_sv = perl_get_sv("DB_File::db_version", GV_ADD|GV_ADDMULTI) ;
     SV * ver_sv = perl_get_sv("DB_File::db_ver", GV_ADD|GV_ADDMULTI) ;
     SV * compat_sv = perl_get_sv("DB_File::db_185_compat", GV_ADD|GV_ADDMULTI) ;
@@ -49,25 +49,25 @@ __getBerkeleyDBInfo()
     (void)db_version(&Major, &Minor, &Patch) ;
 
     /* Check that the versions of db.h and libdb.a are the same */
-    if (Major != DB_VERSION_MAJOR || Minor != DB_VERSION_MINOR 
+    if (Major != DB_VERSION_MAJOR || Minor != DB_VERSION_MINOR
                || Patch != DB_VERSION_PATCH)
-       croak("\nDB_File needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d.%d and libdb version %d.%d.%d\n",  
-               DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, 
+       croak("\nDB_File needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d.%d and libdb version %d.%d.%d\n",
+               DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
                Major, Minor, Patch) ;
-    
+
     /* check that libdb is recent enough  -- we need 2.3.4 or greater */
     if (Major == 2 && (Minor < 3 || (Minor ==  3 && Patch < 4)))
        croak("DB_File needs Berkeley DB 2.3.4 or greater, you have %d.%d.%d\n",
                 Major, Minor, Patch) ;
+
     {
         char buffer[40] ;
         sprintf(buffer, "%d.%d", Major, Minor) ;
-        sv_setpv(version_sv, buffer) ; 
+        sv_setpv(version_sv, buffer) ;
         sprintf(buffer, "%d.%03d%03d", Major, Minor, Patch) ;
-        sv_setpv(ver_sv, buffer) ; 
+        sv_setpv(ver_sv, buffer) ;
     }
+
 #else /* ! DB_VERSION_MAJOR */
     sv_setiv(version_sv, 1) ;
     sv_setiv(ver_sv, 1) ;
index 8a254ef..6857c89 100644 (file)
@@ -154,7 +154,7 @@ __rep_start(dbenv, dbt, flags)
     "DB_ENV->set_rep_transport must be called before DB_ENV->rep_start");
                return (EINVAL);
        }
-       
+
        /* We'd better not have any logged files open if we are a client. */
        if (LF_ISSET(DB_REP_CLIENT) && (ret = __dbreg_nofiles(dbenv)) != 0) {
                __db_err(dbenv, "DB_ENV->rep_start called with open files");
index 0181fb0..d5a4cca 100644 (file)
@@ -16,7 +16,7 @@
 #include "dbinc_auto/rpc_server_ext.h"
 
 /*
- * PUBLIC: __env_cachesize_reply *__db_env_cachesize_4001 
+ * PUBLIC: __env_cachesize_reply *__db_env_cachesize_4001
  * PUBLIC:     __P((__env_cachesize_msg *, struct svc_req *));
  */
 __env_cachesize_reply *
@@ -74,7 +74,7 @@ __db_env_create_4001(msg, req)
 }
 
 /*
- * PUBLIC: __env_dbremove_reply *__db_env_dbremove_4001 
+ * PUBLIC: __env_dbremove_reply *__db_env_dbremove_4001
  * PUBLIC:     __P((__env_dbremove_msg *, struct svc_req *));
  */
 __env_dbremove_reply *
@@ -96,7 +96,7 @@ __db_env_dbremove_4001(msg, req)
 }
 
 /*
- * PUBLIC: __env_dbrename_reply *__db_env_dbrename_4001 
+ * PUBLIC: __env_dbrename_reply *__db_env_dbrename_4001
  * PUBLIC:     __P((__env_dbrename_msg *, struct svc_req *));
  */
 __env_dbrename_reply *
@@ -119,7 +119,7 @@ __db_env_dbrename_4001(msg, req)
 }
 
 /*
- * PUBLIC: __env_encrypt_reply *__db_env_encrypt_4001 
+ * PUBLIC: __env_encrypt_reply *__db_env_encrypt_4001
  * PUBLIC:     __P((__env_encrypt_msg *, struct svc_req *));
  */
 __env_encrypt_reply *
@@ -257,7 +257,7 @@ __db_txn_commit_4001(msg, req)
 }
 
 /*
- * PUBLIC: __txn_discard_reply *__db_txn_discard_4001 
+ * PUBLIC: __txn_discard_reply *__db_txn_discard_4001
  * PUBLIC:     __P((__txn_discard_msg *, struct svc_req *));
  */
 __txn_discard_reply *
@@ -276,7 +276,7 @@ __db_txn_discard_4001(msg, req)
 }
 
 /*
- * PUBLIC: __txn_prepare_reply *__db_txn_prepare_4001 
+ * PUBLIC: __txn_prepare_reply *__db_txn_prepare_4001
  * PUBLIC:     __P((__txn_prepare_msg *, struct svc_req *));
  */
 __txn_prepare_reply *
@@ -295,7 +295,7 @@ __db_txn_prepare_4001(msg, req)
 }
 
 /*
- * PUBLIC: __txn_recover_reply *__db_txn_recover_4001 
+ * PUBLIC: __txn_recover_reply *__db_txn_recover_4001
  * PUBLIC:     __P((__txn_recover_msg *, struct svc_req *));
  */
 __txn_recover_reply *
@@ -324,7 +324,7 @@ __db_txn_recover_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_associate_reply *__db_db_associate_4001 
+ * PUBLIC: __db_associate_reply *__db_db_associate_4001
  * PUBLIC:     __P((__db_associate_msg *, struct svc_req *));
  */
 __db_associate_reply *
@@ -345,7 +345,7 @@ __db_db_associate_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_bt_maxkey_reply *__db_db_bt_maxkey_4001 
+ * PUBLIC: __db_bt_maxkey_reply *__db_db_bt_maxkey_4001
  * PUBLIC:     __P((__db_bt_maxkey_msg *, struct svc_req *));
  */
 __db_bt_maxkey_reply *
@@ -364,7 +364,7 @@ __db_db_bt_maxkey_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_bt_minkey_reply *__db_db_bt_minkey_4001 
+ * PUBLIC: __db_bt_minkey_reply *__db_db_bt_minkey_4001
  * PUBLIC:     __P((__db_bt_minkey_msg *, struct svc_req *));
  */
 __db_bt_minkey_reply *
@@ -467,7 +467,7 @@ __db_db_encrypt_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_extentsize_reply *__db_db_extentsize_4001 
+ * PUBLIC: __db_extentsize_reply *__db_db_extentsize_4001
  * PUBLIC:     __P((__db_extentsize_msg *, struct svc_req *));
  */
 __db_extentsize_reply *
@@ -546,7 +546,7 @@ __db_db_get_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_h_ffactor_reply *__db_db_h_ffactor_4001 
+ * PUBLIC: __db_h_ffactor_reply *__db_db_h_ffactor_4001
  * PUBLIC:     __P((__db_h_ffactor_msg *, struct svc_req *));
  */
 __db_h_ffactor_reply *
@@ -584,7 +584,7 @@ __db_db_h_nelem_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_key_range_reply *__db_db_key_range_4001 
+ * PUBLIC: __db_key_range_reply *__db_db_key_range_4001
  * PUBLIC:     __P((__db_key_range_msg *, struct svc_req *));
  */
 __db_key_range_reply *
@@ -653,7 +653,7 @@ __db_db_open_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_pagesize_reply *__db_db_pagesize_4001 
+ * PUBLIC: __db_pagesize_reply *__db_db_pagesize_4001
  * PUBLIC:     __P((__db_pagesize_msg *, struct svc_req *));
  */
 __db_pagesize_reply *
@@ -760,7 +760,7 @@ __db_db_put_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_re_delim_reply *__db_db_re_delim_4001 
+ * PUBLIC: __db_re_delim_reply *__db_db_re_delim_4001
  * PUBLIC:     __P((__db_re_delim_msg *, struct svc_req *));
  */
 __db_re_delim_reply *
@@ -906,7 +906,7 @@ __db_db_sync_4001(msg, req)
 }
 
 /*
- * PUBLIC: __db_truncate_reply *__db_db_truncate_4001 
+ * PUBLIC: __db_truncate_reply *__db_db_truncate_4001
  * PUBLIC:     __P((__db_truncate_msg *, struct svc_req *));
  */
 __db_truncate_reply *
index 232199b..2e54d83 100644 (file)
@@ -568,7 +568,7 @@ err:        /*
         */
        if (td->status == TXN_PREPARED)
                return (__db_panic(dbenv, ret));
-               
+
        if ((t_ret = txnp->abort(txnp)) != 0)
                ret = t_ret;
        return (ret);
index a93dafb..25a81fd 100644 (file)
@@ -296,17 +296,17 @@ e_account_list_save (EAccountList *account_list)
        gconf_client_suggest_sync (account_list->priv->gconf, NULL);
 }
 
-void 
+void
 e_account_list_prune_proxies (EAccountList *account_list)
 {
        EAccount *account;
        EIterator *iter;
-       
+
        for (iter = e_list_get_iterator (E_LIST (account_list));
             e_iterator_is_valid (iter);
             e_iterator_next (iter)) {
                account = (EAccount *)e_iterator_get (iter);
-               if (account->parent_uid) 
+               if (account->parent_uid)
                        e_account_list_remove (account_list, account);
        }
 
@@ -314,7 +314,7 @@ e_account_list_prune_proxies (EAccountList *account_list)
        g_object_unref (iter);
 }
 
-void 
+void
 e_account_list_remove_account_proxies (EAccountList *accounts, EAccount *account)
 {
        EAccount *child_account;
@@ -338,9 +338,9 @@ e_account_list_account_has_proxies (EAccountList *accounts, EAccount *account)
 
 /**
  * e_account_list_add:
- * @accounts: 
- * @account: 
- * 
+ * @accounts:
+ * @account:
+ *
  * Add an account to the account list.  Will emit the account-changed
  * event.
  **/
@@ -355,9 +355,9 @@ e_account_list_add(EAccountList *accounts, EAccount *account)
 
 /**
  * e_account_list_change:
- * @accounts: 
- * @account: 
- * 
+ * @accounts:
+ * @account:
+ *
  * Signal that the details of an account have changed.
  **/
 void
@@ -369,9 +369,9 @@ e_account_list_change(EAccountList *accounts, EAccount *account)
 
 /**
  * e_account_list_remove:
- * @accounts: 
- * @account: 
- * 
+ * @accounts:
+ * @account:
+ *
  * Remove an account from the account list, and emit the
  * account-removed signal.  If the account was the default account,
  * then reset the default to the first account.
@@ -391,11 +391,11 @@ e_account_list_remove(EAccountList *accounts, EAccount *account)
 
 /**
  * e_account_list_get_default:
- * @accounts: 
- * 
+ * @accounts:
+ *
  * Get the default account.  If no default is specified, or the default
  * has become stale, then the first account is made the default.
- * 
+ *
  * Return value: The account or NULL if no accounts are defined.
  **/
 const EAccount *
@@ -433,9 +433,9 @@ e_account_list_get_default(EAccountList *accounts)
 
 /**
  * e_account_list_set_default:
- * @accounts: 
- * @account: 
- * 
+ * @accounts:
+ * @account:
+ *
  * Set the account @account to be the default account.
  **/
 void
@@ -446,17 +446,17 @@ e_account_list_set_default(EAccountList *accounts, EAccount *account)
 
 /**
  * e_account_list_find:
- * @accounts: 
+ * @accounts:
  * @type: Type of search.
  * @key: Search key.
- * 
+ *
  * Perform a search of the account list on a single key.
  *
  * @type must be set from one of the following search types:
  * E_ACCOUNT_FIND_NAME - Find an account by account name.
  * E_ACCOUNT_FIND_ID_NAME - Find an account by the owner's identity name.
  * E_ACCOUNT_FIND_ID_ADDRESS - Find an account by the owner's identity address.
- * 
+ *
  * Return value: The account or NULL if it doesn't exist.
  **/
 const EAccount *
@@ -471,7 +471,7 @@ e_account_list_find(EAccountList *accounts, e_account_find_t type, const char *k
 
        if (!key)
                return NULL;
-       
+
        for (it = e_list_get_iterator ((EList *)accounts);
             e_iterator_is_valid (it);
             e_iterator_next (it)) {
index 4494675..0dfb884 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2003 Ximian, Inc.
  *
  * This library is free software; you can redistribute it and/or
index e5749c1..3a4eb49 100644 (file)
@@ -50,25 +50,25 @@ G_DEFINE_TYPE (EAccount, e_account, G_TYPE_OBJECT);
 lock mail accounts     Relatively difficult -- involves redesign of the XML blobs which describe accounts
 disable adding mail accounts   Simple -- can be done with just a Gconf key and some UI work to make assoc. widgets unavailable
 disable editing mail accounts  Relatively difficult -- involves redesign of the XML blobs which describe accounts
-disable removing mail accounts 
+disable removing mail accounts
 lock default character encoding        Simple -- Gconf key + a little UI work to desensitize widgets, etc
-disable free busy publishing   
+disable free busy publishing
 disable specific mime types (from being viewed)        90% done already (Unknown MIME types still pose a problem)
-lock image loading preference  
-lock junk mail filtering settings      
+lock image loading preference
+lock junk mail filtering settings
 **  junk mail per account
-lock work week 
-lock first day of work week    
-lock working hours     
-disable forward as icalendar   
-lock color options for tasks   
-lock default contact filing format     
+lock work week
+lock first day of work week
+lock working hours
+disable forward as icalendar
+lock color options for tasks
+lock default contact filing format
 * forbid signatures    Simple -- can be done with just a Gconf key and some UI work to make assoc. widgets unavailable
 * lock user to having 1 specific signature     Simple -- can be done with just a Gconf key and some UI work to make assoc. widgets unavailable
 * forbid adding/removing signatures    Simple -- can be done with just a Gconf key and some UI work to make assoc. widgets unavailable
-* lock each account to a certain signature     Relatively difficult -- involved redesign of the XML blobs which describe accounts 
-* set default folders  
-set trash emptying frequency   
+* lock each account to a certain signature     Relatively difficult -- involved redesign of the XML blobs which describe accounts
+* set default folders
+set trash emptying frequency
 * lock displayed mail headers  Simple -- can be done with just a Gconf key and some UI work to make assoc. widgets unavailable
 * lock authentication type (for incoming mail) Relatively difficult -- involves redesign of the XML blobs which describe accounts
 * lock authentication type (for outgoing mail) Relatively difficult -- involves redesign of the XML blobs which describe accounts
@@ -108,7 +108,7 @@ e_account_init (EAccount *account)
        account->transport = g_new0 (EAccountService, 1);
 
        account->parent_uid = NULL;
-       
+
        account->source->auto_check = FALSE;
        account->source->auto_check_time = 10;
 }
@@ -283,7 +283,7 @@ static xmlChar*
 receipt_policy_to_str (EAccountReceiptPolicy val)
 {
        char *ret = NULL;
-       
+
        switch (val) {
        case E_ACCOUNT_RECEIPT_NEVER:
                ret = "never";
@@ -366,10 +366,10 @@ xml_set_identity (xmlNodePtr node, EAccountIdentity *id)
                                /* set a fake sig uid so the migrate code can handle this */
                                gboolean autogen = FALSE;
                                int sig_id = 0;
-                               
+
                                xml_set_bool (node, "auto", &autogen);
                                xml_set_int (node, "default", &sig_id);
-                               
+
                                if (autogen) {
                                        id->sig_uid = g_strdup ("::0");
                                        changed = TRUE;
@@ -521,9 +521,9 @@ e_account_import (EAccount *dest, EAccount *src)
 {
        g_free (dest->name);
        dest->name = g_strdup (src->name);
-       
+
        dest->enabled = src->enabled;
-       
+
        g_free (dest->id->name);
        dest->id->name = g_strdup (src->id->name);
        g_free (dest->id->address);
@@ -533,41 +533,41 @@ e_account_import (EAccount *dest, EAccount *src)
        g_free (dest->id->organization);
        dest->id->organization = g_strdup (src->id->organization);
        dest->id->sig_uid = g_strdup (src->id->sig_uid);
-       
+
        g_free (dest->source->url);
        dest->source->url = g_strdup (src->source->url);
        dest->source->keep_on_server = src->source->keep_on_server;
        dest->source->auto_check = src->source->auto_check;
        dest->source->auto_check_time = src->source->auto_check_time;
        dest->source->save_passwd = src->source->save_passwd;
-       
+
        g_free (dest->transport->url);
        dest->transport->url = g_strdup (src->transport->url);
        dest->transport->save_passwd = src->transport->save_passwd;
-       
+
        g_free (dest->drafts_folder_uri);
        dest->drafts_folder_uri = g_strdup (src->drafts_folder_uri);
-       
+
        g_free (dest->sent_folder_uri);
        dest->sent_folder_uri = g_strdup (src->sent_folder_uri);
-       
+
        dest->always_cc = src->always_cc;
        g_free (dest->cc_addrs);
        dest->cc_addrs = g_strdup (src->cc_addrs);
-       
+
        dest->always_bcc = src->always_bcc;
        g_free (dest->bcc_addrs);
        dest->bcc_addrs = g_strdup (src->bcc_addrs);
-       
+
        dest->receipt_policy = src->receipt_policy;
-       
+
        g_free (dest->pgp_key);
        dest->pgp_key = g_strdup (src->pgp_key);
        dest->pgp_encrypt_to_self = src->pgp_encrypt_to_self;
        dest->pgp_always_sign = src->pgp_always_sign;
        dest->pgp_no_imip_sign = src->pgp_no_imip_sign;
        dest->pgp_always_trust = src->pgp_always_trust;
-       
+
        dest->smime_sign_default = src->smime_sign_default;
        g_free (dest->smime_sign_key);
        dest->smime_sign_key = g_strdup (src->smime_sign_key);
@@ -576,7 +576,7 @@ e_account_import (EAccount *dest, EAccount *src)
        dest->smime_encrypt_to_self = src->smime_encrypt_to_self;
        g_free (dest->smime_encrypt_key);
        dest->smime_encrypt_key = g_strdup (src->smime_encrypt_key);
-       
+
        g_signal_emit(dest, signals[CHANGED], 0, -1);
 }
 
@@ -648,7 +648,7 @@ e_account_to_xml (EAccount *account)
 
        node = xmlNewChild (root, NULL, (xmlChar*)"receipt-policy", NULL);
        xmlSetProp (node, (xmlChar*)"policy", receipt_policy_to_str (account->receipt_policy));
-       
+
        node = xmlNewChild (root, NULL, (xmlChar*)"pgp", NULL);
        xmlSetProp (node, (xmlChar*)"encrypt-to-self", (xmlChar*)(account->pgp_encrypt_to_self ? "true" : "false"));
        xmlSetProp (node, (xmlChar*)"always-trust", (xmlChar*)(account->pgp_always_trust ? "true" : "false"));
@@ -669,7 +669,7 @@ e_account_to_xml (EAccount *account)
        if (account->parent_uid) {
                node = xmlNewChild (root, NULL, (xmlChar*)"proxy", NULL);
                xmlNewTextChild (node, NULL, (xmlChar*)"parent-uid", (xmlChar*)account->parent_uid);
-       }       
+       }
 
        xmlDocDumpMemory (doc, &xmlbuf, &n);
        xmlFreeDoc (doc);
@@ -786,7 +786,7 @@ static struct _account_info {
        { /* E_ACCOUNT_BCC_ADDRS */ 0, TYPE_STRING, G_STRUCT_OFFSET(EAccount, bcc_addrs) },
 
        { /* E_ACCOUNT_RECEIPT_POLICY */ 0, TYPE_INT, G_STRUCT_OFFSET(EAccount, receipt_policy) },
-       
+
        { /* E_ACCOUNT_PGP_KEY */ 0, TYPE_STRING, G_STRUCT_OFFSET(EAccount, pgp_key) },
        { /* E_ACCOUNT_PGP_ENCRYPT_TO_SELF */ 0, TYPE_BOOL, G_STRUCT_OFFSET(EAccount, pgp_encrypt_to_self) },
        { /* E_ACCOUNT_PGP_ALWAYS_SIGN */ 0, TYPE_BOOL, G_STRUCT_OFFSET(EAccount, pgp_always_sign) },
@@ -829,10 +829,10 @@ ea_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, void *cr
        struct _system_info *info;
 
        g_return_if_fail (gconf_entry_get_key (entry) != NULL);
-       
+
        if (!(value = gconf_entry_get_value (entry)))
                return;
-       
+
        tkey = strrchr(entry->key, '/');
        g_return_if_fail (tkey != NULL);
 
@@ -887,7 +887,7 @@ ea_setting_setup(void)
        ((account_info[type].type & TYPE_STRUCT)? \
        (((char **)(((char *)ea)+account_info[type].offset))[0] + account_info[type].struct_offset): \
        (((char *)ea)+account_info[type].offset))
-       
+
 const char *e_account_get_string(EAccount *ea, e_account_item_t type)
 {
        return *((const char **)addr(ea, type));
index 019d7bb..809dfc5 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2003 Ximian, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -58,7 +58,7 @@ typedef enum _e_account_item_t {
        E_ACCOUNT_BCC_ADDRS,
 
        E_ACCOUNT_RECEIPT_POLICY,
-       
+
        E_ACCOUNT_PGP_KEY,
        E_ACCOUNT_PGP_ENCRYPT_TO_SELF,
        E_ACCOUNT_PGP_ALWAYS_SIGN,
@@ -85,7 +85,7 @@ typedef struct _EAccountIdentity {
        char *address;
        char *reply_to;
        char *organization;
-       
+
        char *sig_uid;
 } EAccountIdentity;
 
index 74c8208..eee93ed 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2005 Novell, Inc.
  *
  * This library is free software; you can redistribute it and/or
index ce4c8ac..ea2fa36 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2005 Novell, Inc.
  *
  * This library is free software; you can redistribute it and/or
index 3504d84..f711b0f 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  *  e-data-server-module.c - Interface to e-d-s extensions
- * 
+ *
  *  Copyright (C) 2004 Novell, Inc.
  *
  *  This library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
  *
  *  Authors: Chris Toshok <toshok@ximian.com>
  *           Dave Camp <dave@ximian.com>
- * 
+ *
  */
 
 #include <config.h>
@@ -55,7 +55,7 @@ struct _EDataServerModule {
 };
 
 struct _EDataServerModuleClass {
-       GTypeModuleClass parent;        
+       GTypeModuleClass parent;
 };
 
 static GType e_data_server_module_get_type (void);
@@ -71,9 +71,9 @@ static gboolean
 e_data_server_module_load (GTypeModule *gmodule)
 {
        EDataServerModule *module;
-       
+
        module = E_DATA_SERVER_MODULE (gmodule);
-       
+
        module->library = g_module_open (module->path, G_MODULE_BIND_LAZY);
 
        if (!module->library) {
@@ -93,12 +93,12 @@ e_data_server_module_load (GTypeModule *gmodule)
 
                g_warning (g_module_error ());
                g_module_close (module->library);
-               
+
                return FALSE;
        }
 
        module->initialize (gmodule);
-       
+
        return TRUE;
 }
 
@@ -106,13 +106,13 @@ static void
 e_data_server_module_unload (GTypeModule *gmodule)
 {
        EDataServerModule *module;
-       
+
        module = E_DATA_SERVER_MODULE (gmodule);
-       
+
        module->shutdown ();
-       
+
        g_module_close (module->library);
-       
+
        module->initialize = NULL;
        module->shutdown = NULL;
        module->list_types = NULL;
@@ -122,7 +122,7 @@ static void
 e_data_server_module_finalize (GObject *object)
 {
        EDataServerModule *module;
-       
+
        module = E_DATA_SERVER_MODULE (object);
 
        g_free (module->path);
@@ -156,9 +156,9 @@ add_module_objects (EDataServerModule *module)
        const GType *types;
        int num_types;
        int i;
-       
+
        module->list_types (&types, &num_types);
-       
+
        for (i = 0; i < num_types; i++) {
                e_data_server_module_add_type (types[i]);
        }
@@ -168,10 +168,10 @@ static EDataServerModule *
 e_data_server_module_load_file (const char *filename)
 {
        EDataServerModule *module;
-       
+
        module = g_object_new (E_DATA_SERVER_TYPE_MODULE, NULL);
        module->path = g_strdup (filename);
-       
+
        if (g_type_module_use (G_TYPE_MODULE (module))) {
                add_module_objects (module);
                g_type_module_unuse (G_TYPE_MODULE (module));
@@ -186,18 +186,18 @@ static void
 load_module_dir (const char *dirname)
 {
        GDir *dir;
-       
+
        dir = g_dir_open (dirname, 0, NULL);
-       
+
        if (dir) {
                const char *name;
-               
+
                while ((name = g_dir_read_name (dir))) {
                        if (g_str_has_suffix (name, "." G_MODULE_SUFFIX)) {
                                char *filename;
 
-                               filename = g_build_filename (dirname, 
-                                                            name, 
+                               filename = g_build_filename (dirname,
+                                                            name,
                                                             NULL);
                                e_data_server_module_load_file (filename);
                                g_free (filename);
@@ -215,7 +215,7 @@ e_data_server_module_init (void)
 
        if (!initialized) {
                initialized = TRUE;
-               
+
                load_module_dir (E_DATA_SERVER_EXTENSIONDIR);
        }
 }
@@ -225,7 +225,7 @@ e_data_server_get_extensions_for_type (GType type)
 {
        GList *l;
        GList *ret = NULL;
-       
+
        for (l = module_objects; l != NULL; l = l->next) {
                if (G_TYPE_CHECK_INSTANCE_TYPE (G_OBJECT (l->data),
                                                type)) {
@@ -234,21 +234,21 @@ e_data_server_get_extensions_for_type (GType type)
                }
        }
 
-       return ret;     
+       return ret;
 }
 
 void
 e_data_server_extension_list_free (GList *extensions)
 {
        GList *l;
-       
+
        for (l = extensions; l != NULL; l = l->next) {
                g_object_unref (l->data);
        }
        g_list_free (extensions);
 }
 
-void   
+void
 e_data_server_module_add_type (GType type)
 {
        GObject *object;
@@ -256,7 +256,7 @@ e_data_server_module_add_type (GType type)
        g_message ("adding type `%s'", g_type_name (type));
 
        object = g_object_new (type, NULL);
-       g_object_weak_ref (object, 
+       g_object_weak_ref (object,
                           (GWeakNotify)module_object_weak_notify,
                           NULL);
 
index a175c94..ceeeccc 100644 (file)
@@ -83,14 +83,14 @@ e_util_strstrcase (const gchar *haystack, const gchar *needle)
         return NULL;
 }
 
-/** 
+/**
  * e_util_unicode_get_utf8:
  * @text: The string to take the UTF-8 character from.
  * @out: The location to store the UTF-8 character in.
- * 
+ *
  * Get a UTF-8 character from the beginning of @text.
  *
- * Returns: A pointer to the next character in @text after @out. 
+ * Returns: A pointer to the next character in @text after @out.
  **/
 gchar *
 e_util_unicode_get_utf8 (const gchar *text, gunichar *out)
@@ -99,11 +99,11 @@ e_util_unicode_get_utf8 (const gchar *text, gunichar *out)
         return (*out == (gunichar)-1) ? NULL : g_utf8_next_char (text);
 }
 
-/** 
+/**
  * e_util_utf8_strstrcase:
  * @haystack: The string to search in.
  * @needle: The string to search for.
- * 
+ *
  * Find the first instance of @needle in @haystack, ignoring case. (No
  * proper case folding or decomposing is done.) Both @needle and
  * @haystack are UTF-8 strings.
@@ -192,11 +192,11 @@ stripped_char (gunichar ch)
         return 0;
 }
 
-/** 
+/**
  * e_util_utf8_strstrcasedecomp:
  * @haystack: The string to search in.
  * @needle: The string to search for.
- * 
+ *
  * Find the first instance of @needle in @haystack, where both @needle
  * and @haystack are UTF-8 strings. Both strings are stripped and
  * decomposed for comparison, and case is ignored.
@@ -266,7 +266,7 @@ e_util_utf8_strcasecmp (const gchar *s1, const gchar *s2)
        int retval;
 
        g_return_val_if_fail (s1 != NULL && s2 != NULL, -1);
-       
+
        if (strcmp (s1, s2) == 0)
                return 0;
 
@@ -281,7 +281,7 @@ e_util_utf8_strcasecmp (const gchar *s1, const gchar *s2)
        return retval;
 }
 
-/** 
+/**
  * e_strftime:
  * @s: The string array to store the result in.
  * @max: The size of array @s.
@@ -331,7 +331,7 @@ size_t e_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
        return ret;
 }
 
-/** 
+/**
  * e_utf8_strftime:
  * @s: The string array to store the result in.
  * @max: The size of array @s.
@@ -342,7 +342,7 @@ size_t e_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
  *
  * Returns: The number of characters placed in @s.
  **/
-size_t 
+size_t
 e_utf8_strftime(char *s, size_t max, const char *fmt, const struct tm *tm)
 {
        size_t sz, ret;
@@ -458,8 +458,8 @@ e_filename_make_safe (gchar *string)
        const char *unsafe_chars = " /'\"`&();|<>$%{}!\\:*?#";
 #else
        const char *unsafe_chars = " /'\"`&();|<>$%{}!#";
-#endif 
-       
+#endif
+
        g_return_if_fail (string != NULL);
        p = string;
 
@@ -472,7 +472,7 @@ e_filename_make_safe (gchar *string)
                 * written?
                 */
                if (!g_unichar_isprint(c) || ( c < 0xff && strchr (unsafe_chars, c&0xff ))) {
-                       while (ts<p)    
+                       while (ts<p)
                                *ts++ = '_';
                }
        }
@@ -556,7 +556,7 @@ get_prefixes (gpointer  hmodule,
                 gchar *p = strrchr (*full_prefix, '\\');
                 if (p != NULL)
                         *p = '\0';
-      
+
                 p = strrchr (*full_prefix, '\\');
                 if (p && (g_ascii_strcasecmp (p + 1, "bin") == 0))
                         *p = '\0';
@@ -567,7 +567,7 @@ get_prefixes (gpointer  hmodule,
                 gchar *p = _mbsrchr (*cp_prefix, '\\');
                 if (p != NULL)
                         *p = '\0';
-      
+
                 p = _mbsrchr (*cp_prefix, '\\');
                 if (p && (g_ascii_strcasecmp (p + 1, "bin") == 0))
                         *p = '\0';
@@ -638,8 +638,8 @@ replace_prefix (const char *runtime_prefix,
 static void
 setup (void)
 {
-       char *full_pfx;  
-       char *cp_pfx; 
+       char *full_pfx;
+       char *cp_pfx;
 
         G_LOCK (mutex);
         if (prefix != NULL) {
index 5111f20..baf0291 100644 (file)
@@ -15,7 +15,7 @@
 #include "db.h"
 #include "md5-utils.h"
 
-struct _EDbHashPrivate 
+struct _EDbHashPrivate
 {
        DB *db;
 };
@@ -66,7 +66,7 @@ md5_to_dbt(const guchar str[16], DBT *dbt)
        dbt->size = 16;
 }
 
-void 
+void
 e_dbhash_add (EDbHash *edbh, const gchar *key, const gchar *data)
 {
        DB *db;
@@ -81,7 +81,7 @@ e_dbhash_add (EDbHash *edbh, const gchar *key, const gchar *data)
        g_return_if_fail (data != NULL);
 
        db = edbh->priv->db;
-       
+
        /* Key dbt */
        string_to_dbt (key, &dkey);
 
@@ -93,18 +93,18 @@ e_dbhash_add (EDbHash *edbh, const gchar *key, const gchar *data)
        db->put (db, NULL, &dkey, &ddata, 0);
 }
 
-void 
+void
 e_dbhash_remove (EDbHash *edbh, const char *key)
 {
        DB *db;
        DBT dkey;
-       
+
        g_return_if_fail (edbh != NULL);
        g_return_if_fail (edbh->priv != NULL);
        g_return_if_fail (key != NULL);
 
        db = edbh->priv->db;
-       
+
        /* Key dbt */
        string_to_dbt (key, &dkey);
 
@@ -112,7 +112,7 @@ e_dbhash_remove (EDbHash *edbh, const char *key)
        db->del (db, NULL, &dkey, 0);
 }
 
-void 
+void
 e_dbhash_foreach_key (EDbHash *edbh, EDbHashFunc func, gpointer user_data)
 {
        DB *db;
@@ -120,7 +120,7 @@ e_dbhash_foreach_key (EDbHash *edbh, EDbHashFunc func, gpointer user_data)
        DBT ddata;
        DBC *dbc;
        int db_error = 0;
-       
+
        g_return_if_fail (edbh != NULL);
        g_return_if_fail (edbh->priv != NULL);
        g_return_if_fail (func != NULL);
@@ -152,31 +152,31 @@ e_dbhash_compare (EDbHash *edbh, const char *key, const char *compare_data)
        DBT dkey;
        DBT ddata;
        guchar compare_hash[16];
-       
+
        g_return_val_if_fail (edbh != NULL, FALSE);
        g_return_val_if_fail (edbh->priv != NULL, FALSE);
        g_return_val_if_fail (key != NULL, FALSE);
        g_return_val_if_fail (compare_hash != NULL, FALSE);
 
        db = edbh->priv->db;
-       
+
        /* Key dbt */
        string_to_dbt (key, &dkey);
 
        /* Lookup in database */
        memset (&ddata, 0, sizeof (DBT));
        db->get (db, NULL, &dkey, &ddata, 0);
-       
+
        /* Compare */
        if (ddata.data) {
                md5_get_digest (compare_data, strlen (compare_data), compare_hash);
-               
+
                if (memcmp (ddata.data, compare_hash, sizeof (guchar) * 16))
                        return E_DBHASH_STATUS_DIFFERENT;
        } else {
                return E_DBHASH_STATUS_NOT_FOUND;
        }
-       
+
        return E_DBHASH_STATUS_SAME;
 }
 
@@ -184,29 +184,29 @@ void
 e_dbhash_write (EDbHash *edbh)
 {
        DB *db;
-       
+
        g_return_if_fail (edbh != NULL);
        g_return_if_fail (edbh->priv != NULL);
 
        db = edbh->priv->db;
-       
+
        /* Flush database to disk */
        db->sync (db, 0);
 }
 
-void 
+void
 e_dbhash_destroy (EDbHash *edbh)
 {
        DB *db;
-       
+
        g_return_if_fail (edbh != NULL);
        g_return_if_fail (edbh->priv != NULL);
 
        db = edbh->priv->db;
-       
+
        /* Close datbase */
        db->close (db, 0);
-       
+
        g_free (edbh->priv);
        g_free (edbh);
 }
index 7883d4f..c325b86 100644 (file)
@@ -57,7 +57,7 @@ e_file_cache_set_property (GObject *object, guint property_id, const GValue *val
        priv = cache->priv;
 
        /* FIXME: the property is being set twice. Need to investigate
-        * why and fix. Until then, we just return when called the 
+        * why and fix. Until then, we just return when called the
         * second time*/
        if (priv->filename)
                return;
index b5dd4e6..0cd35de 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2007 Novell, Inc.
  *
  * This library is free software; you can redistribute it and/or
index 1bb58ed..d52e4d5 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2007 Novell, Inc.
  *
  * This library is free software; you can redistribute it and/or
index ac9f7f6..d516a1b 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * e-iconv.c
  * Copyright 2000, 2001, Ximian, Inc.
  *
@@ -42,7 +42,7 @@
 
 #include "iconv-detect.h"
 
-#define cd(x) 
+#define cd(x)
 
 #ifdef G_THREADS_ENABLED
 static GStaticMutex lock = G_STATIC_MUTEX_INIT;
@@ -198,13 +198,13 @@ static const char *
 e_strdown (char *str)
 {
        register char *s = str;
-       
+
        while (*s) {
                if (*s >= 'A' && *s <= 'Z')
                        *s += 0x20;
                s++;
        }
-       
+
        return str;
 }
 
@@ -212,13 +212,13 @@ static const char *
 e_strup (char *str)
 {
        register char *s = str;
-       
+
        while (*s) {
                if (*s >= 'a' && *s <= 'z')
                        *s -= 0x20;
                s++;
        }
-       
+
        return str;
 }
 
@@ -227,18 +227,18 @@ static void
 locale_parse_lang (const char *locale)
 {
        char *codeset, *lang;
-       
+
        if ((codeset = strchr (locale, '.')))
                lang = g_strndup (locale, codeset - locale);
        else
                lang = g_strdup (locale);
-       
+
        /* validate the language */
        if (strlen (lang) >= 2) {
                if (lang[2] == '-' || lang[2] == '_') {
                        /* canonicalise the lang */
                        e_strdown (lang);
-                       
+
                        /* validate the country code */
                        if (strlen (lang + 3) > 2) {
                                /* invalid country code */
@@ -252,7 +252,7 @@ locale_parse_lang (const char *locale)
                        g_free (lang);
                        lang = NULL;
                }
-               
+
                locale_lang = lang;
        } else {
                /* invalid language */
@@ -277,7 +277,7 @@ e_iconv_init(int keep)
        }
 
        iconv_charsets = g_hash_table_new(g_str_hash, g_str_equal);
-       
+
        for (i = 0; known_iconv_charsets[i].charset != NULL; i++) {
                from = g_strdup(known_iconv_charsets[i].charset);
                to = g_strdup(known_iconv_charsets[i].iconv_name);
@@ -288,19 +288,19 @@ e_iconv_init(int keep)
        e_dlist_init(&iconv_cache_list);
        iconv_cache = g_hash_table_new(g_str_hash, g_str_equal);
        iconv_cache_open = g_hash_table_new(NULL, NULL);
-       
+
 #ifndef G_OS_WIN32
        locale = setlocale (LC_ALL, NULL);
 #else
        locale = g_win32_getlocale ();
 #endif
-       
+
        if (!locale || !strcmp (locale, "C") || !strcmp (locale, "POSIX")) {
                /* The locale "C"  or  "POSIX"  is  a  portable  locale;  its
                 * LC_CTYPE  part  corresponds  to  the 7-bit ASCII character
                 * set.
                 */
-               
+
                locale_charset = NULL;
                locale_lang = NULL;
        } else {
@@ -320,11 +320,11 @@ e_iconv_init(int keep)
                 * ISO-8859-1 or UTF-8.
                 */
                char *codeset, *p;
-               
+
                codeset = strchr (locale, '.');
                if (codeset) {
                        codeset++;
-                       
+
                        /* ; is a hack for debian systems and / is a hack for Solaris systems */
                        for (p = codeset; *p && !strchr ("@;/", *p); p++);
                        locale_charset = g_strndup (codeset, p - codeset);
@@ -333,9 +333,9 @@ e_iconv_init(int keep)
                        /* charset unknown */
                        locale_charset = NULL;
                }
-#endif         
+#endif
 #endif /* !G_OS_WIN32 */
-               
+
                /* parse the locale lang */
                locale_parse_lang (locale);
 
@@ -358,7 +358,7 @@ const char *e_iconv_charset_name(const char *charset)
        name = g_alloca (strlen (charset) + 1);
        strcpy (name, charset);
        e_strdown (name);
-       
+
        e_iconv_init(TRUE);
        ret = g_hash_table_lookup(iconv_charsets, name);
        if (ret != NULL) {
@@ -371,13 +371,13 @@ const char *e_iconv_charset_name(const char *charset)
                /* Convert iso-nnnn-n or isonnnn-n or iso_nnnn-n to iso-nnnn-n or isonnnn-n */
                int iso, codepage;
                char *p;
-               
+
                tmp = name + 3;
                if (*tmp == '-' || *tmp == '_')
                        tmp++;
-               
+
                iso = strtoul (tmp, &p, 10);
-               
+
                if (iso == 10646) {
                        /* they all become ICONV_10646 */
                        ret = g_strdup (ICONV_10646);
@@ -385,9 +385,9 @@ const char *e_iconv_charset_name(const char *charset)
                        tmp = p;
                        if (*tmp == '-' || *tmp == '_')
                                tmp++;
-                       
+
                        codepage = strtoul (tmp, &p, 10);
-                       
+
                        if (p > tmp) {
                                /* codepage is numeric */
 #ifdef __aix__
@@ -412,7 +412,7 @@ const char *e_iconv_charset_name(const char *charset)
                tmp = name+10;
                if (!strncmp(tmp, "cp", 2))
                        tmp+=2;
-               ret = g_strdup_printf("CP%s", tmp);     
+               ret = g_strdup_printf("CP%s", tmp);
        } else {
                /* Just assume its ok enough as is, case and all */
                ret = g_strdup(charset);
@@ -458,7 +458,7 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom)
                errno = EINVAL;
                return (iconv_t) -1;
        }
-       
+
        to = e_iconv_charset_name (oto);
        from = e_iconv_charset_name (ofrom);
        tofrom = g_alloca (strlen (to) + strlen (from) + 2);
@@ -488,7 +488,7 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom)
                }
 
                iconv_cache_size++;
-               
+
                ic = g_malloc(sizeof(*ic));
                e_dlist_init(&ic->open);
                ic->conv = g_strdup(tofrom);
@@ -504,8 +504,8 @@ iconv_t e_iconv_open(const char *oto, const char *ofrom)
                cd(printf("using existing iconv converter '%s'\n", ic->conv));
                ip = in->ip;
                if (ip != (iconv_t)-1) {
-                       /* work around some broken iconv implementations 
-                        * that die if the length arguments are NULL 
+                       /* work around some broken iconv implementations
+                        * that die if the length arguments are NULL
                         */
                        size_t buggy_iconv_len = 0;
                        char *buggy_iconv_buf = NULL;
@@ -579,7 +579,7 @@ const char *
 e_iconv_locale_language (void)
 {
        e_iconv_init (FALSE);
-       
+
        return locale_lang;
 }
 
@@ -613,15 +613,15 @@ const char *
 e_iconv_charset_language (const char *charset)
 {
        int i;
-       
+
        if (!charset)
                return NULL;
-       
+
        charset = e_iconv_charset_name (charset);
        for (i = 0; i < NUM_CJKR_LANGS; i++) {
                if (!g_ascii_strcasecmp (cjkr_lang_map[i].charset, charset))
                        return cjkr_lang_map[i].lang;
        }
-       
+
        return NULL;
 }
index a46558e..5b4db13 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * e-iconv.h
  * Copyright 2000, 2001, Ximian, Inc.
  *
index 1edf6d2..512f141 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- * Authors: 
+ * Authors:
  *   Christopher James Lahey <clahey@umich.edu>
  *
  * Copyright (C) 2000 Ximian, Inc.
@@ -59,7 +59,7 @@ e_iterator_init (EIterator *card)
 }
 
 /*
- * Virtual functions: 
+ * Virtual functions:
  */
 const void *
 e_iterator_get      (EIterator *iterator)
index dd29ba7..05a0b45 100644 (file)
@@ -35,7 +35,7 @@ struct _EIteratorClass {
 
        /* Signals */
        void         (*invalidate) (EIterator  *iterator);
-       
+
        /* Virtual functions */
        const void * (*get)        (EIterator  *iterator);
        void         (*reset)      (EIterator  *iterator);
@@ -60,7 +60,7 @@ void           e_iterator_delete     (EIterator  *iterator);
 void           e_iterator_insert     (EIterator  *iterator,
                                      const void *object,
                                      gboolean    before);
-void           e_iterator_set        (EIterator  *iterator, 
+void           e_iterator_set        (EIterator  *iterator,
                                      const void *object);
 gboolean       e_iterator_is_valid   (EIterator  *iterator);
 
index 7acf004..dc6ad63 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- * Authors: 
+ * Authors:
  *   Christopher James Lahey <clahey@umich.edu>
  *
  * Copyright (C) 2000 Ximian, Inc.
@@ -14,7 +14,7 @@
 
 static void        e_list_iterator_init       (EListIterator *list);
 static void        e_list_iterator_class_init (EListIteratorClass *klass);
-                  
+
 static void        e_list_iterator_invalidate (EIterator *iterator);
 static gboolean    e_list_iterator_is_valid   (EIterator *iterator);
 static void        e_list_iterator_set        (EIterator  *iterator,
@@ -82,7 +82,7 @@ e_list_iterator_new (EList *list)
 }
 
 /*
- * Virtual functions: 
+ * Virtual functions:
  */
 static void
 e_list_iterator_dispose (GObject *object)
index 02cfd56..b3268b1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- * Authors: 
+ * Authors:
  *   Christopher James Lahey <clahey@umich.edu>
  *
  * Copyright (C) 2000 Ximian, Inc.
@@ -142,8 +142,8 @@ e_list_remove_iterator (EList *list, EIterator *iterator)
        list->iterators = g_list_remove(list->iterators, iterator);
 }
 
-/* 
- * Virtual functions 
+/*
+ * Virtual functions
  */
 static void
 e_list_dispose (GObject *object)
index 52487ca..4195319 100644 (file)
@@ -43,11 +43,11 @@ struct _EListClass {
        GObjectClass parent_class;
 };
 
-EList     *e_list_new                  (EListCopyFunc  copy, 
+EList     *e_list_new                  (EListCopyFunc  copy,
                                        EListFreeFunc  free,
                                        void          *closure);
 void       e_list_construct            (EList         *list,
-                                       EListCopyFunc  copy, 
+                                       EListCopyFunc  copy,
                                        EListFreeFunc  free,
                                        void          *closure);
 EList     *e_list_duplicate            (EList *list);
@@ -59,7 +59,7 @@ void       e_list_remove               (EList         *list,
 int        e_list_length               (EList         *list);
 
 /* For iterators to call. */
-void       e_list_remove_link          (EList         *list, 
+void       e_list_remove_link          (EList         *list,
                                        GList         *link);
 void       e_list_remove_iterator      (EList         *list,
                                        EIterator     *iterator);
index d843f16..088c0a6 100644 (file)
@@ -4,8 +4,8 @@
  * Authors: Michael Zucchi <notzed@ximian.com>
  *         Jacob Berkman <jacob@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -116,10 +116,10 @@ typedef struct _EMemChunk {
  * e_memchunk_new:
  * @atomcount: The number of atoms stored in a single malloc'd block of memory.
  * @atomsize: The size of each allocation.
- * 
+ *
  * Create a new memchunk header.  Memchunks are an efficient way to allocate
  * and deallocate identical sized blocks of memory quickly, and space efficiently.
- * 
+ *
  * e_memchunks are effectively the same as gmemchunks, only faster (much), and
  * they use less memory overhead for housekeeping.
  *
@@ -139,8 +139,8 @@ MemChunk *e_memchunk_new(int atomcount, int atomsize)
 
 /**
  * memchunk_alloc:
- * @m: 
- * 
+ * @m:
+ *
  * Allocate a new atom size block of memory from a memchunk.
  **/
 void *e_memchunk_alloc(MemChunk *m)
@@ -182,9 +182,9 @@ void *e_memchunk_alloc0(EMemChunk *m)
 
 /**
  * e_memchunk_free:
- * @m: 
+ * @m:
  * @mem: Address of atom to free.
- * 
+ *
  * Free a single atom back to the free pool of atoms in the given
  * memchunk.
  **/
@@ -208,8 +208,8 @@ e_memchunk_free(MemChunk *m, void *mem)
 
 /**
  * e_memchunk_empty:
- * @m: 
- * 
+ * @m:
+ *
  * Clean out the memchunk buffers.  Marks all allocated memory as free blocks,
  * but does not give it back to the system.  Can be used if the memchunk
  * is to be used repeatedly.
@@ -257,9 +257,9 @@ static int tree_search(struct _cleaninfo *a, char *mem)
 
 /**
  * e_memchunk_clean:
- * @m: 
- * 
- * Scan all empty blocks and check for blocks which can be free'd 
+ * @m:
+ *
+ * Scan all empty blocks and check for blocks which can be free'd
  * back to the system.
  *
  * This routine may take a while to run if there are many allocated
@@ -306,7 +306,7 @@ e_memchunk_clean(MemChunk *m)
        while (ci) {
                if (ci->count == m->blocksize) {
                        MemChunkFreeNode *prev = NULL;
-                       
+
                        f = m->free;
                        while (f) {
                                if (tree_search (ci, (void *) f) == 0) {
@@ -318,10 +318,10 @@ e_memchunk_clean(MemChunk *m)
                                } else {
                                        prev = f;
                                }
-                               
+
                                f = f->next;
                        }
-                       
+
                        g_ptr_array_remove_fast(m->blocks, ci->base);
                        g_free(ci->base);
                }
@@ -333,8 +333,8 @@ e_memchunk_clean(MemChunk *m)
 
 /**
  * e_memchunk_destroy:
- * @m: 
- * 
+ * @m:
+ *
  * Free the memchunk header, and all associated memory.
  **/
 void
@@ -386,7 +386,7 @@ static GStaticMutex mempool_mutex = G_STATIC_MUTEX_INIT;
  * struct alignment, E_MEMPOOL_ALIGN_WORD aligns to 16 bits (2 bytes),
  * and E_MEMPOOL_ALIGN_BYTE aligns to the nearest byte.  The default
  * is to align to native structures.
- * 
+ *
  * Create a new mempool header.  Mempools can be used to efficiently
  * allocate data which can then be freed as a whole.
  *
@@ -396,8 +396,8 @@ static GStaticMutex mempool_mutex = G_STATIC_MUTEX_INIT;
  *
  * However, each allocation cannot be freed individually, only all
  * or nothing.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 MemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags)
 {
@@ -436,9 +436,9 @@ MemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags)
 
 /**
  * e_mempool_alloc:
- * @pool: 
- * @size: 
- * 
+ * @pool:
+ * @size:
+ *
  * Allocate a new data block in the mempool.  Size will
  * be rounded up to the mempool's alignment restrictions
  * before being used.
@@ -485,9 +485,9 @@ char *e_mempool_strdup(EMemPool *pool, const char *str)
 
 /**
  * e_mempool_flush:
- * @pool: 
+ * @pool:
  * @freeall: Free all system allocated blocks as well.
- * 
+ *
  * Flush used memory and mark allocated blocks as free.
  *
  * If @freeall is #TRUE, then all allocated blocks are free'd
@@ -526,8 +526,8 @@ void e_mempool_flush(MemPool *pool, int freeall)
 
 /**
  * e_mempool_destroy:
- * @pool: 
- * 
+ * @pool:
+ *
  * Free all memory associated with a mempool.
  **/
 void e_mempool_destroy(MemPool *pool)
@@ -573,7 +573,7 @@ struct _e_strvunpacked {
  * e_strv_new:
  * @size: The number of elements in the strv.  Currently this is limited
  * to 254 elements.
- * 
+ *
  * Create a new strv (string array) header.  strv's can be used to
  * create and work with arrays of strings that can then be compressed
  * into a space-efficient static structure.  This is useful
@@ -583,8 +583,8 @@ struct _e_strvunpacked {
  * The size limit is currently 254 elements.  This will probably not
  * change as arrays of this size suffer significant performance
  * penalties when looking up strings with high indices.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 struct _EStrv *
 e_strv_new(int size)
@@ -629,13 +629,13 @@ strv_unpack(struct _EStrv *strv)
 
 /**
  * e_strv_set_ref:
- * @strv: 
- * @index: 
- * @str: 
- * 
+ * @strv:
+ * @index:
+ * @str:
+ *
  * Set a string array element by reference.  The string
  * is not copied until the array is packed.
- * 
+ *
  * If @strv has been packed, then it is unpacked ready
  * for more inserts, and should be packed again once finished with.
  * The memory used by the original @strv is not freed until
@@ -665,15 +665,15 @@ e_strv_set_ref(struct _EStrv *strv, int index, char *str)
 
 /**
  * e_strv_set_ref_free:
- * @strv: 
- * @index: 
- * @str: 
- * 
+ * @strv:
+ * @index:
+ * @str:
+ *
  * Set a string by reference, similar to set_ref, but also
  * free the string when finished with it.  The string
  * is not copied until the strv is packed, and not at
  * all if the index is overwritten.
- * 
+ *
  * Return value: @strv if already unpacked, otherwise an packed
  * EStrv.
  **/
@@ -701,13 +701,13 @@ e_strv_set_ref_free(struct _EStrv *strv, int index, char *str)
 
 /**
  * e_strv_set:
- * @strv: 
- * @index: 
- * @str: 
- * 
+ * @strv:
+ * @index:
+ * @str:
+ *
  * Set a string array reference.  The string @str is copied
  * into the string array at location @index.
- * 
+ *
  * If @strv has been packed, then it is unpacked ready
  * for more inserts, and should be packed again once finished with.
  *
@@ -739,14 +739,14 @@ e_strv_set(struct _EStrv *strv, int index, const char *str)
 
 /**
  * e_strv_pack:
- * @strv: 
- * 
+ * @strv:
+ *
  * Pack the @strv into a space efficient structure for later lookup.
  *
  * All strings are packed into a single allocated block, separated
  * by single \0 characters, together with a count byte.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 struct _EStrv *
 e_strv_pack(struct _EStrv *strv)
@@ -783,14 +783,14 @@ e_strv_pack(struct _EStrv *strv)
 
 /**
  * e_strv_get:
- * @strv: 
- * @index: 
- * 
+ * @strv:
+ * @index:
+ *
  * Retrieve a string by index.  This function works
  * identically on both packed and unpacked strv's, although
  * may be much slower on a packed strv.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 char *
 e_strv_get(struct _EStrv *strv, int index)
@@ -816,8 +816,8 @@ e_strv_get(struct _EStrv *strv, int index)
 
 /**
  * e_strv_destroy:
- * @strv: 
- * 
+ * @strv:
+ *
  * Free a strv and all associated memory.  Works on packed
  * or unpacked strv's.
  **/
@@ -1026,8 +1026,8 @@ poolv_profile_update (void)
        if (new_time - last_time < 5)
                return;
 
-       printf("poolv profile: %lu hits, %lu misses: %d%% hit rate, memory: %lu, instances: %lu\n", 
-              poolv_hits, poolv_misses, 
+       printf("poolv profile: %lu hits, %lu misses: %d%% hit rate, memory: %lu, instances: %lu\n",
+              poolv_hits, poolv_misses,
               (int)(100.0 * ((double) poolv_hits / (double) (poolv_hits + poolv_misses))),
               poolv_mem, poolv_count);
 
@@ -1304,7 +1304,7 @@ main()
        }
        time_end("allocating 1000000 malloc");
 #endif
-       
+
 }
 
 #endif
index 5a7a774..3d2d7cf 100644 (file)
@@ -4,8 +4,8 @@
  * Authors: Michael Zucchi <notzed@ximian.com>
  *         Jacob Berkman <jacob@ximian.com>
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 91825a2..e2a1412 100644 (file)
@@ -72,10 +72,10 @@ e_pipe (int *fds)
 #ifndef G_OS_WIN32
        if (pipe (fds) != -1)
                return 0;
-       
+
        fds[0] = -1;
        fds[1] = -1;
-       
+
        return -1;
 #else
        SOCKET temp, socket1 = -1, socket2 = -1;
@@ -86,11 +86,11 @@ e_pipe (int *fds)
        struct timeval tv;
 
        temp = socket (AF_INET, SOCK_STREAM, 0);
-       
+
        if (temp == INVALID_SOCKET) {
                goto out0;
        }
-       
+
        arg = 1;
        if (ioctlsocket (temp, FIONBIO, &arg) == SOCKET_ERROR) {
                goto out0;
@@ -115,13 +115,13 @@ e_pipe (int *fds)
        }
 
        socket1 = socket (AF_INET, SOCK_STREAM, 0);
-       
+
        if (socket1 == INVALID_SOCKET) {
                goto out0;
        }
 
        arg = 1;
-       if (ioctlsocket (socket1, FIONBIO, &arg) == SOCKET_ERROR) { 
+       if (ioctlsocket (socket1, FIONBIO, &arg) == SOCKET_ERROR) {
                goto out1;
        }
 
@@ -187,10 +187,10 @@ out1:
 out0:
        closesocket (temp);
        errno = EMFILE;         /* FIXME: use the real syscall errno? */
-       
+
        fds[0] = -1;
        fds[1] = -1;
-       
+
        return -1;
 
 #endif
@@ -289,14 +289,14 @@ struct _EMCache {
 
 /**
  * em_cache_new:
- * @timeout: 
- * @nodesize: 
- * @nodefree: 
- * 
+ * @timeout:
+ * @nodesize:
+ * @nodefree:
+ *
  * Setup a new timeout cache.  @nodesize is the size of nodes in the
  * cache, and @nodefree will be called to free YOUR content.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 EMCache *
 em_cache_new(time_t timeout, size_t nodesize, GFreeFunc nodefree)
@@ -316,8 +316,8 @@ em_cache_new(time_t timeout, size_t nodesize, GFreeFunc nodefree)
 
 /**
  * em_cache_destroy:
- * @emc: 
- * 
+ * @emc:
+ *
  * destroy the cache, duh.
  **/
 void
@@ -330,13 +330,13 @@ em_cache_destroy(EMCache *emc)
 
 /**
  * em_cache_lookup:
- * @emc: 
- * @key: 
- * 
+ * @emc:
+ * @key:
+ *
  * Lookup a cache node.  once you're finished with it, you need to
  * unref it.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 EMCacheNode *
 em_cache_lookup(EMCache *emc, const char *key)
@@ -360,13 +360,13 @@ em_cache_lookup(EMCache *emc, const char *key)
 
 /**
  * em_cache_node_new:
- * @emc: 
- * @key: 
- * 
+ * @emc:
+ * @key:
+ *
  * Create a new key'd cache node.  The node will not be added to the
  * cache until you insert it.
- * 
- * Return value: 
+ *
+ * Return value:
  **/
 EMCacheNode *
 em_cache_node_new(EMCache *emc, const char *key)
@@ -382,9 +382,9 @@ em_cache_node_new(EMCache *emc, const char *key)
 
 /**
  * em_cache_node_unref:
- * @emc: 
- * @n: 
- * 
+ * @emc:
+ * @n:
+ *
  * unref a cache node, you can only unref nodes which have been looked
  * up.
  **/
@@ -399,9 +399,9 @@ em_cache_node_unref(EMCache *emc, EMCacheNode *n)
 
 /**
  * em_cache_add:
- * @emc: 
- * @n: 
- * 
+ * @emc:
+ * @n:
+ *
  * Add a cache node to the cache, once added the memory is owned by
  * the cache.  If there are conflicts and the old node is still in
  * use, then the new node is not added, otherwise it is added and any
@@ -462,8 +462,8 @@ em_cache_add(EMCache *emc, EMCacheNode *n)
 
 /**
  * em_cache_clear:
- * @emc: 
- * 
+ * @emc:
+ *
  * clear the cache.  just for api completeness.
  **/
 void
@@ -510,10 +510,10 @@ e_prpipe (PRFileDesc **fds)
        if (PR_CreatePipe (&fds[0], &fds[1]) != PR_FAILURE)
                return 0;
 #endif
-       
+
        fds[0] = NULL;
        fds[1] = NULL;
-       
+
        return -1;
 }
 #endif
@@ -868,7 +868,7 @@ void e_thread_destroy(EThread *e)
                        msg = g_malloc0(sizeof(*msg));
                        msg->reply_port = E_THREAD_QUIT_REPLYPORT;
                        e_msgport_put(e->server_port, msg);
-                       l = l->next;                    
+                       l = l->next;
                }
 
                /* then, wait for everyone to quit */
@@ -984,7 +984,7 @@ thread_destroy_msg(EThread *e, EMsg *m)
        func = e->destroy;
        func_data = e->destroy_data;
        pthread_mutex_unlock(&e->mutex);
-       
+
        if (func)
                func(e, m, func_data);
 }
@@ -1000,7 +1000,7 @@ thread_received_msg(EThread *e, EMsg *m)
        func = e->received;
        func_data = e->received_data;
        pthread_mutex_unlock(&e->mutex);
-       
+
        if (func)
                func(e, m, func_data);
        else
@@ -1018,7 +1018,7 @@ thread_lost_msg(EThread *e, EMsg *m)
        func = e->lost;
        func_data = e->lost_data;
        pthread_mutex_unlock(&e->mutex);
-       
+
        if (func)
                func(e, m, func_data);
 }
index 187c7b5..af970aa 100644 (file)
@@ -1,13 +1,13 @@
-/* 
+/*
  * Copyright 2000 Ximian (www.ximian.com).
  *
  * A simple, extensible s-exp evaluation engine.
  *
- * Author : 
+ * Author :
  *  Michael Zucchi <notzed@ximian.com>
 
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -121,9 +121,9 @@ static const GScannerConfig scanner_config =
          G_CSET_LATINS
          G_CSET_LATINC )       /* cset_identifier_nth */,
        ( ";\n" )               /* cpair_comment_single */,
-  
+
        FALSE                   /* case_sensitive */,
-  
+
        TRUE                    /* skip_comment_multi */,
        TRUE                    /* skip_comment_single */,
        TRUE                    /* scan_comment_multi */,
@@ -154,7 +154,7 @@ e_sexp_fatal_error(struct _ESExp *f, char *why, ...)
 
        if (f->error)
                g_free(f->error);
-       
+
        va_start(args, why);
        f->error = g_strdup_vprintf(why, args);
        va_end(args);
@@ -246,11 +246,11 @@ term_eval_and(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
        int type=-1;
        int bool = TRUE;
        int i;
-       
+
        r(printf("( and\n"));
 
        r = e_sexp_result_new(f, ESEXP_RES_UNDEFINED);
-       
+
        for (i=0;bool && i<argc;i++) {
                r1 = e_sexp_term_eval(f, argv[i]);
                if (type == -1)
@@ -263,7 +263,7 @@ term_eval_and(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
                } else if (r1->type == ESEXP_RES_ARRAY_PTR) {
                        char **a1;
                        int l1, j;
-                       
+
                        a1 = (char **)r1->value.ptrarray->pdata;
                        l1 = r1->value.ptrarray->len;
                        for (j=0;j<l1;j++) {
@@ -278,7 +278,7 @@ term_eval_and(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
                }
                e_sexp_result_free(f, r1);
        }
-       
+
        if (type == ESEXP_RES_ARRAY_PTR) {
                lambdafoo.count = argc;
                lambdafoo.uids = g_ptr_array_new();
@@ -289,9 +289,9 @@ term_eval_and(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
                r->type = ESEXP_RES_BOOL;
                r->value.bool = bool;
        }
-       
+
        g_hash_table_destroy(ht);
-       
+
        return r;
 }
 
@@ -304,11 +304,11 @@ term_eval_or(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
        int type = -1;
        int bool = FALSE;
        int i;
-       
+
        r(printf("(or \n"));
 
        r = e_sexp_result_new(f, ESEXP_RES_UNDEFINED);
-       
+
        for (i=0;!bool && i<argc;i++) {
                r1 = e_sexp_term_eval(f, argv[i]);
                if (type == -1)
@@ -321,18 +321,18 @@ term_eval_or(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
                } else if (r1->type == ESEXP_RES_ARRAY_PTR) {
                        char **a1;
                        int l1, j;
-                       
+
                        a1 = (char **)r1->value.ptrarray->pdata;
                        l1 = r1->value.ptrarray->len;
                        for (j=0;j<l1;j++) {
                                g_hash_table_insert(ht, a1[j], (void *)1);
                        }
                } else if (r1->type == ESEXP_RES_BOOL) {
-                       bool |= r1->value.bool;                         
+                       bool |= r1->value.bool;
                }
                e_sexp_result_free(f, r1);
        }
-       
+
        if (type == ESEXP_RES_ARRAY_PTR) {
                lambdafoo.count = argc;
                lambdafoo.uids = g_ptr_array_new();
@@ -344,7 +344,7 @@ term_eval_or(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
                r->value.bool = bool;
        }
        g_hash_table_destroy(ht);
-       
+
        return r;
 }
 
@@ -371,7 +371,7 @@ term_eval_lt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
        struct _ESExpResult *r, *r1, *r2;
 
        r = e_sexp_result_new(f, ESEXP_RES_UNDEFINED);
-       
+
        if (argc == 2) {
                r1 = e_sexp_term_eval(f, argv[0]);
                r2 = e_sexp_term_eval(f, argv[1]);
@@ -403,7 +403,7 @@ term_eval_gt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
        struct _ESExpResult *r, *r1, *r2;
 
        r = e_sexp_result_new(f, ESEXP_RES_UNDEFINED);
-       
+
        if (argc == 2) {
                r1 = e_sexp_term_eval(f, argv[0]);
                r2 = e_sexp_term_eval(f, argv[1]);
@@ -435,7 +435,7 @@ term_eval_eq(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
        struct _ESExpResult *r, *r1, *r2;
 
        r = e_sexp_result_new(f, ESEXP_RES_BOOL);
-       
+
        if (argc == 2) {
                r1 = e_sexp_term_eval(f, argv[0]);
                r2 = e_sexp_term_eval(f, argv[1]);
@@ -726,7 +726,7 @@ static void
 eval_dump_result(ESExpResult *r, int depth)
 {
        int i;
-       
+
        if (r==NULL) {
                printf("null result???\n");
                return;
@@ -771,7 +771,7 @@ parse_dump_term(struct _ESExpTerm *t, int depth)
 
        for (i=0;i<depth;i++)
                printf("   ");
-       
+
        switch (t->type) {
        case ESEXP_TERM_STRING:
                printf(" \"%s\"", t->value.string);
@@ -826,7 +826,7 @@ parse_term_free(struct _ESExp *f, struct _ESExpTerm *t)
        if (t==NULL) {
                return;
        }
-       
+
        switch (t->type) {
        case ESEXP_TERM_INT:
        case ESEXP_TERM_BOOL:
@@ -882,7 +882,7 @@ parse_values(ESExp *f, int *len)
 
        p(printf("found %d subterms\n", size));
        *len = size;
-       
+
        p(printf("done parsing values\n"));
        return terms;
 }
@@ -894,9 +894,9 @@ parse_value(ESExp *f)
        struct _ESExpTerm *t = NULL;
        GScanner *gs = f->scanner;
        struct _ESExpSymbol *s;
-       
+
        p(printf("parsing value\n"));
-       
+
        token = g_scanner_get_next_token(gs);
        switch(token) {
        case G_TOKEN_EOF:
@@ -916,7 +916,7 @@ parse_value(ESExp *f)
                        e_sexp_fatal_error (f, "Invalid format for a integer value");
                        return NULL;
                }
-               
+
                negative = TRUE;
                /* fall through... */
        case G_TOKEN_INT:
@@ -928,22 +928,22 @@ parse_value(ESExp *f)
                break;
        case '#': {
                char *str;
-               
+
                p(printf("got bool?\n"));
                token = g_scanner_get_next_token(gs);
                if (token != G_TOKEN_IDENTIFIER) {
                        e_sexp_fatal_error (f, "Invalid format for a boolean value");
                        return NULL;
                }
-               
+
                str = g_scanner_cur_value (gs).v_identifier;
-               
+
                g_assert (str != NULL);
                if (!(strlen (str) == 1 && (str[0] == 't' || str[0] == 'f'))) {
                        e_sexp_fatal_error (f, "Invalid format for a boolean value");
                        return NULL;
                }
-               
+
                t = parse_term_new(f, ESEXP_TERM_BOOL);
                t->value.bool = (str[0] == 't');
                break; }
@@ -1125,7 +1125,7 @@ GType
 e_sexp_get_type (void)
 {
        static GType type = 0;
-       
+
        if (!type) {
                static const GTypeInfo info = {
                        sizeof (ESExpClass),
@@ -1138,10 +1138,10 @@ e_sexp_get_type (void)
                        0,    /* n_preallocs */
                        (GInstanceInitFunc) e_sexp_init,
                };
-               
+
                type = g_type_register_static (G_TYPE_OBJECT, "ESExp", &info, 0);
        }
-       
+
        return type;
 }
 #endif
@@ -1155,7 +1155,7 @@ e_sexp_new (void)
        ESExp *f = g_malloc0 (sizeof (ESExp));
        e_sexp_init (f);
 #endif
-       
+
        return f;
 }
 
@@ -1308,9 +1308,9 @@ e_sexp_eval(ESExp *f)
 
 /**
  * e_sexp_encode_bool:
- * @s: 
- * @state: 
- * 
+ * @s:
+ * @state:
+ *
  * Encode a bool into an s-expression @s.  Bools are
  * encoded using #t #f syntax.
  **/
@@ -1327,7 +1327,7 @@ e_sexp_encode_bool(GString *s, gboolean state)
  * e_sexp_encode_string:
  * @s: Destination string.
  * @string: String expression.
- * 
+ *
  * Add a c string @string to the s-expression stored in
  * the gstring @s.  Quotes are added, and special characters
  * are escaped appropriately.
index f0599f3..cdc22fa 100644 (file)
@@ -113,11 +113,11 @@ struct _ESExp {
 #endif
        GScanner *scanner;      /* for parsing text version */
        ESExpTerm *tree;        /* root of expression tree */
-       
+
        /* private stuff */
        jmp_buf failenv;
        char *error;
-       
+
        /* TODO: may also need a pool allocator for term strings, so we dont lose them
           in error conditions? */
        struct _EMemChunk *term_chunks;
index 705c21a..355ba27 100644 (file)
@@ -124,7 +124,7 @@ e_source_group_class_init (ESourceGroupClass *class)
        object_class->dispose  = impl_dispose;
        object_class->finalize = impl_finalize;
 
-       signals[CHANGED] = 
+       signals[CHANGED] =
                g_signal_new ("changed",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -133,7 +133,7 @@ e_source_group_class_init (ESourceGroupClass *class)
                              g_cclosure_marshal_VOID__VOID,
                              G_TYPE_NONE, 0);
 
-       signals[SOURCE_ADDED] = 
+       signals[SOURCE_ADDED] =
                g_signal_new ("source_added",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -142,7 +142,7 @@ e_source_group_class_init (ESourceGroupClass *class)
                              g_cclosure_marshal_VOID__OBJECT,
                              G_TYPE_NONE, 1,
                              G_TYPE_OBJECT);
-       signals[SOURCE_REMOVED] = 
+       signals[SOURCE_REMOVED] =
                g_signal_new ("source_removed",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -299,7 +299,7 @@ e_source_group_new_from_xmldoc (xmlDocPtr doc)
 
        e_source_group_set_name (new, GC name);
        e_source_group_set_base_uri (new, GC base_uri);
-       
+
        for (p = root->children; p != NULL; p = p->next) {
                ESource *new_source;
 
@@ -344,7 +344,7 @@ e_source_group_update_from_xml (ESourceGroup *group,
        g_return_val_if_fail (E_IS_SOURCE_GROUP (group), FALSE);
        g_return_val_if_fail (xml != NULL, FALSE);
 
-       
+
        xmldoc = xmlParseDoc (XC xml);
 
        success = e_source_group_update_from_xmldoc (group, xmldoc, changed_return);
@@ -414,7 +414,7 @@ e_source_group_update_from_xmldoc (ESourceGroup *group,
                                                                  g_free, g_free);
                changed = TRUE;
        }
-       
+
        new_sources_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
 
        for (nodep = root->children; nodep != NULL; nodep = nodep->next) {
@@ -524,12 +524,12 @@ e_source_group_uid_from_xmldoc (xmlDocPtr doc)
        xmlNodePtr root = doc->children;
        xmlChar *name;
        char *retval;
-       
+
        if (root && root->name) {
                if (strcmp (GC root->name, "group") != 0)
                        return NULL;
        }
-       else 
+       else
                return NULL;
 
        name = xmlGetProp (root, XC "uid");
@@ -550,7 +550,7 @@ e_source_group_set_name (ESourceGroup *group,
 
        if (group->priv->readonly)
                return;
-       
+
        if (group->priv->name != NULL &&
            strcmp (group->priv->name, name) == 0)
                return;
@@ -566,10 +566,10 @@ void e_source_group_set_base_uri (ESourceGroup *group,
 {
        g_return_if_fail (E_IS_SOURCE_GROUP (group));
        g_return_if_fail (base_uri != NULL);
-       
+
        if (group->priv->readonly)
                return;
-       
+
        if (group->priv->base_uri == base_uri)
                return;
 
@@ -583,18 +583,18 @@ void e_source_group_set_readonly (ESourceGroup *group,
                                  gboolean      readonly)
 {
        GSList *i;
-       
+
        g_return_if_fail (E_IS_SOURCE_GROUP (group));
-       
+
        if (group->priv->readonly)
                return;
-       
+
        if (group->priv->readonly == readonly)
                return;
 
        group->priv->readonly = readonly;
        for (i = group->priv->sources; i != NULL; i = i->next)
-               e_source_set_readonly (E_SOURCE (i->data), readonly);   
+               e_source_set_readonly (E_SOURCE (i->data), readonly);
 
        g_signal_emit (group, signals[CHANGED], 0);
 }
@@ -676,7 +676,7 @@ e_source_group_add_source (ESourceGroup *group,
 
        if (group->priv->readonly)
                return FALSE;
-       
+
        if (e_source_group_peek_source_by_uid (group, e_source_peek_uid (source)) != NULL)
                return FALSE;
 
@@ -731,7 +731,7 @@ e_source_group_remove_source_by_uid (ESourceGroup *group,
 
        if (group->priv->readonly)
                return FALSE;
-       
+
        for (p = group->priv->sources; p != NULL; p = p->next) {
                ESource *source = E_SOURCE (p->data);
 
@@ -774,7 +774,7 @@ e_source_group_to_xml (ESourceGroup *group)
                properties_node = xmlNewChild (root, NULL, XC "properties", NULL);
                g_hash_table_foreach (group->priv->properties, (GHFunc) property_dump_cb, properties_node);
        }
-       
+
        xmlDocSetRootElement (doc, root);
 
        for (p = group->priv->sources; p != NULL; p = p->next)
index 2e09a7a..8b813f1 100644 (file)
@@ -171,7 +171,7 @@ load_from_gconf (ESourceList *list)
 
        /* FIXME if the order changes, the function doesn't notice.  */
 
-       if (changed) 
+       if (changed)
                g_signal_emit (list, signals[CHANGED], 0);
 }
 
@@ -240,7 +240,7 @@ impl_dispose (GObject *object)
 
                g_source_remove (priv->sync_idle_id);
                priv->sync_idle_id = 0;
-               
+
                if (! e_source_list_sync (E_SOURCE_LIST (object), &error))
                        g_warning ("Could not update \"%s\": %s",
                                   priv->gconf_path, error->message);
@@ -300,7 +300,7 @@ e_source_list_class_init (ESourceListClass *class)
        object_class->dispose  = impl_dispose;
        object_class->finalize = impl_finalize;
 
-       signals[CHANGED] = 
+       signals[CHANGED] =
                g_signal_new ("changed",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -309,7 +309,7 @@ e_source_list_class_init (ESourceListClass *class)
                              g_cclosure_marshal_VOID__VOID,
                              G_TYPE_NONE, 0);
 
-       signals[GROUP_REMOVED] = 
+       signals[GROUP_REMOVED] =
                g_signal_new ("group_removed",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -319,7 +319,7 @@ e_source_list_class_init (ESourceListClass *class)
                              G_TYPE_NONE, 1,
                              G_TYPE_POINTER);
 
-       signals[GROUP_ADDED] = 
+       signals[GROUP_ADDED] =
                g_signal_new ("group_added",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -342,10 +342,10 @@ e_source_list_init (ESourceList *source_list)
 
 /* returns the type */
 static GType
-get_source_list_type (void) 
+get_source_list_type (void)
 {
        static GType type = 0;
-       
+
        if (!type) {
                if (!(type = g_type_from_name ("ESourceList")))
                        type = e_source_list_get_type ();
@@ -392,7 +392,7 @@ e_source_list_new_for_gconf (GConfClient *client,
 
 ESourceList *
 e_source_list_new_for_gconf_default (const char  *path)
-{      
+{
        ESourceList *list;
 
        g_return_val_if_fail (path != NULL, NULL);
@@ -471,7 +471,7 @@ e_source_list_peek_source_by_uid (ESourceList *list,
        for (p = list->priv->groups; p != NULL; p = p->next) {
                ESourceGroup *group = E_SOURCE_GROUP (p->data);
                ESource *source;
-               
+
                source = e_source_group_peek_source_by_uid (group, uid);
                if (source)
                        return source;
@@ -490,7 +490,7 @@ e_source_list_peek_source_any (ESourceList *list)
        for (p = list->priv->groups; p != NULL; p = p->next) {
                ESourceGroup *group = E_SOURCE_GROUP (p->data);
                GSList *sources;
-               
+
                sources = e_source_group_peek_sources (group);
                if (sources && sources->data)
                        return E_SOURCE (sources->data);
@@ -540,7 +540,7 @@ e_source_list_remove_group_by_uid (ESourceList *list,
                                    const char *uid)
 {
        ESourceGroup *group;
-       
+
        g_return_val_if_fail (E_IS_SOURCE_LIST (list), FALSE);
        g_return_val_if_fail (uid != NULL, FALSE);
 
@@ -557,14 +557,14 @@ e_source_list_remove_source_by_uid (ESourceList *list,
                                     const char *uid)
 {
        GSList *p;
-       
+
        g_return_val_if_fail (E_IS_SOURCE_LIST (list), FALSE);
        g_return_val_if_fail (uid != NULL, FALSE);
 
        for (p = list->priv->groups; p != NULL; p = p->next) {
                ESourceGroup *group = E_SOURCE_GROUP (p->data);
                ESource *source;
-               
+
                source = e_source_group_peek_source_by_uid (group, uid);
                if (source)
                        return e_source_group_remove_source_by_uid (group, uid);
@@ -613,9 +613,9 @@ e_source_list_is_gconf_updated (ESourceList *list)
        GSList *conf_list = NULL, *temp = NULL, *p = NULL;
        xmlDocPtr xmldoc;
        ESourceGroup *group = NULL;
-       GSList *groups = NULL;  
+       GSList *groups = NULL;
        gboolean conf_to_list = TRUE, list_to_conf = TRUE;
-       
+
        g_return_val_if_fail (list != NULL, FALSE);
 
        conf_list = gconf_client_get_list (list->priv->gconf_client,
@@ -645,7 +645,7 @@ e_source_list_is_gconf_updated (ESourceList *list)
                                break;
                        }
                } else {
-                       conf_to_list = FALSE;   
+                       conf_to_list = FALSE;
                        break;
                }
        }
@@ -660,10 +660,10 @@ e_source_list_is_gconf_updated (ESourceList *list)
                g_slist_free (conf_list);
                return FALSE;
        }
-       
+
        groups = e_source_list_peek_groups (list);
-       
-       /* From list to conf */ 
+
+       /* From list to conf */
 
        for (p = groups ; p != NULL; p = p->next) {
                group = E_SOURCE_GROUP (p->data);
@@ -674,7 +674,7 @@ e_source_list_is_gconf_updated (ESourceList *list)
                        if (strcmp (gconf_xml, source_group_xml))
                                continue;
                        else
-                               break; 
+                               break;
                }
                g_free (source_group_xml);
 
@@ -694,6 +694,6 @@ e_source_list_is_gconf_updated (ESourceList *list)
        /* If there is mismatch return FALSE */
        if (!list_to_conf)
                return FALSE;
-       
+
        return TRUE;
 }
index cb53a31..d8887ab 100644 (file)
@@ -42,7 +42,7 @@ struct _ESourcePrivate {
        char *absolute_uri;
 
        gboolean readonly;
-       
+
        gchar *color_spec;
 
        GHashTable *properties;
@@ -116,7 +116,7 @@ e_source_class_init (ESourceClass *class)
        object_class->dispose  = impl_dispose;
        object_class->finalize = impl_finalize;
 
-       signals[CHANGED] = 
+       signals[CHANGED] =
                g_signal_new ("changed",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -303,9 +303,9 @@ compare_str_hashes (GHashTable *table1, GHashTable *table2)
  * e_source_update_from_xml_node:
  * @source: An ESource.
  * @node: A pointer to the node to parse.
- * 
+ *
  * Update the ESource properties from @node.
- * 
+ *
  * Return value: %TRUE if the data in @node was recognized and parsed into
  * acceptable values for @source, %FALSE otherwise.
  **/
@@ -369,7 +369,7 @@ e_source_update_from_xml_node (ESource *source,
                                                                  g_free, g_free);
                changed = TRUE;
        }
-       
+
        for (node = node->children; node; node = node->next) {
                if (!node->name)
                        continue;
@@ -387,7 +387,7 @@ e_source_update_from_xml_node (ESource *source,
        }
 
        retval = TRUE;
-       
+
  done:
        if (changed)
                g_signal_emit (source, signals[CHANGED], 0);
@@ -412,10 +412,10 @@ e_source_update_from_xml_node (ESource *source,
 /**
  * e_source_name_from_xml_node:
  * @node: A pointer to an XML node.
- * 
+ *
  * Assuming that @node is a valid ESource specification, retrieve the name of
  * the source from it.
- * 
+ *
  * Return value: Name of the source in the specified @node.  The caller must
  * free the string.
  **/
@@ -440,7 +440,7 @@ e_source_build_absolute_uri (ESource *source)
        gchar *uri_str;
 
        g_return_val_if_fail (source->priv->group != NULL, NULL);
-       
+
        base_uri_str = e_source_group_peek_base_uri (source->priv->group);
 
        /* If last character in base URI is a slash, just concat the
@@ -471,7 +471,7 @@ e_source_set_group (ESource *source,
 
        if (source->priv->readonly)
                return;
-       
+
        if (source->priv->group == group)
                return;
 
@@ -495,7 +495,7 @@ e_source_set_name (ESource *source,
 
        if (source->priv->readonly)
                return;
-       
+
        if (source->priv->name != NULL &&
            strcmp (source->priv->name, name) == 0)
                return;
@@ -516,7 +516,7 @@ e_source_set_relative_uri (ESource *source,
 
        if (source->priv->readonly)
                return;
-       
+
        if (source->priv->relative_uri == relative_uri)
                return;
 
@@ -524,7 +524,7 @@ e_source_set_relative_uri (ESource *source,
        source->priv->relative_uri = g_strdup (relative_uri);
 
        /* reset the absolute uri */
-       if (source->priv->absolute_uri && 
+       if (source->priv->absolute_uri &&
            (absolute_uri = e_source_build_absolute_uri (source))) {
                g_free (source->priv->absolute_uri);
                source->priv->absolute_uri = absolute_uri;
@@ -561,7 +561,7 @@ e_source_set_readonly (ESource  *source,
        source->priv->readonly = readonly;
 
        g_signal_emit (source, signals[CHANGED], 0);
-       
+
 }
 
 void
@@ -648,10 +648,10 @@ e_source_peek_absolute_uri (ESource *source)
 /**
  * e_source_peek_color_spec:
  * @source: an ESource
- * 
+ *
  * Return the textual representation of the color for @source, or %NULL if it
  * has none.  The returned string should be parsable by #gdk_color_parse().
- * 
+ *
  * Return value: a string specifying the color
  *
  * Since: 1.10
@@ -678,9 +678,9 @@ e_source_get_readonly (ESource *source)
  * @source: An ESource
  * @color_return: Pointer to a variable where the returned color will be
  * stored.
- * 
+ *
  * If @source has an associated color, return it in *@color_return.
- * 
+ *
  * Return value: %TRUE if the @source has a defined color (and hence
  * *@color_return was set), %FALSE otherwise.
  **/
index 0663381..2fc982d 100644 (file)
@@ -44,7 +44,7 @@ get_locale_string (int lctype)
 {
        int nbytes = GetLocaleInfo (GetThreadLocale (), lctype, NULL, 0);
        char *tem;
-       GQuark quark; 
+       GQuark quark;
 
        if (nbytes == 0)
                return "???";
@@ -645,9 +645,9 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
                                   get_locale_string (LOCALE_STIMEFORMAT),
                                   NULL);
              const char *posix_d_t_fmt = translate_picture (d_t_fmt);
-             
+
              g_free (d_t_fmt);
-                     
+
              if (!recursive (posix_d_t_fmt))
                {
                  if (*decided == loc)
@@ -1492,13 +1492,13 @@ parse_with_strptime (const char *value, struct tm *result, const char **formats,
                result->tm_isdst = -1;
                return E_TIME_PARSE_NONE;
        }
-       
+
        locale_str = g_locale_from_utf8 (value, -1, NULL, NULL, NULL);
        pos = (const char *) locale_str;
 
        if (!locale_str)
                return E_TIME_PARSE_INVALID;
-       
+
        /* Skip whitespace */
        while (n = (int)((unsigned char)*pos), isspace (n) != 0)
                pos++;
@@ -1541,7 +1541,7 @@ parse_with_strptime (const char *value, struct tm *result, const char **formats,
    case the user can choose between 12 and 24-hour time formats. */
 static gboolean
 locale_supports_12_hour_format (void)
-{  
+{
        struct tm tmp_tm = { 0 };
        char s[16];
 
@@ -1563,7 +1563,7 @@ locale_supports_12_hour_format (void)
  * formats with am/pm can be used.
  *
  * Returns: E_TIME_PARSE_OK if the string was successfully parsed,
- *          E_TIME_PARSE_NONE if the string was empty, or 
+ *          E_TIME_PARSE_NONE if the string was empty, or
  *          E_TIME_PARSE_INVALID if the string could not be parsed.
  */
 ETimeParseStatus
@@ -1605,7 +1605,7 @@ e_time_parse_date_and_time                (const char     *value,
                format[num_formats++] = _("%a %m/%d/%Y %I:%M:%S %p");
        }
 
-       /* strptime format of a weekday, a date and a time, 
+       /* strptime format of a weekday, a date and a time,
           in 24-hour format. */
        format[num_formats++] = _("%a %m/%d/%Y %H:%M:%S");
 
@@ -1704,10 +1704,10 @@ e_time_parse_date_and_time              (const char     *value,
  * e_time_parse_date:
  * @value: A date string.
  * @result: Return value for the parsed date.
- * 
+ *
  * Takes in a date string entered by the user and tries to convert it to
  * a struct #tm.
- * 
+ *
  * Returns: An #ETimeParseStatus result code indicating whether
  * @value was an empty string, a valid date, or an invalid date.
  **/
@@ -1724,7 +1724,7 @@ e_time_parse_date (const char *value, struct tm *result)
 
        /* according to the current locale */
        format [0] = ("%x");
-       
+
        /* strptime format of a weekday and a date. */
        format[1] = _("%a %m/%d/%Y");
 
@@ -1738,16 +1738,16 @@ e_time_parse_date (const char *value, struct tm *result)
                if (result->tm_year < 0) {
                        t = time (NULL);
                        today_tm = localtime (&t);
-                       
+
                        /* This should convert it into a value from 0 to 99. */
                        result->tm_year += 1900;
-                       
+
                        /* Now add on the century. */
                        result->tm_year += today_tm->tm_year
                                - (today_tm->tm_year % 100);
                }
        }
-       
+
        return status;
 }
 
@@ -1866,7 +1866,7 @@ e_time_format_date_and_time               (struct tm      *date_tm,
  * @show_zero_seconds: A #gboolean.
  * @buffer: The #char buffer to store the result in.
  * @buffer_size: The length of @buffer.
- *  
+ *
  * Creates a string representation of a time value in @date_tm and
  * stores it in @buffer. @buffer_size should be at least 64.
  **/
@@ -1896,7 +1896,7 @@ e_time_format_time                        (struct tm      *date_tm,
                        /* strftime format of a time in 12-hour format. */
                        format = _("%I:%M:%S %p");
        }
-                       
+
        /* strftime returns 0 if the string doesn't fit, and leaves the buffer
           undefined, so we set it to the empty string in that case. */
        if (e_utf8_strftime (buffer, buffer_size, format, date_tm) == 0)
@@ -1907,9 +1907,9 @@ e_time_format_time                        (struct tm      *date_tm,
 /**
  * e_mktime_utc:
  * @tm: The #tm to convert to a calendar time representation.
- * 
+ *
  * Like mktime(3), but assumes UTC instead of local timezone.
- * 
+ *
  * Returns: The calendar time representation of @tm.
  **/
 time_t
index 427c2ce..19bf803 100644 (file)
@@ -19,7 +19,7 @@
  * @E_TIME_PARSE_OK: The time string was parsed successfully.
  * @E_TIME_PARSE_NONE: The time string was empty.
  * @E_TIME_PARSE_INVALID: The time string was not formatted correctly.
- **/ 
+ **/
 typedef enum {
        E_TIME_PARSE_OK,
        E_TIME_PARSE_NONE,
index b8640bc..0634f42 100644 (file)
@@ -56,7 +56,7 @@ struct _ETrie {
        struct _trie_state root;
        GPtrArray *fail_states;
        gboolean icase;
-       
+
        EMemChunk *match_chunks;
        EMemChunk *state_chunks;
 };
@@ -69,10 +69,10 @@ trie_utf8_getc (const unsigned char **in, size_t inlen)
        const unsigned char *inend = inptr + inlen;
        register unsigned char c, r;
        register gunichar u, m;
-       
+
        if (inlen == 0)
                return 0;
-       
+
        r = *inptr++;
        if (r < 0x80) {
                *in = inptr;
@@ -83,25 +83,25 @@ trie_utf8_getc (const unsigned char **in, size_t inlen)
                do {
                        if (inptr >= inend)
                                return 0;
-                       
+
                        c = *inptr++;
                        if ((c & 0xc0) != 0x80)
                                goto error;
-                       
+
                        u = (u << 6) | (c & 0x3f);
                        r <<= 1;
                        m <<= 5;
                } while (r & 0x40);
-               
+
                *in = inptr;
-               
+
                u &= ~m;
        } else {
        error:
                *in = (*in)+1;
                u = 0xfffe;
        }
-       
+
        return u;
 }
 
@@ -118,19 +118,19 @@ ETrie *
 e_trie_new (gboolean icase)
 {
        ETrie *trie;
-       
+
        trie = g_new (ETrie, 1);
        trie->root.next = NULL;
        trie->root.fail = NULL;
        trie->root.match = NULL;
        trie->root.final = 0;
-       
+
        trie->fail_states = g_ptr_array_sized_new (8);
        trie->icase = icase;
-       
+
        trie->match_chunks = e_memchunk_new (8, sizeof (struct _trie_match));
        trie->state_chunks = e_memchunk_new (8, sizeof (struct _trie_state));
-       
+
        return trie;
 }
 
@@ -155,10 +155,10 @@ static struct _trie_match *
 g (struct _trie_state *s, gunichar c)
 {
        struct _trie_match *m = s->match;
-       
+
        while (m && m->c != c)
                m = m->next;
-       
+
        return m;
 }
 
@@ -166,42 +166,42 @@ static struct _trie_state *
 trie_insert (ETrie *trie, int depth, struct _trie_state *q, gunichar c)
 {
        struct _trie_match *m;
-       
+
        m = e_memchunk_alloc (trie->match_chunks);
        m->next = q->match;
        m->c = c;
-       
+
        q->match = m;
        q = m->state = e_memchunk_alloc (trie->state_chunks);
        q->match = NULL;
        q->fail = &trie->root;
        q->final = 0;
        q->id = -1;
-       
+
        if (trie->fail_states->len < depth + 1) {
                unsigned int size = trie->fail_states->len;
-               
+
                size = MAX (size + 64, depth + 1);
                g_ptr_array_set_size (trie->fail_states, size);
        }
-       
+
        q->next = trie->fail_states->pdata[depth];
        trie->fail_states->pdata[depth] = q;
-       
+
        return q;
 }
 
 
 #if 1
-static void 
+static void
 dump_trie (struct _trie_state *s, int depth)
 {
        char *p = g_alloca ((depth * 2) + 1);
        struct _trie_match *m;
-       
+
        memset (p, ' ', depth * 2);
        p[depth * 2] = '\0';
-       
+
        fprintf (stderr, "%s[state] %p: final=%d; pattern-id=%d; fail=%p\n",
                 p, s, s->final, s->id, s->fail);
        m = s->match;
@@ -209,7 +209,7 @@ dump_trie (struct _trie_state *s, int depth)
                fprintf (stderr, " %s'%c' -> %p\n", p, m->c, m->state);
                if (m->state)
                        dump_trie (m->state, depth + 1);
-               
+
                m = m->next;
        }
 }
@@ -246,30 +246,30 @@ e_trie_add (ETrie *trie, const char *pattern, int pattern_id)
        struct _trie_match *m, *n;
        int i, depth = 0;
        gunichar c;
-       
+
        /* Step 1: add the pattern to the trie */
-       
+
        q = &trie->root;
-       
+
        while ((c = trie_utf8_getc (&inptr, -1))) {
                if (trie->icase)
                        c = g_unichar_tolower (c);
-               
+
                m = g (q, c);
                if (m == NULL) {
                        q = trie_insert (trie, depth, q, c);
                } else {
                        q = m->state;
                }
-               
+
                depth++;
        }
-       
+
        q->final = depth;
        q->id = pattern_id;
-       
+
        /* Step 2: compute failure graph */
-       
+
        for (i = 0; i < trie->fail_states->len; i++) {
                q = trie->fail_states->pdata[i];
                while (q) {
@@ -280,7 +280,7 @@ e_trie_add (ETrie *trie, const char *pattern, int pattern_id)
                                r = q->fail;
                                while (r && (n = g (r, c)) == NULL)
                                        r = r->fail;
-                               
+
                                if (r != NULL) {
                                        q1->fail = n->state;
                                        if (q1->fail->final > q1->final)
@@ -291,14 +291,14 @@ e_trie_add (ETrie *trie, const char *pattern, int pattern_id)
                                        else
                                                q1->fail = &trie->root;
                                }
-                               
+
                                m = m->next;
                        }
-                       
+
                        q = q->next;
                }
        }
-       
+
        d(fprintf (stderr, "\nafter adding pattern '%s' to trie %p:\n", pattern, trie));
        d(dump_trie (&trie->root, 0));
 }
@@ -342,42 +342,42 @@ e_trie_search (ETrie *trie, const char *buffer, size_t buflen, int *matched_id)
        struct _trie_state *q;
        struct _trie_match *m = NULL; /* init to please gcc */
        gunichar c;
-       
+
        inptr = (const unsigned char *) buffer;
        inend = inptr + buflen;
-       
+
        q = &trie->root;
        pat = prev = inptr;
        while ((c = trie_utf8_getc (&inptr, inlen))) {
                inlen = (inend - inptr);
-               
+
                if (c != 0xfffe) {
                        if (trie->icase)
                                c = g_unichar_tolower (c);
-                       
+
                        while (q != NULL && (m = g (q, c)) == NULL)
                                q = q->fail;
-                       
+
                        if (q == &trie->root)
                                pat = prev;
-                       
+
                        if (q == NULL) {
                                q = &trie->root;
                                pat = inptr;
                        } else if (m != NULL) {
                                q = m->state;
-                               
+
                                if (q->final) {
                                        if (matched_id)
                                                *matched_id = q->id;
-                                       
+
                                        return (const char *) pat;
                                }
                        }
                }
-               
+
                prev = inptr;
        }
-       
+
        return NULL;
 }
index 2e0b01a..c1bf9a4 100644 (file)
@@ -30,9 +30,9 @@
 
 /**
  * e_uid_new:
- * 
+ *
  * Generate a new unique string for use e.g. in account lists.
- * 
+ *
  * Return value: The newly generated UID.  The caller should free the string
  * when it's done with it.
  **/
index fc9bd68..59e1d61 100644 (file)
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
- * 
+ *
  * 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 Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
@@ -46,7 +46,7 @@ e_url_shroud (const char *url)
        const char *last_at = NULL;
        const char *p;
        char *shrouded;
-       
+
        if (url == NULL)
                return NULL;
 
index 2570dba..eca7b47 100644 (file)
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
- * 
+ *
  * 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 Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
index 9c6f65a..65db4f2 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2001-2003 Ximian, Inc.
  *
  * This program is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@
 
 /**
  * e_xml_to_hash:
- * @doc: The #xmlDoc to store in a hash table. 
+ * @doc: The #xmlDoc to store in a hash table.
  * @type: The value type to use as a key in the hash table.
  *
  * Creates a #GHashTable representation of the #xmlDoc @doc.
@@ -198,7 +198,7 @@ e_xmlhash_new (const char *filename)
                doc = e_xml_parse_file (filename);
                if (!doc) {
                        e_xmlhash_destroy (hash);
-                       
+
                        return NULL;
                }
                hash->objects = e_xml_to_hash (doc, E_XML_HASH_TYPE_OBJECT_UID);
@@ -206,7 +206,7 @@ e_xmlhash_new (const char *filename)
        } else {
                hash->objects = g_hash_table_new (g_str_hash, g_str_equal);
        }
-       
+
        return hash;
 }
 
@@ -263,7 +263,7 @@ e_xmlhash_remove (EXmlHash *hash, const char *key)
  *
  * Returns: E_XMLHASH_STATUS_SAME if the value and @compare_data are
  *          equal,E_XMLHASH_STATUS_DIFFERENT if they are different, or
- *          E_XMLHASH_STATUS_NOT_FOUND if there is no entry in @hash with 
+ *          E_XMLHASH_STATUS_NOT_FOUND if there is no entry in @hash with
  *          its key equal to @key.
  **/
 EXmlHashStatus
index 4d8dcb0..eedfb4f 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2001-2003 Ximian, Inc.
  *
  * This program is free software; you can redistribute it and/or
index 228cee7..9491a93 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2005 Novell, Inc.
  *
  * This program is free software; you can redistribute it and/or
@@ -72,13 +72,13 @@ e_xml_save_file (const char *filename, xmlDocPtr doc)
        filesave = g_build_filename (dirname, savebasename, NULL);
        g_free (savebasename);
        g_free (dirname);
-       
+
        fd = g_open (filesave, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0600);
        if (fd == -1) {
                g_free (filesave);
                return -1;
        }
-       
+
        xmlDocDumpFormatMemory (doc, &xmlbuf, &size, TRUE);
        if (size <= 0) {
                close (fd);
@@ -87,19 +87,19 @@ e_xml_save_file (const char *filename, xmlDocPtr doc)
                errno = ENOMEM;
                return -1;
        }
-       
+
        n = (size_t) size;
        do {
                do {
                        w = write (fd, xmlbuf + written, n - written);
                } while (w == -1 && errno == EINTR);
-               
+
                if (w > 0)
                        written += w;
        } while (w != -1 && written < n);
-       
+
        xmlFree (xmlbuf);
-       
+
        if (written < n || fsync (fd) == -1) {
                errnosave = errno;
                close (fd);
@@ -111,12 +111,12 @@ e_xml_save_file (const char *filename, xmlDocPtr doc)
 
        while ((ret = close (fd)) == -1 && errno == EINTR)
                ;
-       
+
        if (ret == -1) {
                g_free (filesave);
                return -1;
        }
-       
+
        if (g_rename (filesave, filename) == -1) {
                errnosave = errno;
                g_unlink (filesave);
@@ -125,7 +125,7 @@ e_xml_save_file (const char *filename, xmlDocPtr doc)
                return -1;
        }
        g_free (filesave);
-       
+
        return 0;
 }
 
@@ -136,7 +136,7 @@ e_xml_get_child_by_name (const xmlNode *parent, const xmlChar *child_name)
 
        g_return_val_if_fail (parent != NULL, NULL);
        g_return_val_if_fail (child_name != NULL, NULL);
-       
+
        for (child = parent->xmlChildrenNode; child != NULL; child = child->next) {
                if (xmlStrcmp (child->name, child_name) == 0) {
                        return child;
index 29cf26e..ce14d66 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2005 Novell, Inc.
  *
  * This program is free software; you can redistribute it and/or
index 5f7a101..814fe4d 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * libedataserver-private.h: For e-d-s (not just libedataserver)
  * Copyright 2005, Novell, Inc.
  *
index 6474f04..e54161c 100644 (file)
@@ -39,7 +39,7 @@ static void md5_transform (guint32 buf[4], const guint32 in[16]);
 /*
  * Note: this code is not required on little-endian machines.
  */
-static void 
+static void
 _byte_reverse (guchar *buf, guint32 longs)
 {
        guint32 t;
@@ -54,19 +54,19 @@ _byte_reverse (guchar *buf, guint32 longs)
 
 /**
  * md5_init: Initialise an md5 context object
- * @ctx: md5 context 
- * 
- * Initialise an md5 buffer. 
+ * @ctx: md5 context
+ *
+ * Initialise an md5 buffer.
  *
  **/
-void 
+void
 md5_init (MD5Context *ctx)
 {
        ctx->buf[0] = 0x67452301;
        ctx->buf[1] = 0xefcdab89;
        ctx->buf[2] = 0x98badcfe;
        ctx->buf[3] = 0x10325476;
-       
+
        ctx->bits[0] = 0;
        ctx->bits[1] = 0;
 }
@@ -78,29 +78,29 @@ md5_init (MD5Context *ctx)
  * @ctx: context object used for md5 computaion
  * @buf: buffer to add
  * @len: buffer length
- * 
+ *
  * Update context to reflect the concatenation of another buffer full
  * of bytes. Use this to progressively construct an md5 hash.
  **/
-void 
+void
 md5_update (MD5Context *ctx, const guchar *buf, guint32 len)
 {
        guint32 t;
-       
+
        /* Update bitcount */
-       
+
        t = ctx->bits[0];
        if ((ctx->bits[0] = t + ((guint32) len << 3)) < t)
                ctx->bits[1]++;         /* Carry from low to high */
        ctx->bits[1] += len >> 29;
-       
+
        t = (t >> 3) & 0x3f;    /* Bytes already in shsInfo->data */
-       
+
        /* Handle any leading odd-sized chunks */
-       
+
        if (t) {
                guchar *p = (guchar *) ctx->in + t;
-               
+
                t = 64 - t;
                if (len < t) {
                        memcpy (p, buf, len);
@@ -115,7 +115,7 @@ md5_update (MD5Context *ctx, const guchar *buf, guint32 len)
                len -= t;
        }
        /* Process data in 64-byte chunks */
-       
+
        while (len >= 64) {
                memcpy (ctx->in, buf, 64);
 #if G_BYTE_ORDER == G_BIG_ENDIAN
@@ -125,9 +125,9 @@ md5_update (MD5Context *ctx, const guchar *buf, guint32 len)
                buf += 64;
                len -= 64;
        }
-       
+
        /* Handle any remaining bytes of data. */
-       
+
        memcpy (ctx->in, buf, len);
 }
 
@@ -136,33 +136,33 @@ md5_update (MD5Context *ctx, const guchar *buf, guint32 len)
 
 
 /*
- * Final wrapup - pad to 64-byte boundary with the bit pattern 
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
  * 1 0* (64-bit count of bits processed, MSB-first)
  */
 /**
  * md5_final: copy the final md5 hash to a bufer
  * @digest: 16 bytes buffer
  * @ctx: context containing the calculated md5
- * 
+ *
  * copy the final md5 hash to a bufer
  **/
-void 
+void
 md5_final (MD5Context *ctx, guchar digest[16])
 {
        guint32 count;
        guchar *p;
-       
+
        /* Compute number of bytes mod 64 */
        count = (ctx->bits[0] >> 3) & 0x3F;
-       
+
        /* Set the first char of padding to 0x80.  This is safe since there is
           always at least one byte free */
        p = ctx->in + count;
        *p++ = 0x80;
-       
+
        /* Bytes of padding needed to make 64 bytes */
        count = 64 - 1 - count;
-       
+
        /* Pad out to 56 mod 64 */
        if (count < 8) {
                /* Two lots of padding:  Pad the first block to 64 bytes */
@@ -171,7 +171,7 @@ md5_final (MD5Context *ctx, guchar digest[16])
                _byte_reverse (ctx->in, 16);
 #endif
                md5_transform (ctx->buf, (guint32 *) ctx->in);
-               
+
                /* Now fill the next block with 56 bytes */
                memset (ctx->in, 0, 56);
        } else {
@@ -181,11 +181,11 @@ md5_final (MD5Context *ctx, guchar digest[16])
 #if G_BYTE_ORDER == G_BIG_ENDIAN
        _byte_reverse (ctx->in, 14);
 #endif
-       
+
        /* Append length in bits and transform */
        ((guint32 *) ctx->in)[14] = ctx->bits[0];
        ((guint32 *) ctx->in)[15] = ctx->bits[1];
-       
+
        md5_transform (ctx->buf, (guint32 *) ctx->in);
 #if G_BYTE_ORDER == G_BIG_ENDIAN
        _byte_reverse ((guchar *) ctx->buf, 4);
@@ -213,16 +213,16 @@ md5_final (MD5Context *ctx, guchar digest[16])
  * reflect the addition of 16 longwords of new data.  md5_Update blocks
  * the data and converts bytes into longwords for this routine.
  */
-static void 
+static void
 md5_transform (guint32 buf[4], const guint32 in[16])
 {
        register guint32 a, b, c, d;
-       
+
        a = buf[0];
        b = buf[1];
        c = buf[2];
        d = buf[3];
-       
+
        MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7);
        MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
        MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17);
@@ -239,7 +239,7 @@ md5_transform (guint32 buf[4], const guint32 in[16])
        MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
        MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
        MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
-       
+
        MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5);
        MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9);
        MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
@@ -256,7 +256,7 @@ md5_transform (guint32 buf[4], const guint32 in[16])
        MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
        MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14);
        MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
-       
+
        MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4);
        MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11);
        MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
@@ -273,7 +273,7 @@ md5_transform (guint32 buf[4], const guint32 in[16])
        MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
        MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
        MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
-       
+
        MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6);
        MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10);
        MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
@@ -290,7 +290,7 @@ md5_transform (guint32 buf[4], const guint32 in[16])
        MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
        MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
        MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21);
-       
+
        buf[0] += a;
        buf[1] += b;
        buf[2] += c;
@@ -305,19 +305,19 @@ md5_transform (guint32 buf[4], const guint32 in[16])
  * @buffer: byte buffer
  * @buffer_size: buffer size (in bytes)
  * @digest: 16 bytes buffer receiving the hash code.
- * 
- * Get the md5 hash of a buffer. The result is put in 
+ *
+ * Get the md5 hash of a buffer. The result is put in
  * the 16 bytes buffer @digest .
  **/
 void
 md5_get_digest (const gchar *buffer, gint buffer_size, guchar digest[16])
-{      
+{
        MD5Context ctx;
 
        md5_init (&ctx);
        md5_update (&ctx, (guchar*)buffer, buffer_size);
        md5_final (&ctx, digest);
-       
+
 }
 
 
@@ -325,13 +325,13 @@ md5_get_digest (const gchar *buffer, gint buffer_size, guchar digest[16])
  * md5_get_digest_from_file: get the md5 hash of a file
  * @filename: file name
  * @digest: 16 bytes buffer receiving the hash code.
- * 
- * Get the md5 hash of a file. The result is put in 
+ *
+ * Get the md5 hash of a file. The result is put in
  * the 16 bytes buffer @digest .
  **/
 void
 md5_get_digest_from_file (const gchar *filename, guchar digest[16])
-{      
+{
        MD5Context ctx;
        guchar tmp_buf[1024];
        gint nb_bytes_read;
@@ -342,15 +342,15 @@ md5_get_digest_from_file (const gchar *filename, guchar digest[16])
        if (!fp) {
                return;
        }
-       
+
        while ((nb_bytes_read = fread (tmp_buf, 1, sizeof (tmp_buf), fp)) > 0)
                md5_update (&ctx, tmp_buf, nb_bytes_read);
-       
+
        if (ferror(fp)) {
                fclose(fp);
                return;
        }
        fclose(fp);
-       
+
        md5_final (&ctx, digest);
 }
index bdc3dc4..61b4e87 100644 (file)
@@ -406,7 +406,7 @@ on_idle_do_stuff (void *unused_data)
                                fprintf (stderr, "No such group \"%s\".\n", group_arg);
                                exit (1);
                        }
-               } 
+               }
 
                e_source_list_sync (list, NULL);
        }
@@ -416,7 +416,7 @@ on_idle_do_stuff (void *unused_data)
 
                if (source_arg == NULL) {
                        fprintf (stderr,
-                                "When using --set-relative-uri, you need to specify a source using " 
+                                "When using --set-relative-uri, you need to specify a source using "
                                 "--source.\n");
                        exit (1);
                }
@@ -449,7 +449,7 @@ on_idle_do_stuff (void *unused_data)
 
                if (add_source_arg == NULL && source_arg == NULL) {
                        fprintf (stderr,
-                                "When using --unset-color, you need to specify a source using --source\n");                    
+                                "When using --unset-color, you need to specify a source using --source\n");
                        exit (1);
                }
 
index 7aa746e..d473ab3 100644 (file)
@@ -79,7 +79,7 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
                                GtkWidget *dialog;
 
                                /* XXX "LDAP" has to be removed from the folowing message
-                                  so that it wil valid for other servers which provide 
+                                  so that it wil valid for other servers which provide
                                   anonymous access*/
 
                                dialog = gtk_message_dialog_new (NULL,
@@ -115,7 +115,7 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
                        addressbook_authenticate (book, TRUE, data->source, load_source_auth_cb, closure);
 
                        g_free (stripped_uri);
-                      
+
                        return;
                }
        }
@@ -157,7 +157,7 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc
        const gchar *uri               = e_book_get_uri (book);
         gchar *stripped_uri      = remove_parameters_from_uri (uri);
        const gchar *auth_domain = e_source_get_property (source, "auth-domain");
-                       
+
        component_name = auth_domain ? auth_domain : "Addressbook";
        uri = stripped_uri;
 
@@ -229,7 +229,7 @@ static void
 auth_required_cb (EBook *book, gpointer data)
 {
        LoadSourceData *load_source_data = g_new0 (LoadSourceData, 1);
-       
+
        load_source_data->source = g_object_ref (g_object_ref (e_book_get_source (book)));
 
        addressbook_authenticate (book, FALSE, load_source_data->source,
@@ -247,7 +247,7 @@ load_source_cb (EBook *book, EBookStatus status, gpointer closure)
                auth = e_source_get_property (load_source_data->source, "auth");
                if (auth && strcmp (auth, "none")) {
                        g_signal_connect (book, "auth_required", (GCallback) auth_required_cb, NULL);
-                       
+
                        if (e_book_is_online (book)) {
                                addressbook_authenticate (book, FALSE, load_source_data->source,
                                                          load_source_auth_cb, closure);
index 3497b33..1d94559 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2005 Novell, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -341,7 +341,7 @@ edit_button_clicked_cb (GtkButton *button, gpointer user_data)
        gtk_tree_model_get (model, &iter, COLUMN_CATEGORY, &category_name, -1);
        gtk_entry_set_text (GTK_ENTRY (prop_dialog->category_name), category_name);
        gtk_widget_set_sensitive (prop_dialog->category_name, FALSE);
-       gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (prop_dialog->category_icon), 
+       gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (prop_dialog->category_icon),
                                       e_categories_get_icon_file_for (category_name));
 
        if (gtk_dialog_run (GTK_DIALOG (prop_dialog->the_dialog)) == GTK_RESPONSE_OK) {
@@ -452,7 +452,7 @@ e_categories_dialog_init (ECategoriesDialog *dialog)
                        if (icon_file)
                                icon = gdk_pixbuf_new_from_file (icon_file, NULL);
                        gtk_list_store_append (model, &iter);
-                       gtk_list_store_set (model, &iter, 
+                       gtk_list_store_set (model, &iter,
                                            COLUMN_ACTIVE, FALSE,
                                            COLUMN_ICON,   icon,
                                            COLUMN_CATEGORY,  cat_list->data,
@@ -502,7 +502,7 @@ e_categories_dialog_new (const char *initial_category_list)
        if (initial_category_list)
                e_categories_dialog_set_categories (dialog, initial_category_list);
 
-       g_signal_connect (G_OBJECT (dialog->priv->categories_entry), "changed", 
+       g_signal_connect (G_OBJECT (dialog->priv->categories_entry), "changed",
                          G_CALLBACK (entry_changed_cb), dialog);
 
        return GTK_WIDGET (dialog);
index 9b49ad6..063b511 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2005 Novell, Inc.
  *
  * This library is free software; you can redistribute it and/or
index 14d1e32..ce72633 100644 (file)
@@ -17,7 +17,7 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -60,11 +60,11 @@ cell_renderer_color_get_size (GtkCellRenderer *cell,
 
        calc_width  = (gint) cell->xpad * 2 + color_width;
        calc_height = (gint) cell->ypad * 2 + color_height;
-  
+
        if (cell_area && color_width > 0 && color_height > 0) {
                if (x_offset) {
                        *x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
-                                       (1.0 - cell->xalign) : cell->xalign) * 
+                                       (1.0 - cell->xalign) : cell->xalign) *
                                        (cell_area->width - calc_width));
                        *x_offset = MAX (*x_offset, 0);
                }
@@ -121,7 +121,7 @@ cell_renderer_color_render (GtkCellRenderer *cell,
 
        gdk_colormap_alloc_color (
                gdk_colormap_get_system(), priv->color, FALSE, TRUE);
-       
+
        gc = gdk_gc_new (window);
        gdk_gc_set_foreground (gc, priv->color);
        gdk_draw_rectangle (
@@ -139,7 +139,7 @@ cell_renderer_color_set_property (GObject *object,
        ECellRendererColorPrivate *priv;
 
        priv = E_CELL_RENDERER_COLOR_GET_PRIVATE (object);
-  
+
        switch (property_id) {
                case PROP_COLOR:
                        if (priv->color != NULL)
index ecd931c..dbc532a 100644 (file)
@@ -602,7 +602,7 @@ view_sequence_complete (EContactStore *contact_store, EBookViewStatus status, EB
 
        /* However, if it was a pending view, calculate and emit the differences between that
         * and the current view, and move the pending view up to current.
-        * 
+        *
         * This is O(m * n), and can be sped up with a temporary hash table if needed. */
 
        /* Deletions */
@@ -844,7 +844,7 @@ e_contact_store_get_contact (EContactStore *contact_store, GtkTreeIter *iter)
  * @iter: a destination #GtkTreeIter to set
  *
  * Sets @iter to point to the contact row matching @uid.
- * 
+ *
  * Return value: %TRUE if the contact was found, and @iter was set. %FALSE otherwise.
  **/
 gboolean
index 5b4f809..b479593 100644 (file)
@@ -354,7 +354,7 @@ e_destination_store_list_destinations (EDestinationStore *destination_store)
                EDestination *destination = g_ptr_array_index (destination_store->destinations, i);
                destination_list = g_list_prepend (destination_list, destination);
        }
-       
+
        destination_list = g_list_reverse(destination_list);
 
        return destination_list;
@@ -456,7 +456,7 @@ void
 e_destination_store_remove_destination_nth (EDestinationStore *destination_store, int n)
 {
        EDestination *destination;
-       
+
        g_return_if_fail ( n >= 0);
 
        destination = g_ptr_array_index(destination_store->destinations, n);
index 6e3d485..7ade4d1 100644 (file)
@@ -76,7 +76,7 @@ void               e_destination_store_append_destination (EDestinationStore *de
                                                           EDestination *destination);
 void               e_destination_store_remove_destination (EDestinationStore *destination_store,
                                                           EDestination *destination);
-void              e_destination_store_remove_destination_nth (EDestinationStore *destination_store, 
+void              e_destination_store_remove_destination_nth (EDestinationStore *destination_store,
                                                               int n);
 guint             e_destination_store_get_destination_count (EDestinationStore *destination_store);
 GtkTreePath       *e_destination_store_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter);
index 4651586..9d39bc0 100644 (file)
@@ -45,7 +45,7 @@ typedef struct {
        gchar        *name;
 
        GtkBox       *section_box;
-       GtkLabel     *label;  
+       GtkLabel     *label;
        GtkButton    *transfer_button;
        GtkButton    *remove_button;
        GtkTreeView  *destination_view;
@@ -141,12 +141,12 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
        GtkTreeSelection  *selection;
        ESourceList       *source_list;
        char              *gladefile;
-       GConfClient *gconf_client;      
+       GConfClient *gconf_client;
        char *uid;
 
        ENameSelectorDialogPrivate *priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
        priv->destination_index = 0;
-       
+
        /* Get Glade GUI */
        gladefile = g_build_filename (E_DATA_SERVER_UI_GLADEDIR,
                                      "e-name-selector-dialog.glade",
@@ -227,7 +227,7 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
                widget, "changed",
                G_CALLBACK (source_changed), name_selector_dialog);
        g_object_unref (source_list);
+
        gconf_client = gconf_client_get_default();
        uid = gconf_client_get_string (gconf_client, "/apps/evolution/addressbook/display/primary_addressbook",
                        NULL);
@@ -273,7 +273,7 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
        gtk_window_set_title            (GTK_WINDOW (name_selector_dialog), _("Select Contacts from Address Book"));
        gtk_widget_grab_focus (widget);
 }
-       
+
 /* Partial, repeatable destruction. Release references. */
 static void
 e_name_selector_dialog_dispose (GObject *object)
@@ -509,7 +509,7 @@ add_section (ENameSelectorDialog *name_selector_dialog,
        /* Set up transfer button */
        g_signal_connect_swapped (section.transfer_button, "clicked",
                                  G_CALLBACK (transfer_button_clicked), name_selector_dialog);
-       
+
        /*data for the remove callback*/
        data = g_malloc0(sizeof(SelData));
        data->view = section.destination_view;
@@ -517,10 +517,10 @@ add_section (ENameSelectorDialog *name_selector_dialog,
 
        /*Associate to an object destroy so that it gets freed*/
        g_object_set_data_full ((GObject *)section.destination_view, "sel-remove-data", data, g_free);
-       
+
        g_signal_connect(section.remove_button, "clicked",
                                  G_CALLBACK (remove_button_clicked), data);
-       
+
        /* Set up view */
        column = gtk_tree_view_column_new ();
        cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
@@ -541,7 +541,7 @@ add_section (ENameSelectorDialog *name_selector_dialog,
        gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (section.transfer_button));
        gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, TRUE, 6);
        gtk_size_group_add_widget (name_selector_dialog->button_size_group, GTK_WIDGET (section.transfer_button));
-       
+
        /*to get the image embedded in the button*/
        widget = gtk_alignment_new (0.7, 0.5, 0.0, 0.0);
        gtk_container_add (GTK_CONTAINER (section.transfer_button), GTK_WIDGET (widget));
@@ -557,7 +557,7 @@ add_section (ENameSelectorDialog *name_selector_dialog,
        image = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_BUTTON);
        gtk_widget_show (image);
        gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
-       
+
        widget = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
        gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (section.remove_button));
        gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, TRUE, 0);
@@ -580,7 +580,7 @@ add_section (ENameSelectorDialog *name_selector_dialog,
        gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
 
        vbox = gtk_vbox_new (FALSE, 0);
-       
+
        widget = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
        gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (section.label));
        gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, TRUE, 0);
@@ -667,7 +667,7 @@ model_section_removed (ENameSelectorDialog *name_selector_dialog, const gchar *n
  * -------------------- */
 
 static void
-status_message(EBookView *view, const gchar *message, ENameSelectorDialog *dialog) 
+status_message(EBookView *view, const gchar *message, ENameSelectorDialog *dialog)
 {
        if(message == NULL)
                gtk_label_set_text(dialog->status_label, "");
@@ -686,7 +686,7 @@ book_opened (EBook *book, EBookStatus status, gpointer data)
 {
        ENameSelectorDialog *name_selector_dialog = E_NAME_SELECTOR_DIALOG (data);
        EContactStore       *contact_store;
-       EBookView           *view; 
+       EBookView           *view;
 
        if (status != E_BOOK_ERROR_OK) {
                /* TODO: Handle errors gracefully */
@@ -786,7 +786,7 @@ contact_selection_changed (ENameSelectorDialog *name_selector_dialog)
        GtkTreeSelection *contact_selection;
        gboolean          have_selection = FALSE;
        gint              i;
-       
+
        contact_selection = gtk_tree_view_get_selection (name_selector_dialog->contact_view);
        if (gtk_tree_selection_count_selected_rows (contact_selection))
                have_selection = TRUE;
@@ -814,7 +814,7 @@ contact_activated (ENameSelectorDialog *name_selector_dialog, GtkTreePath *path)
        contact_store = e_name_selector_model_peek_contact_store (name_selector_dialog->name_selector_model);
 
        /* If we have no sections, we can't transfer */
-       if (name_selector_dialog->sections->len == 0) 
+       if (name_selector_dialog->sections->len == 0)
                return;
 
        /* Get the contact to be transferred */
@@ -878,7 +878,7 @@ destination_activated (ENameSelectorDialog *name_selector_dialog, GtkTreePath *p
        e_destination_store_remove_destination (destination_store, destination);
 }
 
-static gboolean 
+static gboolean
 remove_selection (ENameSelectorDialog *name_selector_dialog, GtkTreeView *tree_view)
 {
        gint               section_index;
@@ -935,14 +935,14 @@ remove_button_clicked (GtkButton *button, SelData *data)
 {
        GtkTreeView *view;
        ENameSelectorDialog *name_selector_dialog;
-       
-       view = data->view; 
+
+       view = data->view;
        name_selector_dialog = data->dlg_ptr;
        remove_selection (name_selector_dialog, view);
 }
-       
-static gboolean 
-destination_key_press (ENameSelectorDialog *name_selector_dialog, 
+
+static gboolean
+destination_key_press (ENameSelectorDialog *name_selector_dialog,
                       GdkEventKey *event, GtkTreeView *tree_view)
 {
 
@@ -1001,7 +1001,7 @@ transfer_button_clicked (ENameSelectorDialog *name_selector_dialog, GtkButton *t
                        gtk_tree_path_free (path);
                        return ;
                }
-                       
+
                gtk_tree_path_free (path);
                sort_iter_to_contact_store_iter (name_selector_dialog, &iter, &email_n);
 
@@ -1231,7 +1231,7 @@ e_name_selector_dialog_set_model (ENameSelectorDialog *name_selector_dialog,
  * @name_selector_dialog: an #ENameSelectorDialog
  * @index: index of the destination section, starting from 0.
  *
- * Sets the index number of the destination section. 
+ * Sets the index number of the destination section.
  **/
 void
 e_name_selector_dialog_set_destination_index (ENameSelectorDialog *name_selector_dialog,
index 8b907ff..876d2e2 100644 (file)
@@ -148,7 +148,7 @@ e_name_selector_entry_class_init (ENameSelectorEntryClass *name_selector_entry_c
        /* Install properties */
 
        /* Install signals */
-       
+
        signals[UPDATED] = g_signal_new ("updated",
                                         E_TYPE_NAME_SELECTOR_ENTRY,
                                         G_SIGNAL_RUN_FIRST,
@@ -925,7 +925,7 @@ modify_destination_at_position (ENameSelectorEntry *name_selector_entry, gint po
        destination = find_destination_at_position (name_selector_entry, pos);
        if (!destination)
                return;
-       
+
        text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
        raw_address = get_address_at_position (text, pos);
        g_assert (raw_address);
@@ -1147,25 +1147,25 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
 {
        const gchar *text;
        gint         index_start, index_end;
-       gint         selection_start, selection_end;    
+       gint         selection_start, selection_end;
        gunichar     str_context [2], str_b_context [2];
        gint         len;
        gint         i;
        gboolean     already_selected = FALSE, del_space = FALSE, del_comma = FALSE;
 
-       if (start_pos == end_pos) 
+       if (start_pos == end_pos)
                return;
 
        text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
        len = g_utf8_strlen (text, -1);
 
-       if (gtk_editable_get_selection_bounds (GTK_EDITABLE (name_selector_entry), 
-                                              &selection_start, 
-                                              &selection_end)) 
+       if (gtk_editable_get_selection_bounds (GTK_EDITABLE (name_selector_entry),
+                                              &selection_start,
+                                              &selection_end))
                if ((g_utf8_get_char (g_utf8_offset_to_pointer (text, selection_end)) == 0) ||
                    (g_utf8_get_char (g_utf8_offset_to_pointer (text, selection_end)) == ','))
                        already_selected = TRUE;
-       
+
        get_utf8_string_context (text, start_pos, str_context, 2);
        get_utf8_string_context (text, end_pos, str_b_context, 2);
 
@@ -1182,9 +1182,9 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
 
        index_start = get_index_at_position (text, start_pos);
        index_end   = get_index_at_position (text, end_pos);
-       
+
        g_signal_stop_emission_by_name (name_selector_entry, "delete_text");
-       
+
        /* If the deletion touches more than one destination, the first one is changed
         * and the rest are removed. If the last destination wasn't completely deleted,
         * it becomes part of the first one, since the separator between them was
@@ -1203,7 +1203,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
 
                if (!email || !*email)
                        continue;
-               
+
                if (!get_range_by_index (text, i, &range_start, &range_end)) {
                        g_warning ("ENameSelectorEntry is out of sync with model!");
                        return;
@@ -1227,12 +1227,12 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
                        g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry);
 
                }
-               
+
                remove_destination_by_index (name_selector_entry, i);
        }
-       
+
        /* Do the actual deletion */
-       
+
        if (end_pos == start_pos +1 &&  index_end == index_start) {
                /* We could be just deleting the empty text */
                char *c;
@@ -1262,9 +1262,9 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
                EDestination *dest = find_destination_by_index (name_selector_entry, index_end);
                /* If we have deleted the last comma, let us autocomplete normally
                 */
-               
+
                if (dest && len - end_pos  != 0) {
-                       
+
                        EDestination *destination1  = find_destination_by_index (name_selector_entry, index_start);
                        char *ttext;
                        const char *email=NULL;
@@ -1291,7 +1291,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
                                g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry);
                                g_signal_handlers_unblock_by_func (name_selector_entry, user_insert_text, name_selector_entry);
                        }
-                       
+
                        if (range_start != -1) {
                                start_pos = range_start;
                                end_pos = start_pos+1;
@@ -1301,7 +1301,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
        }
        gtk_editable_delete_text (GTK_EDITABLE (name_selector_entry),
                                  start_pos, end_pos);
-       
+
        /*If the user is deleting a '"' new destinations have to be created for ',' between the quoted text
         Like "fd,ty,uy" is a one entity, but if you remove the quotes it has to be broken doan into 3 seperate
         addresses.
@@ -1317,7 +1317,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
                                insert_destination_at_position (name_selector_entry, j+1);
                        }
                }
-               
+
        }
 
        /* Let model know about changes */
@@ -1339,7 +1339,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
                g_source_remove (name_selector_entry->type_ahead_complete_cb_id);
                name_selector_entry->type_ahead_complete_cb_id = 0;
        }
-       
+
        g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry);
 }
 
@@ -1390,7 +1390,7 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
        gint           range_len;
        const gchar   *text;
        gchar         *cue_str;
-       
+
        cursor_pos = gtk_editable_get_position (GTK_EDITABLE (name_selector_entry));
        if (cursor_pos < 0)
                return;
@@ -1410,14 +1410,14 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
                return;
 
        cue_str = get_entry_substring (name_selector_entry, range_start, range_end);
-#if 0  
+#if 0
        if (!find_existing_completion (name_selector_entry, cue_str, &contact,
                                       &textrep, &matched_field)) {
                g_free (cue_str);
                return;
        }
-#endif 
-       g_free (cue_str);       
+#endif
+       g_free (cue_str);
        sync_destination_at_position (name_selector_entry, cursor_pos, &cursor_pos);
 
        /* Place cursor at end of address */
@@ -1425,9 +1425,9 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
 
        if (priv->is_completing) {
                char *str_context=NULL;
-               
+
                str_context = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), range_end, range_end+1);
-               
+
                if (str_context[0] != ',') {
                        /* At the end*/
                        gtk_editable_insert_text (GTK_EDITABLE (name_selector_entry), ", ", -1, &range_end);
@@ -1443,13 +1443,13 @@ entry_activate (ENameSelectorEntry *name_selector_entry)
 
                        /* Move it close to next destination*/
                        range_end = range_end+2;
-                       
+
                }
        }
 
        gtk_editable_set_position (GTK_EDITABLE (name_selector_entry), range_end);
        g_signal_emit (name_selector_entry, signals[UPDATED], 0, destination, NULL);
-       
+
        priv->is_completing = FALSE;
 }
 
@@ -1457,7 +1457,7 @@ static gboolean
 user_focus_in (ENameSelectorEntry *name_selector_entry, GdkEventFocus *event_focus)
 {
        /*
-        * To preserve selected text, do not propagate the event any more. 
+        * To preserve selected text, do not propagate the event any more.
         */
 
        return TRUE;
@@ -1473,7 +1473,7 @@ user_focus_out (ENameSelectorEntry *name_selector_entry, GdkEventFocus *event_fo
        if (!event_focus->in && priv->is_completing) {
                entry_activate (name_selector_entry);
        }
-       
+
        if (name_selector_entry->type_ahead_complete_cb_id) {
                g_source_remove (name_selector_entry->type_ahead_complete_cb_id);
                name_selector_entry->type_ahead_complete_cb_id = 0;
@@ -1663,7 +1663,7 @@ destination_row_changed (ENameSelectorEntry *name_selector_entry, GtkTreePath *p
 
        if (!destination)
                return;
-       
+
        g_assert (n >= 0);
 
        entry_text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
@@ -1913,7 +1913,7 @@ editor_closed_cb (GtkObject *editor, gpointer data)
        gboolean result;
        gint email_num;
        ENameSelectorEntry *name_selector_entry = E_NAME_SELECTOR_ENTRY (data);
-       
+
        destination = name_selector_entry->popup_destination;
        contact = e_destination_get_contact (destination);
        if (!contact)
@@ -1951,9 +1951,9 @@ popup_activate_inline_expand (ENameSelectorEntry *name_selector_entry, GtkWidget
        int position, start, end;
 
        position = GPOINTER_TO_INT(g_object_get_data ((GObject *)name_selector_entry, "index"));
-       
+
        email_list = e_destination_get_address(destination);
-       text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));    
+       text = gtk_entry_get_text (GTK_ENTRY (name_selector_entry));
        get_range_at_position (text, position, &start, &end);
 
        g_signal_handlers_block_by_func (name_selector_entry, user_delete_text, name_selector_entry);
@@ -2050,8 +2050,8 @@ static void
 popup_activate_list (EDestination *destination, GtkWidget *item)
 {
        gboolean status = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item));
-       
-       e_destination_set_ignored (destination, !status);       
+
+       e_destination_set_ignored (destination, !status);
 }
 
 static void
@@ -2118,7 +2118,7 @@ destination_set_list (GtkWidget *item, EDestination *destination)
        contact = e_destination_get_contact (destination);
        if (!contact)
                return;
-       
+
        e_destination_set_ignored (destination, !status);
 }
 
@@ -2182,17 +2182,17 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
                for (iter = (GList *)dests; iter; iter = iter->next) {
                        EDestination *dest = (EDestination *) iter->data;
                        const char *email = e_destination_get_email (dest);
-                       
+
                        if (!email || *email == '\0')
-                               continue;       
+                               continue;
 
                        if (length > 1) {
                                menu_item = gtk_check_menu_item_new_with_label (email);
-                               g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_list), dest);                               
+                               g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_list), dest);
                        } else {
                                menu_item = gtk_menu_item_new_with_label (email);
                        }
-                       
+
                        gtk_widget_show (menu_item);
                        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
                        show_menu = TRUE;
@@ -2200,10 +2200,10 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
                        if (length > 1) {
                                gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), !e_destination_is_ignored(dest));
                                g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_list),
-                                                         dest);        
+                                                         dest);
                        }
                }
-               
+
        } else {
                email_list = e_contact_get (contact, E_CONTACT_EMAIL);
                len = g_list_length (email_list);
@@ -2213,19 +2213,19 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 
                        if (!email || *email == '\0')
                                continue;
-               
+
                        if (len > 1) {
                                menu_item = gtk_radio_menu_item_new_with_label (group, email);
                                group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
                                g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_email), destination);
                        } else {
-                               menu_item = gtk_menu_item_new_with_label (email);                       
+                               menu_item = gtk_menu_item_new_with_label (email);
                        }
-                       
+
                        gtk_widget_show (menu_item);
                        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
                        show_menu = TRUE;
-                       g_object_set_data (G_OBJECT (menu_item), "order", GINT_TO_POINTER (i));                 
+                       g_object_set_data (G_OBJECT (menu_item), "order", GINT_TO_POINTER (i));
 
                        if ( i == email_num && len > 1 ) {
                                gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
@@ -2246,7 +2246,7 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
        /* Expand a list inline */
        if (is_list) {
                /* To Translators: This would be similiar to "Expand MyList Inline" where MyList is a Contact List*/
-               edit_label = g_strdup_printf (_("E_xpand %s Inline"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS)); 
+               edit_label = g_strdup_printf (_("E_xpand %s Inline"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
                menu_item = gtk_menu_item_new_with_mnemonic (edit_label);
                g_free (edit_label);
                gtk_widget_show (menu_item);
@@ -2273,13 +2273,13 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
        /* Cut Contact Item */
        cut_label = g_strdup_printf (_("C_ut %s"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
        menu_item = gtk_menu_item_new_with_mnemonic (cut_label);
-       g_free (cut_label);     
+       g_free (cut_label);
        gtk_widget_show (menu_item);
        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
-       
+
        g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_cut),
                                  name_selector_entry);
-       
+
        if (show_menu) {
                menu_item = gtk_separator_menu_item_new ();
                gtk_widget_show (menu_item);
@@ -2288,7 +2288,7 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 
        /* Edit Contact item */
 
-       edit_label = g_strdup_printf (_("_Edit %s"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS)); 
+       edit_label = g_strdup_printf (_("_Edit %s"), (char *)e_contact_get_const (contact, E_CONTACT_FILE_AS));
        menu_item = gtk_menu_item_new_with_mnemonic (edit_label);
        g_free (edit_label);
        gtk_widget_show (menu_item);
@@ -2432,7 +2432,7 @@ e_name_selector_entry_set_contact_store (ENameSelectorEntry *name_selector_entry
 /**
  * e_name_selector_entry_peek_destination_store:
  * @name_selector_entry: an #ENameSelectorEntry
- * 
+ *
  * Gets the #EDestinationStore being used to store @name_selector_entry's destinations.
  *
  * Return value: An #EDestinationStore.
index 8c8834f..3054f7d 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02110-1301, USA.
  *
  * Authors: Srinivasa Ragavan <sragavan@novell.com>
- *       : Devashish Sharma  <sdevashish@novell.com>   
+ *       : Devashish Sharma  <sdevashish@novell.com>
  */
 
 #include <config.h>
@@ -72,7 +72,7 @@ enl_popup_size (ENameSelectorList *list)
 
        /* Show a maximum of 10 rows in the popup list view */
        count = list->rows;
-       if (count > MAX_ROW) 
+       if (count > MAX_ROW)
                count = MAX_ROW;
        if (count <= 0)
                count = 1;
@@ -88,17 +88,17 @@ enl_popup_position (ENameSelectorList *list)
        enl_popup_size (list);
        gdk_window_get_origin (((GtkWidget *)list)->window, &x, &y);
        y = y +((GtkWidget *)list)->allocation.height;
-       
+
        gtk_window_move (list->popup, x, y);
 }
 
 static void
 enl_popup_grab (ENameSelectorList *list)
 {
-       int len; 
-       
+       int len;
+
        gtk_grab_add (GTK_WIDGET (list->popup));
-       
+
        gdk_pointer_grab (((GtkWidget *)list->popup)->window, TRUE,
                          GDK_BUTTON_PRESS_MASK |
                          GDK_BUTTON_RELEASE_MASK |
@@ -107,13 +107,13 @@ enl_popup_grab (ENameSelectorList *list)
 
        gdk_keyboard_grab (((GtkWidget *)list->popup)->window, TRUE, GDK_CURRENT_TIME);
        gtk_widget_grab_focus ((GtkWidget *)list);
-       
+
        /* Build the listview from the model */
        gtk_tree_view_set_model (GTK_TREE_VIEW (list->tree_view), GTK_TREE_MODEL(((ENameSelectorEntry *)list)->destination_store));
 
        /* If any selection of text is present, unselect it */
        len = strlen(gtk_entry_get_text(GTK_ENTRY(list)));
-       gtk_editable_select_region (GTK_EDITABLE(list), len, -1); 
+       gtk_editable_select_region (GTK_EDITABLE(list), len, -1);
 }
 
 static void
@@ -121,8 +121,8 @@ enl_popup_ungrab (ENameSelectorList *list)
 {
        if (!GTK_WIDGET_HAS_GRAB(list->popup))
                return;
-       
-       gdk_pointer_ungrab (GDK_CURRENT_TIME);  
+
+       gdk_pointer_ungrab (GDK_CURRENT_TIME);
        gtk_grab_remove ( GTK_WIDGET (list->popup));
        gdk_keyboard_ungrab (GDK_CURRENT_TIME);
 }
@@ -131,11 +131,11 @@ static gboolean
 enl_entry_focus_in (ENameSelectorList *list, GdkEventFocus *event, gpointer dummy)
 {
        int len;
-       
+
        /* FIXME: Dont select every thing by default- Code is there but still it does */
        len = strlen(gtk_entry_get_text(GTK_ENTRY(list)));
        gtk_editable_select_region (GTK_EDITABLE(list), len, -1);
-       
+
        return TRUE;
 }
 
@@ -146,7 +146,7 @@ enl_entry_focus_out (ENameSelectorList *list, GdkEventFocus *event, gpointer dum
        if (GTK_WIDGET_VISIBLE (list->popup) && !GTK_WIDGET_HAS_GRAB(list->popup)) {
                enl_popup_ungrab (list);
                gtk_widget_hide ((GtkWidget *)list->popup);
-               
+
                return FALSE;
        }
 
@@ -183,7 +183,7 @@ enl_popup_enter_notify (GtkWidget        *widget,
 {
   if (event->type == GDK_ENTER_NOTIFY && !GTK_WIDGET_HAS_GRAB (list->popup))
        enl_popup_grab (list);
-  
+
   return TRUE;
 }
 
@@ -194,7 +194,7 @@ enl_tree_select_node (ENameSelectorList *list,
        GtkTreeSelection *selection;
        GtkTreeIter iter;
        GtkTreePath *path;
-       
+
        selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list->tree_view));
        iter.stamp = ((ENameSelectorEntry *) list)->destination_store->stamp;
        iter.user_data = GINT_TO_POINTER (n-1);
@@ -207,12 +207,12 @@ enl_tree_select_node (ENameSelectorList *list,
        gtk_tree_view_set_cursor ( GTK_TREE_VIEW (list->tree_view), path, gtk_tree_view_get_column( GTK_TREE_VIEW (list->tree_view), 0), FALSE);
        gtk_widget_grab_focus (list->tree_view);
        /*Fixme: We should grab the focus to the column. How? */
-       
+
        gtk_tree_path_free (path);
 }
 
 static gboolean
-enl_entry_key_press_event (ENameSelectorList *list, 
+enl_entry_key_press_event (ENameSelectorList *list,
                           GdkEventKey *event,
                           gpointer dummy)
 {
@@ -234,20 +234,20 @@ delete_row (GtkTreePath *path, ENameSelectorList *list)
        GtkTreeIter   iter;
        int n, len;
        GtkTreeSelection *selection;
-       
+
        if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (E_NAME_SELECTOR_ENTRY (list)->destination_store), &iter, path))
                return;
-               
+
        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (list->tree_view));
        len = e_destination_store_get_destination_count (E_NAME_SELECTOR_ENTRY (list)->destination_store);
        n = GPOINTER_TO_INT (iter.user_data);
-       
+
        e_destination_store_remove_destination_nth (((ENameSelectorEntry *) list)->destination_store, n);
-       
+
        /* If the last one is deleted select the last but one or the deleted +1 */
        if (n == len -1)
                n -= 1;
-       
+
        /* We deleted the last entry */
        if (len == 1) {
                enl_popup_ungrab (list);
@@ -260,15 +260,15 @@ delete_row (GtkTreePath *path, ENameSelectorList *list)
        iter.stamp = ((ENameSelectorEntry *) list)->destination_store->stamp;
        iter.user_data = GINT_TO_POINTER (n);
 
-       gtk_tree_selection_unselect_all (selection);    
+       gtk_tree_selection_unselect_all (selection);
        gtk_tree_selection_select_iter (selection, &iter);
-       
+
        gtk_tree_path_free (path);
 
        list->rows = e_destination_store_get_destination_count (((ENameSelectorEntry *) list)->destination_store);
        enl_popup_size (list);
 
-       
+
 }
 
 static void
@@ -294,8 +294,8 @@ static void
 popup_activate_list (EDestination *destination, GtkWidget *item)
 {
        gboolean status = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item));
-       
-       e_destination_set_ignored (destination, !status);       
+
+       e_destination_set_ignored (destination, !status);
 }
 
 static void
@@ -307,7 +307,7 @@ destination_set_list (GtkWidget *item, EDestination *destination)
        contact = e_destination_get_contact (destination);
        if (!contact)
                return;
-       
+
        e_destination_set_ignored (destination, !status);
 }
 
@@ -369,22 +369,22 @@ enl_tree_button_press_event (GtkWidget *widget,
 
        if ( !GTK_WIDGET_HAS_GRAB (list->popup))
                enl_popup_grab (list);
-  
+
        gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW (list->tree_view), event->x, event->y, &path, NULL);
        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (list->tree_view));
        if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (E_NAME_SELECTOR_ENTRY (list)->destination_store), &iter, path))
                return FALSE;
-                               
-       gtk_tree_selection_unselect_all (selection);    
+
+       gtk_tree_selection_unselect_all (selection);
        gtk_tree_selection_select_iter (selection, &iter);
 
        if (event->button != 3) {
                return FALSE;
        }
-       
+
        name_selector_entry = E_NAME_SELECTOR_ENTRY (list);
 
-       destination = e_destination_store_get_destination ( ((ENameSelectorEntry *)list)->destination_store, &iter);    
+       destination = e_destination_store_get_destination ( ((ENameSelectorEntry *)list)->destination_store, &iter);
 
        if (!destination)
                return FALSE;
@@ -413,17 +413,17 @@ enl_tree_button_press_event (GtkWidget *widget,
                for (iters = (GList *)dests; iters; iters = iters->next) {
                        EDestination *dest = (EDestination *) iters->data;
                        const char *email = e_destination_get_email (dest);
-                       
+
                        if (!email || *email == '\0')
-                               continue;       
+                               continue;
 
                        if (length > 1) {
                                menu_item = gtk_check_menu_item_new_with_label (email);
-                               g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_list), dest);                               
+                               g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_list), dest);
                        } else {
                                menu_item = gtk_menu_item_new_with_label (email);
                        }
-                       
+
                        gtk_widget_show (menu_item);
                        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
                        show_menu = TRUE;
@@ -431,10 +431,10 @@ enl_tree_button_press_event (GtkWidget *widget,
                        if (length > 1) {
                                gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), !e_destination_is_ignored(dest));
                                g_signal_connect_swapped (menu_item, "activate", G_CALLBACK (popup_activate_list),
-                                                         dest);        
+                                                         dest);
                        }
                }
-               
+
        } else {
                email_list = e_contact_get (contact, E_CONTACT_EMAIL);
                len = g_list_length (email_list);
@@ -444,19 +444,19 @@ enl_tree_button_press_event (GtkWidget *widget,
 
                        if (!email || *email == '\0')
                                continue;
-               
+
                        if (len > 1) {
                                menu_item = gtk_radio_menu_item_new_with_label (group, email);
                                group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
                                g_signal_connect (menu_item, "toggled", G_CALLBACK (destination_set_email), destination);
                        } else {
-                               menu_item = gtk_menu_item_new_with_label (email);                       
+                               menu_item = gtk_menu_item_new_with_label (email);
                        }
-                       
+
                        gtk_widget_show (menu_item);
                        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
                        show_menu = TRUE;
-                       g_object_set_data (G_OBJECT (menu_item), "order", GINT_TO_POINTER (i));                 
+                       g_object_set_data (G_OBJECT (menu_item), "order", GINT_TO_POINTER (i));
 
                        if ( i == email_num && len > 1 ) {
                                gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
@@ -488,7 +488,7 @@ enl_tree_button_press_event (GtkWidget *widget,
 
        g_signal_connect (menu_item, "activate", G_CALLBACK (popup_delete_row),
                                  row_info);
-       
+
        return TRUE;
 
 
@@ -512,10 +512,10 @@ enl_tree_key_press_event (GtkWidget *w,
                paths = g_list_reverse (paths);
                g_list_foreach (paths, (GFunc) delete_row, list);
                g_list_free (paths);
-       } else if (event->keyval != GDK_Up && event->keyval != GDK_Down 
+       } else if (event->keyval != GDK_Up && event->keyval != GDK_Down
                   && event->keyval != GDK_Shift_R && event->keyval != GDK_Shift_L
                   && event->keyval != GDK_Control_R && event->keyval != GDK_Control_L){
-                  
+
                enl_popup_ungrab (list);
                gtk_widget_hide ( GTK_WIDGET (list->popup));
                gtk_widget_event (GTK_WIDGET (list), (GdkEvent *)event);
@@ -525,7 +525,7 @@ enl_tree_key_press_event (GtkWidget *w,
        return FALSE;
 }
 
-void 
+void
 e_name_selector_list_expand_clicked(ENameSelectorList *list)
 {
 
@@ -564,7 +564,7 @@ e_name_selector_list_realize (GtkWidget *widget)
 {
        ENameSelectorList *list = (ENameSelectorList *)widget;
        GTK_WIDGET_CLASS (e_name_selector_list_parent_class)->realize (widget);
-       
+
        gtk_tree_view_set_model ( GTK_TREE_VIEW (list->tree_view), GTK_TREE_MODEL(((ENameSelectorEntry *)list)->destination_store));
 }
 
@@ -597,11 +597,11 @@ e_name_selector_list_init (ENameSelectorList *list)
 
        list->store = e_destination_store_new ();
        list->menu = NULL;
-       
+
        list->tree_view = GTK_WIDGET (gtk_tree_view_new_with_model (GTK_TREE_MODEL(entry->destination_store)));
        gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (list->tree_view), FALSE);
        gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (list->tree_view), FALSE);
-       
+
        selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list->tree_view));
        gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
        gtk_tree_selection_unselect_all (selection);
@@ -621,7 +621,7 @@ e_name_selector_list_init (ENameSelectorList *list)
                                        GTK_POLICY_NEVER,
                                        GTK_POLICY_AUTOMATIC);
        gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
-                                                    GTK_SHADOW_NONE);  
+                                                    GTK_SHADOW_NONE);
        gtk_widget_set_size_request (GTK_SCROLLED_WINDOW (scroll)->vscrollbar, -1, 0);
 
        list->popup =  GTK_WINDOW (gtk_window_new (GTK_WINDOW_POPUP));
@@ -630,9 +630,9 @@ e_name_selector_list_init (ENameSelectorList *list)
        popup_frame = gtk_frame_new (NULL);
        gtk_frame_set_shadow_type (GTK_FRAME (popup_frame),
                                   GTK_SHADOW_ETCHED_IN);
-       
+
        gtk_container_add (GTK_CONTAINER (list->popup), popup_frame);
-  
+
        vbox = gtk_vbox_new (FALSE, 0);
        gtk_container_add (GTK_CONTAINER (popup_frame), vbox);
 
@@ -650,7 +650,7 @@ e_name_selector_list_init (ENameSelectorList *list)
        g_signal_connect (GTK_WIDGET (list->popup), "button-press-event", G_CALLBACK(enl_popup_button_press), list);
        g_signal_connect (GTK_WIDGET (list->popup), "focus-out-event", G_CALLBACK(enl_popup_focus_out), list);
        g_signal_connect (GTK_WIDGET (list->popup), "enter-notify-event", G_CALLBACK (enl_popup_enter_notify), list);
-       
+
 }
 
 ENameSelectorList *
index 1062081..0687787 100644 (file)
@@ -62,7 +62,7 @@ struct _ENameSelectorList {
 
 GType                   e_name_selector_list_get_type (void);
 ENameSelectorList      *e_name_selector_list_new (void);
-void                    e_name_selector_list_expand_clicked (ENameSelectorList *list); 
+void                    e_name_selector_list_expand_clicked (ENameSelectorList *list);
 
 G_END_DECLS
 #endif
index 3b117a3..9a85f91 100644 (file)
@@ -348,7 +348,7 @@ find_section_by_name (ENameSelectorModel *name_selector_model, const gchar *name
 /**
  * e_name_selector_model_peek_contact_store:
  * @name_selector_model: an #ENameSelectorModel
- * 
+ *
  * Gets the #EContactStore associated with @name_selector_model.
  *
  * Return value: An #EContactStore.
index f84fc88..2e56fe1 100644 (file)
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
- * 
+ *
  * 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 Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
@@ -81,7 +81,7 @@ struct _EPassMsg {
        void (*dispatch) (struct _EPassMsg *);
 
        /* input */
-       struct _GtkWindow *parent;      
+       struct _GtkWindow *parent;
        const gchar *component;
        const gchar *key;
        const gchar *title;
@@ -307,25 +307,25 @@ ep_clear_passwords_keyring (EPassMsg *msg)
 {
        GnomeKeyringAttributeList *attributes;
        GnomeKeyringResult result;
-       GList *matches = NULL, *tmp;    
+       GList *matches = NULL, *tmp;
        gchar *default_keyring = NULL;
 
        result = gnome_keyring_get_default_keyring_sync (&default_keyring);
        if (!default_keyring) {
                if (gnome_keyring_create_sync ("default", NULL) != GNOME_KEYRING_RESULT_OK)
                        return;
-               default_keyring = g_strdup ("default");                 
+               default_keyring = g_strdup ("default");
        }
 
        d(g_print ("Get Default %d\n", result));
-       
+
        /* Not called at all */
        attributes = gnome_keyring_attribute_list_new ();
        gnome_keyring_attribute_list_append_string (attributes, "application", "Evolution");
 
        result = gnome_keyring_find_items_sync (GNOME_KEYRING_ITEM_NETWORK_PASSWORD, attributes, &matches);
        d(g_print ("Find Items %d\n", result));
-               
+
        gnome_keyring_attribute_list_free (attributes);
 
        if (result) {
@@ -336,7 +336,7 @@ ep_clear_passwords_keyring (EPassMsg *msg)
                        d(g_print ("Delete Items %d\n", result));
                }
        }
-       
+
        g_free (default_keyring);
 }
 #endif
@@ -382,23 +382,23 @@ ep_forget_passwords_keyring (EPassMsg *msg)
 {
        GnomeKeyringAttributeList *attributes;
        GnomeKeyringResult result;
-       GList *matches = NULL, *tmp;    
+       GList *matches = NULL, *tmp;
        gchar *default_keyring = NULL;
 
        result = gnome_keyring_get_default_keyring_sync (&default_keyring);
        if (!default_keyring) {
                if (gnome_keyring_create_sync ("default", NULL) != GNOME_KEYRING_RESULT_OK)
                        return;
-               default_keyring = g_strdup ("default");                 
-       }       
+               default_keyring = g_strdup ("default");
+       }
        d(g_print ("Get Default %d\n", result));
-       
+
        attributes = gnome_keyring_attribute_list_new ();
        gnome_keyring_attribute_list_append_string (attributes, "application", "Evolution");
 
        result = gnome_keyring_find_items_sync (GNOME_KEYRING_ITEM_NETWORK_PASSWORD, attributes, &matches);
        d(g_print ("Find Items %d\n", result));
-               
+
        gnome_keyring_attribute_list_free (attributes);
 
        if (result) {
@@ -409,7 +409,7 @@ ep_forget_passwords_keyring (EPassMsg *msg)
                        d(g_print ("Delete Items %d\n", result));
                }
        }
-       
+
        g_free (default_keyring);
 
        /* free up the session passwords */
@@ -469,18 +469,18 @@ ep_remember_password_keyring (EPassMsg *msg)
                        /* LDAP doesnt use username in url. Let the url be the user key. So safe it */
                        gchar *keycopy = g_strdup (msg->key);
                        gint i;
-                       
+
                        for (i = 0; i < strlen (keycopy); i ++)
                                if (keycopy[i] == '/' || keycopy[i] =='=')
-                                       keycopy[i] = '_';               
+                                       keycopy[i] = '_';
                        uri->user = keycopy;
                }
-               
+
                attributes = gnome_keyring_attribute_list_new ();
                gnome_keyring_attribute_list_append_string (attributes, "user", uri->user);
                gnome_keyring_attribute_list_append_string (attributes, "server", uri->host);
                gnome_keyring_attribute_list_append_string (attributes, "application", "Evolution");
-               
+
                result = gnome_keyring_item_create_sync (NULL, /* Use default keyring */
                                                         GNOME_KEYRING_ITEM_NETWORK_PASSWORD, /* type */
                                                         msg->key, /* name */
@@ -488,14 +488,14 @@ ep_remember_password_keyring (EPassMsg *msg)
                                                         value, /* password */
                                                         TRUE, /* Update if already exists */
                                                         &item_id);
-       
+
                d(g_print ("Remember %s: %d/%d\n", msg->key, result, item_id));
 
                gnome_keyring_attribute_list_free (attributes);
 
                /* now remove it from our session hash */
                g_hash_table_remove (password_cache, msg->key);
-               
+
                e_uri_free (uri);
        }
 }
@@ -547,8 +547,8 @@ ep_forget_password_keyring (EPassMsg *msg)
 {
        GnomeKeyringAttributeList *attributes;
        GnomeKeyringResult result;
-       GList *matches = NULL, *tmp;    
-       gchar *default_keyring = NULL;  
+       GList *matches = NULL, *tmp;
+       gchar *default_keyring = NULL;
        EUri *uri = e_uri_new (msg->key);
 
        if (!strcmp (uri->protocol, "ldap") && !uri->user) {
@@ -558,25 +558,25 @@ ep_forget_password_keyring (EPassMsg *msg)
 
                for (i = 0; i < strlen (keycopy); i ++)
                        if (keycopy[i] == '/' || keycopy[i] =='=')
-                               keycopy[i] = '_';               
+                               keycopy[i] = '_';
                uri->user = keycopy;
        }
-           
+
        g_hash_table_remove (password_cache, msg->key);
 
        if (!uri->host && !uri->user)
                /* No need to remove from keyring for pass phrases */
                goto exit;
-       
+
        result = gnome_keyring_get_default_keyring_sync (&default_keyring);
        if (!default_keyring) {
                if (gnome_keyring_create_sync ("default", NULL) != GNOME_KEYRING_RESULT_OK)
                        goto exit;
-               default_keyring = g_strdup ("default");                 
+               default_keyring = g_strdup ("default");
        }
 
        d(g_print ("Get Default %d\n", result));
-       
+
        attributes = gnome_keyring_attribute_list_new ();
        gnome_keyring_attribute_list_append_string (attributes, "user", uri->user);
        gnome_keyring_attribute_list_append_string (attributes, "server", uri->host);
@@ -584,7 +584,7 @@ ep_forget_password_keyring (EPassMsg *msg)
 
        result = gnome_keyring_find_items_sync (GNOME_KEYRING_ITEM_NETWORK_PASSWORD, attributes, &matches);
        d(g_print ("Find Items %d\n", result));
-               
+
        gnome_keyring_attribute_list_free (attributes);
 
        if (result) {
@@ -607,17 +607,17 @@ ep_forget_password_keyring (EPassMsg *msg)
                                } else if (!strcmp (attr->name, "server")) {
                                        present++;
                                        if (strcmp (attr->value.string, uri->host))
-                                               accept = FALSE;                                         
+                                               accept = FALSE;
                                }
                        }
                                if (present == 2 && accept) {
                                        result = gnome_keyring_item_delete_sync (default_keyring, ((GnomeKeyringFound *) tmp->data)->item_id);
-                                       d(g_print ("Delete Items %s %s %d\n", uri->host, uri->user, result));                   
+                                       d(g_print ("Delete Items %s %s %d\n", uri->host, uri->user, result));
                                }
-               }       
+               }
 
        }
-       
+
        g_free (default_keyring);
 
 exit:
@@ -671,14 +671,14 @@ ep_get_password_keyring (EPassMsg *msg)
        gchar *passwd;
        GnomeKeyringAttributeList *attributes;
        GnomeKeyringResult result;
-       GList *matches = NULL, *tmp;    
+       GList *matches = NULL, *tmp;
 
        passwd = g_hash_table_lookup (password_cache, msg->key);
        if (passwd) {
                msg->password = g_strdup (passwd);
        } else {
                EUri *uri = e_uri_new (msg->key);
-               
+
                if (!strcmp (uri->protocol, "ldap") && !uri->user) {
                        /* LDAP doesnt use username in url. Let the url be the user key. So safe it */
                        gchar *keycopy = g_strdup (msg->key);
@@ -686,10 +686,10 @@ ep_get_password_keyring (EPassMsg *msg)
 
                        for (i = 0; i < strlen (keycopy); i ++)
                                if (keycopy[i] == '/' || keycopy[i] =='=')
-                                       keycopy[i] = '_';               
+                                       keycopy[i] = '_';
                        uri->user = keycopy;
                }
-               
+
                if (uri->host &&  uri->user) {
                        /* We dont store passphrases.*/
 
@@ -701,7 +701,7 @@ ep_get_password_keyring (EPassMsg *msg)
 
                        result = gnome_keyring_find_items_sync (GNOME_KEYRING_ITEM_NETWORK_PASSWORD, attributes, &matches);
                        d(g_print ("Find Items %d\n", result));
-                       
+
                        gnome_keyring_attribute_list_free (attributes);
 
                        if (result) {
@@ -726,20 +726,20 @@ ep_get_password_keyring (EPassMsg *msg)
                                                } else if (!strcmp (attr->name, "server") && attr->value.string) {
                                                        present++;
                                                        if (strcmp (attr->value.string, uri->host))
-                                                               accept = FALSE;                                         
+                                                               accept = FALSE;
                                                }
                                        }
                                        if (present == 2 && accept) {
                                                msg->password = g_strdup (((GnomeKeyringFound *) tmp->data)->secret);
                                                break;
                                        }
-                               }       
+                               }
                        }
                }
-               
+
                e_uri_free (uri);
        }
-}      
+}
 #endif
 
 static void
@@ -822,7 +822,7 @@ pass_response (GtkDialog *dialog, gint response, void *data)
                                ep_add_password (msg);
                        }
                        if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER)
-                               ep_remember_password (msg);                                 
+                               ep_remember_password (msg);
 
                        msg->noreply = noreply;
                }
@@ -841,7 +841,7 @@ pass_response (GtkDialog *dialog, gint response, void *data)
        while (mn) {
                if ((mw->dispatch == ep_forget_password
                     || mw->dispatch == ep_get_password
-                    || mw->dispatch == ep_ask_password)                    
+                    || mw->dispatch == ep_ask_password)
                    && (strcmp (mw->component, msg->component) == 0
                        && strcmp (mw->key, msg->key) == 0)) {
                        e_dlist_remove ((EDListNode *)mw);
@@ -887,7 +887,7 @@ ep_ask_password (EPassMsg *msg)
        gtk_widget_show (vbox);
        gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), vbox, TRUE, FALSE, 0);
        gtk_container_set_border_width ((GtkContainer *)vbox, 12);
-       
+
        msg->entry = gtk_entry_new ();
 
        a11y = gtk_widget_get_accessible (msg->entry);
@@ -897,7 +897,7 @@ ep_ask_password (EPassMsg *msg)
        gtk_box_pack_start (GTK_BOX (vbox), msg->entry, TRUE, FALSE, 3);
        gtk_widget_show (msg->entry);
        gtk_widget_grab_focus (msg->entry);
-       
+
        if ((msg->flags & E_PASSWORDS_REPROMPT)) {
                ep_get_password (msg);
                if (msg->password) {
@@ -918,7 +918,7 @@ ep_ask_password (EPassMsg *msg)
                        msg->check = gtk_check_button_new_with_mnemonic (type == E_PASSWORDS_REMEMBER_FOREVER
                                                                        ? _("_Remember this password")
                                                                        : _("_Remember this password for the remainder of this session"));
-                       
+
                }
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (msg->check), *msg->remember);
                gtk_box_pack_start (GTK_BOX (vbox), msg->check, TRUE, FALSE, 3);
@@ -926,7 +926,7 @@ ep_ask_password (EPassMsg *msg)
                        gtk_widget_set_sensitive (msg->check, FALSE);
                gtk_widget_show (msg->check);
        }
-       
+
        msg->noreply = noreply;
 
        g_signal_connect (password_dialog, "response", G_CALLBACK (pass_response), msg);
@@ -974,7 +974,7 @@ e_passwords_init (void)
 
 /**
  * e_passwords_cancel:
- * 
+ *
  * Cancel any outstanding password operations and close any dialogues
  * currently being shown.
  **/
@@ -1010,8 +1010,8 @@ e_passwords_shutdown (void)
 
 /**
  * e_passwords_set_online:
- * @state: 
- * 
+ * @state:
+ *
  * Set the offline-state of the application.  This is a work-around
  * for having the backends fully offline aware, and returns a
  * cancellation response instead of prompting for passwords.
@@ -1034,7 +1034,7 @@ void
 e_passwords_forget_passwords (void)
 {
        EPassMsg *msg = ep_msg_new (ep_forget_passwords);
-       
+
        ep_msg_send (msg);
        ep_msg_free (msg);
 }
@@ -1047,7 +1047,7 @@ e_passwords_forget_passwords (void)
 void
 e_passwords_clear_passwords (const gchar *component_name)
 {
-       EPassMsg *msg = ep_msg_new (ep_clear_passwords);                
+       EPassMsg *msg = ep_msg_new (ep_clear_passwords);
 
        msg->component = component_name;
        ep_msg_send (msg);
@@ -1201,6 +1201,6 @@ e_passwords_ask_password (const gchar *title, const gchar *component_name,
        passwd = msg->password;
        msg->password = NULL;
        ep_msg_free (msg);
-       
+
        return passwd;
 }
index 5558849..39fd088 100644 (file)
@@ -8,12 +8,12 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
- * 
+ *
  * 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 Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
@@ -61,7 +61,7 @@ typedef enum {
        E_PASSWORDS_PASSPHRASE = 1<<12, /* We are asking a passphrase */
 } EPasswordsRememberType;
 
-char *      e_passwords_ask_password      (const char *title, 
+char *      e_passwords_ask_password      (const char *title,
                                           const char*component_name, const char *key,
                                           const char *prompt,
                                           EPasswordsRememberType remember_type,
index 579ee7c..cebb9e8 100644 (file)
@@ -251,7 +251,7 @@ e_source_option_menu_class_init (ESourceOptionMenuClass *class)
        object_class->dispose  = e_source_option_menu_dispose;
        object_class->finalize = e_source_option_menu_finalize;
 
-       signals[SOURCE_SELECTED] = 
+       signals[SOURCE_SELECTED] =
                g_signal_new ("source_selected",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
index ca24b3d..c69509e 100644 (file)
@@ -40,11 +40,11 @@ struct _ESourceSelectorPrivate {
        ESourceList *list;
 
        GtkTreeStore *tree_store;
-       
+
        GHashTable *selected_sources;
        GtkTreeRowReference *saved_primary_selection;
        ESourceGroup *primary_source_group;
-       
+
        int rebuild_model_idle_id;
 
        gboolean toggled_last;
@@ -86,11 +86,11 @@ static ESourceSelectorRebuildData *
 create_rebuild_data (ESourceSelector *selector)
 {
        ESourceSelectorRebuildData *rebuild_data;
-       
+
        rebuild_data = g_new0 (ESourceSelectorRebuildData, 1);
-       
+
        rebuild_data->selector = selector;
-       rebuild_data->remaining_uids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, 
+       rebuild_data->remaining_uids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
                                                              (GDestroyNotify) gtk_tree_row_reference_free);
        rebuild_data->deleted_uids = NULL;
 
@@ -102,12 +102,12 @@ static void
 free_rebuild_data (ESourceSelectorRebuildData *rebuild_data)
 {
        GSList *p;
-       
+
        g_hash_table_destroy (rebuild_data->remaining_uids);
        for (p = rebuild_data->deleted_uids; p; p = p->next)
                gtk_tree_row_reference_free (p->data);
        g_slist_free (rebuild_data->deleted_uids);
-       
+
        g_free (rebuild_data);
 }
 
@@ -168,10 +168,10 @@ find_source_iter (ESourceSelector *selector, ESource *source, GtkTreeIter *paren
 
                                        if (E_SOURCE (data) == source) {
                                                g_object_unref (data);
-                                               
+
                                                return TRUE;
                                        }
-                                       
+
                                        g_object_unref (data);
                                } while (gtk_tree_model_iter_next (model, source_iter));
                        }
@@ -195,31 +195,31 @@ rebuild_existing_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
                uid = e_source_group_peek_uid (E_SOURCE_GROUP (node));
 
                if (e_source_list_peek_group_by_uid (rebuild_data->selector->priv->list, uid)) {
-                       g_hash_table_insert (rebuild_data->remaining_uids, g_strdup (uid), 
+                       g_hash_table_insert (rebuild_data->remaining_uids, g_strdup (uid),
                                             gtk_tree_row_reference_new (model, path));
                } else {
-                       rebuild_data->deleted_uids = g_slist_prepend (rebuild_data->deleted_uids, 
+                       rebuild_data->deleted_uids = g_slist_prepend (rebuild_data->deleted_uids,
                                                                      gtk_tree_row_reference_new (model, path));
                }
        } else {
                uid = e_source_peek_uid (E_SOURCE (node));
                if (e_source_list_peek_source_by_uid (rebuild_data->selector->priv->list, uid)) {
-                       g_hash_table_insert (rebuild_data->remaining_uids, g_strdup (uid), 
+                       g_hash_table_insert (rebuild_data->remaining_uids, g_strdup (uid),
                                             gtk_tree_row_reference_new (model, path));
                } else {
-                       rebuild_data->deleted_uids = g_slist_prepend (rebuild_data->deleted_uids, 
+                       rebuild_data->deleted_uids = g_slist_prepend (rebuild_data->deleted_uids,
                                                                      gtk_tree_row_reference_new (model, path));
-                       
+
                        if (g_hash_table_remove (rebuild_data->selector->priv->selected_sources, node))
                                rebuild_data->selection_changed = TRUE;
                }
        }
-       
+
        g_object_unref (node);
 
        return FALSE;
 }
-       
+
 static ESource *
 find_source (ESourceSelector *selector, ESource *source)
 {
@@ -291,25 +291,25 @@ rebuild_model (ESourceSelector *selector)
        GtkTreeIter iter;
        GSList *groups, *p;
        gboolean set_primary;
-       
+
        tree_store = selector->priv->tree_store;
 
        rebuild_data = create_rebuild_data (selector);
        set_primary = e_source_selector_peek_primary_selection (selector) != NULL;
-       
+
        /* Remove any delete sources or groups */
        gtk_tree_model_foreach (GTK_TREE_MODEL (tree_store), rebuild_existing_cb, rebuild_data);
        for (p = rebuild_data->deleted_uids; p; p = p->next) {
                GtkTreeRowReference *row_ref = p->data;
                GtkTreePath *path;
-               
+
                path = gtk_tree_row_reference_get_path (row_ref);
                gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_store), &iter, path);
                gtk_tree_store_remove (tree_store, &iter);
 
                gtk_tree_path_free (path);
        }
-       
+
        /* Add new sources/groups or call row_changed in case they were renamed */
        groups = e_source_list_peek_groups (selector->priv->list);
        for (p = groups; p != NULL; p = p->next) {
@@ -317,14 +317,14 @@ rebuild_model (ESourceSelector *selector)
                GSList *sources, *q;
                GtkTreeRowReference *row_ref;
                gint position;
-               
+
                row_ref = g_hash_table_lookup (rebuild_data->remaining_uids, e_source_group_peek_uid (group));
                if (!row_ref) {
                        gtk_tree_store_append (GTK_TREE_STORE (tree_store), &iter, NULL);
                        gtk_tree_store_set (GTK_TREE_STORE (tree_store), &iter, 0, group, -1);
                } else {
                        GtkTreePath *path;
-                       
+
                        path = gtk_tree_row_reference_get_path (row_ref);
                        gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_store), &iter, path);
 
@@ -332,7 +332,7 @@ rebuild_model (ESourceSelector *selector)
 
                        gtk_tree_path_free (path);
                }
-               
+
                sources = get_sorted_sources (e_source_group_peek_sources (group));
                for (q = sources, position = 0; q != NULL; q = q->next, position++) {
                        ESource *source = E_SOURCE (q->data);
@@ -349,10 +349,10 @@ rebuild_model (ESourceSelector *selector)
                                gtk_tree_store_set (GTK_TREE_STORE (tree_store), &child_iter, 0, source, -1);
                        } else {
                                GtkTreePath *path;
-                               
+
                                path = gtk_tree_row_reference_get_path (row_ref);
                                gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_store), &child_iter, path);
-                               
+
                                gtk_tree_model_row_changed (GTK_TREE_MODEL (tree_store), path, &child_iter);
 
                                gtk_tree_path_free (path);
@@ -368,7 +368,7 @@ rebuild_model (ESourceSelector *selector)
 
        if (set_primary && !e_source_selector_peek_primary_selection (selector))
                e_source_selector_set_primary_selection (selector, e_source_list_peek_source_any (selector->priv->list));
-       
+
        free_rebuild_data (rebuild_data);
 }
 
@@ -448,10 +448,10 @@ text_cell_data_func (GtkTreeViewColumn *column,
                              NULL);
        } else {
                ESource *source;
-               
+
                g_assert (E_IS_SOURCE (data));
                source = E_SOURCE (data);
-               
+
                g_object_set (renderer,
                              "text", e_source_peek_name (source),
                              "weight", PANGO_WEIGHT_NORMAL,
@@ -477,7 +477,7 @@ pixbuf_cell_data_func (GtkTreeViewColumn *column,
                g_object_set (renderer,
                              "visible", FALSE,
                              NULL);
-       } else {        
+       } else {
                ESource *source;
                GdkPixbuf *pixbuf = NULL;
                const gchar *color_spec;
@@ -485,7 +485,7 @@ pixbuf_cell_data_func (GtkTreeViewColumn *column,
 
                g_assert (E_IS_SOURCE (data));
                source = E_SOURCE (data);
-               
+
                color_spec = e_source_peek_color_spec (source);
                if (color_spec != NULL && gdk_color_parse (color_spec, &color)) {
                        guint32 rgba;
@@ -498,12 +498,12 @@ pixbuf_cell_data_func (GtkTreeViewColumn *column,
 
                        gdk_pixbuf_fill (pixbuf, rgba);
                }
-                       
+
                g_object_set (renderer,
                              "visible", pixbuf != NULL,
                              "pixbuf", pixbuf,
                              NULL);
-                       
+
                if (pixbuf)
                        g_object_unref (pixbuf);
        }
@@ -524,9 +524,9 @@ selection_func (GtkTreeSelection *selection,
 
        if (selector->priv->toggled_last) {
                selector->priv->toggled_last = FALSE;
-               
+
                return FALSE;
-       }               
+       }
 
        if (path_currently_selected)
                return TRUE;
@@ -538,7 +538,7 @@ selection_func (GtkTreeSelection *selection,
        gtk_tree_model_get (model, &iter, 0, &data, -1);
        if (E_IS_SOURCE_GROUP (data)) {
                g_object_unref (data);
-               
+
                return FALSE;
        }
 
@@ -575,16 +575,16 @@ cell_toggled_callback (GtkCellRendererToggle *renderer,
                        unselect_source (selector, source);
                else
                        select_source (selector, source);
-               
+
                selector->priv->toggled_last = TRUE;
-               
+
                gtk_tree_model_row_changed (model, path, &iter);
                g_signal_emit (selector, signals[SELECTION_CHANGED], 0);
        }
 
        gtk_tree_path_free (path);
-       
-       g_object_unref (data);  
+
+       g_object_unref (data);
 }
 
 static void
@@ -598,9 +598,9 @@ static gboolean
 test_collapse_row_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *path, gpointer data)
 {
        ESourceSelector *selector = data;
-       ESourceSelectorPrivate *priv;   
+       ESourceSelectorPrivate *priv;
        GtkTreeIter child_iter;
-       
+
        priv = selector->priv;
 
        /* Clear this because something else has been clicked on now */
@@ -608,18 +608,18 @@ test_collapse_row_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePat
 
        if (priv->saved_primary_selection)
                return FALSE;
-       
+
        if (!gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW (selector)), NULL, &child_iter))
                return FALSE;
-       
+
        if (gtk_tree_store_is_ancestor (priv->tree_store, iter, &child_iter)) {
                GtkTreePath *child_path;
-               
+
                child_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->tree_store), &child_iter);
                priv->saved_primary_selection = gtk_tree_row_reference_new (GTK_TREE_MODEL (priv->tree_store), child_path);
                gtk_tree_path_free (child_path);
        }
-       
+
        return FALSE;
 }
 
@@ -627,17 +627,17 @@ static gboolean
 row_expanded_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *path, gpointer data)
 {
        ESourceSelector *selector = data;
-       ESourceSelectorPrivate *priv;   
+       ESourceSelectorPrivate *priv;
        GtkTreePath *child_path;
        GtkTreeIter child_iter;
-       
+
        priv = selector->priv;
 
        if (!priv->saved_primary_selection)
                return FALSE;
-       
+
        child_path = gtk_tree_row_reference_get_path (priv->saved_primary_selection);
-       gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->tree_store), &child_iter, child_path);   
+       gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->tree_store), &child_iter, child_path);
 
        if (gtk_tree_store_is_ancestor (priv->tree_store, iter, &child_iter)) {
                GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (selector));
@@ -647,8 +647,8 @@ row_expanded_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *pa
        }
 
        gtk_tree_path_free (child_path);
-       
-       return FALSE;   
+
+       return FALSE;
 }
 
 static gboolean
@@ -658,7 +658,7 @@ selector_popup_menu (GtkWidget *widget)
        ESource *source;
        gboolean res = FALSE;
 
-       source = e_source_selector_peek_primary_selection (selector);   
+       source = e_source_selector_peek_primary_selection (selector);
        g_signal_emit (selector, signals[POPUP_EVENT], 0, source, NULL, &res);
        return res;
 }
@@ -672,7 +672,7 @@ selector_button_press_event (GtkWidget *widget, GdkEventButton *event, ESourceSe
        gboolean res = FALSE;
 
        priv->toggled_last = FALSE;
-       
+
        /* only process right-clicks */
        if (event->button != 3 || event->type != GDK_BUTTON_PRESS)
                return FALSE;
@@ -681,22 +681,22 @@ selector_button_press_event (GtkWidget *widget, GdkEventButton *event, ESourceSe
        if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), event->x, event->y, &path, NULL, NULL, NULL)) {
                GtkTreeIter iter;
                gpointer data;
-               
+
                if (gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->tree_store), &iter, path)) {
                        gtk_tree_model_get (GTK_TREE_MODEL (priv->tree_store), &iter, 0, &data, -1);
 
-                       /* Do not emit popup since we will not be able to get the source */     
+                       /* Do not emit popup since we will not be able to get the source */
                        if (E_IS_SOURCE_GROUP (data)) {
                                /* do i need to ref it here */
                                ESourceGroup *group;
-                               
+
                                group = E_SOURCE_GROUP (data);g_object_ref (group);
                                priv->primary_source_group = group;
                                /* data shuld be unreffed after creating the
-                                * new source*/ 
+                                * new source*/
                                return res;
                        }
-                       
+
                        source = E_SOURCE (data);
                }
        }
@@ -777,7 +777,7 @@ e_source_selector_class_init (ESourceSelectorClass *class)
        widget_class->popup_menu = selector_popup_menu;
 
 
-       signals[SELECTION_CHANGED] = 
+       signals[SELECTION_CHANGED] =
                g_signal_new ("selection_changed",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -786,7 +786,7 @@ e_source_selector_class_init (ESourceSelectorClass *class)
                              g_cclosure_marshal_VOID__VOID,
                              G_TYPE_NONE, 0);
 
-       signals[PRIMARY_SELECTION_CHANGED] = 
+       signals[PRIMARY_SELECTION_CHANGED] =
                g_signal_new ("primary_selection_changed",
                              G_OBJECT_CLASS_TYPE (object_class),
                              G_SIGNAL_RUN_LAST,
@@ -815,23 +815,23 @@ group_search_function   (GtkTreeModel *model,
        void *data;
        const char *name = NULL;
        gboolean status = TRUE;
-       
+
        gtk_tree_model_get (model, iter, 0, &data, -1);
 
        if (E_IS_SOURCE_GROUP (data))
                name = e_source_group_peek_name (E_SOURCE_GROUP (data));
        else {
                g_assert (E_IS_SOURCE (data));
-               
+
                name = e_source_peek_name (E_SOURCE (data));
        }
 
        if (name)
                status = g_ascii_strncasecmp (name, key, strlen(key)) != 0;
 
-                                                
+
        g_object_unref (data);
-       
+
        return status;
 }
 
@@ -845,11 +845,11 @@ e_source_selector_init (ESourceSelector *selector)
 
        priv = g_new0 (ESourceSelectorPrivate, 1);
        selector->priv = priv;
-       
+
        gtk_tree_view_set_search_column (GTK_TREE_VIEW (selector), 0);
        gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (selector), group_search_function, NULL, NULL);
        gtk_tree_view_set_enable_search (GTK_TREE_VIEW (selector), TRUE);
-       
+
        g_signal_connect (G_OBJECT (selector), "button_press_event",
                          G_CALLBACK (selector_button_press_event), selector);
 
@@ -896,10 +896,10 @@ e_source_selector_init (ESourceSelector *selector)
 /**
  * e_source_selector_new:
  * @list: A source list.
- * 
+ *
  * Create a new view for @list.  The view will update automatically when @list
  * changes.
- * 
+ *
  * Return value: The newly created widget.
  **/
 GtkWidget *
@@ -925,10 +925,10 @@ e_source_selector_new (ESourceList *list)
 /**
  * e_source_selector_get_selection:
  * @selector: an #ESourceSelector
- * 
+ *
  * Get the list of selected sources, i.e. those that were enabled through the
  * corresponding checkboxes in the tree.
- * 
+ *
  * Return value: A list of the ESources currently selected.  The sources will
  * be in the same order as they appear on the screen, and the list should be
  * freed using e_source_selector_free_selection().
@@ -967,7 +967,7 @@ e_source_selector_get_selection (ESourceSelector *selector)
 /**
  * e_source_selector_get_primary_source_group:
  * @selector: an #ESourceSelector
- * 
+ *
  * Gets the primary source group associated with the selector.
  *
  * Return value: primary_source_group if selector is valid, NULL otherwise.
@@ -976,7 +976,7 @@ ESourceGroup *
 e_source_selector_get_primary_source_group (ESourceSelector *selector)
 {
        g_return_val_if_fail (E_IS_SOURCE_SELECTOR (selector), NULL);
-       
+
        return selector->priv->primary_source_group;
 
 }
@@ -984,7 +984,7 @@ e_source_selector_get_primary_source_group (ESourceSelector *selector)
 /**
  * e_source_list_free_selection:
  * @list: A selection list returned by e_source_selector_get_selection().
- * 
+ *
  * Free the selection list.
  **/
 void
@@ -998,7 +998,7 @@ e_source_selector_free_selection (GSList *list)
 /**
  * e_source_selector_show_selection:
  * @selector: An ESourceSelector widget
- * 
+ *
  * Specify whether the checkboxes in the ESourceSelector should be shown or
  * not.
  **/
@@ -1022,9 +1022,9 @@ e_source_selector_show_selection (ESourceSelector *selector,
 /**
  * e_source_selector_selection_shown:
  * @selector: an #ESourceSelector
- * 
+ *
  * Check whether the checkboxes in the ESourceSelector are being shown or not.
- * 
+ *
  * Return value: %TRUE if the checkboxes are shown, %FALSE otherwise.
  **/
 gboolean
@@ -1054,7 +1054,7 @@ e_source_selector_set_select_new (ESourceSelector *selector, gboolean state)
  * e_source_selector_select_source:
  * @selector: An #ESourceSelector widget
  * @source: An #ESource.
- * 
+ *
  * Select @source in @selector.
  **/
 void
@@ -1062,7 +1062,7 @@ e_source_selector_select_source (ESourceSelector *selector,
                                 ESource *source)
 {
        GtkTreeIter parent_iter, source_iter;
-       
+
        g_return_if_fail (E_IS_SOURCE_SELECTOR (selector));
        g_return_if_fail (E_IS_SOURCE (source));
 
@@ -1076,20 +1076,20 @@ e_source_selector_select_source (ESourceSelector *selector,
        if (find_source_iter (selector, source, &parent_iter, &source_iter)) {
                GtkTreeModel *model = GTK_TREE_MODEL (selector->priv->tree_store);
                GtkTreePath *path;
-               
+
                path = gtk_tree_model_get_path (model, &source_iter);
                gtk_tree_model_row_changed (model, path, &source_iter);
                gtk_tree_path_free (path);
-               
+
                g_signal_emit (selector, signals[SELECTION_CHANGED], 0);
-       }       
+       }
 }
 
 /**
  * e_source_selector_unselect_source:
  * @selector: An #ESourceSelector widget
  * @source: An #ESource.
- * 
+ *
  * Unselect @source in @selector.
  **/
 void
@@ -1111,11 +1111,11 @@ e_source_selector_unselect_source (ESourceSelector *selector,
        if (find_source_iter (selector, source, &parent_iter, &source_iter)) {
                GtkTreeModel *model = GTK_TREE_MODEL (selector->priv->tree_store);
                GtkTreePath *path;
-               
+
                path = gtk_tree_model_get_path (model, &source_iter);
                gtk_tree_model_row_changed (model, path, &source_iter);
                gtk_tree_path_free (path);
-               
+
                g_signal_emit (selector, signals[SELECTION_CHANGED], 0);
        }
 }
@@ -1124,9 +1124,9 @@ e_source_selector_unselect_source (ESourceSelector *selector,
  * e_source_selector_source_is_selected:
  * @selector: An #ESourceSelector widget
  * @source: An #ESource.
- * 
+ *
  * Check whether @source is selected in @selector.
- * 
+ *
  * Return value: %TRUE if @source is currently selected, %FALSE otherwise.
  **/
 gboolean
@@ -1144,12 +1144,12 @@ e_source_selector_source_is_selected (ESourceSelector *selector,
 /**
  * e_source_selector_peek_primary_selection:
  * @selector: An #ESourceSelector widget
- * 
+ *
  * Get the primary selected source.  The primary selection is the one that is
  * highlighted through the normal #GtkTreeView selection mechanism (as opposed
  * to the "normal" selection, which is the set of source whose checkboxes are
  * checked).
- * 
+ *
  * Return value: The selected source.
  **/
 ESource *
@@ -1166,7 +1166,7 @@ e_source_selector_peek_primary_selection (ESourceSelector *selector)
 
        if (selector->priv->saved_primary_selection) {
                GtkTreePath *child_path;
-               
+
                child_path = gtk_tree_row_reference_get_path (selector->priv->saved_primary_selection);
                if (child_path) {
                        if (gtk_tree_model_get_iter (GTK_TREE_MODEL (selector->priv->tree_store), &iter, child_path))
@@ -1184,12 +1184,12 @@ e_source_selector_peek_primary_selection (ESourceSelector *selector)
 
        if (! E_IS_SOURCE (data)) {
                g_object_unref (data);
-               
+
                return NULL;
        }
-       
+
        g_object_unref (data);
-       
+
        return E_SOURCE (data);
 }
 
@@ -1197,7 +1197,7 @@ e_source_selector_peek_primary_selection (ESourceSelector *selector)
  * e_source_selector_set_primary_selection:
  * @selector: an #ESourceSelector widget
  * @source: an #ESource to select
- * 
+ *
  * Set the primary selected source.
  **/
 void
@@ -1216,26 +1216,26 @@ e_source_selector_set_primary_selection (ESourceSelector *selector, ESource *sou
 
        if (!source)
                return;
-       
+
        if (find_source_iter (selector, source, &parent_iter, &source_iter)) {
                GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (selector));
                GtkTreePath *path;
-               
+
                /* We block the signal because this all needs to be atomic */
                g_signal_handlers_block_matched (selection, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, selection_changed_callback, NULL);
                gtk_tree_selection_unselect_all (selection);
                g_signal_handlers_unblock_matched (selection, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, selection_changed_callback, NULL);
 
                clear_saved_primary_selection (selector);
-               
+
                path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->tree_store), &parent_iter);
-               
+
                if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (selector), path)) {
                        gtk_tree_selection_select_iter (selection, &source_iter);
                } else {
                        GtkTreePath *child_path;
-                       
-                       child_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->tree_store), &source_iter);                 
+
+                       child_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->tree_store), &source_iter);
                        priv->saved_primary_selection = gtk_tree_row_reference_new (GTK_TREE_MODEL (priv->tree_store), child_path);
                        gtk_tree_path_free (child_path);
 
@@ -1245,13 +1245,13 @@ e_source_selector_set_primary_selection (ESourceSelector *selector, ESource *sou
                                gtk_tree_model_row_changed (GTK_TREE_MODEL (priv->tree_store), path, &source_iter);
                                g_signal_emit (selector, signals[SELECTION_CHANGED], 0);
                        }
-                       
+
                        g_signal_emit (selector, signals[PRIMARY_SELECTION_CHANGED], 0);
                }
-               
+
                gtk_tree_path_free (path);
        } else {
-               g_warning (G_STRLOC ": Cannot find source %p (%s) in selector %p", 
+               g_warning (G_STRLOC ": Cannot find source %p (%s) in selector %p",
                           source, e_source_peek_name (source), selector);
        }
 }
index 20c2a5b..1f25cbb 100644 (file)
@@ -946,7 +946,7 @@ e_tree_model_generator_convert_path_to_child_path (ETreeModelGenerator *tree_mod
  * @child_iter: a #GtkTreeIter to set
  * @permutation_n: a permutation index to set
  * @generator_iter: a #GtkTreeIter indicating the row to convert
- * 
+ *
  * Converts a @tree_model_generator row into a child row and permutation index.
  * The permutation index is the index of the generated row based on this
  * child row, with the first generated row based on this child row being 0.
index a982137..b7ce9ee 100644 (file)
@@ -72,7 +72,7 @@ main (int argc, char **argv)
        const char *gconf_path;
 
        gtk_init (&argc, &argv);
-       
+
        if (argc < 2)
                gconf_path = "/apps/evolution/calendar/sources";
        else
index 46acdec..1843fcb 100644 (file)
@@ -66,7 +66,7 @@ krb_error (E2kKerberosResult result, const char *failed)
                        fprintf (stderr, "%s\n", failed);
                        exit (1);
                }
-               /* else fall through */                 
+               /* else fall through */
 
        default:
                fprintf (stderr, "Unknown error.\n");
index e5aa3dc..b72501c 100644 (file)
@@ -638,7 +638,7 @@ extract_action (guint8 **data, int *len, E2kAction **act_ret)
 
  lose:
        e2k_action_free (act);
-       return FALSE;   
+       return FALSE;
 }
 
 /**
index 2cee84a..3afd9bc 100644 (file)
@@ -1387,7 +1387,7 @@ read_config (void)
                gchar *filename = g_build_filename (CONNECTOR_PREFIX,
                                                    "etc/connector.conf",
                                                    NULL);
-               
+
                fd = g_open (filename, O_RDONLY, 0);
                g_free (filename);
        }
@@ -1455,7 +1455,7 @@ e2k_autoconfig_lookup_option (const char *option)
        return g_hash_table_lookup (config_options, option);
 }
 
-static gboolean 
+static gboolean
 validate (const char *owa_url, char *user, char *password, ExchangeParams *exchange_params, E2kAutoconfigResult *result)
 {
        E2kAutoconfig *ac;
@@ -1465,7 +1465,7 @@ validate (const char *owa_url, char *user, char *password, ExchangeParams *excha
        const char *old, *new;
        char *path, *mailbox;
 
-       ac = e2k_autoconfig_new (owa_url, user, password, 
+       ac = e2k_autoconfig_new (owa_url, user, password,
                                 E2K_AUTOCONFIG_USE_EITHER);
 
        e2k_operation_init (&op);
@@ -1475,15 +1475,15 @@ validate (const char *owa_url, char *user, char *password, ExchangeParams *excha
 
        if (*result == E2K_AUTOCONFIG_OK) {
                /*
-                * On error code 403 and SSL seen in server response 
+                * On error code 403 and SSL seen in server response
                 * e2k_autoconfig_get_context() tries to
                 * connect using https if owa url has http and vice versa.
                 * And also re-sets the owa_uri in E2kAutoconfig.
-                * So even if the uri is incorrect, 
+                * So even if the uri is incorrect,
                 * e2k_autoconfig_check_exchange() will return success.
                 * In this case of account set up, owa_url paramter will still
                 * have wrong url entered, and we throw the error, instead of
-                * going ahead with account setup and failing later. 
+                * going ahead with account setup and failing later.
                 */
                if (g_str_has_prefix (ac->owa_uri, "http:")) {
                    if (!g_str_has_prefix (owa_url, "http:"))
@@ -1496,8 +1496,8 @@ validate (const char *owa_url, char *user, char *password, ExchangeParams *excha
        if (*result == E2K_AUTOCONFIG_OK) {
                *result = e2k_autoconfig_check_global_catalog (ac, &op);
                e2k_operation_free (&op);
-               
-               /* find mailbox and owa_path values */  
+
+               /* find mailbox and owa_path values */
                euri = e2k_uri_new (ac->home_uri);
                path = g_strdup (euri->path + 1);
                e2k_uri_free (euri);
@@ -1513,7 +1513,7 @@ validate (const char *owa_url, char *user, char *password, ExchangeParams *excha
                exchange_params->owa_path = g_strdup_printf ("%s%s", "/", path);
                g_free (path);
                exchange_params->host = g_strdup (ac->pf_server);
-               if (ac->gc_server) 
+               if (ac->gc_server)
                        exchange_params->ad_server = g_strdup (ac->gc_server);
                exchange_params->is_ntlm = ac->saw_ntlm;
 
@@ -1638,7 +1638,7 @@ e2k_validate_user (const char *owa_url, char *pkey, char **user,
        uri = e_uri_new (owa_url);
        key = g_strdup_printf ("%s%s/", pkey, uri->host); /* FIXME */
        e_uri_free (uri);
-       
+
 try_auth_again:
        username = g_strdup (*user);
 
@@ -1647,11 +1647,11 @@ try_auth_again:
        if (password) {
                /* This can be the case, where user presses authenticate button and
                 * later cancels the account setup or removal of account fails for
-                * some reason. We need to prompt for the password always when 
+                * some reason. We need to prompt for the password always when
                 * authenticate button is pressed */
                e_passwords_forget_password ("Exchange", key);
        }
-       
+
        prompt = g_strdup_printf (_("Enter password for %s"), username);
        password = e_passwords_ask_password (_("Enter password"),
                                "Exchange", key, prompt,
@@ -1667,16 +1667,16 @@ try_auth_again:
 
        valid = validate (owa_url, username, password, exchange_params, result);
        if (valid) {
-               /* generate the proper key once the host name 
-                * is read and remember password temporarily, 
-                * so that at the end of * account creation, 
+               /* generate the proper key once the host name
+                * is read and remember password temporarily,
+                * so that at the end of * account creation,
                 * user will not be prompted, for password will
-                * not be asked again. 
+                * not be asked again.
                 */
                *remember_password = remember;
                g_free (key);
                if (exchange_params->is_ntlm)
-                       key = g_strdup_printf ("exchange://%s;auth=NTLM@%s/", 
+                       key = g_strdup_printf ("exchange://%s;auth=NTLM@%s/",
                                                       username, exchange_params->host);
                else
                        key = g_strdup_printf ("exchange://%s@%s/", username, exchange_params->host);
@@ -1685,8 +1685,8 @@ try_auth_again:
        }
        else {
                if (try == 0) {
-                       /* Check for name as e-mail id and try once again 
-                        * extracing username from e-mail id. 
+                       /* Check for name as e-mail id and try once again
+                        * extracing username from e-mail id.
                         */
                        usernames = g_strsplit (*user, "@", 2);
                        if (usernames && usernames[0] && usernames[1]) {
index f16b7d5..740eeb6 100644 (file)
@@ -313,7 +313,7 @@ e2k_context_new (const char *uri)
        suri = soup_uri_new (uri);
        if (!suri)
                return NULL;
-       
+
        if (!suri->host) {
                soup_uri_free (suri);
                return NULL;
@@ -385,11 +385,11 @@ e2k_context_set_auth (E2kContext *ctx, const char *username,
                g_object_unref (ctx->priv->async_session);
 
        /* Set a default timeout value of 30 seconds.
-          FIXME: Make timeout configurable 
+          FIXME: Make timeout configurable
        */
        if (g_getenv ("SOUP_SESSION_TIMEOUT"))
                timeout = atoi (g_getenv ("SOUP_SESSION_TIMEOUT"));
-       
+
        ctx->priv->session = soup_session_sync_new_with_options (
                SOUP_SESSION_USE_NTLM, !authmech || !strcmp (authmech, "NTLM"),
                SOUP_SESSION_TIMEOUT, timeout,
@@ -1632,7 +1632,7 @@ propfind_msg (E2kContext *ctx, const char *base_uri,
        }
        g_string_append (propxml, "\r\n</D:prop>\r\n</D:propfind>");
 
-       msg = e2k_soup_message_new_full (ctx, base_uri, 
+       msg = e2k_soup_message_new_full (ctx, base_uri,
                                         hrefs ? "BPROPFIND" : "PROPFIND",
                                         "text/xml", SOUP_BUFFER_SYSTEM_OWNED,
                                         propxml->str, propxml->len);
@@ -2598,7 +2598,7 @@ renew_subscription (gpointer user_data)
  * Notifications can be used *only* to discover changes made by other
  * clients! The code cannot assume that it will receive a notification
  * for every change that it makes to the server, for two reasons:
- * 
+ *
  * First, if multiple notifications occur within @min_interval seconds
  * of each other, the later ones will be suppressed, to avoid
  * excessive traffic between the client and the server as the client
index 0da58d2..e41b41d 100644 (file)
@@ -204,8 +204,8 @@ SoupMessage   *e2k_soup_message_new_full (E2kContext *ctx,
                                          const char *body,
                                          gulong length);
 void           e2k_context_queue_message (E2kContext *ctx,
-                                         SoupMessage *msg, 
-                                         SoupMessageCallbackFn callback, 
+                                         SoupMessage *msg,
+                                         SoupMessageCallbackFn callback,
                                          gpointer user_data);
 E2kHTTPStatus  e2k_context_send_message  (E2kContext *ctx,
                                          E2kOperation *op,
index d9a2126..f2ca78a 100644 (file)
@@ -437,7 +437,7 @@ e2k_freebusy_add_from_calendar_uri (E2kFreebusy *fb, const char *uri,
                e2k_freebusy_add_interval (fb, busy,
                                           e2k_parse_timestamp (start),
                                           e2k_parse_timestamp (end));
-                             
+
        }
 
        return e2k_result_iter_free (iter);
@@ -475,7 +475,7 @@ add_events (GArray *events_array, E2kProperties *props,
                        start_tm.tm_year++;
                        start_tm.tm_mon = 0;
                }
-       }            
+       }
        e2k_properties_set_int_array (props, month_list_prop, monthyears);
 
        datas = g_ptr_array_new ();
index 45ea505..5a562b2 100644 (file)
@@ -646,31 +646,31 @@ get_quota_values (E2kGlobalCatalog *gc, E2kOperation *op,
                E2K_GC_DEBUG_MSG(("GC: Using global mailbox store limits\n"));
        }
        ldap_value_free (quota_setting_values);
-       
+
        quota_limit_values = ldap_get_values (gc->priv->ldap, msg, "mDBStorageQuota");
        if (quota_limit_values) {
                entry->quota_warn = atoi(quota_limit_values[0]);
                E2K_GC_DEBUG_MSG(("GC: mDBStorageQuota %s\n", quota_limit_values[0]));
-               ldap_value_free (quota_limit_values);   
+               ldap_value_free (quota_limit_values);
        }
 
        quota_limit_values = ldap_get_values (gc->priv->ldap, msg, "mDBOverQuotaLimit");
        if (quota_limit_values) {
                entry->quota_nosend = atoi(quota_limit_values[0]);
                E2K_GC_DEBUG_MSG(("GC: mDBOverQuotaLimit %s\n", quota_limit_values[0]));
-               ldap_value_free (quota_limit_values);   
+               ldap_value_free (quota_limit_values);
        }
 
        quota_limit_values = ldap_get_values (gc->priv->ldap, msg, "mDBOverHardQuotaLimit");
        if (quota_limit_values) {
                entry->quota_norecv = atoi(quota_limit_values[0]);
                E2K_GC_DEBUG_MSG(("GC: mDBHardQuotaLimit %s\n", quota_limit_values[0]));
-               ldap_value_free (quota_limit_values);   
+               ldap_value_free (quota_limit_values);
        }
 }
 
 static void
-get_account_control_values (E2kGlobalCatalog *gc, E2kOperation *op, 
+get_account_control_values (E2kGlobalCatalog *gc, E2kOperation *op,
                            LDAPMessage *msg, E2kGlobalCatalogEntry *entry)
 {
        char **values;
@@ -682,7 +682,7 @@ get_account_control_values (E2kGlobalCatalog *gc, E2kOperation *op,
                entry->mask |= E2K_GLOBAL_CATALOG_LOOKUP_ACCOUNT_CONTROL;
                ldap_value_free (values);
        }
-       
+
 }
 
 /**
@@ -1025,13 +1025,13 @@ find_domain_dn (char *domain)
        }
        if (dn_value->str[0])
                dn = g_strndup (dn_value->str, strlen(dn_value->str) - 1);
-       else 
+       else
                dn = NULL;
        g_string_free (dn_value, TRUE);
        return dn;
 }
 
-double 
+double
 lookup_passwd_max_age (E2kGlobalCatalog *gc, E2kOperation *op)
 {
        char **values = NULL, *filter = NULL, *val=NULL;
@@ -1041,7 +1041,7 @@ lookup_passwd_max_age (E2kGlobalCatalog *gc, E2kOperation *op)
        int ldap_error, msgid;
        double maxAge=0;
        gchar *dn=NULL;
-       
+
        attrs[0] = "maxPwdAge";
        attrs[1] = NULL;
 
@@ -1051,12 +1051,12 @@ lookup_passwd_max_age (E2kGlobalCatalog *gc, E2kOperation *op)
 
        ldap_error = get_ldap_connection (gc, op, gc->priv->server, LDAP_PORT, &ldap);
        if (ldap_error != LDAP_SUCCESS) {
-               E2K_GC_DEBUG_MSG(("GC: Establishing ldap connection failed : 0x%02x\n\n", 
+               E2K_GC_DEBUG_MSG(("GC: Establishing ldap connection failed : 0x%02x\n\n",
                                                                        ldap_error));
-               return -1; 
+               return -1;
        }
 
-       ldap_error = ldap_search_ext (ldap, dn, LDAP_SCOPE_BASE, filter, (char **)attrs, 
+       ldap_error = ldap_search_ext (ldap, dn, LDAP_SCOPE_BASE, filter, (char **)attrs,
                                      FALSE, NULL, NULL, NULL, 0, &msgid);
        if (!ldap_error) {
                ldap_error = gc_ldap_result (ldap, op, msgid, &msg);
@@ -1072,14 +1072,14 @@ lookup_passwd_max_age (E2kGlobalCatalog *gc, E2kOperation *op)
 
        values = ldap_get_values (ldap, msg, "maxPwdAge");
        if (!values) {
-               E2K_GC_DEBUG_MSG(("GC: couldn't retrieve maxPwdAge\n")); 
+               E2K_GC_DEBUG_MSG(("GC: couldn't retrieve maxPwdAge\n"));
                return -1;
        }
 
        if (values[0]) {
                val = values[0];
                if (*val == '-')
-                       ++val; 
+                       ++val;
                maxAge = strtod (val, NULL);
        }
 
index 628e63b..d8f9231 100644 (file)
@@ -74,7 +74,7 @@ typedef struct {
        E2kSid *sid;
        char *email, *exchange_server, *mailbox, *legacy_exchange_dn;
        GPtrArray *delegates, *delegators;
-       int quota_warn, quota_nosend, quota_norecv; 
+       int quota_warn, quota_nosend, quota_norecv;
        int user_account_control;
 
        E2kGlobalCatalogLookupFlags mask;
@@ -100,7 +100,7 @@ void             e2k_global_catalog_async_lookup (E2kGlobalCatalog *gc,
                                                  E2kGlobalCatalogCallback callback,
                                                  gpointer user_data);
 
-double         lookup_passwd_max_age (E2kGlobalCatalog *gc, 
+double         lookup_passwd_max_age (E2kGlobalCatalog *gc,
                                      E2kOperation *op);
 
 
index 3d515a2..f860af0 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Copyright (C) 2001 Ximian, Inc.
  *
  * This library is free software; you can redistribute it and/or
index a21a616..d955501 100644 (file)
@@ -742,7 +742,7 @@ e2k_prop_property_name (const char *prop)
  *
  * Computes the MAPI proptag value of @prop, which must be the name
  * of a MAPI property.
- * 
+ *
  * Return value: the MAPI proptag value
  **/
 guint32
index 469baf8..490eba3 100644 (file)
@@ -887,7 +887,7 @@ extract_restriction (guint8 **data, int *len, E2kRestriction **rn)
 
                if (!e2k_rule_extract_byte (data, len, &nprops))
                        return FALSE;
-               
+
                props = g_new0 (E2kPropValue, nprops);
                for (i = 0; i < nprops; i++) {
                        if (!e2k_rule_extract_propvalue (data, len, &props[i])) {
index 5f0cdac..dfea32c 100644 (file)
@@ -75,7 +75,7 @@ E2kRestriction *e2k_restriction_compare     (const char           *propname1,
                                             const char           *propname2);
 E2kRestriction *e2k_restriction_bitmask     (const char           *propname,
                                             E2kRestrictionBitop   bitop,
-                                            guint32               mask); 
+                                            guint32               mask);
 E2kRestriction *e2k_restriction_size        (const char           *propname,
                                             E2kRestrictionRelop   relop,
                                             guint32               size);
index f93115e..70562f3 100644 (file)
@@ -589,7 +589,7 @@ stringify_entryid (guint8 *data, int len)
        ret = string->str;
        g_string_free (string, FALSE);
        return ret;
-}      
+}
 
 static gboolean
 action_to_xml (E2kAction *act, xmlNode *actionset)
@@ -712,7 +712,7 @@ rule_to_xml (E2kRule *rule, xmlNode *ruleset)
 
        top = xmlNewChild (ruleset, NULL, "rule", NULL);
 
-       xmlSetProp (top, "source", 
+       xmlSetProp (top, "source",
                    (rule->state & E2K_RULE_STATE_ONLY_WHEN_OOF) ?
                    "oof" : "incoming");
        xmlSetProp (top, "enabled", (rule->state & E2K_RULE_STATE_ENABLED) ? "1" : "0");
index f1b5740..95eddc7 100644 (file)
@@ -155,13 +155,13 @@ struct _E2kAction {
        E2kActionType type;
        guint32       flavor;
        guint32       flags;
+
        union {
                struct {
                        GByteArray *store_entryid;
                        GByteArray *folder_source_key;
                } xfer;
+
                struct {
                        GByteArray *entryid;
                        guint8      reply_template_guid[16];
index 5ef427b..6c24126 100644 (file)
@@ -824,7 +824,7 @@ e2k_security_descriptor_set_permissions (E2kSecurityDescriptor *sd,
                ace.Mask = object_denied;
                set_ace (sd, &ace);
        }
-       
+
        ace.Header.AceType  = E2K_ACCESS_ALLOWED_ACE_TYPE;
        ace.Header.AceFlags = E2K_CONTAINER_INHERIT_ACE;
        ace.Mask = container_allowed;
index f366769..85aeb6f 100644 (file)
@@ -194,7 +194,7 @@ e2k_uri_free (E2kUri *uri)
                g_datalist_clear (&uri->params);
                g_free (uri->query);
                g_free (uri->fragment);
-               
+
                g_free (uri);
        }
 }
index 0f047b8..14b0a90 100644 (file)
@@ -251,7 +251,7 @@ print_properties (E2kResult *results, int nresults)
        printf ("%s\n", results[0].href);
        props = g_ptr_array_new ();
        e2k_properties_foreach (results[0].props, add_prop, props);
-       qsort (props->pdata, props->len, sizeof (gpointer), prop_compar); 
+       qsort (props->pdata, props->len, sizeof (gpointer), prop_compar);
 
        for (i = 0; i < props->len; i++)
                print_prop (props->pdata[i]);
@@ -333,7 +333,7 @@ get_fav_properties(E2kContext *ctx, char *uri)
        int status;
        char *eml_str, *top = uri, fav_uri[1024];
 
-       
+
        /* list the contents and search for the favorite properties */
        e2k_operation_init (&op);
        prop = E2K_PR_DAV_DISPLAY_NAME;
index d2e9058..a7056dc 100644 (file)
@@ -43,7 +43,7 @@ do_lookup (E2kGlobalCatalog *gc, const char *user)
        E2kGlobalCatalogEntry *entry;
        E2kGlobalCatalogLookupType type;
        guint32 flags;
-       int i, pwd_exp_days; 
+       int i, pwd_exp_days;
        double maxAge;
 
        if (*user == '/')
@@ -109,7 +109,7 @@ do_lookup (E2kGlobalCatalog *gc, const char *user)
 
        if (entry->quota_warn || entry->quota_nosend || entry->quota_norecv )
                printf ("  Mail Quota Info:\n");
-       if (entry->quota_warn)  
+       if (entry->quota_warn)
                printf ("    Issue Quota warning at : %d\n", entry->quota_warn);
        if (entry->quota_nosend)
                printf ("    Stop sending mails at  : %d\n", entry->quota_nosend);
@@ -117,7 +117,7 @@ do_lookup (E2kGlobalCatalog *gc, const char *user)
                printf ("    Stop sending and recieving mails at : %d\n", entry->quota_norecv);
        if (entry->user_account_control)
                printf ("    user_account_control : %d\n", entry->user_account_control);
-       
+
 
        maxAge = lookup_passwd_max_age (gc, &op);
        printf("Password max age is %f \n", maxAge);
index 66bfab1..8a2f853 100644 (file)
@@ -44,100 +44,100 @@ dump_uri (E2kUri *euri) {
 
        if (euri->protocol)
                printf("Protocol : %s \n", euri->protocol);
-       else 
-               printf ("Protocol : NULL \n");  
+       else
+               printf ("Protocol : NULL \n");
        if (euri->user)
                printf("User : %s \n", euri->user);
-       else 
-               printf ("User : NULL \n");      
+       else
+               printf ("User : NULL \n");
        if (euri->domain)
                printf("Domain : %s \n", euri->domain);
-       else 
-               printf ("Domain : NULL \n");    
+       else
+               printf ("Domain : NULL \n");
        if (euri->authmech)
                printf("Authmech : %s \n", euri->authmech);
-       else 
-               printf ("Authmech : NULL \n");  
+       else
+               printf ("Authmech : NULL \n");
        if (euri->passwd)
                printf("Password : %s \n", euri->passwd);
-       else 
-               printf ("Password : NULL \n");  
+       else
+               printf ("Password : NULL \n");
        if (euri->host)
                printf("Host : %s \n", euri->host);
-       else 
-               printf ("Host : NULL \n");      
+       else
+               printf ("Host : NULL \n");
        if (euri->port)
                printf("Port : %d \n", euri->port);
-       else 
-               printf ("Port : NULL \n");      
+       else
+               printf ("Port : NULL \n");
        if (euri->path)
                printf("Path : %s \n", euri->path);
-       else 
-               printf ("Path : NULL \n");      
+       else
+               printf ("Path : NULL \n");
        if (euri->params) {
                printf("\nParams : \n");
-               temp = e2k_uri_get_param (euri, "ad_server"); 
+               temp = e2k_uri_get_param (euri, "ad_server");
                if (temp) printf ("\tAd server = %s\n", temp);
                else printf ("\tAd server = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "ad_limit"); 
+               temp = e2k_uri_get_param (euri, "ad_limit");
                if (temp) printf ("\tAd Limit = %s\n", temp);
                else printf ("\tAd Limit = NULL\n");
 
-               temp = e2k_uri_get_param (euri, "passwd_exp_warn_period"); 
+               temp = e2k_uri_get_param (euri, "passwd_exp_warn_period");
                if (temp) printf ("\tPasswd expiry warn period = %s\n", temp);
                else printf ("\tPasswd expiry warn period = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "offline_sync"); 
+               temp = e2k_uri_get_param (euri, "offline_sync");
                if (temp) printf ("\tOffline Sync = %s\n", temp);
                else printf ("\tOffline Sync = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "owa_path"); 
+               temp = e2k_uri_get_param (euri, "owa_path");
                if (temp) printf ("\tOwa path = %s\n", temp);
                else printf ("\tOwa path = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "pf_server"); 
+               temp = e2k_uri_get_param (euri, "pf_server");
                if (temp) printf ("\tPf server = %s\n", temp);
                else printf ("\tPf server = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "use_ssl"); 
+               temp = e2k_uri_get_param (euri, "use_ssl");
                if (temp) printf ("\tSSL = %s\n", temp);
                else printf ("\tSSL = NULL\n");
 
-               temp = e2k_uri_get_param (euri, "mailbox"); 
+               temp = e2k_uri_get_param (euri, "mailbox");
                if (temp) printf ("\tMailbox = %s\n", temp);
                else printf ("\tMailbox = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "filter"); 
+               temp = e2k_uri_get_param (euri, "filter");
                if (temp) printf ("\tFilter = %s\n", temp);
                else printf ("\tFilter = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "filter_junk"); 
+               temp = e2k_uri_get_param (euri, "filter_junk");
                if (temp) printf ("\tFilter junk = %s\n", temp);
                else printf ("\tFilter junk = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "filter_junk_inbox"); 
+               temp = e2k_uri_get_param (euri, "filter_junk_inbox");
                if (temp) printf ("\tFilter junk inbox = %s\n", temp);
                else printf ("\tFilter junk inbox = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "owa_protocol"); 
+               temp = e2k_uri_get_param (euri, "owa_protocol");
                if (temp) printf ("\tOwa protocol = %s\n", temp);
                else printf ("\tOwa protocol = NULL \n");
 
-               temp = e2k_uri_get_param (euri, "owa_url"); 
+               temp = e2k_uri_get_param (euri, "owa_url");
                if (temp) printf ("\tOwa url = %s\n", temp);
                else printf ("\tOwa url = NULL \n");
        }
-       else 
-               printf ("Params : NULL \n");    
+       else
+               printf ("Params : NULL \n");
        if (euri->query)
                printf("Query : %s \n", euri->query);
-       else 
-               printf ("Query : NULL \n");     
+       else
+               printf ("Query : NULL \n");
        if (euri->fragment)
                printf("Fragment : %s \n", euri->fragment);
-       else 
-               printf ("Fragment : NULL \n");  
+       else
+               printf ("Fragment : NULL \n");
 }
 
 void
index d7a5e29..b7aaa3f 100644 (file)
@@ -131,10 +131,10 @@ sanitize_path (const char *path)
                new_path = g_strdup (comps[0]);
 
        g_strfreev (comps);
-       return new_path;        
+       return new_path;
 }
 
-#define d(x) 
+#define d(x)
 
 /**
  * e_folder_exchange_new:
@@ -162,7 +162,7 @@ e_folder_exchange_new (ExchangeHierarchy *hier, const char *name,
        g_return_val_if_fail (physical_uri != NULL, NULL);
        g_return_val_if_fail (internal_uri != NULL, NULL);
 
-       d(g_print ("e_folder_exchange_new: name=[%s], type=[%s], internal_uri=[%s], physical_uri=[%s]\n", 
+       d(g_print ("e_folder_exchange_new: name=[%s], type=[%s], internal_uri=[%s], physical_uri=[%s]\n",
                   name, type, internal_uri, physical_uri));
 
        efe = g_object_new (E_TYPE_FOLDER_EXCHANGE, NULL);
@@ -184,28 +184,28 @@ e_folder_exchange_new (ExchangeHierarchy *hier, const char *name,
        efe->priv->outlook_class = g_strdup (outlook_class);
 
        /* Add ESources */
-       if (hier->type == EXCHANGE_HIERARCHY_PERSONAL || 
+       if (hier->type == EXCHANGE_HIERARCHY_PERSONAL ||
            hier->type == EXCHANGE_HIERARCHY_FAVORITES) {
-               
+
                if ((strcmp (type, "calendar") == 0) ||
                    (strcmp (type, "calendar/public") == 0)) {
-                       add_folder_esource (hier->account, 
-                                           EXCHANGE_CALENDAR_FOLDER, 
-                                           name, 
+                       add_folder_esource (hier->account,
+                                           EXCHANGE_CALENDAR_FOLDER,
+                                           name,
                                            physical_uri);
                }
                else if ((strcmp (type, "tasks") == 0) ||
                         (strcmp (type, "tasks/public") == 0)) {
-                       add_folder_esource (hier->account, 
-                                           EXCHANGE_TASKS_FOLDER, 
-                                           name, 
+                       add_folder_esource (hier->account,
+                                           EXCHANGE_TASKS_FOLDER,
+                                           name,
                                            physical_uri);
                }
                else if ((strcmp (type, "contacts") == 0) ||
                         (strcmp (type, "contacts/public") == 0)) {
-                       add_folder_esource (hier->account, 
-                                           EXCHANGE_CONTACTS_FOLDER, 
-                                           name, 
+                       add_folder_esource (hier->account,
+                                           EXCHANGE_CONTACTS_FOLDER,
+                                           name,
                                            physical_uri);
                }
        }
@@ -426,7 +426,7 @@ e_folder_exchange_get_hierarchy (EFolder *folder)
        g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), NULL);
 
        return E_FOLDER_EXCHANGE (folder)->priv->hier;
-}      
+}
 
 /**
  * e_folder_exchange_get_storage_file:
@@ -811,7 +811,7 @@ e_folder_exchange_transfer_start (EFolder *source, E2kOperation *op,
 E2kHTTPStatus
 e_folder_exchange_put_new (EFolder *folder,
                           E2kOperation *op,
-                          const char *object_name, 
+                          const char *object_name,
                           E2kContextTestCallback test_callback,
                           gpointer user_data,
                           const char *content_type,
@@ -958,7 +958,7 @@ e_folder_exchange_delete (EFolder *folder, E2kOperation *op)
 
        g_return_val_if_fail (E_IS_FOLDER_EXCHANGE (folder), E2K_HTTP_MALFORMED);
        /* remove ESources */
-       hier = e_folder_exchange_get_hierarchy (folder); 
+       hier = e_folder_exchange_get_hierarchy (folder);
 
        if (hier->type == EXCHANGE_HIERARCHY_PERSONAL ||
            hier->type == EXCHANGE_HIERARCHY_FAVORITES) {
@@ -967,7 +967,7 @@ e_folder_exchange_delete (EFolder *folder, E2kOperation *op)
 
                if ((strcmp (folder_type, "calendar") == 0) ||
                    (strcmp (folder_type, "calendar/public") == 0)) {
-                       remove_folder_esource (hier->account, 
+                       remove_folder_esource (hier->account,
                                               EXCHANGE_CALENDAR_FOLDER,
                                               physical_uri);
                }
@@ -978,7 +978,7 @@ e_folder_exchange_delete (EFolder *folder, E2kOperation *op)
                                               physical_uri);
                }
                else if ((strcmp (folder_type, "contacts") == 0) ||
-                        (strcmp (folder_type, "contacts/public") == 0)) { 
+                        (strcmp (folder_type, "contacts/public") == 0)) {
                        remove_folder_esource (hier->account,
                                               EXCHANGE_CONTACTS_FOLDER,
                                               physical_uri);
index 4c52940..7b09d5c 100644 (file)
@@ -161,9 +161,9 @@ remove_folder (EFolderTree *folder_tree,
  * e_folder_tree_new:
  * @folder_destroy_notify: Function to be called when a folder gets removed from the tree
  * @closure: Additional data to pass to @folder_destroy_notify
- * 
+ *
  * Create a new EFolderTree.
- * 
+ *
  * Return value: A pointer to the newly created EFolderTree.
  **/
 EFolderTree *
@@ -188,7 +188,7 @@ e_folder_tree_new (EFolderDestroyNotify folder_destroy_notify,
 /**
  * e_folder_tree_destroy:
  * @folder_tree: A pointer to an EFolderTree
- * 
+ *
  * Destroy @folder_tree.
  **/
 void
@@ -212,7 +212,7 @@ e_folder_tree_destroy (EFolderTree *folder_tree)
  * @folder_tree: A pointer to an EFolderTree
  * @path: Path at which the new folder must be added
  * @data: Data associated with the new folder
- * 
+ *
  * Insert a new folder at @path, with the specified @data.
  *
  * Return value: %TRUE if successful, %FALSE if failed.
@@ -286,7 +286,7 @@ e_folder_tree_add (EFolderTree *folder_tree,
  * e_folder_tree_remove:
  * @folder_tree: A pointer to an EFolderTree
  * @path: Path of the folder to remove
- * 
+ *
  * Remove the folder at @path from @folder_tree.
  *
  * Return value: %TRUE if successful, %FALSE if failed.
@@ -316,35 +316,35 @@ count_nodes (EFolderTree *tree,
             void *closure)
 {
        int *count = closure;
-       
+
        (*count)++;
 }
 
 /**
  * e_folder_tree_get_count:
  * @folder_tree: A pointer to an EFolderTree
- * 
+ *
  * Gets the number of folders in the tree
- * 
+ *
  * Return value: The number of folders in the tree
  **/
 int
 e_folder_tree_get_count (EFolderTree *folder_tree)
 {
        int count = 0;
-       
+
        e_folder_tree_foreach (folder_tree, count_nodes, &count);
-       
+
        return count;
 }
-                                             
+
 /**
  * e_folder_tree_get_folder:
  * @folder_tree: A pointer to an EFolderTree
  * @path: Path of the folder for which we want to get the data
- * 
+ *
  * Get the data for the folder at @path.
- * 
+ *
  * Return value: The pointer to the data for the folder at @path.
  **/
 void *
@@ -368,9 +368,9 @@ e_folder_tree_get_folder (EFolderTree *folder_tree,
  * e_folder_tree_get_subfolders:
  * @folder_tree: A pointer to an EFolderTree
  * @path: A path in @folder_tree
- * 
+ *
  * Get a list of the paths of the subfolders of @path.
- * 
+ *
  * Return value: A list of pointers to the paths of the subfolders.  The list
  * and the strings must be freed by the caller.
  **/
@@ -403,10 +403,10 @@ e_folder_tree_get_subfolders (EFolderTree *folder_tree,
 
 /**
  * e_folder_tree_foreach:
- * @folder_tree: 
- * @foreach_func: 
- * @data: 
- * 
+ * @folder_tree:
+ * @foreach_func:
+ * @data:
+ *
  * Call @foreach_func with the specified @data for all the folders
  * in @folder_tree, starting at the root node.
  **/
@@ -434,9 +434,9 @@ e_folder_tree_foreach (EFolderTree *folder_tree,
  * e_folder_tree_get_path_for_data:
  * @folder_tree: A pointer to an EFolderTree
  * @data: The data for the folder for which the path is needed
- * 
+ *
  * Look up the path for the specified @data.
- * 
+ *
  * Return value: The path for the folder that holds that @data.
  **/
 const char *
index a1f9cf6..c98a831 100644 (file)
@@ -32,9 +32,9 @@ typedef void (* EFolderTreeForeachFunc) (EFolderTree *tree, const char *path, vo
 
 EFolderTree *e_folder_tree_new               (EFolderDestroyNotify    folder_destroy_notify,
                                              void                   *closure);
-                                           
+
 void        e_folder_tree_destroy            (EFolderTree            *folder_tree);
-                                           
+
 gboolean    e_folder_tree_add                (EFolderTree            *folder_tree,
                                              const char             *path,
                                              void                   *data);
@@ -47,7 +47,7 @@ void       *e_folder_tree_get_folder         (EFolderTree            *folder_tre
                                              const char             *path);
 GList      *e_folder_tree_get_subfolders     (EFolderTree            *folder_tree,
                                              const char             *path);
-                                           
+
 void        e_folder_tree_foreach            (EFolderTree            *folder_tree,
                                              EFolderTreeForeachFunc  foreach_func,
                                              void                   *data);
index f571642..5fdbad0 100644 (file)
@@ -250,7 +250,7 @@ e_folder_get_has_subfolders (EFolder *folder)
 /**
  * e_folder_get_custom_icon:
  * @folder: An EFolder
- * 
+ *
  * Get the name of the custom icon for @folder, or NULL if no custom icon is
  * associated with it.
  **/
@@ -265,9 +265,9 @@ e_folder_get_custom_icon_name (EFolder *folder)
 /**
  * e_folder_get_sorting_priority:
  * @folder: An EFolder
- * 
+ *
  * Get the sorting priority for @folder.
- * 
+ *
  * Return value: Sorting priority value for @folder.
  **/
 int
@@ -400,7 +400,7 @@ e_folder_set_has_subfolders (EFolder *folder,
  * @folder: An EFolder
  * @icon_name: Name of the icon to be set (to be found in the standard
  * Evolution icon dir)
- * 
+ *
  * Set a custom icon for @folder (thus overriding the default icon, which is
  * the one associated to the type of the folder).
  **/
@@ -426,7 +426,7 @@ e_folder_set_custom_icon (EFolder *folder,
  * e_folder_set_sorting_priority:
  * @folder: An EFolder
  * @sorting_priority: A sorting priority number
- * 
+ *
  * Set the sorting priority for @folder.  Folders have a default sorting
  * priority of zero; when deciding the sort order in the Evolution folder tree,
  * folders with the same priority value are compared by name, while folders
index a382afa..c03cda2 100644 (file)
@@ -100,7 +100,7 @@ folder_changed_cb (EFolder *folder,
                p = strrchr (path, '/');
                if (p && p != path) {
                        char *name;
-                       
+
                        name = g_strndup (path, p - path);
                        folder = e_folder_tree_get_folder (priv->folder_tree, name);
                        g_free (name);
@@ -623,9 +623,9 @@ get_path_for_physical_uri_foreach (EFolderTree *folder_tree,
  * e_storage_get_path_for_physical_uri:
  * @storage: A storage
  * @physical_uri: A physical URI
- * 
+ *
  * Look for the folder having the specified @physical_uri.
- * 
+ *
  * Return value: The path of the folder having the specified @physical_uri in
  * @storage.  If such a folder does not exist, just return NULL.  The return
  * value must be freed by the caller.
index 68a000b..0f297ab 100644 (file)
@@ -52,7 +52,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#define d(x) 
+#define d(x)
 #define ADS_UF_DONT_EXPIRE_PASSWORD 0x10000
 #define ONE_HUNDRED_NANOSECOND 0.000000100
 #define SECONDS_IN_DAY 86400
@@ -64,7 +64,7 @@ struct _ExchangeAccountPrivate {
        ExchangeFolderSize *fsize;
 
        GMutex *connect_lock;
-       gboolean connecting, connected; 
+       gboolean connecting, connected;
        int account_online;
 
        GPtrArray *hierarchies;
@@ -373,8 +373,8 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
                g_hash_table_insert (account->priv->fresh_folders,
                                     key,
                                     folder);
-       }       
-       
+       }
+
        key = (char *) e_folder_get_physical_uri (folder);
        if (!g_hash_table_lookup (account->priv->folders, key)) {
                /* Avoid dupilcations since the user could add a folder as
@@ -388,8 +388,8 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
 
        key = (char *) e_folder_exchange_get_internal_uri (folder);
        if (!g_hash_table_lookup (account->priv->folders, key)) {
-               /* The internal_uri for public folders and favorites folder 
-                  is same !!! Without this check the folder value could 
+               /* The internal_uri for public folders and favorites folder
+                  is same !!! Without this check the folder value could
                   overwrite the previously added folder. */
                g_object_ref (folder);
                g_hash_table_insert (account->priv->folders,
@@ -398,7 +398,7 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
                table_updated = 1;
        }
 
-       if (permanent_uri && (!g_hash_table_lookup (account->priv->folders, 
+       if (permanent_uri && (!g_hash_table_lookup (account->priv->folders,
                                        permanent_uri))) {
                g_object_ref (folder);
                g_hash_table_insert (account->priv->folders,
@@ -406,10 +406,10 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
                                     folder);
                table_updated = 1;
        }
-       
+
        if (table_updated)
        {
-               g_hash_table_insert (account->priv->hierarchies_by_folder, 
+               g_hash_table_insert (account->priv->hierarchies_by_folder,
                                        folder, hier);
 
                g_signal_emit (account, signals[NEW_FOLDER], 0, folder);
@@ -420,18 +420,18 @@ static void
 hierarchy_removed_folder (ExchangeHierarchy *hier, EFolder *folder,
                          ExchangeAccount *account)
 {
-       if (!g_hash_table_lookup (account->priv->folders, 
+       if (!g_hash_table_lookup (account->priv->folders,
                                        e_folder_exchange_get_path (folder)))
                return;
 
-       g_hash_table_remove (account->priv->folders, 
+       g_hash_table_remove (account->priv->folders,
                                        e_folder_exchange_get_path (folder));
-       g_hash_table_remove (account->priv->folders, 
+       g_hash_table_remove (account->priv->folders,
                                        e_folder_get_physical_uri (folder));
-       /* Dont remove this for favorites, as the internal_uri is shared 
+       /* Dont remove this for favorites, as the internal_uri is shared
                by the public folder as well */
        if (hier->type != EXCHANGE_HIERARCHY_FAVORITES) {
-               g_hash_table_remove (account->priv->folders, 
+               g_hash_table_remove (account->priv->folders,
                                        e_folder_exchange_get_internal_uri (folder));
        }
        g_hash_table_remove (account->priv->hierarchies_by_folder, folder);
@@ -494,7 +494,7 @@ exchange_account_create_folder (ExchangeAccount *account,
        ExchangeHierarchy *hier;
        EFolder *parent;
 
-       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 
+       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
                                EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 
        if (!get_parent_and_name (account, &path, &parent, &hier))
@@ -522,7 +522,7 @@ exchange_account_remove_folder (ExchangeAccount *account, const char *path)
        EFolder *folder;
        const char *int_uri;
 
-       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 
+       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
                                EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 
        d(g_print ("exchange_account_remove_folder: path=[%s]\n", path));
@@ -532,7 +532,7 @@ exchange_account_remove_folder (ExchangeAccount *account, const char *path)
 
        int_uri = e_folder_exchange_get_internal_uri (folder);
 
-       if (g_hash_table_find (account->priv->standard_uris, 
+       if (g_hash_table_find (account->priv->standard_uris,
                                        check_if_sf, (char *)int_uri)) {
                return EXCHANGE_ACCOUNT_FOLDER_UNSUPPORTED_OPERATION;
        }
@@ -550,7 +550,7 @@ exchange_account_xfer_folder (ExchangeAccount *account,
        ExchangeHierarchy *source_hier, *dest_hier;
        const char *name;
 
-       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 
+       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
                                EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 
        if (!get_folder (account, source_path, &source, &source_hier) ||
@@ -668,7 +668,7 @@ exchange_account_discover_shared_folder (ExchangeAccount *account,
        E2kGlobalCatalogStatus status;
        E2kGlobalCatalogEntry *entry;
 
-       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 
+       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
                                EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 
        if (!account->priv->gc)
@@ -762,7 +762,7 @@ exchange_account_remove_shared_folder (ExchangeAccount *account,
        ExchangeHierarchy *hier;
        EFolder *folder;
 
-       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 
+       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
                                EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 
        if (!get_folder (account, path, &folder, &hier))
@@ -780,7 +780,7 @@ exchange_account_open_folder (ExchangeAccount *account, const char *path)
        EFolder *folder;
        int mode;
 
-       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 
+       g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account),
                                EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
 
        d(g_print ("exchange_account_remove_folder: path=[%s]\n", path));
@@ -797,8 +797,8 @@ exchange_account_open_folder (ExchangeAccount *account, const char *path)
                 * anyway. So just ignore the request for now.
                 */
                return EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST;
-       }               
-       
+       }
+
        return exchange_hierarchy_scan_subtree (hier, folder, mode);
 }
 
@@ -938,25 +938,25 @@ get_password (ExchangeAccount *account, E2kAutoconfig *ac, ExchangeAccountResult
 
                        prompt = g_strdup_printf (_("Enter password for %s"),
                                                  account->account_name);
-                       oldremember = remember = 
+                       oldremember = remember =
                                        account->priv->account->source->save_passwd;
                        password = e_passwords_ask_password (
                                        _("Enter password"),
-                                       "Exchange", 
+                                       "Exchange",
                                        account->priv->password_key,
-                                       prompt, 
+                                       prompt,
                                        E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET,
-                                       &remember, 
+                                       &remember,
                                        NULL);
                        if (remember != oldremember) {
                                account->priv->account->source->save_passwd = remember;
                        }
                        g_free (prompt);
-               } 
+               }
                else if (!account->priv->account->source->save_passwd) {
-                       /* get_password returns the password cached but user has not 
-                        * selected remember password option, forget this password 
-                        * whis is stored temporarily by e2k_validate_user() 
+                       /* get_password returns the password cached but user has not
+                        * selected remember password option, forget this password
+                        * whis is stored temporarily by e2k_validate_user()
                         */
                        e_passwords_forget_password ("Exchange", account->priv->password_key);
                }
@@ -965,9 +965,9 @@ get_password (ExchangeAccount *account, E2kAutoconfig *ac, ExchangeAccountResult
        if (!password) {
        }
        else if (!account->priv->account->source->save_passwd) {
-               /* get_password returns the password cached but user has not 
-                * selected remember password option, forget this password 
-                * whis is stored temporarily by e2k_validate_user() 
+               /* get_password returns the password cached but user has not
+                * selected remember password option, forget this password
+                * whis is stored temporarily by e2k_validate_user()
                 */
                e_passwords_forget_password ("Exchange", account->priv->password_key);
        }
@@ -1007,15 +1007,15 @@ is_password_expired (ExchangeAccount *account, E2kAutoconfig *ac)
 
        result = e2k_kerberos_check_password (ac->username, domain,
                                              ac->password);
-       if (result != E2K_KERBEROS_OK && 
+       if (result != E2K_KERBEROS_OK &&
            result != E2K_KERBEROS_PASSWORD_EXPIRED) {
                /* try again with nt domain */
                domain = ac->nt_domain;
                if (domain)
-                       result = e2k_kerberos_check_password (ac->username, 
+                       result = e2k_kerberos_check_password (ac->username,
                                                              domain,
                                                              ac->password);
-       } 
+       }
 
        return (result == E2K_KERBEROS_PASSWORD_EXPIRED);
 }
@@ -1033,43 +1033,43 @@ find_passwd_exp_period (ExchangeAccount *account, E2kGlobalCatalogEntry *entry)
        if (account->priv->passwd_exp_warn_period == -1)
                return -1;
 
-       /* Check for password expiry period */ 
-       /* This needs to be invoked after is_password_expired(), i.e., 
+       /* Check for password expiry period */
+       /* This needs to be invoked after is_password_expired(), i.e.,
           only if password is not expired */
 
        /* Check for account control value for a user */
 
        e2k_operation_init (&gcop);
-       gcstatus = e2k_global_catalog_lookup (account->priv->gc, 
-                                             &gcop, 
-                                             E2K_GLOBAL_CATALOG_LOOKUP_BY_EMAIL, 
-                                             account->priv->identity_email, 
-                                             E2K_GLOBAL_CATALOG_LOOKUP_ACCOUNT_CONTROL, 
-                                             &entry); 
+       gcstatus = e2k_global_catalog_lookup (account->priv->gc,
+                                             &gcop,
+                                             E2K_GLOBAL_CATALOG_LOOKUP_BY_EMAIL,
+                                             account->priv->identity_email,
+                                             E2K_GLOBAL_CATALOG_LOOKUP_ACCOUNT_CONTROL,
+                                             &entry);
        e2k_operation_free (&gcop);
-       if (gcstatus != E2K_GLOBAL_CATALOG_OK) 
+       if (gcstatus != E2K_GLOBAL_CATALOG_OK)
                return -1;
-       
+
        if (entry->user_account_control & ADS_UF_DONT_EXPIRE_PASSWORD) {
                return -1;         /* Password is not set to expire */
        }
 
-       /* Here we don't check not setting the password and expired password */ 
+       /* Here we don't check not setting the password and expired password */
        /* Check for the maximum password age set */
 
-       e2k_operation_init (&gcop); 
-       max_pwd_age = lookup_passwd_max_age (account->priv->gc, &gcop); 
+       e2k_operation_init (&gcop);
+       max_pwd_age = lookup_passwd_max_age (account->priv->gc, &gcop);
        e2k_operation_free (&gcop);
 
        if (max_pwd_age > 0) {
                /* Calculate password expiry period */
-               max_pwd_age_days = 
+               max_pwd_age_days =
                ( max_pwd_age * ONE_HUNDRED_NANOSECOND ) / SECONDS_IN_DAY;
 
                if (max_pwd_age_days <= account->priv->passwd_exp_warn_period) {
                        return max_pwd_age_days;
                }
-       } 
+       }
        return -1;
 }
 
@@ -1113,7 +1113,7 @@ exchange_account_set_password (ExchangeAccount *account, char *old_pass, char *n
                /* try with nt_domain */
                domain = account->priv->nt_domain;
                if (domain)
-                       result = e2k_kerberos_change_password (account->priv->username, 
+                       result = e2k_kerberos_change_password (account->priv->username,
                                                               domain, old_pass,
                                                               new_pass);
        }
@@ -1132,7 +1132,7 @@ exchange_account_set_password (ExchangeAccount *account, char *old_pass, char *n
        default:
                return EXCHANGE_ACCOUNT_PASSWORD_CHANGE_FAILED;
        }
-       
+
        return EXCHANGE_ACCOUNT_PASSWORD_CHANGE_SUCCESS;
 #else
        g_warning ("exchange_account_set_password: Not implemented (no KRB5)");
@@ -1140,13 +1140,13 @@ exchange_account_set_password (ExchangeAccount *account, char *old_pass, char *n
 #endif
 }
 
-void 
+void
 exchange_account_set_save_password (ExchangeAccount *account, gboolean save_password)
 {
        account->priv->account->source->save_passwd = save_password;
 }
 
-gboolean 
+gboolean
 exchange_account_is_save_password (ExchangeAccount *account)
 {
        return account->priv->account->source->save_passwd;
@@ -1167,7 +1167,7 @@ exchange_account_is_save_password (ExchangeAccount *account)
 gboolean
 exchange_account_set_offline (ExchangeAccount *account)
 {
-               
+
        g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), FALSE);
 
        g_mutex_lock (account->priv->connect_lock);
@@ -1200,7 +1200,7 @@ exchange_account_set_online (ExchangeAccount *account)
        g_mutex_lock (account->priv->connect_lock);
        account->priv->account_online = ONLINE_MODE;
        g_mutex_unlock (account->priv->connect_lock);
-       
+
        return TRUE;
 }
 
@@ -1214,7 +1214,7 @@ void
 exchange_account_is_offline (ExchangeAccount *account, int *state)
 {
        g_return_if_fail (EXCHANGE_IS_ACCOUNT (account));
-       
+
        *state = account->priv->account_online;
 }
 
@@ -1311,7 +1311,7 @@ setup_account_hierarchies (ExchangeAccount *account)
        }
 
 hierarchies_created:
-       
+
        /* Scan the personal and favorite folders so we can resolve references
         * to the Calendar, Contacts, etc even if the tree isn't
         * opened.
@@ -1319,7 +1319,7 @@ hierarchies_created:
 
        /* Assuming the first element being personal hierarchy. */
        personal_hier = account->priv->hierarchies->pdata[0];
-       
+
        fresult = exchange_hierarchy_scan_subtree (personal_hier,
                                                   personal_hier->toplevel,
                                                   mode);
@@ -1335,7 +1335,7 @@ hierarchies_created:
                account->priv->favorites_hierarchy,
                account->priv->favorites_hierarchy->toplevel,
                mode);
-       if (fresult != EXCHANGE_ACCOUNT_FOLDER_OK && 
+       if (fresult != EXCHANGE_ACCOUNT_FOLDER_OK &&
            fresult != EXCHANGE_ACCOUNT_FOLDER_DOES_NOT_EXIST) {
                account->priv->connecting = FALSE;
                return FALSE;
@@ -1355,7 +1355,7 @@ hierarchies_created:
  * failed.
  **/
 E2kContext *
-exchange_account_connect (ExchangeAccount *account, const char *pword, 
+exchange_account_connect (ExchangeAccount *account, const char *pword,
                          ExchangeAccountResult *info_result)
 {
        E2kAutoconfig *ac;
@@ -1371,12 +1371,12 @@ exchange_account_connect (ExchangeAccount *account, const char *pword,
        E2kOperation gcop;
        char *user_name = NULL;
 
-       *info_result = EXCHANGE_ACCOUNT_UNKNOWN_ERROR; 
+       *info_result = EXCHANGE_ACCOUNT_UNKNOWN_ERROR;
        g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
 
        *info_result = EXCHANGE_ACCOUNT_CONNECT_SUCCESS;
        exchange_account_is_offline (account, &mode);
-       
+
        g_mutex_lock (account->priv->connect_lock);
 
        if (mode == UNSUPPORTED_MODE) {
@@ -1385,7 +1385,7 @@ exchange_account_connect (ExchangeAccount *account, const char *pword,
                g_mutex_unlock (account->priv->connect_lock);
                return NULL;
        }
-       
+
        if (account->priv->connecting || mode == OFFLINE_MODE) {
                g_mutex_unlock (account->priv->connect_lock);
                if (mode == OFFLINE_MODE) {
@@ -1571,22 +1571,22 @@ exchange_account_connect (ExchangeAccount *account, const char *pword,
                                             E2K_GLOBAL_CATALOG_LOOKUP_BY_EMAIL,
                                             account->priv->identity_email,
                                            E2K_GLOBAL_CATALOG_LOOKUP_QUOTA,
-                                            &entry);   
+                                            &entry);
        e2k_operation_free (&gcop);
 
-       /* FIXME: warning message should have quota limit value 
+       /* FIXME: warning message should have quota limit value
         */
        if (gcstatus == E2K_GLOBAL_CATALOG_OK) {
 
-               if (entry->quota_norecv && 
+               if (entry->quota_norecv &&
                        account->mbox_size >= entry->quota_norecv) {
                                *info_result = EXCHANGE_ACCOUNT_QUOTA_RECIEVE_ERROR;
                                account->priv->quota_limit = entry->quota_norecv;
-               } else if (entry->quota_nosend && 
+               } else if (entry->quota_nosend &&
                                account->mbox_size >= entry->quota_nosend) {
                                        *info_result = EXCHANGE_ACCOUNT_QUOTA_SEND_ERROR;
                                        account->priv->quota_limit = entry->quota_nosend;
-               } else if (entry->quota_warn && 
+               } else if (entry->quota_warn &&
                                account->mbox_size >= entry->quota_warn) {
                                        *info_result = EXCHANGE_ACCOUNT_QUOTA_WARN;
                                        account->priv->quota_limit = entry->quota_warn;
@@ -1649,7 +1649,7 @@ E2kGlobalCatalog *
 exchange_account_get_global_catalog (ExchangeAccount *account)
 {
        g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
-               
+
        return account->priv->gc;
 }
 
@@ -1659,7 +1659,7 @@ exchange_account_get_global_catalog (ExchangeAccount *account)
  *
  * Return value: @account's #EAccount, if it is connected and
  * online, or %NULL if not.
- **/   
+ **/
 EAccount *
 exchange_account_fetch (ExchangeAccount *acct)
 {
@@ -1783,7 +1783,7 @@ exchange_account_get_foreign_uri (ExchangeAccount *account,
 
 /* Scans the subscribed users folders. */
 /*FIXME This function is not really required if the syncronization
-  problem between exchange and evolution is fixed. Exchange does not get to know 
+  problem between exchange and evolution is fixed. Exchange does not get to know
  if an user's folder is subscribed from evolution */
 void
 exchange_account_scan_foreign_hierarchy (ExchangeAccount *account, const char *user_email)
@@ -1791,7 +1791,7 @@ exchange_account_scan_foreign_hierarchy (ExchangeAccount *account, const char *u
        char *dir;
        ExchangeHierarchy *hier;
        int mode;
-       
+
        hier = g_hash_table_lookup (account->priv->foreign_hierarchies, user_email);
        if (hier) {
                exchange_hierarchy_rescan (hier);
@@ -1816,7 +1816,7 @@ exchange_account_scan_foreign_hierarchy (ExchangeAccount *account, const char *u
  * @email: email id of the foreign user
  *
  * If the hierarchy is present just return it back. Else try to get it
- * from the filesystem and return it. 
+ * from the filesystem and return it.
  *
  * Return value: Returns the ExchangeHierarchy of the foreign user's folder.
  **/
@@ -1886,14 +1886,14 @@ add_folder (gpointer key, gpointer value, gpointer folders)
 {
        EFolder *folder = value;
 
-       d(g_print ("%s(%d):%s: key=[%s]\t folder-path=[%s]\n", __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION, 
+       d(g_print ("%s(%d):%s: key=[%s]\t folder-path=[%s]\n", __FILE__, __LINE__, G_GNUC_PRETTY_FUNCTION,
                   key, e_folder_exchange_get_path (folder)));
 
        /* Each folder appears under three different keys, but
         * we only want to add it to the results array once. So
         * we only add when we see the "path" key.
         */
-       if (!strcmp (key, e_folder_exchange_get_path (folder))) 
+       if (!strcmp (key, e_folder_exchange_get_path (folder)))
                g_ptr_array_add (folders, folder);
 }
 
@@ -1940,7 +1940,7 @@ exchange_account_get_folders (ExchangeAccount *account)
               sizeof (EFolder *), folder_comparator);
 
        return folders;
-}      
+}
 
 /**
  * exchange_account_get_folder_tree:
@@ -1987,7 +1987,7 @@ exchange_account_get_folder_tree (ExchangeAccount *account, char* path)
        g_free (fld_tree);
 
        return folders;
-}      
+}
 
 /**
  * exchange_account_get_quota_limit:
@@ -2021,7 +2021,7 @@ char *
 exchange_account_get_username (ExchangeAccount *account)
 {
        g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
-       
+
        return account->priv->username;
 }
 
@@ -2029,7 +2029,7 @@ exchange_account_get_username (ExchangeAccount *account)
   * exchange_account_get_email_id :
   * @account : #ExchangeAccount
   *
-  * Retunrs user's e-mail id. 
+  * Retunrs user's e-mail id.
   *
   * Return value : e-mail id string.
   **/
@@ -2039,12 +2039,12 @@ exchange_account_get_email_id (ExchangeAccount *account)
        g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
 
        return account->priv->identity_email;
-} 
+}
 
 /**
   * exchange_account_folder_size_add :
   * @account : #ExchangeAccount
-  * @folder_name : 
+  * @folder_name :
   * @size : Size of @folder_name
   *
   * Updates the #ExchangeFolderSize object with the @size of @folder_name
@@ -2064,7 +2064,7 @@ exchange_account_folder_size_add (ExchangeAccount *account,
 /**
   * exchange_account_folder_size_remove :
   * @account : #ExchangeAccount
-  * @folder_name : 
+  * @folder_name :
   *
   * Removes the entry for @folder_name in #ExchangeFolderSize object
   *
@@ -2090,7 +2090,7 @@ exchange_account_folder_size_remove (ExchangeAccount *account,
   *
   * Return value : void
   **/
-void 
+void
 exchange_account_folder_size_rename (ExchangeAccount *account,
                                        const char *old_name,
                                        const char *new_name)
@@ -2104,7 +2104,7 @@ exchange_account_folder_size_rename (ExchangeAccount *account,
        if (cached_size >= 0) {
                exchange_folder_size_remove (account->priv->fsize, old_name);
                exchange_folder_size_update (account->priv->fsize,
-                                               new_name, cached_size);         
+                                               new_name, cached_size);
        }
 
 }
@@ -2153,7 +2153,7 @@ exchange_account_new (EAccountList *account_list, EAccount *adata)
 {
        ExchangeAccount *account;
        char *enc_user, *mailbox;
-       const char *param, *proto="http", *owa_path, *pf_server, *owa_url; 
+       const char *param, *proto="http", *owa_path, *pf_server, *owa_url;
        const char *passwd_exp_warn_period, *offline_sync;
        E2kUri *uri;
 
@@ -2203,10 +2203,10 @@ exchange_account_new (EAccountList *account_list, EAccount *adata)
         * password from this to source_uri.
         * old_uri_authority = g_strdup_printf ("%s@%s", enc_user,
         *                                      uri->host);
-        * old_uri_authority needs to be used in the key for migrating 
+        * old_uri_authority needs to be used in the key for migrating
         * passwords remembered.
         */
-       account->priv->password_key = g_strdup_printf ("exchange://%s/", 
+       account->priv->password_key = g_strdup_printf ("exchange://%s/",
                                                        account->priv->uri_authority);
 
        account->priv->username = g_strdup (uri->user);
@@ -2226,7 +2226,7 @@ exchange_account_new (EAccountList *account_list, EAccount *adata)
                if (param)
                        account->priv->ad_limit = atoi (param);
        }
-       
+
        passwd_exp_warn_period = e2k_uri_get_param (uri, "passwd_exp_warn_period");
        if (!passwd_exp_warn_period || !*passwd_exp_warn_period)
                account->priv->passwd_exp_warn_period = -1;
@@ -2234,9 +2234,9 @@ exchange_account_new (EAccountList *account_list, EAccount *adata)
                account->priv->passwd_exp_warn_period = atoi (passwd_exp_warn_period);
 
        offline_sync = e2k_uri_get_param (uri, "offline_sync");
-       if (!offline_sync) 
+       if (!offline_sync)
                account->priv->offline_sync = FALSE;
-       else 
+       else
                account->priv->offline_sync = TRUE;
 
        owa_path = e2k_uri_get_param (uri, "owa_path");
@@ -2249,7 +2249,7 @@ exchange_account_new (EAccountList *account_list, EAccount *adata)
        if (!pf_server || !*pf_server)
                pf_server = uri->host;
 
-       /* We set protocol reading owa_url, instead of having use_ssl parameter 
+       /* We set protocol reading owa_url, instead of having use_ssl parameter
         * because we don't have SSL section anymore in the account creation
         * druid and account editor
         */
@@ -2257,7 +2257,7 @@ exchange_account_new (EAccountList *account_list, EAccount *adata)
 
        owa_url = e2k_uri_get_param (uri, "owa_url");
        if (owa_url) {
-               account->priv->owa_url = g_strdup (owa_url); 
+               account->priv->owa_url = g_strdup (owa_url);
                if (!strncmp (owa_url, "https:", 6))
                        proto = "https";
        }
@@ -2306,17 +2306,17 @@ exchange_account_new (EAccountList *account_list, EAccount *adata)
  * @account: an #ExchangeAccount
  * @type: Hierarchy type
  *
- * Returns the non-foreign hierarchy pointer for the requested type 
+ * Returns the non-foreign hierarchy pointer for the requested type
  *
  * Return value: Returns the hierarchy pointer for the requested type
  **/
 
 ExchangeHierarchy*
-exchange_account_get_hierarchy_by_type (ExchangeAccount* acct, 
+exchange_account_get_hierarchy_by_type (ExchangeAccount* acct,
                                        ExchangeHierarchyType type)
 {
        int i;
-       
+
        g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (acct), NULL);
        g_return_val_if_fail (type != EXCHANGE_HIERARCHY_FOREIGN, NULL);
 
index c7b136d..236cf5f 100644 (file)
@@ -118,7 +118,7 @@ ExchangeAccountResult exchange_account_set_password              (ExchangeAccount  *acc
 
 void                  exchange_account_forget_password       (ExchangeAccount  *acct);
 
-void                  exchange_account_set_save_password    (ExchangeAccount *account, 
+void                  exchange_account_set_save_password    (ExchangeAccount *account,
                                                              gboolean save_password);
 
 gboolean              exchange_account_is_save_password     (ExchangeAccount *account);
@@ -195,7 +195,7 @@ void                        exchange_account_folder_size_rename (ExchangeAccount *account,
                                                             const char *old_name,
                                                             const char *new_name);
 GtkListStore          *exchange_account_folder_size_get_model (ExchangeAccount *account);
-void                   exchange_account_scan_foreign_hierarchy (ExchangeAccount *account, 
+void                   exchange_account_scan_foreign_hierarchy (ExchangeAccount *account,
                                                              const char *user_email);
 
 
index e4cb6ac..f73e55c 100644 (file)
@@ -33,9 +33,9 @@
 static gboolean is_offline (void);
 
 void
-add_folder_esource (ExchangeAccount *account, 
-                   FolderType folder_type, 
-                   const char *folder_name, 
+add_folder_esource (ExchangeAccount *account,
+                   FolderType folder_type,
+                   const char *folder_name,
                    const char *physical_uri)
 {
        ESource *source = NULL;
@@ -57,9 +57,9 @@ add_folder_esource (ExchangeAccount *account,
 
        /* Unset the flag */
        folder_type = folder_type & ~FORIEGN_FOLDER_FLAG;
-       
+
        if (folder_type == EXCHANGE_CONTACTS_FOLDER) {
-               source_list = e_source_list_new_for_gconf ( client, 
+               source_list = e_source_list_new_for_gconf ( client,
                                                        CONF_KEY_CONTACTS);
                /* Modify the URI handling of Contacts to the same way as calendar and tasks */
                if (!g_str_has_prefix (physical_uri, "gal://")) {
@@ -67,7 +67,7 @@ add_folder_esource (ExchangeAccount *account,
                }
        }
        else if (folder_type == EXCHANGE_CALENDAR_FOLDER) {
-               source_list = e_source_list_new_for_gconf ( client, 
+               source_list = e_source_list_new_for_gconf ( client,
                                                        CONF_KEY_CAL);
                relative_uri = g_strdup (physical_uri + strlen (EXCHANGE_URI_PREFIX));
                is_contacts_folder = FALSE;
@@ -84,9 +84,9 @@ add_folder_esource (ExchangeAccount *account,
        useremail = exchange_account_get_email_id (account);
        authtype = exchange_account_get_authtype (account);
 
-        if ((source_group = e_source_list_peek_group_by_name (source_list, 
+        if ((source_group = e_source_list_peek_group_by_name (source_list,
                                        account->account_name)) == NULL) {
-               source_group = e_source_group_new (account->account_name, 
+               source_group = e_source_group_new (account->account_name,
                                                   EXCHANGE_URI_PREFIX);
                if (!e_source_list_add_group (source_list, source_group, -1)) {
                        g_object_unref (source_list);
@@ -106,11 +106,11 @@ add_folder_esource (ExchangeAccount *account,
 
                if (mode == OFFLINE_MODE) {
                        /* If account is marked for offline sync during account
-                        * creation, mark all the folders for offline sync 
+                        * creation, mark all the folders for offline sync
                         */
                        e_source_set_property (source, "offline_sync", "1");
                }
-               
+
                if (foriegn_folder && (folder_type != EXCHANGE_CONTACTS_FOLDER)) {
                        e_source_set_property (source, "alarm", "never");
                        e_source_set_property (source, "foreign", "1");
@@ -131,7 +131,7 @@ add_folder_esource (ExchangeAccount *account,
        }
        else {
                 /* source group already exists*/
-               if((source = e_source_group_peek_source_by_name (source_group, 
+               if((source = e_source_group_peek_source_by_name (source_group,
                                                        folder_name)) == NULL) {
                        printf("old group, new source\n");
                        if (is_contacts_folder && g_str_has_prefix (physical_uri, "gal://")) {
@@ -184,25 +184,25 @@ add_folder_esource (ExchangeAccount *account,
                /* Select the folder created */
                if (folder_type == EXCHANGE_CALENDAR_FOLDER && !offline_flag) {
                        ids = gconf_client_get_list (client,
-                                            CONF_KEY_SELECTED_CAL_SOURCES, 
+                                            CONF_KEY_SELECTED_CAL_SOURCES,
                                             GCONF_VALUE_STRING, NULL);
-                       ids = g_slist_append (ids, 
+                       ids = g_slist_append (ids,
                                        g_strdup (e_source_peek_uid (source)));
                        gconf_client_set_list (client,
-                                      CONF_KEY_SELECTED_CAL_SOURCES, 
+                                      CONF_KEY_SELECTED_CAL_SOURCES,
                                       GCONF_VALUE_STRING, ids, NULL);
                        g_slist_foreach (ids, (GFunc) g_free, NULL);
                        g_slist_free (ids);
                }
                else if (folder_type == EXCHANGE_TASKS_FOLDER && !offline_flag) {
-                       ids = gconf_client_get_list (client, 
-                                            CONF_KEY_SELECTED_TASKS_SOURCES, 
+                       ids = gconf_client_get_list (client,
+                                            CONF_KEY_SELECTED_TASKS_SOURCES,
                                             GCONF_VALUE_STRING, NULL);
 
-                       ids = g_slist_append (ids, 
+                       ids = g_slist_append (ids,
                                        g_strdup (e_source_peek_uid (source)));
-                       gconf_client_set_list (client,  
-                                      CONF_KEY_SELECTED_TASKS_SOURCES, 
+                       gconf_client_set_list (client,
+                                      CONF_KEY_SELECTED_TASKS_SOURCES,
                                       GCONF_VALUE_STRING, ids, NULL);
                        g_slist_foreach (ids, (GFunc) g_free, NULL);
                        g_slist_free (ids);
@@ -212,7 +212,7 @@ add_folder_esource (ExchangeAccount *account,
        g_free (relative_uri);
        g_free (authtype);
 
-       if (source_new) 
+       if (source_new)
                g_object_unref (source);
        if (group_new)
                g_object_unref (source_group);
@@ -220,9 +220,9 @@ add_folder_esource (ExchangeAccount *account,
        g_object_unref (client);
 }
 
-void 
-remove_folder_esource (ExchangeAccount *account, 
-                      FolderType folder_type, 
+void
+remove_folder_esource (ExchangeAccount *account,
+                      FolderType folder_type,
                       const char *physical_uri)
 {
        ESourceGroup *group;
@@ -240,11 +240,11 @@ remove_folder_esource (ExchangeAccount *account,
 
        /* Remove ESource for a given folder */
        if (folder_type == EXCHANGE_CONTACTS_FOLDER) {
-               source_list = e_source_list_new_for_gconf ( client, 
+               source_list = e_source_list_new_for_gconf ( client,
                                                        CONF_KEY_CONTACTS);
        }
        else if (folder_type == EXCHANGE_CALENDAR_FOLDER) {
-               source_list = e_source_list_new_for_gconf ( client, 
+               source_list = e_source_list_new_for_gconf ( client,
                                                        CONF_KEY_CAL);
                is_contacts_folder = FALSE;
        }
@@ -253,7 +253,7 @@ remove_folder_esource (ExchangeAccount *account,
                                                        CONF_KEY_TASKS);
                is_contacts_folder = FALSE;
        }
-       
+
        groups = e_source_list_peek_groups (source_list);
        found_group = FALSE;
 
@@ -267,17 +267,17 @@ remove_folder_esource (ExchangeAccount *account,
                        sources = e_source_group_peek_sources (group);
 
                        for( ; sources != NULL; sources = g_slist_next (sources)) {
-                               
+
                                source = E_SOURCE (sources->data);
                                read_uri = e_source_get_uri (source);
 
-                               if (strcmp (read_uri, physical_uri) == 0) { 
+                               if (strcmp (read_uri, physical_uri) == 0) {
 
                                        source_uid = e_source_peek_uid (source);
                                        /* Folder Deleted - Remove only the source */
                                        /*
                                        e_source_group_remove_source_by_uid (
-                                                               group, 
+                                                               group,
                                                                source_uid);
                                        */
                                        e_source_group_remove_source (
@@ -288,16 +288,16 @@ remove_folder_esource (ExchangeAccount *account,
                                                /* Remove from the selected folders */
                                                if (folder_type == EXCHANGE_CALENDAR_FOLDER) {
                                                        ids = gconf_client_get_list (
-                                                                       client, 
-                                                                       CONF_KEY_SELECTED_CAL_SOURCES, 
+                                                                       client,
+                                                                       CONF_KEY_SELECTED_CAL_SOURCES,
                                                                        GCONF_VALUE_STRING, NULL);
                                                        if (ids) {
-                                                               node_to_be_deleted = g_slist_find_custom (ids, 
-                                                                                       source_uid, 
+                                                               node_to_be_deleted = g_slist_find_custom (ids,
+                                                                                       source_uid,
                                                                                        (GCompareFunc) strcmp);
                                                                if (node_to_be_deleted) {
                                                                        g_free (node_to_be_deleted->data);
-                                                                       ids = g_slist_delete_link (ids, 
+                                                                       ids = g_slist_delete_link (ids,
                                                                                        node_to_be_deleted);
                                                                }
                                                        }
@@ -307,16 +307,16 @@ remove_folder_esource (ExchangeAccount *account,
                                                        g_slist_free (ids);
                                                }
                                                else if (folder_type == EXCHANGE_TASKS_FOLDER) {
-                                                       ids = gconf_client_get_list (client, 
-                                                                       CONF_KEY_SELECTED_TASKS_SOURCES, 
+                                                       ids = gconf_client_get_list (client,
+                                                                       CONF_KEY_SELECTED_TASKS_SOURCES,
                                                                        GCONF_VALUE_STRING, NULL);
                                                        if (ids) {
-                                                               node_to_be_deleted = g_slist_find_custom (ids, 
-                                                                                       source_uid, 
+                                                               node_to_be_deleted = g_slist_find_custom (ids,
+                                                                                       source_uid,
                                                                                        (GCompareFunc) strcmp);
                                                                if (node_to_be_deleted) {
                                                                        g_free (node_to_be_deleted->data);
-                                                                       ids = g_slist_delete_link (ids, 
+                                                                       ids = g_slist_delete_link (ids,
                                                                                        node_to_be_deleted);
                                                                }
                                                        }
@@ -337,8 +337,8 @@ remove_folder_esource (ExchangeAccount *account,
        g_object_unref (client);
 }
 
-static gboolean 
-is_offline (void) 
+static gboolean
+is_offline (void)
 {
        GConfClient *client;
        GConfValue *value;
index 021652a..4efc318 100644 (file)
@@ -47,7 +47,7 @@ typedef struct {
 
 
 struct _ExchangeFolderSizePrivate {
-       
+
        GHashTable *table;
        GtkListStore *model;
        GHashTable *row_refs;
@@ -141,7 +141,7 @@ exchange_folder_size_new (void)
 }
 
 void
-exchange_folder_size_update (ExchangeFolderSize *fsize, 
+exchange_folder_size_update (ExchangeFolderSize *fsize,
                                const char *folder_name,
                                gdouble folder_size)
 {
@@ -178,14 +178,14 @@ exchange_folder_size_update (ExchangeFolderSize *fsize,
                f_info = g_new0(folder_info, 1);
                f_info->folder_name = g_strdup (folder_name);
                f_info->folder_size = folder_size;
-               g_hash_table_insert (folder_size_table, f_info->folder_name, f_info); 
+               g_hash_table_insert (folder_size_table, f_info->folder_name, f_info);
 
                gtk_list_store_append (fsize->priv->model, &iter);
                gtk_list_store_set (fsize->priv->model, &iter,
                                      COLUMN_NAME, f_info->folder_name,
                                      COLUMN_SIZE, f_info->folder_size,
                                      -1);
-               
+
                path = gtk_tree_model_get_path (GTK_TREE_MODEL (fsize->priv->model), &iter);
                row = gtk_tree_row_reference_new (GTK_TREE_MODEL (fsize->priv->model), path);
                gtk_tree_path_free (path);
@@ -195,7 +195,7 @@ exchange_folder_size_update (ExchangeFolderSize *fsize,
 }
 
 void
-exchange_folder_size_remove (ExchangeFolderSize *fsize, 
+exchange_folder_size_remove (ExchangeFolderSize *fsize,
                                const char *folder_name)
 {
        ExchangeFolderSizePrivate *priv;
@@ -233,7 +233,7 @@ exchange_folder_size_get (ExchangeFolderSize *fsize,
        folder_info *cached_info;
 
        g_return_val_if_fail (EXCHANGE_IS_FOLDER_SIZE (fsize), -1);
-       
+
        priv = fsize->priv;
        folder_size_table = priv->table;
 
index b6c72db..c33166a 100644 (file)
@@ -134,7 +134,7 @@ get_hrefs (ExchangeHierarchySomeDAV *hsd)
         * permanent_urls. Unfortunately it doesn't seem to be possible
         * to BPROPFIND a group of permanent_urls.
         */
-       iter = e2k_context_search_start (ctx, NULL, hfav->priv->shortcuts_uri, 
+       iter = e2k_context_search_start (ctx, NULL, hfav->priv->shortcuts_uri,
                                         shortcuts_props, n_shortcuts_props,
                                         NULL, NULL, TRUE);
        while ((result = e2k_result_iter_next (iter))) {
@@ -169,7 +169,7 @@ get_hrefs (ExchangeHierarchySomeDAV *hsd)
        }
 
        return hrefs;
-}      
+}
 /**
  * exchange_hierarchy_favorites_is_added:
  * @hier: the hierarchy
@@ -189,7 +189,7 @@ exchange_hierarchy_favorites_is_added (ExchangeHierarchy *hier, EFolder *folder)
 
        folder_uri = e_folder_exchange_get_internal_uri (folder);
        shortcut_uri = g_hash_table_lookup (hfav->priv->shortcuts, folder_uri);
-       
+
        return shortcut_uri ? TRUE : FALSE;
 }
 
@@ -236,7 +236,7 @@ remove_folder (ExchangeHierarchy *hier, EFolder *folder)
                                               physical_uri);
                }
        }
-       
+
        return exchange_hierarchy_webdav_status_to_folder_result (status);
 }
 
@@ -269,7 +269,7 @@ exchange_hierarchy_favorites_add_folder (ExchangeHierarchy *hier,
        props = e2k_properties_new ();
        e2k_properties_set_string (props, PR_FAV_DISPLAY_NAME,
                                   g_strdup (e_folder_get_name (folder)));
-       if (permanent_uri)      
+       if (permanent_uri)
                e2k_properties_set_binary (props, PR_FAV_PUBLIC_SOURCE_KEY,
                                   e2k_permanenturl_to_entryid (permanent_uri));
        e2k_properties_set_int (props, PR_FAV_LEVEL_MASK, 1);
index 3794361..6438768 100644 (file)
@@ -436,7 +436,7 @@ exchange_hierarchy_foreign_add_folder (ExchangeHierarchy *hier,
                /* Add the esources */
                folder_type = e_folder_get_type_string (*folder);
                physical_uri = e_folder_get_physical_uri (*folder);
-               new_folder_name = g_strdup_printf("%s's %s", 
+               new_folder_name = g_strdup_printf("%s's %s",
                                        hier->owner_name, folder_name);
 
                if (!(strcmp (folder_type, "calendar")) ||
@@ -527,7 +527,7 @@ exchange_hierarchy_foreign_new (ExchangeAccount *account,
        xmlDoc *doc;
 
        g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
-       
+
        hier = hierarchy_foreign_new (account, hierarchy_name,
                                      physical_uri_prefix,
                                      internal_uri_prefix,
index dc036fb..844bbaa 100644 (file)
@@ -60,9 +60,9 @@ exchange_hierarchy_gal_new (ExchangeAccount *account,
                                      EXCHANGE_HIERARCHY_GAL, toplevel,
                                      NULL, NULL, NULL);
        /* Add ESource */
-       add_folder_esource (hier->account, EXCHANGE_CONTACTS_FOLDER, 
+       add_folder_esource (hier->account, EXCHANGE_CONTACTS_FOLDER,
                            hierarchy_name, physical_uri_prefix);
-       
+
        g_object_unref (toplevel);
 
        return hier;
index 47f6158..bbd0c55 100644 (file)
@@ -133,7 +133,7 @@ scan_subtree (ExchangeHierarchy *hier, EFolder *folder, int mode)
        EFolder *iter_folder = NULL;
 
        /* FIXME : Temporarily allow a rescan of the hierarchy. The proper fix
-       is to handle the folder list either in ExchangeAccount or in the 
+       is to handle the folder list either in ExchangeAccount or in the
        plugins/exchange backend separately by listening to signals.
        if (hsd->priv->scanned || folder != hier->toplevel) */
        if (folder != hier->toplevel)
@@ -229,7 +229,7 @@ exchange_hierarchy_somedav_add_folder (ExchangeHierarchySomeDAV *hsd,
                                EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
        g_return_val_if_fail (uri != NULL,
                                EXCHANGE_ACCOUNT_FOLDER_GENERIC_ERROR);
-        
+
        hwd = EXCHANGE_HIERARCHY_WEBDAV (hsd);
        hier = EXCHANGE_HIERARCHY (hsd);
        ctx = exchange_account_get_context (hier->account);
index c9b37bf..d56c1fd 100644 (file)
@@ -183,7 +183,7 @@ hierarchy_new_folder (ExchangeHierarchy *hier, EFolder *folder,
 {
        const char *internal_uri ;
        char *mf_path;
-       
+
        g_return_if_fail (E_IS_FOLDER (folder));
        internal_uri = e_folder_exchange_get_internal_uri (folder);
 
@@ -249,7 +249,7 @@ e_folder_webdav_new (ExchangeHierarchy *hier, const char *internal_uri,
                real_type = g_strdup ("calendar/public"); /* Hack */
        else
                real_type = g_strdup (type);
-       
+
        fixed_name = e2k_uri_encode (name, FALSE, URI_ENCODE_CHARS);
        physical_uri = e2k_uri_concat (e_folder_get_physical_uri (parent), fixed_name);
        g_free (fixed_name);
@@ -282,7 +282,7 @@ e_folder_webdav_new (ExchangeHierarchy *hier, const char *internal_uri,
                d(g_print ("exchange-hierarchy-webdave.c:e_folder_webdave_new: http_uri=[%s], new_internal_uri=[%s], temp_name=[%s], name[%s]\n",
                           http_uri, new_internal_uri, temp_name, name));
                g_free (temp_name);
-       
+
                folder = e_folder_exchange_new (hier, name,
                                                real_type, outlook_class,
                                                physical_uri, http_uri);
@@ -340,7 +340,7 @@ create_folder (ExchangeHierarchy *hier, EFolder *parent,
                exchange_hierarchy_new_folder (hier, dest);
                g_object_unref (dest);
 
-               /* update the folder size table, new folder, initialize the size to 0 */ 
+               /* update the folder size table, new folder, initialize the size to 0 */
                exchange_account_folder_size_add (hier->account, name, 0);
                return EXCHANGE_ACCOUNT_FOLDER_OK;
        }
@@ -365,7 +365,7 @@ remove_folder (ExchangeHierarchy *hier, EFolder *folder)
         exchange_account_is_offline (hier->account, &mode);
 
         if (mode != ONLINE_MODE)
-                return EXCHANGE_ACCOUNT_FOLDER_OFFLINE; 
+                return EXCHANGE_ACCOUNT_FOLDER_OFFLINE;
 
        if (folder == hier->toplevel)
                return EXCHANGE_ACCOUNT_FOLDER_PERMISSION_DENIED;
@@ -375,7 +375,7 @@ remove_folder (ExchangeHierarchy *hier, EFolder *folder)
                exchange_hierarchy_removed_folder (hier, folder);
 
                /* update the folder size info */
-               exchange_account_folder_size_remove (hier->account, 
+               exchange_account_folder_size_remove (hier->account,
                                        e_folder_get_name(folder));
                return EXCHANGE_ACCOUNT_FOLDER_OK;
        } else
@@ -423,24 +423,24 @@ xfer_folder (ExchangeHierarchy *hier, EFolder *source,
                g_object_unref (dest);
                ret_code = EXCHANGE_ACCOUNT_FOLDER_OK;
 
-               /* Find if folder movement or rename.  
+               /* Find if folder movement or rename.
                 * update folder size in case of rename.
                 */
 
                source_folder_name = strrchr (physical_uri, '/') + 1;
-               source_parent = g_strndup (physical_uri, 
-                                          source_folder_name - physical_uri); 
+               source_parent = g_strndup (physical_uri,
+                                          source_folder_name - physical_uri);
                if (!strcmp (e_folder_get_physical_uri (dest_parent), source_parent)) {
-                       /* rename - remove folder entry from hash, and 
-                        * update the hash table with new name 
+                       /* rename - remove folder entry from hash, and
+                        * update the hash table with new name
                         */
-                       exchange_account_folder_size_rename (hier->account, 
+                       exchange_account_folder_size_rename (hier->account,
                                source_folder_name+1, dest_name);
                }
                g_free (source_parent);
        } else {
                physical_uri = e2k_uri_concat (
-                               e_folder_get_physical_uri (dest_parent), 
+                               e_folder_get_physical_uri (dest_parent),
                                dest_name);
                g_object_unref (dest);
                if (status == E2K_HTTP_FORBIDDEN ||
@@ -451,25 +451,25 @@ xfer_folder (ExchangeHierarchy *hier, EFolder *source,
        }
 
        /* Remove the ESource of the source folder, in case of rename/move */
-       if ((hier->type == EXCHANGE_HIERARCHY_PERSONAL || 
-            hier->type == EXCHANGE_HIERARCHY_FAVORITES) && remove_source && 
+       if ((hier->type == EXCHANGE_HIERARCHY_PERSONAL ||
+            hier->type == EXCHANGE_HIERARCHY_FAVORITES) && remove_source &&
             ret_code == EXCHANGE_ACCOUNT_FOLDER_OK) {
-               
+
                if ((strcmp (folder_type, "calendar") == 0) ||
                    (strcmp (folder_type, "calendar/public") == 0)) {
-                       remove_folder_esource (hier->account, 
+                       remove_folder_esource (hier->account,
                                               EXCHANGE_CALENDAR_FOLDER,
                                               physical_uri);
                }
                else if ((strcmp (folder_type, "tasks") == 0) ||
                         (strcmp (folder_type, "tasks/public") == 0)){
-                       remove_folder_esource (hier->account, 
+                       remove_folder_esource (hier->account,
                                               EXCHANGE_TASKS_FOLDER,
                                               physical_uri);
                }
                else if ((strcmp (folder_type, "contacts") == 0) ||
                         (strcmp (folder_type, "contacts/public") == 0)) {
-                       remove_folder_esource (hier->account, 
+                       remove_folder_esource (hier->account,
                                               EXCHANGE_CONTACTS_FOLDER,
                                               physical_uri);
                }
@@ -483,12 +483,12 @@ static void
 add_href (gpointer path, gpointer folder, gpointer hrefs)
 {
        const char *folder_type;
-       
+
        folder_type = e_folder_get_type_string (folder);
 
        if (!folder_type)
                return;
-       
+
        if (!strcmp (folder_type, "noselect"))
                return;
 
@@ -557,10 +557,10 @@ rescan (ExchangeHierarchy *hier)
                if (folder_size) {
                        folder_name = e_folder_get_name (folder);
                        fsize_d = g_ascii_strtod (folder_size, NULL)/1024;
-                       exchange_account_folder_size_add (hier->account, 
+                       exchange_account_folder_size_add (hier->account,
                                                        folder_name, fsize_d);
                        if (personal)
-                               hwd->priv->total_folder_size = 
+                               hwd->priv->total_folder_size =
                                        hwd->priv->total_folder_size + fsize_d;
                }
        }
@@ -602,7 +602,7 @@ exchange_hierarchy_webdav_parse_folder (ExchangeHierarchyWebDAV *hwd,
 
        g_return_val_if_fail (EXCHANGE_IS_HIERARCHY_WEBDAV (hwd), NULL);
        g_return_val_if_fail (E_IS_FOLDER (parent), NULL);
-       
+
        /* It's possible to have a localized inbox folder named, eg,
         * "Innboks", with children whose URIs go through "Inbox"
         * instead. (See bugzilla 27065.) This is probably related to
@@ -637,11 +637,11 @@ exchange_hierarchy_webdav_parse_folder (ExchangeHierarchyWebDAV *hwd,
                outlook_class = folder_type->contentclass;
 
        /*
-        * The permanenturl Field provides a unique identifier for an item 
-        * across the *store* and will not change as long as the item remains 
-        * in the same folder. The permanenturl Field contains the ID of the 
-        * parent folder of the item, which changes when the item is moved to a 
-        * different folder or deleted. Changing a field on an item will not 
+        * The permanenturl Field provides a unique identifier for an item
+        * across the *store* and will not change as long as the item remains
+        * in the same folder. The permanenturl Field contains the ID of the
+        * parent folder of the item, which changes when the item is moved to a
+        * different folder or deleted. Changing a field on an item will not
         * change the permanenturl Field and neither will adding more items to
         * the folder with the same display name or message subject.
         */
@@ -659,8 +659,8 @@ exchange_hierarchy_webdav_parse_folder (ExchangeHierarchyWebDAV *hwd,
        if (hassubs)
                e_folder_exchange_set_has_subfolders (folder, TRUE);
        if (permanenturl) {
-               /* Favorite folders and subscribed folders will not have 
-                * permanenturl 
+               /* Favorite folders and subscribed folders will not have
+                * permanenturl
                 */
                e_folder_exchange_set_permanent_uri (folder, permanenturl);
        }
@@ -727,7 +727,7 @@ scan_subtree (ExchangeHierarchy *hier, EFolder *parent, int mode)
                return EXCHANGE_ACCOUNT_FOLDER_OK;
        }
 
-       
+
        if (!folders_rn) {
                folders_rn =
                        e2k_restriction_andv (
@@ -738,9 +738,9 @@ scan_subtree (ExchangeHierarchy *hier, EFolder *parent, int mode)
                                NULL);
        }
 
-       if (hier->type == EXCHANGE_HIERARCHY_PUBLIC) 
+       if (hier->type == EXCHANGE_HIERARCHY_PUBLIC)
                iter = e_folder_exchange_search_start (parent, NULL,
-                                                      pub_folder_props, 
+                                                      pub_folder_props,
                                                       n_pub_folder_props,
                                                       folders_rn, NULL, TRUE);
        else
@@ -775,7 +775,7 @@ scan_subtree (ExchangeHierarchy *hier, EFolder *parent, int mode)
 
                if (personal) {
                        /* calculate mail box size only for personal folders */
-                       hwd->priv->total_folder_size = 
+                       hwd->priv->total_folder_size =
                                hwd->priv->total_folder_size + fsize_d;
                }
 
@@ -813,7 +813,7 @@ scan_offline_cb (const char *physical_path, const char *path, gpointer data)
        struct scan_offline_data *sod = data;
        EFolder *folder;
        char *mf_name;
-       
+
 
        mf_name = g_build_filename (physical_path, "connector-metadata.xml", NULL);
        folder = e_folder_exchange_new_from_file (sod->hier, mf_name);
@@ -864,7 +864,7 @@ exchange_hierarchy_webdav_offline_scan_subtree (ExchangeHierarchy *hier,
        dir = e_path_to_physical (hier->account->storage_dir, prefix);
        g_free (prefix);
        e_path_find_folders (dir, scan_offline_cb, &sod);
-       
+
        if (sod.badpaths) {
                for (i = 0; i < sod.badpaths->len; i++) {
                        e_path_rmdir (dir, sod.badpaths->pdata[i]);
@@ -897,7 +897,7 @@ exchange_hierarchy_webdav_construct (ExchangeHierarchyWebDAV *hwd,
 
        toplevel = e_folder_exchange_new (EXCHANGE_HIERARCHY (hwd),
                                          hierarchy_name,
-                                         "noselect", NULL, 
+                                         "noselect", NULL,
                                          physical_uri_prefix,
                                          internal_uri_prefix);
        e_folder_set_custom_icon (toplevel, "stock_folder");
index a63be1d..9a854b1 100644 (file)
@@ -145,7 +145,7 @@ exchange_hierarchy_new_folder (ExchangeHierarchy *hier,
 {
        g_return_if_fail (EXCHANGE_IS_HIERARCHY (hier));
        g_return_if_fail (E_IS_FOLDER (folder));
-       
+
        g_signal_emit (hier, signals[NEW_FOLDER], 0, folder);
 }
 
index 953e63f..8266dc2 100644 (file)
@@ -146,7 +146,7 @@ exchange_oof_get (ExchangeAccount *account, gboolean *oof, char **message)
 
                *message = g_strndup (ta_start, ta_end - ta_start);
                /* FIXME: HTML decode */
-               
+
        }
 
        return TRUE;
index b90edde..8b215d3 100644 (file)
@@ -175,7 +175,7 @@ void
 xntlm_des(XNTLM_DES_KS ks, unsigned char block[8])
 {
        guint32 left,right,work;
-       
+
        /* Read input block and place in left/right in big-endian order */
        left = ((guint32)block[0] << 24)
         | ((guint32)block[1] << 16)
@@ -187,7 +187,7 @@ xntlm_des(XNTLM_DES_KS ks, unsigned char block[8])
         | (guint32)block[7];
 
        /* Hoey's clever initial permutation algorithm, from Outerbridge
-        * (see Schneier p 478) 
+        * (see Schneier p 478)
         *
         * The convention here is the same as Outerbridge: rotate each
         * register left by 1 bit, i.e., so that "left" contains permuted
index 95a8ca3..b18abcf 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *  Jason Willis <zenbrother@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -68,7 +68,7 @@ enum {
 static const gchar *GOOGLE_CLIENT_LOGIN = "https://www.google.com/accounts/ClientLogin";
 static const gchar *GOOGLE_CLIENT_LOGIN_MSG = "Email=%s&Passwd=%s&service=%s&source=%s";
 
-void 
+void
 gdata_google_service_set_credentials (GDataService *service, const gchar *username, const gchar *password)
 {
        GDataGoogleServicePrivate *priv;
@@ -84,7 +84,7 @@ gdata_google_service_set_credentials (GDataService *service, const gchar *userna
        auth->password = g_strdup(password);
 }
 
-static gboolean 
+static gboolean
 service_is_authenticated (GDataGoogleService *service)
 {
        GDataGoogleServicePrivate *priv;
@@ -147,7 +147,7 @@ service_authenticate (GDataGoogleService *service)
        auth->token = token;
        if (!token)
                return "FAILURE";
-       
+
        g_free(request_body);
        g_free(request_body_encoded);
 
@@ -160,15 +160,15 @@ service_authenticate (GDataGoogleService *service)
 
 /**
  *
- * gdata_google_service_get_feed: 
+ * gdata_google_service_get_feed:
  * @service A GDataService Object
  * @feed_url Feed Url , the private url to send request to , needs authentication
  * @entry A GDataFeed Object
- * returns the newly inserted entry 
- * 
+ * returns the newly inserted entry
+ *
  **/
 
-GDataFeed * 
+GDataFeed *
 gdata_google_service_get_feed (GDataService *service, const gchar *feed_url)
 {
        GDataFeed *feed = NULL;
@@ -177,7 +177,7 @@ gdata_google_service_get_feed (GDataService *service, const gchar *feed_url)
        SoupSession *soup_session;
        SoupMessage *msg;
        gchar *status;
-       
+
        g_return_val_if_fail(service != NULL, NULL);
        g_return_val_if_fail(GDATA_IS_GOOGLE_SERVICE(service),NULL);
 
@@ -194,16 +194,16 @@ gdata_google_service_get_feed (GDataService *service, const gchar *feed_url)
        msg = NULL;
        msg = soup_message_new(SOUP_METHOD_GET, feed_url);
 
-       soup_message_add_header(msg->request_headers, 
+       soup_message_add_header(msg->request_headers,
                        "Authorization", (gchar *)g_strdup_printf("GoogleLogin auth=%s", auth->token));
 
-       soup_session_send_message(soup_session, msg); 
+       soup_session_send_message(soup_session, msg);
        if (msg->response.length) {
                feed = gdata_feed_new_from_xml(msg->response.body, msg->response.length);
        }
-       
+
        if (SOUP_IS_MESSAGE(msg))
-               g_object_unref(msg); 
+               g_object_unref(msg);
 
        return feed;
 }
@@ -211,12 +211,12 @@ gdata_google_service_get_feed (GDataService *service, const gchar *feed_url)
 
 /**
  *
- * gdata_google_service_insert_entry: 
+ * gdata_google_service_insert_entry:
  * @service A #GDataService Object
  * @feed_url Feed Url , this is the private url of the author which requires authentication
  * @entry A #GDataEntry Object
- * returns the newly inserted entry 
- * 
+ * returns the newly inserted entry
+ *
  **/
 GDataEntry *
 gdata_google_service_insert_entry (GDataService *service, const gchar *feed_url, GDataEntry *entry)
@@ -247,16 +247,16 @@ gdata_google_service_insert_entry (GDataService *service, const gchar *feed_url,
        msg = soup_message_new(SOUP_METHOD_POST, feed_url);
        soup_message_set_http_version (msg, SOUP_HTTP_1_0);
 
-       soup_message_add_header(msg->request_headers, 
-                               "Authorization", 
-                               (gchar *)g_strdup_printf("GoogleLogin auth=%s", 
+       soup_message_add_header(msg->request_headers,
+                               "Authorization",
+                               (gchar *)g_strdup_printf("GoogleLogin auth=%s",
                                auth->token));
 
-       soup_message_set_request (msg, 
-                               "application/atom+xml", 
-                               SOUP_BUFFER_USER_OWNED, 
-                               entry_xml, 
-                               strlen(entry_xml)); 
+       soup_message_set_request (msg,
+                               "application/atom+xml",
+                               SOUP_BUFFER_USER_OWNED,
+                               entry_xml,
+                               strlen(entry_xml));
 
        soup_session_send_message(soup_session, msg);
 
@@ -272,8 +272,8 @@ gdata_google_service_insert_entry (GDataService *service, const gchar *feed_url,
        }
 
        if (SOUP_IS_MESSAGE(msg))
-               g_object_unref (msg);   
-       
+               g_object_unref (msg);
+
        if (entry_xml)
                g_free (entry_xml);
 
@@ -283,14 +283,14 @@ gdata_google_service_insert_entry (GDataService *service, const gchar *feed_url,
 
 /**
  *
- * gdata_google_service_delete_entry: 
+ * gdata_google_service_delete_entry:
  * @service A #GDataService Object
  * @feed_url Feed Url , this is the private url of the author which requires authentication
  * @entry A #GDataEntry Object
- * Removes the entry 
- * 
+ * Removes the entry
+ *
  **/
-void 
+void
 gdata_google_service_delete_entry (GDataService *service, GDataEntry *entry)
 {
        GDataGoogleServiceAuth *auth;
@@ -299,16 +299,16 @@ gdata_google_service_delete_entry (GDataService *service, GDataEntry *entry)
        SoupMessage *msg;
        const gchar *entry_edit_url;
        xmlChar *status;
-       
+
        g_return_if_fail (service !=NULL);
        g_return_if_fail (GDATA_IS_GOOGLE_SERVICE(service));
 
        if (!service_is_authenticated (GDATA_GOOGLE_SERVICE(service))) {
                status = (xmlChar *)service_authenticate (GDATA_GOOGLE_SERVICE(service));
-               if (g_ascii_strcasecmp((gchar *)status, "SUCCESS")) 
+               if (g_ascii_strcasecmp((gchar *)status, "SUCCESS"))
                        return ;
        }
-       
+
        entry_edit_url = gdata_entry_get_edit_link (entry);
        priv = GDATA_GOOGLE_SERVICE_GET_PRIVATE (GDATA_GOOGLE_SERVICE (service));
        auth = (GDataGoogleServiceAuth *) priv->auth;
@@ -323,18 +323,18 @@ gdata_google_service_delete_entry (GDataService *service, GDataEntry *entry)
 
        if (SOUP_IS_MESSAGE(msg))
                g_object_unref (msg);
-}      
+}
 
 /**
  *
- * gdata_google_service_update_entry: 
+ * gdata_google_service_update_entry:
  * @service A GDataService Object
  * @feed_url Feed Url , this is the private url of the author which requires authentication
  * @entry A GDataEntry Object
- * updates the entry 
- * 
+ * updates the entry
+ *
  **/
-void 
+void
 gdata_google_service_update_entry (GDataService *service, GDataEntry *entry)
 {
        GDataGoogleServiceAuth *auth;
@@ -344,10 +344,10 @@ gdata_google_service_update_entry (GDataService *service, GDataEntry *entry)
        gchar *status;
        gchar *entry_xml;
        const gchar *entry_edit_url;
-       
+
        g_return_if_fail (service !=NULL);
        g_return_if_fail (GDATA_IS_GOOGLE_SERVICE (service));
-       
+
        if (!service_is_authenticated (GDATA_GOOGLE_SERVICE (service))) {
                status = service_authenticate (GDATA_GOOGLE_SERVICE (service));
                if (g_ascii_strcasecmp (status, "SUCCESS"))
@@ -371,14 +371,14 @@ gdata_google_service_update_entry (GDataService *service, GDataEntry *entry)
                                "Authorization",
                                (gchar *)g_strdup_printf ("GoogleLogin auth=%s",
                                auth->token));
-       soup_message_set_request (msg, 
-                       "application/atom+xml", 
-                       SOUP_BUFFER_USER_OWNED, 
-                       entry_xml, 
-                       strlen(entry_xml)); 
+       soup_message_set_request (msg,
+                       "application/atom+xml",
+                       SOUP_BUFFER_USER_OWNED,
+                       entry_xml,
+                       strlen(entry_xml));
 
        soup_session_send_message (soup_session, msg);
-       
+
        if (SOUP_IS_MESSAGE(msg))
                g_object_unref (msg);
        if (entry_xml)
@@ -388,14 +388,14 @@ gdata_google_service_update_entry (GDataService *service, GDataEntry *entry)
 
 /**
  *
- * gdata_google_update_entry_with_link: 
+ * gdata_google_update_entry_with_link:
  * @service A #GDataService Object
- * @edit_link url of the edit link of the entry 
+ * @edit_link url of the edit link of the entry
  * @entry A #GDataEntry Object
- * Updates the entry 
- * 
+ * Updates the entry
+ *
  **/
-void 
+void
 gdata_google_service_update_entry_with_link (GDataService *service, GDataEntry *entry, gchar *edit_link)
 {
        GDataGoogleServiceAuth *auth;
@@ -404,10 +404,10 @@ gdata_google_service_update_entry_with_link (GDataService *service, GDataEntry *
        SoupMessage *msg;
        gchar *status;
        gchar *entry_xml;
-       
+
        g_return_if_fail (service !=NULL);
        g_return_if_fail (GDATA_IS_GOOGLE_SERVICE (service));
-       
+
        if (!service_is_authenticated (GDATA_GOOGLE_SERVICE(service))) {
                status = service_authenticate (GDATA_GOOGLE_SERVICE(service));
                if (g_ascii_strcasecmp (status, "SUCCESS"))
@@ -431,16 +431,16 @@ gdata_google_service_update_entry_with_link (GDataService *service, GDataEntry *
                                (gchar *)g_strdup_printf ("GoogleLogin auth=%s",
                                auth->token));
 
-       soup_message_set_request (msg, 
-                               "application/atom+xml", 
-                               SOUP_BUFFER_USER_OWNED, 
-                               entry_xml, 
-                               strlen(entry_xml)); 
+       soup_message_set_request (msg,
+                               "application/atom+xml",
+                               SOUP_BUFFER_USER_OWNED,
+                               entry_xml,
+                               strlen(entry_xml));
 
        soup_session_send_message (soup_session, msg);
 
-       if (SOUP_IS_MESSAGE(msg)) 
-               g_object_unref (msg);   
+       if (SOUP_IS_MESSAGE(msg))
+               g_object_unref (msg);
        if (entry_xml)
                g_free (entry_xml);
 }
@@ -546,7 +546,7 @@ static void gdata_google_service_get_property (GObject *obj,
        priv = GDATA_GOOGLE_SERVICE_GET_PRIVATE(obj);
 
        switch (property_id) {
-               case PROP_NAME: 
+               case PROP_NAME:
                        g_value_set_string(value, priv->name);
                        break;
                case PROP_AGENT:
@@ -632,7 +632,7 @@ GType  gdata_google_service_get_type (void)
 
        if (G_UNLIKELY(type == 0))
        {
-               static const GTypeInfo info = 
+               static const GTypeInfo info =
                {
                        sizeof (GDataGoogleServiceClass),
                        NULL,   /* base_init */
@@ -645,7 +645,7 @@ GType  gdata_google_service_get_type (void)
                        gdata_google_service_instance_init    /* instance_init */
                };
 
-               static const GInterfaceInfo gdata_google_service_iface_info = 
+               static const GInterfaceInfo gdata_google_service_iface_info =
                {
                        (GInterfaceInitFunc) gdata_google_service_iface_init, /* interface_init */
                        NULL,         /* interface_finalize */
@@ -669,16 +669,16 @@ GType  gdata_google_service_get_type (void)
 
 /**
  *
- * gdata_google_service_new: 
- * @service_name  
- * @agent 
+ * gdata_google_service_new:
+ * @service_name
+ * @agent
  * Returns a new #GDataGoogleService Object
- * 
+ *
  **/
 GDataGoogleService *
 gdata_google_service_new(const gchar *service_name, const gchar *agent)
 {
-       return g_object_new(GDATA_TYPE_GOOGLE_SERVICE, 
+       return g_object_new(GDATA_TYPE_GOOGLE_SERVICE,
                        "name", service_name,
                        "agent",agent,
                        NULL);
index 9894358..5f78da7 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *  Jason Willis <zenbrother@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -48,12 +48,12 @@ struct _GDataGoogleService {
   GObject parent;
 
   /* private */
-              
+
 };
 
 struct _GDataGoogleServiceClass {
   GObjectClass parent_class;
-  
+
   /* Public Methods - Inherited from GDATA_SERVICE_IFACE */
 };
 
index ca8b866..20cbcef 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *  Jason Willis <zenbrother@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -28,7 +28,7 @@
 /* LibXML2 includes */
 #include <libxml/parser.h>
 #include <libxml/tree.h>
-#include <libxml/xpath.h>  
+#include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 
 #include <string.h>
@@ -278,7 +278,7 @@ GType gdata_entry_get_type (void)
 
 /*** API ***/
 static GDataEntryAuthor *
-xmlnode_to_author (xmlDocPtr doc, xmlNodePtr cur) 
+xmlnode_to_author (xmlDocPtr doc, xmlNodePtr cur)
 {
        GDataEntryAuthor *author;
        xmlChar *value;
@@ -314,7 +314,7 @@ xmlnode_to_author (xmlDocPtr doc, xmlNodePtr cur)
 }
 
 static GDataEntryLink *
-xmlnode_to_link (xmlDocPtr doc, xmlNodePtr cur) 
+xmlnode_to_link (xmlDocPtr doc, xmlNodePtr cur)
 {
        GDataEntryLink *link;
        xmlChar *value;
@@ -353,7 +353,7 @@ xmlnode_to_link (xmlDocPtr doc, xmlNodePtr cur)
 }
 
 static GDataEntryCategory *
-xmlnode_to_category (xmlDocPtr doc, xmlNodePtr cur) 
+xmlnode_to_category (xmlDocPtr doc, xmlNodePtr cur)
 {
        GDataEntryCategory *category;
        xmlChar *value;
@@ -393,16 +393,16 @@ xmlnode_to_attendee (xmlDocPtr doc, xmlNodePtr cur)
        xmlChar *value;
 
        attendee = g_new0 (Attendee, 1);
-       
-       while (cur != NULL) {   
+
+       while (cur != NULL) {
                value = xmlGetProp(cur, (xmlChar *)"email");
                if (value) {
                        attendee->attendee_email = g_strdup((gchar *)value);
                        xmlFree(value);
-               }       
-               
+               }
+
                value = xmlGetProp(cur, (xmlChar *)"rel");
-       
+
                if (value) {
                        attendee->attendee_rel = g_strdup((gchar *)value);
                        xmlFree (value);
@@ -413,13 +413,13 @@ xmlnode_to_attendee (xmlDocPtr doc, xmlNodePtr cur)
                        attendee->attendee_value = g_strdup((gchar *)value);
                        xmlFree (value);
                }
-               
+
                cur = cur->next;
-       }       
+       }
        return attendee;
 }
 
-static xmlNodePtr 
+static xmlNodePtr
 entry_to_xmlnode (GDataEntry *entry)
 {
        xmlDocPtr doc;
@@ -431,12 +431,12 @@ entry_to_xmlnode (GDataEntry *entry)
        /* FIXME 3rd argument could carry a better name */
        doc = xmlReadMemory (xmlEntry, strlen(xmlEntry), "feeds.xml", NULL, 0);
        cur = xmlDocGetRootElement (doc);
-       
+
        return cur;
 }
 
-static xmlNodePtr 
-author_to_xmlnode (GDataEntryAuthor *author) 
+static xmlNodePtr
+author_to_xmlnode (GDataEntryAuthor *author)
 {
 
        xmlNodePtr author_node;
@@ -451,7 +451,7 @@ author_to_xmlnode (GDataEntryAuthor *author)
        return author_node;
 }
 
-static xmlNodePtr 
+static xmlNodePtr
 link_to_xmlnode (GDataEntryLink *link)
 {
        xmlNodePtr link_node;
@@ -476,7 +476,7 @@ link_to_xmlnode (GDataEntryLink *link)
        return link_node;
 }
 
-static xmlNodePtr 
+static xmlNodePtr
 category_to_xmlnode (GDataEntryCategory *category)
 {
        xmlNodePtr category_node;
@@ -501,7 +501,7 @@ category_to_xmlnode (GDataEntryCategory *category)
  * gdata_entry_new:
  * Creates a new #GDataEntry.
  **/
-GDataEntry * 
+GDataEntry *
 gdata_entry_new (void)
 {
        return g_object_new(GDATA_TYPE_ENTRY, NULL);
@@ -511,21 +511,21 @@ gdata_entry_new (void)
  * gdata_entry_get_private:
  * @entry: A #GDataEntry object
  * Returns a #GDataEntryPrivate object
- **/ 
-GDataEntryPrivate * 
+ **/
+GDataEntryPrivate *
 gdata_entry_get_private (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
 
-       return priv;    
+       return priv;
 }
 /**
- * gdata_entry_new_from_xmlptr: 
+ * gdata_entry_new_from_xmlptr:
  * @doc: A xml document pointer
  * @ptr: A xml Node pointer
  **/
-GDataEntry * 
+GDataEntry *
 gdata_entry_new_from_xmlptr (xmlDocPtr doc, xmlNodePtr cur)
 {
        GDataEntry *entry;
@@ -541,11 +541,11 @@ gdata_entry_new_from_xmlptr (xmlDocPtr doc, xmlNodePtr cur)
                return NULL;
        }
 
-       entry = gdata_entry_new (); 
+       entry = gdata_entry_new ();
        priv  = GDATA_ENTRY_GET_PRIVATE(entry);
        buf = xmlAllocOutputBuffer (NULL);
 
-       if (buf == NULL) { 
+       if (buf == NULL) {
                xmlString = NULL;
        }
        else {
@@ -554,7 +554,7 @@ gdata_entry_new_from_xmlptr (xmlDocPtr doc, xmlNodePtr cur)
 
                if (buf->conv == NULL)
                        xmlString = g_strdup ((gchar *)buf->buffer->content);
-               else    
+               else
                        xmlString = g_strdup ((gchar *)buf->conv->content);
                xmlOutputBufferClose (buf);
        }
@@ -565,7 +565,7 @@ gdata_entry_new_from_xmlptr (xmlDocPtr doc, xmlNodePtr cur)
 
                if (!xmlStrcmp(cur->name, (xmlChar *)"author")) {
                        priv->authors = g_slist_prepend(priv->authors, xmlnode_to_author(doc, cur));
-               } 
+               }
                else if (!xmlStrcmp(cur->name, (xmlChar *)"link")) {
                        priv->links = g_slist_prepend(priv->links, xmlnode_to_link(doc, cur));
                }
@@ -573,7 +573,7 @@ gdata_entry_new_from_xmlptr (xmlDocPtr doc, xmlNodePtr cur)
                        priv->categories = g_slist_prepend(priv->categories, xmlnode_to_category(doc, cur));
                }
                else if (!xmlStrcmp (cur->name, (xmlChar *)"where")) {
-                       priv->location = (gchar *)xmlGetProp (cur, (xmlChar *)"valueString");   
+                       priv->location = (gchar *)xmlGetProp (cur, (xmlChar *)"valueString");
                }
                else if (!xmlStrcmp (cur->name, (xmlChar *)"eventStatus")) {
                        priv->status = (gchar *)xmlGetProp (cur, (xmlChar *)"value");
@@ -588,9 +588,9 @@ gdata_entry_new_from_xmlptr (xmlDocPtr doc, xmlNodePtr cur)
                else if (!xmlStrcmp (cur->name, (xmlChar *)"recurrence")) {
                        priv->is_recurrent = TRUE;
                }
-               
+
                else if (!xmlStrcmp (cur->name, (xmlChar *)"who")) {
-                       priv->attendees = g_slist_prepend (priv->attendees, xmlnode_to_attendee (doc, cur));            
+                       priv->attendees = g_slist_prepend (priv->attendees, xmlnode_to_attendee (doc, cur));
                        priv->has_attendees = TRUE;
                }
                else if (!xmlStrcmp (cur->name, (xmlChar *)"sendEventNotifications")) {
@@ -602,25 +602,25 @@ gdata_entry_new_from_xmlptr (xmlDocPtr doc, xmlNodePtr cur)
 
                else {
                        value = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-                       g_hash_table_insert(priv->field_table, g_strdup((gchar *)cur->name), 
+                       g_hash_table_insert(priv->field_table, g_strdup((gchar *)cur->name),
                                        g_strdup((gchar *)value));
                        xmlFree(value);
                }
                cur = cur->next;
        }
-       
+
        xmlFree(value);
        return entry;
 }
 
 /**
- * gdata_entries_new_from_xml: 
+ * gdata_entries_new_from_xml:
  * @feed_xml: A xml tree.
  * @length: length of feed_xml
  * Returns the list of all the entries in a feed.
  **/
 /*Returns all the entries from the feed */
-GSList * 
+GSList *
 gdata_entries_new_from_xml (const gchar *feed_xml, const gint length)
 {
        GSList *list;
@@ -632,16 +632,16 @@ gdata_entries_new_from_xml (const gchar *feed_xml, const gint length)
        g_return_val_if_fail(feed_xml != NULL && *feed_xml != '\0', NULL);
 
        doc = xmlReadMemory (feed_xml, strlen(feed_xml), "feed.xml", NULL, 0);
-       if (doc == NULL) 
+       if (doc == NULL)
                return NULL;
 
        cur = xmlDocGetRootElement (doc);
        if (cur == NULL) {
                xmlFree (doc);
        }
-       
+
        cur = cur->xmlChildrenNode;
-       while (cur != NULL)     
+       while (cur != NULL)
        {
                if (!xmlStrcmp (cur->name, (xmlChar *)"entry")) {
                        list = g_slist_prepend (list, gdata_entry_new_from_xmlptr (doc, cur));
@@ -659,8 +659,8 @@ gdata_entries_new_from_xml (const gchar *feed_xml, const gint length)
        return list;
 }
 
-/** 
- * gdata_entry_new_from_xml: 
+/**
+ * gdata_entry_new_from_xml:
  * @entry_xml: the xml tree
  * Returns a GDataEntry object:
  **/
@@ -671,18 +671,18 @@ gdata_entry_new_from_xml (const gchar *entry_xml)
        xmlDocPtr doc;
        xmlNodePtr cur;
 
-       g_return_val_if_fail (entry_xml != NULL && *entry_xml != '\0', NULL);   
+       g_return_val_if_fail (entry_xml != NULL && *entry_xml != '\0', NULL);
        doc = xmlReadMemory (entry_xml, strlen(entry_xml), "feed.xml", NULL, 0);
 
        if (doc == NULL)
                return NULL;
 
        cur = xmlDocGetRootElement (doc);
-       if (cur == NULL) 
+       if (cur == NULL)
                xmlFree (doc);
 
        while (cur != NULL) {
-               if (!xmlStrcmp (cur->name,(xmlChar *)"entry")) 
+               if (!xmlStrcmp (cur->name,(xmlChar *)"entry"))
                        entry = gdata_entry_new_from_xmlptr (doc, cur);
                cur = cur->next;
        }
@@ -698,10 +698,10 @@ gdata_entry_new_from_xml (const gchar *entry_xml)
 
 /**
  *gdata_entry_generate_xml:
- *@entry: A GDataEntry Object 
+ *@entry: A GDataEntry Object
  *Returns the xml content:
  **/
-gchar * 
+gchar *
 gdata_entry_generate_xml (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
@@ -760,14 +760,14 @@ gdata_entry_generate_xml (GDataEntry *entry)
                cur_child = xmlNewChild(root, NULL, (xmlChar *)"when", NULL);
                xmlSetNs (cur_child, xmlNewNs (cur_child, NULL, (xmlChar *)"gd"));
                xmlSetProp (cur_child, (xmlChar *)"startTime", (xmlChar *)priv->start_time);
-               xmlSetProp (cur_child, (xmlChar *)"endTime", (xmlChar *)priv->end_time);        
+               xmlSetProp (cur_child, (xmlChar *)"endTime", (xmlChar *)priv->end_time);
 
-               if (priv->reminder) {           
+               if (priv->reminder) {
                        cur = cur_child;
                        cur_child = xmlNewChild(cur, NULL, (xmlChar *)"reminder", (xmlChar *)"");
-                       xmlSetNs (cur_child, xmlNewNs (cur_child, NULL, (xmlChar *)"gd"));                
+                       xmlSetNs (cur_child, xmlNewNs (cur_child, NULL, (xmlChar *)"gd"));
                        xmlSetProp (cur_child->xmlChildrenNode, (xmlChar *)"minutes", (xmlChar *)priv->reminder);
-               } 
+               }
        }
 
        if (priv->location ) {
@@ -797,8 +797,8 @@ gdata_entry_generate_xml (GDataEntry *entry)
 
        xmlFree(xmlString);
        xmlFreeDoc(doc);
-       return priv->entry_xml;          
+
+       return priv->entry_xml;
 }
 
 /* Builds the DOM tree for the entries stored in hash table */
@@ -820,17 +820,17 @@ build_hash_table_entries (gchar *key, gchar *value, xmlNode **cur)
                        (value) ? xmlNodeSetContent (ptr->next, (xmlChar *)value) : xmlNodeSetContent (ptr->next, (xmlChar *)"");
                        break;
                }
-               else 
+               else
                        ptr = ptr->next;
        }
 }
 
-/** 
+/**
  * gdata_entry_get_id:
  * @entry: A GDataEntry object
- * Returns the id of the Entry: 
+ * Returns the id of the Entry:
  **/
-gchar * 
+gchar *
 gdata_entry_get_id (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
@@ -839,15 +839,15 @@ gdata_entry_get_id (GDataEntry *entry)
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL);
 
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
-       return g_hash_table_lookup (priv->field_table, "id");     
+       return g_hash_table_lookup (priv->field_table, "id");
 }
 
-/** 
+/**
  * gdata_entry_get_visibility:
  * @entry: A GDataEntry object
- * Returns the visibility of the Entry: 
+ * Returns the visibility of the Entry:
  **/
-gchar * 
+gchar *
 gdata_entry_get_visibility (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
@@ -859,88 +859,88 @@ gdata_entry_get_visibility (GDataEntry *entry)
        return priv->visibility;
 }
 
-/** 
+/**
  * gdata_entry_get_content:
  * @entry: A #GDataEntry object
- * Returns the content of the Entry/Event. 
+ * Returns the content of the Entry/Event.
  **/
-gchar * 
+gchar *
 gdata_entry_get_content (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail (entry !=NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
        return g_hash_table_lookup (priv->field_table, "content");
 }
 
-/** 
+/**
  * gdata_entry_get_description:
  * @entry: A #GDataEntry object
- * Returns the description of the Entry. 
+ * Returns the description of the Entry.
  **/
 /* Returns the description of the entry */
-gchar * 
+gchar *
 gdata_entry_get_description (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail (entry !=NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
        return NULL;
 }
 
-/** 
+/**
  * gdata_entry_get_copyright:
  * @entry: A #GDataEntry object
  * Returns the copyright of the Entry
  **/
-gchar * 
+gchar *
 gdata_entry_get_copyright (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail (entry !=NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
        return g_hash_table_lookup (priv->field_table, "copyright");
 }
 
-/** 
+/**
  * gdata_entry_get_title:
  * @entry: A #GDataEntry object.
- * Returns the title of the Entry. 
+ * Returns the title of the Entry.
  **/
-gchar * 
+gchar *
 gdata_entry_get_title (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail (entry !=NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
        return g_hash_table_lookup (priv->field_table, "title");
 }
 
-/** 
+/**
  * gdata_entry_get_authors:
  * @entry: A #GDataEntry object.
- * Returns the list of authors of entry.  
+ * Returns the list of authors of entry.
  **/
-GSList * 
+GSList *
 gdata_entry_get_authors (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail (entry != NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
        return priv->authors;
 }
@@ -954,72 +954,72 @@ GSList *
 gdata_entry_get_links (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
-       
+
        g_return_val_if_fail (entry !=NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
        return priv->links;
 }
 
-/** 
+/**
  * gdata_entry_get_start_time:
  * @entry: A #GDataEntry object.
- * Returns the starting time of the Event. 
+ * Returns the starting time of the Event.
  **/
-gchar * 
+gchar *
 gdata_entry_get_start_time (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail (entry!=NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        return priv->start_time;
 }
 
 
-/** 
+/**
  * gdata_entry_get_transparency:
  * @entry: A #GDataEntry object.
- * Returns the transparency of the Event. 
+ * Returns the transparency of the Event.
  **/
-gchar * 
+gchar *
 gdata_entry_get_transparency (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail (entry!=NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        return priv->transparency;
 }
 
-/** 
+/**
  * gdata_entry_get_end_time:
  * @entry: A #GDataEntry object.
- * Returns the ending time of the Event. 
+ * Returns the ending time of the Event.
  **/
-gchar * 
+gchar *
 gdata_entry_get_end_time (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail (entry != NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
-               
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        return priv->end_time;
 }
 
-/** 
+/**
  * gdata_entry_get_location:
  * @entry: A #GDataEntry object.
- * Returns the location of the Event. 
+ * Returns the location of the Event.
  **/
-gchar * 
+gchar *
 gdata_entry_get_location (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
@@ -1028,30 +1028,30 @@ gdata_entry_get_location (GDataEntry *entry)
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), NULL);
 
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
-       return priv->location; 
+       return priv->location;
 }
 
-/** 
+/**
  * gdata_entry_get_status:
  * @entry: A #GDataEntry object.
- * Returns the status of the Event. 
+ * Returns the status of the Event.
  **/
-gchar * 
+gchar *
 gdata_entry_get_status (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
 
        g_return_val_if_fail(entry !=NULL, NULL);
        g_return_val_if_fail(GDATA_IS_ENTRY (entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        return priv->status;
 }
 
-/** 
+/**
  * gdata_entry_get_categories:
  * @entry: A #GDataEntry object.
- * Returns the status of the Event. 
+ * Returns the status of the Event.
  **/
 GSList *
 gdata_entry_get_categories (GDataEntry *entry)
@@ -1060,7 +1060,7 @@ gdata_entry_get_categories (GDataEntry *entry)
 
        g_return_val_if_fail(entry !=NULL, NULL);
        g_return_val_if_fail(GDATA_IS_ENTRY (entry), NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        return priv->categories;
 }
@@ -1091,13 +1091,13 @@ gdata_entry_get_edit_link (GDataEntry *entry)
        return edit_link;
 }
 
-/** 
+/**
  * gdata_entry_set_author:
  * @entry: A #GDataEntry object.
  * @author: A list of authors.
- * Sets the list of authors.  
+ * Sets the list of authors.
  **/
-void 
+void
 gdata_entry_set_author (GDataEntry *entry, GSList *author)
 {
        GDataEntryPrivate *priv;
@@ -1110,13 +1110,13 @@ gdata_entry_set_author (GDataEntry *entry, GSList *author)
        priv->entry_needs_update = TRUE;
 }
 
-/** 
+/**
  * gdata_entry_set_id:
  * @entry: A #GDataEntry object.
  * @id: Id of the entry.
- * Sets the list of authors.  
+ * Sets the list of authors.
  **/
-void 
+void
 gdata_entry_set_id (GDataEntry *entry, gchar *id)
 {
        GDataEntryPrivate *priv;
@@ -1132,50 +1132,50 @@ gdata_entry_set_id (GDataEntry *entry, gchar *id)
 
 
 
-/** 
+/**
  * gdata_entry_set_categories:
  * @entry: A GDataEntry object.
  * @categories: A list of categories.
- * Sets the list of categories of the Entry. 
+ * Sets the list of categories of the Entry.
  **/
-void 
+void
 gdata_entry_set_categories (GDataEntry *entry, GSList *categories)
 {
        GDataEntryPrivate *priv;
-       
+
        g_return_if_fail(categories !=NULL);
        g_return_if_fail(GDATA_IS_ENTRY(entry));
 
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        priv->categories = categories;
-       priv->entry_needs_update = TRUE;                
+       priv->entry_needs_update = TRUE;
 }
 
-/** 
+/**
  * gdata_entry_set_title:
  * @entry: A GDataEntry object.
  * @title: title of the event.
- * Sets the title of the Entry. 
+ * Sets the title of the Entry.
  **/
-void 
+void
 gdata_entry_set_title (GDataEntry *entry, const gchar *title)
 {
        GDataEntryPrivate *priv;
 
        g_return_if_fail(title !=NULL);
        g_return_if_fail(GDATA_IS_ENTRY (entry));
-               
+
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
        priv->title = g_strdup(title);
        g_hash_table_insert (priv->field_table, g_strdup("title"), g_strdup(title));
        priv->entry_needs_update = TRUE;
 }
 
-/** 
+/**
  * gdata_entry_set_content:
  * @entry: A GDataEntry object.
  * @content: The content of the event.
- * Sets the content of the Entry. 
+ * Sets the content of the Entry.
  **/
 void
 gdata_entry_set_content (GDataEntry *entry, const gchar *content)
@@ -1184,20 +1184,20 @@ gdata_entry_set_content (GDataEntry *entry, const gchar *content)
 
        g_return_if_fail(content !=NULL);
        g_return_if_fail(GDATA_IS_ENTRY(entry));
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        priv->content = g_strdup (content);
        priv->entry_needs_update = TRUE;
        g_hash_table_insert (priv->field_table, g_strdup("content"), g_strdup (content));
 }
 
-/** 
+/**
  * gdata_entry_set_links:
  * @entry: A GDataEntry object.
  * @links: A list of links associated.
- * Sets the links of the Event. 
+ * Sets the links of the Event.
  **/
-void 
+void
 gdata_entry_set_links (GDataEntry *entry, GSList *links)
 {
        GDataEntryPrivate *priv;
@@ -1210,96 +1210,96 @@ gdata_entry_set_links (GDataEntry *entry, GSList *links)
        priv->entry_needs_update = TRUE;
 }
 
-/** 
+/**
  * gdata_entry_set_status:
  * @entry: A GDataEntry object.
  * @status: The status of the event.
- * Sets the status of the Event. 
+ * Sets the status of the Event.
  **/
-void 
+void
 gdata_entry_set_status (GDataEntry *entry, const gchar *status)
 {
        GDataEntryPrivate *priv;
 
        g_return_if_fail(status!=NULL);
        g_return_if_fail(GDATA_IS_ENTRY(entry));
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
-       priv->status = g_strdup (status);       
+       priv->status = g_strdup (status);
        priv->entry_needs_update = TRUE;
 }
 
-/** 
+/**
  * gdata_entry_set_sendNotification:
  * @entry: A GDataEntry object.
- * @sendNotification: Whether notification is required. 
- * Sets whether notification should be sent by the Event. 
+ * @sendNotification: Whether notification is required.
+ * Sets whether notification should be sent by the Event.
  **/
-void 
+void
 gdata_entry_set_send_notification (GDataEntry *entry, const gchar *send_notification)
 {
-       GDataEntryPrivate *priv;        
+       GDataEntryPrivate *priv;
 
        g_return_if_fail (send_notification!=NULL);
        g_return_if_fail (GDATA_IS_ENTRY (entry));
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        priv->send_notification = g_strdup(send_notification);
        priv->entry_needs_update = TRUE;
-}      
+}
 
-/** 
+/**
  * gdata_entry_set_reminder:
  * @entry: A GDataEntry object.
  * @reminder: The reminder set.
  * Sets the reminder of the Event.
  **/
-void 
+void
 gdata_entry_set_reminder (GDataEntry *entry, const gchar *reminder)
 {
        GDataEntryPrivate *priv;
 
        g_return_if_fail(reminder !=NULL);
        g_return_if_fail(GDATA_IS_ENTRY (entry));
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        priv->reminder = g_strdup (reminder);
        priv->entry_needs_update = TRUE;
 }
 
-/** 
+/**
  * gdata_entry_set_start_time:
  * @entry: A GDataEntry object.
  * @start_time: The starting time of the event.
- * Sets the starting time of the Event. 
+ * Sets the starting time of the Event.
  **/
-void 
+void
 gdata_entry_set_start_time (GDataEntry *entry, const gchar *start_time)
 {
        GDataEntryPrivate *priv;
 
        g_return_if_fail(start_time !=NULL);
        g_return_if_fail(GDATA_IS_ENTRY(entry));
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        priv->start_time = g_strdup(start_time);
        priv->entry_needs_update = TRUE;
-}      
+}
 
-/** 
+/**
  * gdata_entry_set_end_time:
  * @entry: A GDataEntry object.
  * @end_time: The end time of the event.
  * Sets the end time of the event.
  **/
-void 
+void
 gdata_entry_set_end_time (GDataEntry *entry, const gchar *end_time)
 {
        GDataEntryPrivate *priv;
 
        g_return_if_fail(end_time !=NULL);
        g_return_if_fail(GDATA_IS_ENTRY (entry));
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        priv->end_time = g_strdup(end_time);
        priv->entry_needs_update = TRUE;
@@ -1307,11 +1307,11 @@ gdata_entry_set_end_time (GDataEntry *entry, const gchar *end_time)
 
 /**
  * gdata_entry_set_transparency:
- * @entry: A GDataEntry object. 
+ * @entry: A GDataEntry object.
  * @transparency: Transparency of the Entry.
- * Sets the transparency of the entry. 
+ * Sets the transparency of the entry.
  **/
-void 
+void
 gdata_entry_set_transparency (GDataEntry *entry, const gchar *transparency)
 {
        GDataEntryPrivate *priv;
@@ -1330,7 +1330,7 @@ gdata_entry_set_transparency (GDataEntry *entry, const gchar *transparency)
  * @location: Location of the event.
  * Sets the location of the event.
  **/
-void 
+void
 gdata_entry_set_location (GDataEntry *entry, const gchar *location)
 {
        GDataEntryPrivate *priv;
@@ -1359,19 +1359,19 @@ gdata_entry_set_xml (GDataEntry *entry, const gchar *xml)
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        priv->entry_xml = g_strdup (xml);
        priv->entry_needs_update = TRUE;
-       
+
 }
 
-/** 
+/**
  * gdata_entry_create_authors:
  * @entry: A GDataEntry object.
  * @name: The name of the author.
  * @email: The email of the author.
  * Sets the list of authors to the Entry.
  **/
-void 
+void
 gdata_entry_create_authors (GDataEntry *entry,
-                           const gchar *name, 
+                           const gchar *name,
                            const gchar *email)
 {
        GDataEntryPrivate *priv;
@@ -1379,19 +1379,19 @@ gdata_entry_create_authors (GDataEntry *entry,
 
        g_return_if_fail(name !=NULL || email !=NULL);
        g_return_if_fail(GDATA_IS_ENTRY(entry));
-       
+
        author = g_new0 (GDataEntryAuthor, 1);
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
 
-       author->name = g_strdup(name); 
+       author->name = g_strdup(name);
        author->email = g_strdup(email);
-       
+
        priv->authors = g_slist_prepend(priv->authors, author);
        priv->entry_needs_update = TRUE;
-       
+
 }
 
-/** 
+/**
  * gdata_entry_create_categories:
  * @entry: A GDataEntry object.
  * @scheme:Scheme.
@@ -1399,10 +1399,10 @@ gdata_entry_create_authors (GDataEntry *entry,
  * @term: Term.
  * Sets the categories of the Event.
  **/
-void 
-gdata_entry_create_categories (GDataEntry *entry, 
-                              const gchar *scheme, 
-                              const gchar *label , 
+void
+gdata_entry_create_categories (GDataEntry *entry,
+                              const gchar *scheme,
+                              const gchar *label ,
                               const gchar *term)
 {
        GDataEntryPrivate *priv;
@@ -1426,10 +1426,10 @@ gboolean
 gdata_entry_is_recurrent (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
-       
+
        g_return_val_if_fail (entry != NULL, 0);
        g_return_val_if_fail (GDATA_IS_ENTRY (entry), 0);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE (entry);
        return priv->is_recurrent;
 }
@@ -1438,8 +1438,8 @@ GSList *
 gdata_entry_get_attendee_list (GDataEntry *entry)
 {
        GDataEntryPrivate *priv;
-       
-       g_return_val_if_fail (entry != NULL, NULL);     
+
+       g_return_val_if_fail (entry != NULL, NULL);
        g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
 
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
@@ -1454,7 +1454,7 @@ gdata_entry_set_attendee_list (GDataEntry *entry, GSList *attendees)
        g_return_if_fail (entry != NULL);
        g_return_if_fail (GDATA_IS_ENTRY(entry));
        g_return_if_fail (attendees != NULL);
-       
+
        priv = GDATA_ENTRY_GET_PRIVATE(entry);
        priv->attendees = attendees;
        priv->has_attendees = TRUE;
index 7a7f542..674fffd 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *  Jason Willis <zenbrother@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -32,7 +32,7 @@
 /* LibXML2 includes */
 #include <libxml/parser.h>
 #include <libxml/tree.h>
-#include <libxml/xpath.h>  
+#include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 
 
@@ -60,7 +60,7 @@ struct _GDataEntry {
 };
 
 struct _GDataEntryClass {
-  
+
   GObjectClass parent_class;
   /* class members */
 
@@ -121,10 +121,10 @@ gchar * gdata_entry_get_start_date (GDataEntry *entry);
 
 gchar * gdata_entry_get_end_date (GDataEntry *entry);
 
-gchar * 
+gchar *
 gdata_entry_get_visibility (GDataEntry *entry);
 
-gchar * 
+gchar *
 gdata_entry_get_transparency (GDataEntry *entry);
 
 GSList *
index 8a73a32..c8e9f98 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *  Jason Willis <zenbrother@gmail.com>
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -16,7 +16,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -29,7 +29,7 @@
 /* LibXML2 includes */
 #include <libxml/parser.h>
 #include <libxml/tree.h>
-#include <libxml/xpath.h>  
+#include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 
 #include <string.h>
@@ -155,7 +155,7 @@ enum {
 
 };
 
-static void 
+static void
 gdata_feed_init(GTypeInstance *instance,
                gpointer      g_class)
 {
@@ -187,7 +187,7 @@ gdata_feed_init(GTypeInstance *instance,
        priv->feedXML = NULL;
 }
 
-static void 
+static void
 gdata_feed_dispose(GObject *obj)
 {
        GObjectClass *parent_class;
@@ -210,7 +210,7 @@ gdata_feed_dispose(GObject *obj)
        parent_class->dispose(obj);
 }
 
-static void 
+static void
 gdata_feed_finalize(GObject *obj)
 {
        GDataFeedPrivate *priv;
@@ -253,7 +253,7 @@ gdata_feed_finalize(GObject *obj)
        parent_class->finalize(obj);
 }
 
-static void 
+static void
 gdata_feed_get_property (GObject *obj,
                guint    property_id,
                GValue  *value,
@@ -265,7 +265,7 @@ gdata_feed_get_property (GObject *obj,
 
 }
 
-static void 
+static void
 gdata_feed_set_property (GObject *obj,
                guint    property_id,
                const GValue *value,
@@ -278,7 +278,7 @@ gdata_feed_set_property (GObject *obj,
 
 }
 
-static GObject * gdata_feed_constructor(GType type, 
+static GObject * gdata_feed_constructor(GType type,
                guint n_construct_properties,
                GObjectConstructParam *construct_properties)
 {
@@ -295,9 +295,9 @@ static GObject * gdata_feed_constructor(GType type,
 
        return obj;
 
-}  
+}
 
-static void 
+static void
 gdata_feed_class_init(gpointer g_class,
                gpointer g_class_data)
 {
@@ -313,7 +313,7 @@ gdata_feed_class_init(gpointer g_class,
 
        gobject_class->dispose     = gdata_feed_dispose;
        gobject_class->finalize    = gdata_feed_finalize;
-       gobject_class->constructor = gdata_feed_constructor; 
+       gobject_class->constructor = gdata_feed_constructor;
 
 }
 
@@ -340,7 +340,7 @@ GType gdata_feed_get_type(void)
 
 /*** API ***/
        static GDataFeedAuthor *
-xmlnode_to_author(xmlDocPtr doc, xmlNodePtr cur) 
+xmlnode_to_author(xmlDocPtr doc, xmlNodePtr cur)
 {
        GDataFeedAuthor *author;
        xmlChar *value;
@@ -376,7 +376,7 @@ xmlnode_to_author(xmlDocPtr doc, xmlNodePtr cur)
 }
 
 static GDataFeedLink *
-xmlnode_to_link(xmlDocPtr doc, xmlNodePtr cur) 
+xmlnode_to_link(xmlDocPtr doc, xmlNodePtr cur)
 {
        GDataFeedLink *link;
        xmlChar *value;
@@ -417,7 +417,7 @@ xmlnode_to_link(xmlDocPtr doc, xmlNodePtr cur)
 
 
 static GDataFeedCategory *
-xmlnode_to_category(xmlDocPtr doc, xmlNodePtr cur) 
+xmlnode_to_category(xmlDocPtr doc, xmlNodePtr cur)
 {
        GDataFeedCategory *category;
        xmlChar *value;
@@ -449,7 +449,7 @@ xmlnode_to_category(xmlDocPtr doc, xmlNodePtr cur)
        return category;
 }
 
-static xmlNodePtr 
+static xmlNodePtr
 link_to_xmlnode (GDataFeedLink *link)
 {
        xmlNodePtr cur;
@@ -485,7 +485,7 @@ author_to_xmlnode (GDataFeedAuthor *author)
 
        if (author->uri)
        xmlNewChild (cur, NULL, (xmlChar *)"uri", (xmlChar *)author->uri);
-       
+
        return cur;
 }
 
@@ -517,14 +517,14 @@ entry_to_xmlnode (GDataEntry *entry)
        return cur;
 }
 
-GDataFeed * 
+GDataFeed *
 gdata_feed_new(void)
 {
        return g_object_new(GDATA_TYPE_FEED, NULL);
 }
 
 
-GDataFeed * 
+GDataFeed *
 gdata_feed_new_from_xml(const gchar* feedXML, const gint length)
 {
        GDataFeed *feed;
@@ -562,10 +562,10 @@ gdata_feed_new_from_xml(const gchar* feedXML, const gint length)
 
        cur = cur->xmlChildrenNode;
        while (cur != NULL) {
-               
+
                if (!xmlStrcmp(cur->name, (xmlChar *)"author")) {
                        priv->authors = g_slist_prepend(priv->authors, xmlnode_to_author(doc, cur));
-               } 
+               }
                else if (!xmlStrcmp(cur->name, (xmlChar *)"link")) {
                        priv->links = g_slist_prepend(priv->links, xmlnode_to_link(doc, cur));
                }
@@ -577,7 +577,7 @@ gdata_feed_new_from_xml(const gchar* feedXML, const gint length)
                }
                else {
                        value = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-                       g_hash_table_insert(priv->field_table, g_strdup((gchar *)cur->name), 
+                       g_hash_table_insert(priv->field_table, g_strdup((gchar *)cur->name),
                                        g_strdup((gchar *)value));
                        xmlFree(value);
                }
@@ -586,7 +586,7 @@ gdata_feed_new_from_xml(const gchar* feedXML, const gint length)
 
        xmlDocDumpFormatMemory(doc, &value, &value_size, 1);
        priv->feedXML = g_strdup(feedXML);
-       
+
        xmlFree(value);
        xmlFreeDoc(doc);
 
@@ -594,7 +594,7 @@ gdata_feed_new_from_xml(const gchar* feedXML, const gint length)
 }
 
 
-gchar * 
+gchar *
 gdata_feed_generate_xml(GDataFeed *feed)
 {
        GDataFeedPrivate *priv;
@@ -614,7 +614,7 @@ gdata_feed_generate_xml(GDataFeed *feed)
        if (!priv->feedXML) {
                doc = xmlNewDoc ((xmlChar *)"1.0");
                root = xmlNewDocNode (doc, NULL, (xmlChar *)"feed", NULL);
-               
+
                xmlSetProp (root, (xmlChar *)"xmlns", (xmlChar *)"http://www.w3.org/2005/Atom");
                ns_os = xmlNewNs (root, (xmlChar *)"http://a9.com/-/spec/opensearchrss/1.0/", (xmlChar *)"openSearch");
                ns_gd = xmlNewNs (root, (xmlChar *)"http://schemas.google.com/g/2005", (xmlChar *)"gd");
@@ -624,28 +624,28 @@ gdata_feed_generate_xml(GDataFeed *feed)
                        cur = xmlNewChild (root, NULL, (xmlChar *)"id", NULL);
                        xmlNodeSetContent (cur, (xmlChar *)priv->id);
                }
-               
+
                list = priv->categories;
                while (list) {
                        cur = category_to_xmlnode (list->data);
                        xmlAddChild (root, cur);
                        list = g_slist_next (list);
                }
-               
+
                list = priv->links;
                while (list) {
                        cur = link_to_xmlnode (list->data);
                        xmlAddChild (root, cur);
-                       list = g_slist_next (list);     
+                       list = g_slist_next (list);
                }
-               
+
                list = priv->authors;
                while (list) {
                        cur = author_to_xmlnode (list->data);
                        xmlAddChild (root, cur);
                        list = g_slist_next (list);
                }
-       
+
                list = priv->entries;
                while (list) {
                        cur = entry_to_xmlnode (list->data);
@@ -668,7 +668,7 @@ gdata_feed_get_entries (GDataFeed *feed)
 {
        GDataFeedPrivate *priv;
        priv = GDATA_FEED_GET_PRIVATE (feed);
-       
+
        g_return_val_if_fail (feed !=NULL, NULL);
        g_return_val_if_fail (GDATA_IS_FEED(feed), NULL);
 
index ffb6571..d78857d 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *  Jason Willis <zenbrother@gmail.com>
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -16,7 +16,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
@@ -51,7 +51,7 @@ struct _GDataFeed {
 };
 
 struct _GDataFeedClass {
-  
+
   GObjectClass parent_class;
   /* class members */
 
index 898dc9c..76de912 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *  Jason Willis <zenbrother@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
 #include <config.h>
 #include <gdata-service-iface.h>
 
-void 
+void
 gdata_service_set_credentials (GDataService *self, const char *username, const gchar *password)
 {
        GDATA_SERVICE_GET_IFACE(self)->set_credentials(self, username, password);
        return;
 }
 
-GDataFeed* 
+GDataFeed*
 gdata_service_get_feed (GDataService *self, const char* feedURL)
 {
        return GDATA_SERVICE_GET_IFACE(self)->get_feed(self, feedURL);
 }
 
-GDataEntry* 
+GDataEntry*
 gdata_service_insert_entry (GDataService *self, const gchar *feed_postURL, GDataEntry *entry)
 {
        return GDATA_SERVICE_GET_IFACE(self)->insert_entry(self, g_strdup(feed_postURL), entry);
 }
 
-GDataEntry* 
+GDataEntry*
 gdata_service_get_entry (GDataService *self, const gchar *entry_getURL)
 {
        return  GDATA_SERVICE_GET_IFACE(self)->get_entry(self, entry_getURL);
 }
 
-GDataEntry* 
+GDataEntry*
 gdata_service_update_entry (GDataService *self, GDataEntry *entry)
 {
        GDATA_SERVICE_GET_IFACE(self)->update_entry(self, entry);
        return NULL;
 }
 
-GDataEntry* 
+GDataEntry*
 gdata_service_update_entry_with_link (GDataService *self, GDataEntry *entry, gchar *link)
 {
        GDATA_SERVICE_GET_IFACE(self)->update_entry_with_link(self, entry, link);
        return NULL;
 }
 
-void 
+void
 gdata_service_delete_entry (GDataService *self, GDataEntry *entry)
 {
        GDATA_SERVICE_GET_IFACE(self)->delete_entry (self, entry);
        return;
 }
 
-static void 
+static void
 gdata_service_base_init (gpointer g_class)
 {
        static gboolean initialized = FALSE;
@@ -82,14 +82,14 @@ gdata_service_base_init (gpointer g_class)
        }
 }
 
-GType 
+GType
 gdata_service_get_type (void)
 {
        static GType type = 0;
 
-       if (G_UNLIKELY(type == 0)) 
+       if (G_UNLIKELY(type == 0))
        {
-               static const GTypeInfo info = 
+               static const GTypeInfo info =
                {
                        sizeof (GDataServiceIface),
                        gdata_service_base_init,   /* base_init */
@@ -101,10 +101,10 @@ gdata_service_get_type (void)
                        0,      /* n_preallocs */
                        NULL    /* instance_init */
                };
-               type = g_type_register_static (G_TYPE_INTERFACE, 
+               type = g_type_register_static (G_TYPE_INTERFACE,
                                "GDataService", &info, 0);
-               g_type_interface_add_prerequisite (type, G_TYPE_OBJECT ); 
+               g_type_interface_add_prerequisite (type, G_TYPE_OBJECT );
        }
 
        return type;
-} 
+}
index 0a0a9d8..37b27be 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Ebby Wiselyn <ebbywiselyn@gmail.com>
  *  Jason Willis <zenbrother@gmail.com>
  *
  * Copyright 2007, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
  *
  * * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
  */
index 154482b..e14fd4d 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -60,8 +60,8 @@ struct _EGwConnectionPrivate {
        GMutex *reauth_mutex;
 };
 
-static EGwConnectionStatus 
-reauthenticate (EGwConnection *cnc) 
+static EGwConnectionStatus
+reauthenticate (EGwConnection *cnc)
 {
        EGwConnectionPrivate  *priv;
        SoupSoapMessage *msg;
@@ -69,7 +69,7 @@ reauthenticate (EGwConnection *cnc)
        SoupSoapParameter *param;
        EGwConnectionStatus status = -1;
        char *session = NULL;
-       
+
        priv = cnc->priv;
        if (!priv)
                return E_GW_CONNECTION_STATUS_INVALID_CONNECTION;
@@ -78,10 +78,10 @@ reauthenticate (EGwConnection *cnc)
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getCategoryListRequest");
        e_gw_message_write_footer (msg);
 
-        /* just to make sure we still have invlaid session 
-          when multiple e_gw_connection apis see inavlid connection error 
+        /* just to make sure we still have invlaid session
+          when multiple e_gw_connection apis see inavlid connection error
           at the sma time this prevents this function sending login requests multiple times */
-       response = e_gw_connection_send_message (cnc, msg); 
+       response = e_gw_connection_send_message (cnc, msg);
         if (!response) {
                 g_object_unref (msg);
                g_mutex_unlock (priv->reauth_mutex);
@@ -106,26 +106,26 @@ reauthenticate (EGwConnection *cnc)
 
        /* send message to server */
        response = e_gw_connection_send_message (cnc, msg);
-       if (response) 
+       if (response)
                status = e_gw_connection_parse_response_status (response);
 
        if (status == E_GW_CONNECTION_STATUS_OK) {
                param = soup_soap_response_get_first_parameter_by_name (response, "session");
-               if (param) 
+               if (param)
                        session = soup_soap_parameter_get_string_value (param);
-                       
+
        }
-               
+
        if (session) {
                g_free (priv->session_id);
                priv->session_id = session;
-       } 
+       }
        g_object_unref (msg);
        if (response)
                g_object_unref (response);
        g_mutex_unlock (priv->reauth_mutex);
        return status;
-       
+
 }
 
 EGwConnectionStatus
@@ -223,12 +223,12 @@ e_gw_connection_dispose (GObject *object)
        EGwConnection *cnc = (EGwConnection *) object;
        EGwConnectionPrivate *priv;
        char *hash_key;
-       
+
        g_return_if_fail (E_IS_GW_CONNECTION (cnc));
-       
+
        priv = cnc->priv;
        printf ("gw connection dispose \n");
-       
+
        /* removed the connection from the hash table */
        if (loaded_connections_permissions != NULL) {
                hash_key = g_strdup_printf ("%s:%s@%s",
@@ -242,7 +242,7 @@ e_gw_connection_dispose (GObject *object)
                }
                g_free (hash_key);
        }
-       
+
        if (priv) {
                if (priv->session_id) {
                        logout (cnc);
@@ -283,33 +283,33 @@ e_gw_connection_dispose (GObject *object)
                        g_free (priv->user_uuid);
                        priv->user_uuid = NULL;
                }
-       
+
                if (priv->reauth_mutex) {
                        g_mutex_free (priv->reauth_mutex);
                        priv->reauth_mutex = NULL;
                }
-       
+
                if (priv->categories_by_id) {
                        g_hash_table_destroy (priv->categories_by_id);
                        priv->categories_by_id = NULL;
-               }       
-               
+               }
+
                if (priv->categories_by_name) {
                        g_hash_table_destroy (priv->categories_by_name);
                        priv->categories_by_name = NULL;
                }
-       
+
                if (priv->book_list) {
                        g_list_foreach (priv->book_list, (GFunc) g_object_unref, NULL);
                        g_list_free (priv->book_list);
                        priv->book_list = NULL;
                }
-               
+
                if (priv->opts) {
                        g_object_unref (priv->opts);
                        priv->opts = NULL;
                }
-               
+
                if (priv->version) {
                        g_free (priv->version) ;
                        priv->opts = NULL ;
@@ -323,7 +323,7 @@ e_gw_connection_dispose (GObject *object)
 
        if (parent_class->dispose)
                (* parent_class->dispose) (object);
-} 
+}
 
 static void
 e_gw_connection_finalize (GObject *object)
@@ -365,11 +365,11 @@ e_gw_connection_init (EGwConnection *cnc, EGwConnectionClass *klass)
        cnc->priv = priv;
 
        /* Set a default timeout value of 30 seconds.
-          FIXME: Make timeout configurable 
+          FIXME: Make timeout configurable
        */
        if (g_getenv ("SOUP_SESSION_TIMEOUT"))
                timeout = atoi (g_getenv ("SOUP_SESSION_TIMEOUT"));
-       
+
        /* create the SoupSession for this connection */
        priv->soup_session = soup_session_sync_new_with_options (SOUP_SESSION_TIMEOUT, timeout, NULL);
        priv->reauth_mutex = g_mutex_new ();
@@ -429,9 +429,9 @@ e_gw_connection_new (const char *uri, const char *username, const char *password
        EGwConnectionStatus status;
        char *hash_key;
        char *redirected_uri = NULL;
-       
-       static GStaticMutex connecting = G_STATIC_MUTEX_INIT;   
-       
+
+       static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
+
        g_static_mutex_lock (&connecting);
 
        /* search the connection in our hash table */
@@ -450,12 +450,12 @@ e_gw_connection_new (const char *uri, const char *username, const char *password
                }
        }
 
-       
+
        /* not found, so create a new connection */
        cnc = g_object_new (E_TYPE_GW_CONNECTION, NULL);
 
        msg = form_login_request (uri, username, password);
-       
+
        /* send message to server */
        response = e_gw_connection_send_message (cnc, msg);
 
@@ -490,7 +490,7 @@ e_gw_connection_new (const char *uri, const char *username, const char *password
                        g_free (host);
                        g_free (port);
                }
-                      
+
        }
        param = soup_soap_response_get_first_parameter_by_name (response, "session");
        if (!param) {
@@ -500,7 +500,7 @@ e_gw_connection_new (const char *uri, const char *username, const char *password
                g_static_mutex_unlock (&connecting);
                return NULL;
        }
-       
+
        cnc->priv->uri = g_strdup (uri);
        cnc->priv->username = g_strdup (username);
        cnc->priv->password = g_strdup (password);
@@ -508,7 +508,7 @@ e_gw_connection_new (const char *uri, const char *username, const char *password
 
        /* retrieve user information */
        param = soup_soap_response_get_first_parameter_by_name (response, "userinfo");
-       
+
        if (param) {
                SoupSoapParameter *subparam;
                char *param_value;
@@ -538,10 +538,10 @@ e_gw_connection_new (const char *uri, const char *username, const char *password
                param_value = soup_soap_parameter_get_string_value (param);
                cnc->priv->version = param_value;
        } else
-               cnc->priv->version = NULL;      
+               cnc->priv->version = NULL;
 
        param = soup_soap_response_get_first_parameter_by_name (response, "serverUTCTime");
-       if (param) 
+       if (param)
                cnc->priv->server_time = soup_soap_parameter_get_string_value (param);
 
        /* add the connection to the loaded_connections_permissions hash table */
@@ -599,7 +599,7 @@ e_gw_connection_get_container_list (EGwConnection *cnc, const char *top, GList *
        /* when user cancels password dialog, then the cnc is NULL */
        if (!cnc)
                return E_GW_CONNECTION_STATUS_UNKNOWN;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
        g_return_val_if_fail (container_list != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
 
@@ -630,8 +630,8 @@ e_gw_connection_get_container_list (EGwConnection *cnc, const char *top, GList *
                 return status;
         }
 
-       /* if status is OK - parse result. return the list */   
-       param = soup_soap_response_get_first_parameter_by_name (response, "folders");   
+       /* if status is OK - parse result. return the list */
+       param = soup_soap_response_get_first_parameter_by_name (response, "folders");
         if (param) {
                SoupSoapParameter *subparam;
                for (subparam = soup_soap_parameter_get_first_child_by_name (param, "folder");
@@ -640,7 +640,7 @@ e_gw_connection_get_container_list (EGwConnection *cnc, const char *top, GList *
                        EGwContainer *container;
 
                        container = e_gw_container_new_from_soap_parameter (subparam);
-                       if (container) 
+                       if (container)
                                *container_list = g_list_append (*container_list, container);
                }
        }
@@ -690,8 +690,8 @@ e_gw_connection_get_container_id (EGwConnection *cnc, const char *name)
        return container_id;
 }
 
-EGwConnectionStatus 
-e_gw_connection_get_items_delta_info (EGwConnection *cnc, const char *container, gdouble *first_sequence, 
+EGwConnectionStatus
+e_gw_connection_get_items_delta_info (EGwConnection *cnc, const char *container, gdouble *first_sequence,
                                        gdouble *last_sequence, gdouble *last_po_rebuild_time )
 {
         SoupSoapMessage *msg;
@@ -699,9 +699,9 @@ e_gw_connection_get_items_delta_info (EGwConnection *cnc, const char *container,
         EGwConnectionStatus status;
         SoupSoapParameter *param, *subparam;
        char *tmp = NULL;
-       
+
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getDeltaInfoRequest");
         if (!msg) {
@@ -735,7 +735,7 @@ e_gw_connection_get_items_delta_info (EGwConnection *cnc, const char *container,
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-       
+
         /* parse these parameters */
 
        subparam = soup_soap_parameter_get_first_child_by_name (param, "firstSequence");
@@ -756,7 +756,7 @@ e_gw_connection_get_items_delta_info (EGwConnection *cnc, const char *container,
        }
        else
                *last_sequence = -1;
-               
+
        subparam = soup_soap_parameter_get_first_child_by_name (param, "lastTimePORebuild");
 
        if (subparam) {
@@ -779,9 +779,9 @@ e_gw_connection_get_items_delta (EGwConnection *cnc, const char *container, cons
         SoupSoapResponse *response;
         EGwConnectionStatus status;
         SoupSoapParameter *param, *subparam, *subsubparam;
-       
+
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getDeltasRequest");
         if (!msg) {
@@ -792,12 +792,12 @@ e_gw_connection_get_items_delta (EGwConnection *cnc, const char *container, cons
        e_gw_message_write_string_parameter (msg, "container", NULL, container);
        if (view)
                e_gw_message_write_string_parameter (msg, "view", NULL, view);
-       
+
        soup_soap_message_start_element (msg, "deltaInfo", NULL, NULL);
        e_gw_message_write_string_parameter (msg, "firstSequence", NULL, start_sequence);
        e_gw_message_write_string_parameter (msg, "count", NULL, count);
        soup_soap_message_end_element(msg);
-       
+
         /* send message to server */
 
        e_gw_message_write_footer (msg);
@@ -816,23 +816,23 @@ e_gw_connection_get_items_delta (EGwConnection *cnc, const char *container, cons
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "items");
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-       
+
         /* parse these parameters */
         for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
             subparam != NULL;
             subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
                EGwItem *item;
 
-       
+
                item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, container, subparam);
-               
+
                subsubparam =  soup_soap_parameter_get_first_child_by_name(subparam, "sync");
                if (subsubparam) {
                        char *value;
@@ -842,11 +842,11 @@ e_gw_connection_get_items_delta (EGwConnection *cnc, const char *container, cons
                                *add_list = g_list_append (*add_list, item);
                        } else if (!strcmp (value, "delete")) {
                                *delete_list = g_list_append (*delete_list, item);
-                       } 
+                       }
                        g_free (value);
                }
         }
-               
+
        /* free memory */
         g_object_unref (response);
        g_object_unref (msg);
@@ -863,9 +863,9 @@ e_gw_connection_get_items (EGwConnection *cnc, const char *container, const char
         SoupSoapResponse *response;
         EGwConnectionStatus status;
         SoupSoapParameter *param, *subparam;
-       
+
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getItemsRequest");
         if (!msg) {
@@ -876,8 +876,8 @@ e_gw_connection_get_items (EGwConnection *cnc, const char *container, const char
        e_gw_message_write_string_parameter (msg, "container", NULL, container);
        if (view)
                e_gw_message_write_string_parameter (msg, "view", NULL, view);
-       
-       if (filter) 
+
+       if (filter)
                e_gw_filter_append_to_soap_message (filter, msg);
        e_gw_message_write_footer (msg);
 
@@ -897,14 +897,14 @@ e_gw_connection_get_items (EGwConnection *cnc, const char *container, const char
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "items");
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-       
+
         /* parse these parameters into ecalcomponents*/
         for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
             subparam != NULL;
@@ -915,7 +915,7 @@ e_gw_connection_get_items (EGwConnection *cnc, const char *container, const char
                if (item)
                        *list = g_list_append (*list, item);
         }
-               
+
        /* free memory */
         g_object_unref (response);
        g_object_unref (msg);
@@ -932,7 +932,7 @@ e_gw_connection_get_items_from_ids (EGwConnection *cnc, const char *container, c
         SoupSoapParameter *param, *subparam;
        int i;
         g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getItemsRequest");
         if (!msg) {
@@ -968,14 +968,14 @@ e_gw_connection_get_items_from_ids (EGwConnection *cnc, const char *container, c
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "items");
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-       
+
         /* parse these parameters into ecalcomponents*/
         for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
             subparam != NULL;
@@ -986,7 +986,7 @@ e_gw_connection_get_items_from_ids (EGwConnection *cnc, const char *container, c
                if (item)
                        *list = g_list_append (*list, item);
         }
-               
+
        /* free memory */
         g_object_unref (response);
        g_object_unref (msg);
@@ -997,133 +997,133 @@ e_gw_connection_get_items_from_ids (EGwConnection *cnc, const char *container, c
 EGwConnectionStatus
 e_gw_connection_get_deltas ( EGwConnection *cnc, GSList **adds, GSList **deletes, GSList **updates)
 {
-       SoupSoapMessage *msg; 
-        SoupSoapResponse *response; 
-        EGwConnectionStatus status; 
-        SoupSoapParameter *param, *subparam; 
-        
-       g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT); 
-
-       /* build the SOAP message */ 
-         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getDeltaRequest"); 
-         if (!msg) { 
-                 g_warning (G_STRLOC ": Could not build SOAP message"); 
-                // g_object_unref (cnc); 
-                 return E_GW_CONNECTION_STATUS_UNKNOWN; 
-         } 
-        
+       SoupSoapMessage *msg;
+        SoupSoapResponse *response;
+        EGwConnectionStatus status;
+        SoupSoapParameter *param, *subparam;
+
+       g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+
+       /* build the SOAP message */
+         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getDeltaRequest");
+         if (!msg) {
+                 g_warning (G_STRLOC ": Could not build SOAP message");
+                // g_object_unref (cnc);
+                 return E_GW_CONNECTION_STATUS_UNKNOWN;
+         }
+
         /*FIXME  make this generic */
-         soup_soap_message_start_element (msg, "CalendarItem", NULL, NULL); 
-         soup_soap_message_end_element (msg); 
-         e_gw_message_write_footer (msg); 
-
-         /* send message to server */ 
-         response = e_gw_connection_send_message (cnc, msg); 
-         if (!response) { 
-                 g_object_unref (msg); 
-                // g_object_unref (cnc); 
-                 return E_GW_CONNECTION_STATUS_NO_RESPONSE; 
-         } 
-
-         status = e_gw_connection_parse_response_status (response); 
-         if (status != E_GW_CONNECTION_STATUS_OK) { 
-               g_object_unref (response); 
-               g_object_unref (msg); 
-               //      g_object_unref (cnc); 
-               return status; 
-       } 
-
-       /* if status is OK - parse result. return the list */    
-       param = soup_soap_response_get_first_parameter_by_name (response, "changed"); 
-         if (!param) { 
-                 g_object_unref (response); 
-                 g_object_unref (msg); 
-                // g_object_unref (cnc); 
-                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE; 
-         } 
-       
-         if (!g_ascii_strcasecmp ( soup_soap_parameter_get_string_value (param), "0")) { 
-                 g_message ("No deltas"); 
-                // g_object_unref (cnc); 
-                 return E_GW_CONNECTION_STATUS_OK; 
-         }                 
-
-         param = soup_soap_response_get_first_parameter_by_name (response, "deltas"); 
-         if (!param) { 
-                 g_object_unref (response); 
-                 g_object_unref (msg); 
-                // g_object_unref (cnc); 
-//                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE; 
+         soup_soap_message_start_element (msg, "CalendarItem", NULL, NULL);
+         soup_soap_message_end_element (msg);
+         e_gw_message_write_footer (msg);
+
+         /* send message to server */
+         response = e_gw_connection_send_message (cnc, msg);
+         if (!response) {
+                 g_object_unref (msg);
+                // g_object_unref (cnc);
+                 return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+         }
+
+         status = e_gw_connection_parse_response_status (response);
+         if (status != E_GW_CONNECTION_STATUS_OK) {
+               g_object_unref (response);
+               g_object_unref (msg);
+               //      g_object_unref (cnc);
+               return status;
+       }
+
+       /* if status is OK - parse result. return the list */
+       param = soup_soap_response_get_first_parameter_by_name (response, "changed");
+         if (!param) {
+                 g_object_unref (response);
+                 g_object_unref (msg);
+                // g_object_unref (cnc);
+                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+         }
+
+         if (!g_ascii_strcasecmp ( soup_soap_parameter_get_string_value (param), "0")) {
+                 g_message ("No deltas");
+                // g_object_unref (cnc);
+                 return E_GW_CONNECTION_STATUS_OK;
+         }
+
+         param = soup_soap_response_get_first_parameter_by_name (response, "deltas");
+         if (!param) {
+                 g_object_unref (response);
+                 g_object_unref (msg);
+                // g_object_unref (cnc);
+//                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
                /* getting around the server behavior that deltas can be null
                 * though changes is true */
                 return E_GW_CONNECTION_STATUS_OK;
-         } 
-        
-         /* process all deletes first*/ 
-         param = soup_soap_parameter_get_first_child_by_name (param, "delete"); 
-         if (param) { 
-                 for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item"); 
-                         subparam != NULL; 
-                         subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {  
-                                 /*process each item */  
-                                 char *uid; 
-                                 SoupSoapParameter *param_id; 
-
-                                 param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id"); 
-                                 if (!param_id) { 
-                                         g_object_unref (response); 
-                                         g_object_unref (msg); 
-                                        // g_object_unref (cnc); 
-                                 } 
-                                 uid = (char *)soup_soap_parameter_get_string_value (param_id); 
-                                 /*if (!e_cal_backend_cache_remove_component (cache, uid, NULL)) 
+         }
+
+         /* process all deletes first*/
+         param = soup_soap_parameter_get_first_child_by_name (param, "delete");
+         if (param) {
+                 for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
+                         subparam != NULL;
+                         subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
+                                 /*process each item */
+                                 char *uid;
+                                 SoupSoapParameter *param_id;
+
+                                 param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id");
+                                 if (!param_id) {
+                                         g_object_unref (response);
+                                         g_object_unref (msg);
+                                        // g_object_unref (cnc);
+                                 }
+                                 uid = (char *)soup_soap_parameter_get_string_value (param_id);
+                                 /*if (!e_cal_backend_cache_remove_component (cache, uid, NULL))
                                          g_message ("Could not remove %s", uid); */
                                 *deletes = g_slist_append (*deletes, uid);
-                 } 
-         } 
-        
-         /* process adds*/ 
-         param = soup_soap_parameter_get_first_child_by_name (param, "add"); 
-         if (param) { 
-                 for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item"); 
-                         subparam != NULL; 
-                         subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {  
-                               /*process each item */  
+                 }
+         }
+
+         /* process adds*/
+         param = soup_soap_parameter_get_first_child_by_name (param, "add");
+         if (param) {
+                 for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
+                         subparam != NULL;
+                         subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
+                               /*process each item */
                                EGwItem *item;
                                /*FIXME  pass the container id */
                                item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "Calendar", subparam);
-                                if (!item) { 
-                                         g_object_unref (response); 
-                                         g_object_unref (msg); 
-                                        // g_object_unref (cnc); 
-                                       return E_GW_CONNECTION_STATUS_INVALID_RESPONSE; 
-                                 } 
-                                 /*if (!e_cal_backend_cache_put_component (cache, comp)) 
+                                if (!item) {
+                                         g_object_unref (response);
+                                         g_object_unref (msg);
+                                        // g_object_unref (cnc);
+                                       return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+                                 }
+                                 /*if (!e_cal_backend_cache_put_component (cache, comp))
                                          g_message ("Could not add the component"); */
                                 *adds = g_slist_append (*adds, item);
-                 } 
-         } 
-        
-         /* process updates*/ 
-         param = soup_soap_parameter_get_first_child_by_name (param, "update"); 
-         if (param) { 
-                 for (subparam = soup_soap_parameter_get_first_child_by_name(param, "item"); 
-                    subparam != NULL; 
-                    subparam = soup_soap_parameter_get_next_child (subparam)) {  
+                 }
+         }
+
+         /* process updates*/
+         param = soup_soap_parameter_get_first_child_by_name (param, "update");
+         if (param) {
+                 for (subparam = soup_soap_parameter_get_first_child_by_name(param, "item");
+                    subparam != NULL;
+                    subparam = soup_soap_parameter_get_next_child (subparam)) {
                         EGwItem *item;
                         /*process each item */
                         /*item = get_item_from_updates (subparam);*/
                         item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "Calendar", subparam);
                         if (item)
                                 *updates = g_slist_append (*updates, item);
-                 } 
+                 }
          }
-        
-        /* free memory */ 
-        g_object_unref (response); 
-        g_object_unref (msg); 
 
-        return E_GW_CONNECTION_STATUS_OK;        
+        /* free memory */
+        g_object_unref (response);
+        g_object_unref (msg);
+
+        return E_GW_CONNECTION_STATUS_OK;
 }
 
 EGwConnectionStatus
@@ -1169,7 +1169,7 @@ e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item, GSList **id_list)
                // for loop here to populate the list_ids.
                for (param = soup_soap_response_get_first_parameter_by_name (response, "id");
                        param; param = soup_soap_response_get_next_parameter_by_name (response, param, "id")) {
-                       
+
                        *id_list = g_slist_append (*id_list, soup_soap_parameter_get_string_value (param));
                }
        }
@@ -1188,7 +1188,7 @@ e_gw_connection_create_item (EGwConnection *cnc, EGwItem *item, char** id)
        SoupSoapResponse *response;
        SoupSoapParameter *param;
        EGwConnectionStatus status = E_GW_CONNECTION_STATUS_UNKNOWN;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
        g_return_val_if_fail (E_IS_GW_ITEM (item), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
@@ -1217,24 +1217,24 @@ e_gw_connection_create_item (EGwConnection *cnc, EGwItem *item, char** id)
        status = e_gw_connection_parse_response_status (response);
        if (status == E_GW_CONNECTION_STATUS_OK) {
                param = soup_soap_response_get_first_parameter_by_name (response, "id");
-               if (param != NULL) 
+               if (param != NULL)
                        *id = g_strdup (soup_soap_parameter_get_string_value (param));
        } else if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                reauthenticate (cnc);
-       
+
        g_object_unref (msg);
        g_object_unref (response);
 
        return status;
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_modify_item (EGwConnection *cnc, const char *id , EGwItem *item)
 {
        SoupSoapMessage *msg;
         SoupSoapResponse *response;
         EGwConnectionStatus status;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
        /* build the SOAP message */
@@ -1268,10 +1268,10 @@ e_gw_connection_modify_item (EGwConnection *cnc, const char *id , EGwItem *item)
        g_object_unref (response);
 
        return status;
-               
+
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_get_item (EGwConnection *cnc, const char *container, const char *id, const char *view, EGwItem **item)
 {
 
@@ -1288,7 +1288,7 @@ e_gw_connection_get_item (EGwConnection *cnc, const char *container, const char
                 g_warning (G_STRLOC ": Could not build SOAP message");
                 return E_GW_CONNECTION_STATUS_UNKNOWN;
         }
-      
+
 
        e_gw_message_write_string_parameter (msg, "id", NULL, id);
 
@@ -1312,17 +1312,17 @@ e_gw_connection_get_item (EGwConnection *cnc, const char *container, const char
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "item");
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-       
+
                *item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, container, param);
-       
-               
+
+
        /* free memory */
         g_object_unref (response);
        g_object_unref (msg);
@@ -1418,7 +1418,7 @@ e_gw_connection_accept_request (EGwConnection *cnc, const char *id, const char *
        e_gw_message_write_string_parameter (msg, "item", NULL, id);
        soup_soap_message_end_element (msg);
        e_gw_message_write_string_parameter (msg, "acceptLevel", NULL, accept_level);
-       
+
        if (recurrence_key)
                e_gw_message_write_string_parameter (msg, "recurrenceAllInstances", NULL, recurrence_key);
 
@@ -1452,7 +1452,7 @@ e_gw_connection_decline_request (EGwConnection *cnc, const char *id, const char
        soup_soap_message_start_element (msg, "items", NULL, NULL);
        e_gw_message_write_string_parameter (msg, "item", NULL, id);
        soup_soap_message_end_element (msg);
-       
+
        if (decline_comment)
                e_gw_message_write_string_parameter (msg, "comment", NULL, decline_comment);
 
@@ -1530,7 +1530,7 @@ e_gw_connection_complete_request (EGwConnection *cnc, const char *id)
        return status;
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char *id, const char *comments_org, const char *comments_del, const char *recur_key)
 {
        SoupSoapMessage *msg;
@@ -1538,7 +1538,7 @@ e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char
        SoupSoapResponse *response;
 
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "delegateRequest");
-       
+
        if (id)
                e_gw_message_write_string_parameter (msg, "id", NULL, id);
 
@@ -1549,7 +1549,7 @@ e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char
                e_gw_message_write_string_parameter (msg, "commentToDelegatee", NULL, comments_del);
        if (recur_key)
                e_gw_message_write_string_parameter (msg, "recurrenceAllInstances", NULL, recur_key);
-       
+
        e_gw_message_write_footer (msg);
 
        response = e_gw_connection_send_message (cnc, msg);
@@ -1561,10 +1561,10 @@ e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char
         status = e_gw_connection_parse_response_status (response);
        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                reauthenticate (cnc);
-       
+
        g_object_unref (response);
        g_object_unref (msg);
-       
+
        return status;
 }
 
@@ -1601,14 +1601,14 @@ e_gw_connection_get_user_name (EGwConnection *cnc)
        return (const char *) cnc->priv->user_name;
 }
 
-const char* 
+const char*
 e_gw_connection_get_user_email (EGwConnection *cnc)
 {
        g_return_val_if_fail (cnc != NULL, NULL);
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL);
-  
+
        return (const char*) cnc->priv->user_email;
-       
+
 }
 
 const char *
@@ -1619,7 +1619,7 @@ e_gw_connection_get_user_uuid (EGwConnection *cnc)
        return (const char *) cnc->priv->user_uuid;
 }
 
-const char * 
+const char *
 e_gw_connection_get_server_time (EGwConnection *cnc)
 {
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), NULL) ;
@@ -1632,7 +1632,7 @@ timet_from_string (const char *str)
 {
        struct tm date;
         int len, i;
-                                                              
+
         g_return_val_if_fail (str != NULL, -1);
 
        /* yyyymmdd[Thhmmss[Z]] */
@@ -1660,7 +1660,7 @@ timet_from_string (const char *str)
                 date.tm_min  = digit_at (str, 11) * 10 + digit_at (str, 12);
                 date.tm_sec  = digit_at (str, 13) * 10 + digit_at (str, 14);
         } else
-               date.tm_hour = date.tm_min = date.tm_sec = 0; 
+               date.tm_hour = date.tm_min = date.tm_sec = 0;
 
        return mktime (&date);
 }
@@ -1670,7 +1670,7 @@ e_gw_connection_format_date_string (const char *dtstring)
 {
         char *str2;
         int i, j, len = strlen (dtstring);
-       
+
         str2 = g_malloc0 (len);
        if (len <= 0)
                return str2;
@@ -1692,7 +1692,7 @@ e_gw_connection_get_date_from_string (const char *dtstring)
         char *str2;
         int i, j, len = strlen (dtstring);
        time_t t;
-       
+
         str2 = g_malloc0 (len+1);
         for (i = 0,j = 0; i < len; i++) {
                 if ((dtstring[i] != '-') && (dtstring[i] != ':')) {
@@ -1708,7 +1708,7 @@ e_gw_connection_get_date_from_string (const char *dtstring)
         return t;
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_create_book (EGwConnection *cnc, char *book_name, char**id)
 {
        SoupSoapMessage *msg;
@@ -1745,9 +1745,9 @@ e_gw_connection_create_book (EGwConnection *cnc, char *book_name, char**id)
        if (value)
                *id = value;
 
-       status = E_GW_CONNECTION_STATUS_OK;     
-       return status;  
-} 
+       status = E_GW_CONNECTION_STATUS_OK;
+       return status;
+}
 
 EGwConnectionStatus
 e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_list)
@@ -1800,9 +1800,9 @@ e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_lis
                g_static_mutex_unlock (&connecting);
                 return status;
         }
-       
-       /* if status is OK - parse result. return the list */   
-       param = soup_soap_response_get_first_parameter_by_name (response, "books");     
+
+       /* if status is OK - parse result. return the list */
+       param = soup_soap_response_get_first_parameter_by_name (response, "books");
         if (!param) {
                 g_object_unref (response);
                g_static_mutex_unlock (&connecting);
@@ -1813,7 +1813,7 @@ e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_lis
                     subparam != NULL;
                     subparam = soup_soap_parameter_get_next_child_by_name (subparam, "book")) {
                        EGwContainer *container;
-                                      
+
                        container = e_gw_container_new_from_soap_parameter (subparam);
                        if (container) {
                                priv->book_list = g_list_append (priv->book_list, container);
@@ -1823,7 +1823,7 @@ e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_lis
                                        value = soup_soap_parameter_get_string_value (type_param);
                                if (value && g_str_equal(value , "1"))
                                        e_gw_container_set_is_writable (container, TRUE);
-                               else 
+                               else
                                        e_gw_container_set_is_writable (container, FALSE);
                                g_free (value);
                                value = NULL;
@@ -1832,11 +1832,11 @@ e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_lis
                                         value = soup_soap_parameter_get_string_value (type_param);
                                 if (value && g_str_equal(value , "1"))
                                         e_gw_container_set_is_frequent_contacts (container, TRUE);
-                                                                        
+
                                g_free (value);
-                                       
+
                        }
-                                    
+
                }
        }
 
@@ -1848,7 +1848,7 @@ e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_lis
 }
 
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_get_address_book_id ( EGwConnection *cnc, char *book_name, char**id , gboolean *is_writable)
 {
        EGwConnectionStatus status;
@@ -1866,7 +1866,7 @@ e_gw_connection_get_address_book_id ( EGwConnection *cnc, char *book_name, char*
        for (l = container_list; l != NULL; l = l->next) {
                EGwContainer *container = E_GW_CONTAINER (l->data);
                if (strcmp (e_gw_container_get_name (container), book_name) == 0) {
-                       
+
                        *id = g_strdup (e_gw_container_get_id (container));
                        *is_writable = e_gw_container_get_is_writable (container);
                        break;
@@ -1895,7 +1895,7 @@ e_gw_connection_modify_settings (EGwConnection *cnc, EGwSendOptions *opts)
                 g_warning (G_STRLOC ": Could not build SOAP message");
                 return E_GW_CONNECTION_STATUS_UNKNOWN;
         }
-       
+
        if (!e_gw_sendoptions_form_message_to_modify (msg, opts, priv->opts)) {
                g_warning (G_STRLOC ": Could not append changes to SOAP message");
                g_object_unref (msg);
@@ -1903,7 +1903,7 @@ e_gw_connection_modify_settings (EGwConnection *cnc, EGwSendOptions *opts)
        }
 
                e_gw_message_write_footer (msg);
-       
+
         /* send message to server */
         response = e_gw_connection_send_message (cnc, msg);
         if (!response) {
@@ -1938,7 +1938,7 @@ e_gw_connection_get_settings (EGwConnection *cnc, EGwSendOptions **opts)
        EGwConnectionStatus status;
        SoupSoapParameter *param;
        EGwConnectionPrivate *priv;
-       static GStaticMutex connecting = G_STATIC_MUTEX_INIT;   
+       static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
 
 
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
@@ -1951,7 +1951,7 @@ e_gw_connection_get_settings (EGwConnection *cnc, EGwSendOptions **opts)
                g_object_ref (priv->opts);
                *opts = priv->opts;
                g_static_mutex_unlock (&connecting);
-               
+
                return E_GW_CONNECTION_STATUS_OK;
        }
 
@@ -1980,14 +1980,14 @@ e_gw_connection_get_settings (EGwConnection *cnc, EGwSendOptions **opts)
                g_static_mutex_unlock (&connecting);
                return status;
        }
-       
+
        param = soup_soap_response_get_first_parameter_by_name (response, "settings");
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
                g_static_mutex_unlock (&connecting);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
-        } else 
+        } else
                priv->opts = e_gw_sendoptions_new_from_soap_parameter (param);
 
        g_object_ref (priv->opts);
@@ -1995,11 +1995,11 @@ e_gw_connection_get_settings (EGwConnection *cnc, EGwSendOptions **opts)
        g_object_unref (response);
         g_object_unref (msg);
        g_static_mutex_unlock (&connecting);
-       
+
        return E_GW_CONNECTION_STATUS_OK;
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_id, GHashTable **categories_by_name)
 {
        SoupSoapMessage *msg;
@@ -2049,7 +2049,7 @@ e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_i
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "categories");
         if (!param) {
                 g_object_unref (response);
@@ -2057,7 +2057,7 @@ e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_i
                g_static_mutex_unlock (&connecting);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-       
+
        priv->categories_by_id = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
        priv->categories_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
 
@@ -2075,16 +2075,16 @@ e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_i
                        char **components = g_strsplit (id, "@", -1);
                        g_free (id);
                        id = components[0];
-                       if (categories_by_id) 
+                       if (categories_by_id)
                                g_hash_table_insert (priv->categories_by_id, g_strdup (id), g_strdup (name));
-                       if (categories_by_name) 
+                       if (categories_by_name)
                                g_hash_table_insert (priv->categories_by_name, g_strdup (name), g_strdup (id));
                        g_strfreev (components);
                        g_free (name);
                }
-               
+
         }
-               
+
        /* free memory */
         g_object_unref (response);
        g_object_unref (msg);
@@ -2095,17 +2095,17 @@ e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_i
         return E_GW_CONNECTION_STATUS_OK;
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_add_members (EGwConnection *cnc, const char *group_id, GList *member_ids)
 {
        SoupSoapMessage *msg;
        SoupSoapResponse *response;
         EGwConnectionStatus status;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
        g_return_val_if_fail (member_ids != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
        g_return_val_if_fail (group_id != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
-       
+
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "addMembersRequest");
         if (!msg) {
                 g_warning (G_STRLOC ": Could not build SOAP message");
@@ -2119,7 +2119,7 @@ e_gw_connection_add_members (EGwConnection *cnc, const char *group_id, GList *me
                e_gw_message_write_string_parameter (msg, "id", NULL, member_ids->data);
                soup_soap_message_end_element(msg);
        }
-       
+
        soup_soap_message_end_element(msg);
        e_gw_message_write_footer (msg);
        response = e_gw_connection_send_message (cnc, msg);
@@ -2134,22 +2134,22 @@ e_gw_connection_add_members (EGwConnection *cnc, const char *group_id, GList *me
        g_object_unref (response);
        g_object_unref (msg);
        return status;
-       
+
 
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_remove_members (EGwConnection *cnc, const char *group_id, GList *member_ids)
 {
-       
+
        SoupSoapMessage *msg;
        SoupSoapResponse *response;
         EGwConnectionStatus status;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
        g_return_val_if_fail (member_ids != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
        g_return_val_if_fail (group_id != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
-       
+
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "removeMembersRequest");
         if (!msg) {
                 g_warning (G_STRLOC ": Could not build SOAP message");
@@ -2202,7 +2202,7 @@ e_gw_connection_create_cursor (EGwConnection *cnc, const char *container, const
                e_gw_message_write_string_parameter (msg, "view", NULL, view);
        if (E_IS_GW_FILTER(filter))
                e_gw_filter_append_to_soap_message (filter, msg);
-       
+
        e_gw_message_write_footer (msg);
 
        response = e_gw_connection_send_message (cnc, msg);
@@ -2210,7 +2210,7 @@ e_gw_connection_create_cursor (EGwConnection *cnc, const char *container, const
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_NO_RESPONSE;
         }
-       
+
        status = e_gw_connection_parse_response_status (response);
         if (status != E_GW_CONNECTION_STATUS_OK) {
                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
@@ -2226,7 +2226,7 @@ e_gw_connection_create_cursor (EGwConnection *cnc, const char *container, const
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
        value = soup_soap_parameter_get_string_value(param);
-       
+
        if (!value) {
                 g_object_unref (response);
                 g_object_unref (msg);
@@ -2234,7 +2234,7 @@ e_gw_connection_create_cursor (EGwConnection *cnc, const char *container, const
         }
 
        *cursor =(int) g_ascii_strtod (value, NULL);
-       
+
        g_free (value);
        g_object_unref (response);
        g_object_unref (msg);
@@ -2247,10 +2247,10 @@ e_gw_connection_destroy_cursor (EGwConnection *cnc, const char *container,  int
        SoupSoapMessage *msg;
        SoupSoapResponse *response;
         EGwConnectionStatus status;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
        g_return_val_if_fail ((container != NULL), E_GW_CONNECTION_STATUS_UNKNOWN);
-       
+
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "destroyCursorRequest");
        e_gw_message_write_string_parameter (msg, "container", NULL, container);
 
@@ -2262,14 +2262,14 @@ e_gw_connection_destroy_cursor (EGwConnection *cnc, const char *container,  int
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_NO_RESPONSE;
         }
-       
+
        status = e_gw_connection_parse_response_status (response);
        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                reauthenticate (cnc);
        g_object_unref (response);
        g_object_unref (msg);
        return status;
-     
+
 }
 
 
@@ -2289,7 +2289,7 @@ e_gw_connection_position_cursor (EGwConnection *cnc, const char *container, int
        e_gw_message_write_string_parameter (msg, "container", NULL, container);
        e_gw_message_write_string_parameter (msg, "seek", NULL, seek);
        e_gw_message_write_int_parameter (msg, "offset", NULL, offset);
-       
+
        e_gw_message_write_footer (msg);
 
        response = e_gw_connection_send_message (cnc, msg);
@@ -2297,7 +2297,7 @@ e_gw_connection_position_cursor (EGwConnection *cnc, const char *container, int
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_NO_RESPONSE;
         }
-       
+
        status = e_gw_connection_parse_response_status (response);
        g_object_unref (response);
         g_object_unref (msg);
@@ -2311,19 +2311,19 @@ e_gw_connection_read_cursor (EGwConnection *cnc, const char *container, int curs
        SoupSoapResponse *response;
         EGwConnectionStatus status;
        SoupSoapParameter *param, *subparam;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
        g_return_val_if_fail ((container != NULL), E_GW_CONNECTION_STATUS_UNKNOWN);
-       
+
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "readCursorRequest");
        e_gw_message_write_int_parameter (msg, "cursor", NULL, cursor);
-       /* there is problem in read curosr if you set this, uncomment after the problem 
+       /* there is problem in read curosr if you set this, uncomment after the problem
           is fixed in server */
        e_gw_message_write_string_parameter (msg, "position", NULL, cursor_seek);
        e_gw_message_write_string_parameter (msg, "forward", NULL, forward ? "true": "false");
        e_gw_message_write_string_parameter (msg, "container", NULL, container);
        e_gw_message_write_int_parameter (msg, "count", NULL, count);
-       
+
        e_gw_message_write_footer (msg);
 
        response = e_gw_connection_send_message (cnc, msg);
@@ -2331,7 +2331,7 @@ e_gw_connection_read_cursor (EGwConnection *cnc, const char *container, int curs
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_NO_RESPONSE;
         }
-       
+
        status = e_gw_connection_parse_response_status (response);
         if (status != E_GW_CONNECTION_STATUS_OK) {
                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
@@ -2341,7 +2341,7 @@ e_gw_connection_read_cursor (EGwConnection *cnc, const char *container, int curs
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "items");
         if (!param) {
                 g_object_unref (response);
@@ -2358,7 +2358,7 @@ e_gw_connection_read_cursor (EGwConnection *cnc, const char *container, int curs
                if (item)
                        *item_list = g_list_append (*item_list, item);
         }
-               
+
        /* free memory */
         g_object_unref (response);
        g_object_unref (msg);
@@ -2371,7 +2371,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
        SoupSoapResponse *response;
         EGwConnectionStatus status;
        SoupSoapParameter *param, *subparam;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
        g_return_val_if_fail (message_list != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
 
@@ -2381,7 +2381,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
                e_gw_message_write_string_parameter (msg, "startDate", NULL, *start_date);
        if (container)
                e_gw_message_write_string_parameter (msg, "container", NULL, container);
-       if (item_types) 
+       if (item_types)
                e_gw_message_write_string_parameter (msg, "types", NULL, item_types);
        if (item_sources)
                e_gw_message_write_string_parameter (msg, "source", NULL, item_sources);
@@ -2389,7 +2389,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
                e_gw_message_write_string_parameter (msg, "view", NULL, view);
        if (count > 0)
                e_gw_message_write_int_parameter (msg, "count", NULL, count);
-       
+
        e_gw_message_write_footer (msg);
 
        response = e_gw_connection_send_message (cnc, msg);
@@ -2397,7 +2397,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_NO_RESPONSE;
         }
-       
+
        status = e_gw_connection_parse_response_status (response);
         if (status != E_GW_CONNECTION_STATUS_OK) {
                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
@@ -2407,7 +2407,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        *item_list = NULL;
        param = soup_soap_response_get_first_parameter_by_name (response, "items");
         if (!param) {
@@ -2423,16 +2423,16 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
                        date = soup_soap_parameter_get_string_value (subparam);
                        if (date)
                                g_free (*start_date), *start_date = NULL, *start_date = date;
-                       else 
+                       else
                                return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
-               } else 
+               } else
                        return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
        }
-       
-       if (!strcmp (message_list, "All")) { 
+
+       if (!strcmp (message_list, "All")) {
                gboolean view_is_id = FALSE;
 
-               if (!strcmp (view, "id")) 
+               if (!strcmp (view, "id"))
                        view_is_id = TRUE;
                /* We are  interested only in getting the ids */
                for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
@@ -2440,7 +2440,7 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
                     subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
                        SoupSoapParameter *param_id;
                        char *id;
-                       
+
                        if (view_is_id) {
                                param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id");
                                if (!param_id) {
@@ -2456,12 +2456,12 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
                                        return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
                                }
                        }
-                    
+
                        id = g_strdup (soup_soap_parameter_get_string_value (param_id));
                        if (id)
                                *item_list = g_slist_append (*item_list, id);
                }
-               
+
                g_object_unref (response);
                g_object_unref (msg);
                return E_GW_CONNECTION_STATUS_OK;
@@ -2477,17 +2477,17 @@ EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, cons
                if (item)
                        *item_list = g_slist_append (*item_list, item);
         }
-               
+
        /* free memory */
         g_object_unref (response);
        g_object_unref (msg);
         return E_GW_CONNECTION_STATUS_OK;
-       
+
 
 }
 
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_create_folder(EGwConnection *cnc, const char *parent_name,const char *folder_name, char **container_id)
 {
        SoupSoapMessage *msg;
@@ -2530,7 +2530,7 @@ e_gw_connection_create_folder(EGwConnection *cnc, const char *parent_name,const
 }
 
 /*
- * 
+ *
  */
 EGwConnectionStatus
 e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset, int length, const char **attachment, int *attach_length)
@@ -2550,7 +2550,7 @@ e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset,
                 g_warning (G_STRLOC ": Could not build SOAP message");
                 return E_GW_CONNECTION_STATUS_UNKNOWN;
         }
-      
+
 
        e_gw_message_write_string_parameter (msg, "id", NULL, id);
        e_gw_message_write_int_parameter (msg, "offset", NULL, offset);
@@ -2574,13 +2574,13 @@ e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset,
                return status;
        }
 
-       
+
        param = soup_soap_response_get_first_parameter_by_name (response, "part") ;
        if (param) {
                buf_length =  soup_soap_parameter_get_property (param, "length") ;
                buffer = soup_soap_parameter_get_string_value (param) ;
        }
-        
+
        if (buffer && buf_length) {
                int len = atoi (buf_length) ;
                *attachment = g_base64_decode (buffer,&len) ;
@@ -2597,7 +2597,7 @@ e_gw_connection_get_attachment (EGwConnection *cnc, const char *id, int offset,
 }
 
 /*
- * 
+ *
  */
 EGwConnectionStatus
 e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const char *id, int offset, int length, const char **attachment, int *attach_length, int *offset_r)
@@ -2617,7 +2617,7 @@ e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const char *id, int o
                 g_warning (G_STRLOC ": Could not build SOAP message");
                 return E_GW_CONNECTION_STATUS_UNKNOWN;
         }
-      
+
 
        e_gw_message_write_string_parameter (msg, "id", NULL, id);
        e_gw_message_write_int_parameter (msg, "offset", NULL, offset);
@@ -2641,14 +2641,14 @@ e_gw_connection_get_attachment_base64 (EGwConnection *cnc, const char *id, int o
                return status;
        }
 
-       
+
        param = soup_soap_response_get_first_parameter_by_name (response, "part") ;
        if (param) {
                buf_length =  soup_soap_parameter_get_property (param, "length") ;
                o_return =  soup_soap_parameter_get_property (param, "offset") ;
                buffer = soup_soap_parameter_get_string_value (param) ;
        }
-        
+
        if (buffer && buf_length) {
                int len = atoi (buf_length) ;
                *attachment = g_strdup (buffer);
@@ -2716,7 +2716,7 @@ e_gw_connection_add_items (EGwConnection *cnc, const char *container, GList *ite
 
        if (container && *container)
                e_gw_message_write_string_parameter (msg, "container", NULL, container);
-       
+
        soup_soap_message_start_element (msg, "items", NULL, NULL);
        for (; item_ids != NULL; item_ids = g_list_next (item_ids))
                e_gw_message_write_string_parameter (msg, "item", NULL, item_ids->data);
@@ -2741,13 +2741,13 @@ e_gw_connection_add_items (EGwConnection *cnc, const char *container, GList *ite
        return status;
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *new_name)
 {
        SoupSoapMessage *msg;
         SoupSoapResponse *response;
         EGwConnectionStatus status;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
        /* build the SOAP message */
@@ -2764,7 +2764,7 @@ e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *n
        e_gw_message_write_string_parameter (msg, "name", NULL, new_name);
        soup_soap_message_end_element (msg) ;
        soup_soap_message_end_element (msg) ;
-       
+
        e_gw_message_write_footer (msg);
 
        /* send message to server */
@@ -2781,11 +2781,11 @@ e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *n
        g_object_unref (response);
 
        return status;
-               
+
 }
 
-EGwConnectionStatus 
-e_gw_connection_share_folder(EGwConnection *cnc, gchar *id, GList *new_list, const char *sub, const char *mesg ,int flag) 
+EGwConnectionStatus
+e_gw_connection_share_folder(EGwConnection *cnc, gchar *id, GList *new_list, const char *sub, const char *mesg ,int flag)
 {
        SoupSoapMessage *msg;
        SoupSoapResponse *response;
@@ -2795,7 +2795,7 @@ e_gw_connection_share_folder(EGwConnection *cnc, gchar *id, GList *new_list, con
        e_gw_container_form_message (msg, id, new_list, sub, mesg, flag);
        e_gw_message_write_footer (msg);
        response =  e_gw_connection_send_message (cnc, msg);
-       
+
        if (!response) {
                g_object_unref (msg);
                return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
@@ -2823,13 +2823,13 @@ e_gw_connection_move_item (EGwConnection *cnc, const char *id, const char *dest_
        g_return_val_if_fail (id != NULL, E_GW_CONNECTION_STATUS_INVALID_OBJECT);
        g_return_val_if_fail (dest_container_id != NULL, E_GW_CONNECTION_STATUS_INVALID_OBJECT);
 
-       
+
        /* build the SOAP message */
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "moveItemRequest");
        e_gw_message_write_string_parameter (msg, "id", NULL, id);
        e_gw_message_write_string_parameter (msg, "container", NULL,dest_container_id);
        if (from_container_id)
-               e_gw_message_write_string_parameter (msg, "from", NULL,from_container_id);      
+               e_gw_message_write_string_parameter (msg, "from", NULL,from_container_id);
        e_gw_message_write_footer (msg);
 
        /* send message to server */
@@ -2885,14 +2885,14 @@ e_gw_connection_accept_shared_folder (EGwConnection *cnc, gchar *name, gchar *co
 
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_purge_deleted_items (EGwConnection *cnc)
 {
 
        SoupSoapMessage *msg;
        SoupSoapResponse *response;
        EGwConnectionStatus status = E_GW_CONNECTION_STATUS_UNKNOWN;
-       
+
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "purgeDeletedItemsRequest");
        e_gw_message_write_footer (msg);
        response =  e_gw_connection_send_message (cnc, msg);
@@ -2911,14 +2911,14 @@ e_gw_connection_purge_deleted_items (EGwConnection *cnc)
 
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_purge_selected_items (EGwConnection *cnc, GList *item_ids)
 {
 
        SoupSoapMessage *msg;
        SoupSoapResponse *response;
        EGwConnectionStatus status = E_GW_CONNECTION_STATUS_UNKNOWN;
-       
+
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "purgeRequest");
        /* Now write the elements that need to be deleted */
        soup_soap_message_start_element (msg, "items", NULL, NULL);
@@ -3021,29 +3021,29 @@ e_gw_connection_reply_item (EGwConnection *cnc, const char *id, const char *view
         SoupSoapResponse *response;
         EGwConnectionStatus status;
         SoupSoapParameter *param;
-        
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "replyRequest");
         if (!msg) {
                 g_warning (G_STRLOC ": Could not build SOAP message");
                 return E_GW_CONNECTION_STATUS_UNKNOWN;
         }
-       
+
        e_gw_message_write_string_parameter (msg, "id", NULL, id);
 
        if (view)
                e_gw_message_write_string_parameter (msg, "view", NULL, view) ;
        e_gw_message_write_footer (msg);
-        
+
        /* send message to server */
         response = e_gw_connection_send_message (cnc, msg);
         if (!response) {
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_NO_RESPONSE;
         }
-        
+
        status = e_gw_connection_parse_response_status (response);
         if (status != E_GW_CONNECTION_STATUS_OK) {
                if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
@@ -3053,17 +3053,17 @@ e_gw_connection_reply_item (EGwConnection *cnc, const char *id, const char *view
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "item");
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-               
+
        *item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "", param);
-       
-               
+
+
        /* free memory */
         g_object_unref (response);
        g_object_unref (msg);
@@ -3080,22 +3080,22 @@ e_gw_connection_forward_item (EGwConnection *cnc, const char *id, const char *vi
         SoupSoapParameter *param;
 
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "forwardRequest");
         if (!msg) {
                 g_warning (G_STRLOC ": Could not build SOAP message");
                 return E_GW_CONNECTION_STATUS_UNKNOWN;
         }
-       
+
        e_gw_message_write_string_parameter (msg, "id", NULL, id);
 
        if (view)
                e_gw_message_write_string_parameter (msg, "view", NULL, view) ;
 
-       if (embed) 
+       if (embed)
                e_gw_message_write_int_parameter (msg, "embed", NULL,1);
-        
+
        e_gw_message_write_footer (msg);
        /* send message to server */
         response = e_gw_connection_send_message (cnc, msg);
@@ -3113,17 +3113,17 @@ e_gw_connection_forward_item (EGwConnection *cnc, const char *id, const char *vi
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "item");
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-               
+
        *item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "", param);
-       
-               
+
+
        /* free memory */
        g_object_unref (response);
        g_object_unref (msg);
@@ -3133,21 +3133,21 @@ e_gw_connection_forward_item (EGwConnection *cnc, const char *id, const char *vi
 
 /* e_gw_connection_create_junk_entry :creates a junk entry in the list
  * @cnc
- * @value : to be added in the list 
+ * @value : to be added in the list
  * @match_type : "email"/"domain" default: email
  * @list_type : "junk"/"trust"/"block" default: junk
  * */
 
 EGwConnectionStatus
-e_gw_connection_create_junk_entry (EGwConnection *cnc, const char *value, const char *match_type, const char *list_type) 
+e_gw_connection_create_junk_entry (EGwConnection *cnc, const char *value, const char *match_type, const char *list_type)
 {
        SoupSoapMessage *msg;
         SoupSoapResponse *response;
         EGwConnectionStatus status;
-        
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
        g_return_val_if_fail (value != NULL, E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "createJunkEntryRequest");
         if (!msg) {
@@ -3161,7 +3161,7 @@ e_gw_connection_create_junk_entry (EGwConnection *cnc, const char *value, const
        soup_soap_message_end_element (msg);
        e_gw_message_write_footer (msg);
        response =  e_gw_connection_send_message (cnc, msg);
-       
+
        if (!response) {
                g_object_unref (msg);
                return E_GW_CONNECTION_STATUS_NO_RESPONSE;
@@ -3182,7 +3182,7 @@ static void
 parse_junk_settings (SoupSoapParameter *param, int *use_junk, int *use_block, int *use_pab, int *persistence)
 {
        SoupSoapParameter *subparam, *field_param, *val_param;
-       
+
        if (param == NULL)
                return ;
        else    {
@@ -3218,7 +3218,7 @@ parse_junk_settings (SoupSoapParameter *param, int *use_junk, int *use_block, in
                                        val = soup_soap_parameter_get_int_value (val_param);
                                *use_pab = val;
                                g_free (field);
-                       } else if (!g_ascii_strcasecmp (field, "persistence")) { 
+                       } else if (!g_ascii_strcasecmp (field, "persistence")) {
                                if (val_param)
                                        val = soup_soap_parameter_get_int_value (val_param);
                                *persistence = val;
@@ -3233,7 +3233,7 @@ parse_junk_settings (SoupSoapParameter *param, int *use_junk, int *use_block, in
  * use_junk : returned value, whether junk list is being used
  * use_block: use block list
  * use_pab: returned value, whether personal addresbook is used
- * persistence: 
+ * persistence:
  * */
 EGwConnectionStatus
 e_gw_connection_get_junk_settings (EGwConnection *cnc, int *use_junk, int *use_block, int *use_pab, int *persistence)
@@ -3242,9 +3242,9 @@ e_gw_connection_get_junk_settings (EGwConnection *cnc, int *use_junk, int *use_b
         SoupSoapResponse *response;
        SoupSoapParameter *param;
         EGwConnectionStatus status;
-        
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getJunkMailSettingsRequest");
 
@@ -3254,7 +3254,7 @@ e_gw_connection_get_junk_settings (EGwConnection *cnc, int *use_junk, int *use_b
         }
        e_gw_message_write_footer (msg);
        response =  e_gw_connection_send_message (cnc, msg);
-       
+
        if (!response) {
                g_object_unref (msg);
                return E_GW_CONNECTION_STATUS_NO_RESPONSE;
@@ -3277,7 +3277,7 @@ e_gw_connection_get_junk_settings (EGwConnection *cnc, int *use_junk, int *use_b
 
 }
 
-static void 
+static void
 msg_add_settings (SoupSoapMessage *msg, char *field, int value)
 {
        soup_soap_message_start_element (msg, "setting", NULL, NULL);
@@ -3293,7 +3293,7 @@ msg_add_settings (SoupSoapMessage *msg, char *field, int value)
  * use_pab 1: put messages except from personal add book in junk, 0 disable
  * @persistence :delete after
  * */
+
 EGwConnectionStatus
 e_gw_connection_modify_junk_settings (EGwConnection *cnc, int use_junk, int use_pab, int use_block, int persistence)
 {
@@ -3329,7 +3329,7 @@ e_gw_connection_modify_junk_settings (EGwConnection *cnc, int use_junk, int use_
        status = e_gw_connection_parse_response_status (response);
        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                reauthenticate (cnc);
-       
+
        /* free memory */
        g_object_unref (response);
        g_object_unref (msg);
@@ -3371,15 +3371,15 @@ e_gw_junkentry_new_from_soap_parameter (SoupSoapParameter *param)
        junk_entry->matchType = soup_soap_parameter_get_string_value (subparam);
 
        subparam = soup_soap_parameter_get_first_child_by_name (param, "lastUsed");
-       if (subparam) 
+       if (subparam)
                junk_entry->lastUsed = soup_soap_parameter_get_string_value (subparam);
 
        subparam = soup_soap_parameter_get_first_child_by_name (param, "version");
-       if (subparam) 
+       if (subparam)
                junk_entry->version = soup_soap_parameter_get_int_value (subparam);
 
        subparam = soup_soap_parameter_get_first_child_by_name (param, "modified");
-       if (subparam) 
+       if (subparam)
                junk_entry->modified = soup_soap_parameter_get_string_value (subparam);
 
        return junk_entry;
@@ -3404,7 +3404,7 @@ get_junk_list_from_soap_response (SoupSoapResponse *response, GList **entries)
                        if (junk_entry)
                                *entries = g_list_append (*entries, junk_entry);
                }
-       }       
+       }
        param = soup_soap_response_get_first_parameter_by_name (response, "block");
        if (param) {
                for (subparam = soup_soap_parameter_get_first_child_by_name (param, "entry");
@@ -3436,9 +3436,9 @@ e_gw_connection_get_junk_entries (EGwConnection *cnc, GList **entries)
        SoupSoapMessage *msg;
         SoupSoapResponse *response;
         EGwConnectionStatus status;
-        
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
-       
+
        /* build the SOAP message */
         msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getJunkEntriesRequest");
 
@@ -3448,7 +3448,7 @@ e_gw_connection_get_junk_entries (EGwConnection *cnc, GList **entries)
         }
        e_gw_message_write_footer (msg);
        response =  e_gw_connection_send_message (cnc, msg);
-       
+
        if (!response) {
                g_object_unref (msg);
                return E_GW_CONNECTION_STATUS_NO_RESPONSE;
@@ -3461,7 +3461,7 @@ e_gw_connection_get_junk_entries (EGwConnection *cnc, GList **entries)
        /* if status is OK - parse result. return the list */
        if (status == E_GW_CONNECTION_STATUS_OK)
                get_junk_list_from_soap_response (response, entries);
-       
+
        /* free memory */
        g_object_unref (response);
        g_object_unref (msg);
@@ -3495,7 +3495,7 @@ e_gw_connection_remove_junk_entry (EGwConnection *cnc, const char *id)
        status = e_gw_connection_parse_response_status (response);
        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                reauthenticate (cnc);
-       
+
        /* free memory */
        g_object_unref (response);
        g_object_unref (msg);
@@ -3517,7 +3517,7 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "readCursorRequest");
        e_gw_message_write_int_parameter (msg, "cursor", NULL, cursor);
        *list = NULL;
-       /* there is problem in read curosr if you set this, uncomment after the problem 
+       /* there is problem in read curosr if you set this, uncomment after the problem
           is fixed in server */
        e_gw_message_write_string_parameter (msg, "position", NULL, cursor_seek);
        e_gw_message_write_string_parameter (msg, "forward", NULL, forward ? "true": "false");
@@ -3542,7 +3542,7 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "items");
        if (!param) {
                g_object_unref (response);
@@ -3558,9 +3558,9 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
                EGwItemCalId *calid = g_new0 (EGwItemCalId, 1);
                EGwItemType type;
                char *id = NULL, *item_type = NULL;
-               
+
                item_type = soup_soap_parameter_get_property (subparam, "type");
-               
+
                if (g_str_equal (item_type, "Appointment"))
                                type  = E_GW_ITEM_TYPE_APPOINTMENT;
                else if  (g_str_equal (item_type, "Task"))
@@ -3569,7 +3569,7 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
                        type = E_GW_ITEM_TYPE_NOTE;
                }
                g_free (item_type);
-               
+
                param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id");
                if (param_id) {
                        id = soup_soap_parameter_get_string_value (param_id);
@@ -3587,19 +3587,19 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
                        g_object_unref (msg);
                        return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
                }
-               
+
                id = NULL;
-               
+
                param_id = soup_soap_parameter_get_first_child_by_name (subparam, "recurrenceKey");
                if (param_id) {
                        id = soup_soap_parameter_get_string_value (param_id);
                }
-               
+
                if (id && !g_str_equal (id, "0")) {
                        guint allday = 0;
 
                        calid->recur_key = id;
-               
+
                        if (type == E_GW_ITEM_TYPE_APPOINTMENT) {
                                param_id = soup_soap_parameter_get_first_child_by_name (subparam, "allDayEvent");
                                if (param_id) {
@@ -3608,7 +3608,7 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
 
                        }
 
-                       if (allday) 
+                       if (allday)
                                param_id = soup_soap_parameter_get_first_child_by_name (subparam, "startDay");
                        else
                                param_id = soup_soap_parameter_get_first_child_by_name (subparam, "startDate");
@@ -3618,7 +3618,7 @@ e_gw_connection_read_cal_ids (EGwConnection *cnc, const char *container, int cur
                                id = soup_soap_parameter_get_string_value (param_id);
                                formatted_date = e_gw_connection_format_date_string (id);
                                 /* store the date in calid for recurring events */
-                               calid->ical_id = formatted_date; 
+                               calid->ical_id = formatted_date;
                                g_free (id);
                        }
 
@@ -3666,7 +3666,7 @@ e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const char *container, in
        msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "readCursorRequest");
        e_gw_message_write_int_parameter (msg, "cursor", NULL, cursor);
        *list = NULL;
-       /* there is problem in read curosr if you set this, uncomment after the problem 
+       /* there is problem in read curosr if you set this, uncomment after the problem
           is fixed in server */
        e_gw_message_write_string_parameter (msg, "position", NULL, cursor_seek);
        e_gw_message_write_string_parameter (msg, "forward", NULL, forward ? "true": "false");
@@ -3691,7 +3691,7 @@ e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const char *container, in
                return status;
        }
 
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "items");
        if (!param) {
                g_object_unref (response);
@@ -3705,7 +3705,7 @@ e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const char *container, in
                        subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
                SoupSoapParameter *param_id;
                char *id = NULL;
-               
+
                param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id");
                if (!param_id) {
                        if (*list) {
@@ -3717,7 +3717,7 @@ e_gw_connection_get_all_mail_uids (EGwConnection *cnc, const char *container, in
                        g_object_unref (msg);
                        return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
                }
-               
+
                id = soup_soap_parameter_get_string_value (param_id);
                if (id)
                        *list = g_list_prepend (*list, id);
@@ -3764,7 +3764,7 @@ e_gw_connection_get_proxy_access_list (EGwConnection *cnc, GList **proxy_list)
        if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
                reauthenticate (cnc);
 
-       param = soup_soap_response_get_first_parameter_by_name (response, "accessRights");      
+       param = soup_soap_response_get_first_parameter_by_name (response, "accessRights");
        if (!param) {
                g_object_unref (response);
                return status;
@@ -3779,18 +3779,18 @@ e_gw_connection_get_proxy_access_list (EGwConnection *cnc, GList **proxy_list)
        return status;
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_add_proxy (EGwConnection *cnc, proxyHandler *new_proxy)
 {
        SoupSoapMessage *msg = NULL;
        SoupSoapResponse *response = NULL;
        EGwConnectionStatus status;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
        msg = e_gw_message_new_with_header (e_gw_connection_get_uri (cnc), e_gw_connection_get_session_id (cnc), "createProxyAccessRequest");
 
        e_gw_proxy_form_proxy_add_msg (msg, new_proxy);
-                       
+
        e_gw_message_write_footer (msg);
        response = e_gw_connection_send_message (cnc, msg);
        if (!response) {
@@ -3819,7 +3819,7 @@ e_gw_connection_remove_proxy (EGwConnection *cnc, proxyHandler *removeProxy)
        msg = e_gw_message_new_with_header (e_gw_connection_get_uri(cnc), e_gw_connection_get_session_id(cnc), "removeProxyAccessRequest");
 
        e_gw_proxy_form_proxy_remove_msg (msg, removeProxy);
-       
+
        e_gw_message_write_footer (msg);
 
        response = e_gw_connection_send_message (cnc, msg);
@@ -3834,22 +3834,22 @@ e_gw_connection_remove_proxy (EGwConnection *cnc, proxyHandler *removeProxy)
 
 }
 
-EGwConnectionStatus 
+EGwConnectionStatus
 e_gw_connection_modify_proxy (EGwConnection *cnc, proxyHandler *new_proxy)
 {
        SoupSoapMessage *msg = NULL;
        SoupSoapResponse *response = NULL;
        EGwConnectionStatus status;
-       
+
        g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
        msg = e_gw_message_new_with_header (e_gw_connection_get_uri (cnc), e_gw_connection_get_session_id (cnc), "modifyProxyAccessRequest");
        e_gw_message_write_string_parameter (msg, "id", NULL, new_proxy->uniqueid);
-       
+
        e_gw_proxy_form_modify_proxy_msg (msg, new_proxy);
-       
+
        e_gw_message_write_footer (msg);
        response = e_gw_connection_send_message (cnc, msg);
-       
+
        if (!response) {
                g_object_unref (msg);
                return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
@@ -3879,9 +3879,9 @@ e_gw_connection_get_proxy_list (EGwConnection *cnc, GList **proxy_info)
                 g_warning (G_STRLOC ": Could not build SOAP message");
                 return E_GW_CONNECTION_STATUS_UNKNOWN;
         }
-       
+
        e_gw_message_write_footer (msg);
-        
+
        /* send message to server */
         response = e_gw_connection_send_message (cnc, msg);
         if (!response) {
@@ -3896,15 +3896,15 @@ e_gw_connection_get_proxy_list (EGwConnection *cnc, GList **proxy_info)
                 g_object_unref (msg);
                return status;
        }
-       /* if status is OK - parse result. return the list */   
+       /* if status is OK - parse result. return the list */
        param = soup_soap_response_get_first_parameter_by_name (response, "proxies");
-        e_gw_proxy_construct_proxy_list (param, proxy_info);                   
+        e_gw_proxy_construct_proxy_list (param, proxy_info);
         if (!param) {
                 g_object_unref (response);
                 g_object_unref (msg);
                 return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
         }
-               
+
         g_object_unref (response);
        g_object_unref (msg);
 
@@ -3942,14 +3942,14 @@ e_gw_connection_get_proxy_connection (EGwConnection *parent_cnc, char *username,
        int i;
        char *permissions_key = NULL;
 
-       static GStaticMutex connecting = G_STATIC_MUTEX_INIT;   
+       static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
 
        g_static_mutex_lock (&connecting);
 
        for (i=0; proxy[i]!='\0' && proxy[i]!='@'; i++);
        if (proxy[i]=='@')
                name = g_strndup(proxy, i);
-       else 
+       else
                name = g_strdup (proxy);
        /* search the connection in our hash table */
        if (loaded_connections_permissions != NULL) {
@@ -4036,10 +4036,10 @@ e_gw_connection_get_proxy_connection (EGwConnection *parent_cnc, char *username,
                param_value = soup_soap_parameter_get_string_value (param);
                cnc->priv->version = param_value;
        } else
-               cnc->priv->version = NULL;      
+               cnc->priv->version = NULL;
 
        param = soup_soap_response_get_first_parameter_by_name (response, "serverUTCTime");
-       if (param) 
+       if (param)
                cnc->priv->server_time = soup_soap_parameter_get_string_value (param);
 
        /* add the connection to the loaded_connections_permissions hash table */
index 310a26e..afc17ef 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -153,7 +153,7 @@ EGwConnectionStatus e_gw_connection_get_settings (EGwConnection *cnc, EGwSendOpt
 EGwConnectionStatus e_gw_connection_modify_settings (EGwConnection *cnc, EGwSendOptions *opts);
 EGwConnectionStatus e_gw_connection_add_items (EGwConnection *cnc, const char *container, GList *item_ids) ;
 EGwConnectionStatus e_gw_connection_rename_folder (EGwConnection *cnc, const char *id ,const char *new_name) ;
-EGwConnectionStatus e_gw_connection_share_folder (EGwConnection *cnc, gchar *id, GList *new_list, const char *sub, const char *mesg ,int flag); 
+EGwConnectionStatus e_gw_connection_share_folder (EGwConnection *cnc, gchar *id, GList *new_list, const char *sub, const char *mesg ,int flag);
 EGwConnectionStatus e_gw_connection_accept_shared_folder (EGwConnection *cnc, gchar *folder_name, gchar *container_id, gchar *item_id, gchar *desc);
 EGwConnectionStatus e_gw_connection_purge_deleted_items (EGwConnection *cnc);
 EGwConnectionStatus e_gw_connection_purge_selected_items (EGwConnection *cnc, GList *item_ids);
index 85ba1c4..a342443 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -35,14 +35,14 @@ struct _EGwContainerPrivate {
        guint32 unread ;
        guint32 total ;
        int sequence;
-       char *owner;    
-       GList *user_list;       
+       char *owner;
+       GList *user_list;
        char *modified;
        EGwContainerType type ;
        gboolean is_root ;
        gboolean is_writable;
        gboolean is_frequent_contacts; /*indicates  whether this folder is frequent contacts or not */
-       gboolean is_shared_by_me;   
+       gboolean is_shared_by_me;
        gboolean is_shared_to_me;
        gboolean is_system_folder;
 };
@@ -239,25 +239,25 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
 
        /*retrieve the folder type*/
        subparam = soup_soap_parameter_get_first_child_by_name (param, "folderType") ;
-       if (!subparam) 
+       if (!subparam)
                container->priv->type = E_GW_CONTAINER_TYPE_FOLDER ;
        else {
                value = soup_soap_parameter_get_string_value (subparam);
-               if (!strcmp (value, "Root")) 
+               if (!strcmp (value, "Root"))
                        container->priv->type = E_GW_CONTAINER_TYPE_ROOT ;
-               else if (!strcmp (value, "Mailbox")) 
+               else if (!strcmp (value, "Mailbox"))
                        container->priv->type = E_GW_CONTAINER_TYPE_INBOX ;
-               else if (!strcmp (value, "SentItems")) 
+               else if (!strcmp (value, "SentItems"))
                        container->priv->type = E_GW_CONTAINER_TYPE_SENT;
-               else if (!strcmp (value, "Calendar")) 
+               else if (!strcmp (value, "Calendar"))
                        container->priv->type = E_GW_CONTAINER_TYPE_CALENDAR ;
-               else if (!strcmp (value, "Contacts")) 
+               else if (!strcmp (value, "Contacts"))
                        container->priv->type = E_GW_CONTAINER_TYPE_CONTACTS ;
-               else if (!strcmp (value, "Draft")) 
+               else if (!strcmp (value, "Draft"))
                        container->priv->type = E_GW_CONTAINER_TYPE_DRAFT ;
-               else if (!strcmp (value, "Trash")) 
+               else if (!strcmp (value, "Trash"))
                        container->priv->type = E_GW_CONTAINER_TYPE_TRASH ;
-               else if (!strcmp (value, "JunkMail")) 
+               else if (!strcmp (value, "JunkMail"))
                        container->priv->type = E_GW_CONTAINER_TYPE_JUNK;
                g_free (value) ;
        }
@@ -314,7 +314,7 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
        }
        /* is shared to me*/
        subparam = soup_soap_parameter_get_first_child_by_name (param, "isSharedToMe");
-       
+
        if (!subparam) {
                e_gw_container_set_is_shared_to_me (container, FALSE);
 
@@ -323,11 +323,11 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
                if (value) {
                        e_gw_container_set_is_shared_to_me (container, TRUE);
                        tome = TRUE;
-               } else { 
+               } else {
                        e_gw_container_set_is_shared_to_me (container, FALSE);
                        tome = FALSE;
                }
-               
+
                g_free (value);
        }
        /*Retrieve email add of the sharing person*/
@@ -350,7 +350,7 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
                                        value = soup_soap_parameter_get_string_value (email_rt_subparam);
                                        if (value) {
                                                user->email = value;
-                                       }       
+                                       }
                                        /* Retrieve Rights*/
                                        email_rt_subparam = soup_soap_parameter_get_first_child_by_name (entry_subparam, "rights");
 
@@ -358,16 +358,16 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
                                                g_warning (G_STRLOC ": User without any Rights");
                                        else {
                                                rights = 0;
-                                               rights_subparam = soup_soap_parameter_get_first_child_by_name (email_rt_subparam, "add");       
-                                               if (rights_subparam)    
+                                               rights_subparam = soup_soap_parameter_get_first_child_by_name (email_rt_subparam, "add");
+                                               if (rights_subparam)
                                                        rights = rights | 0x1;
 
-                                               rights_subparam = soup_soap_parameter_get_first_child_by_name (email_rt_subparam, "edit");      
-                                               if (rights_subparam) 
+                                               rights_subparam = soup_soap_parameter_get_first_child_by_name (email_rt_subparam, "edit");
+                                               if (rights_subparam)
                                                        rights = rights | 0x2;
 
-                                               rights_subparam = soup_soap_parameter_get_first_child_by_name (email_rt_subparam, "delete");    
-                                               if (rights_subparam)    
+                                               rights_subparam = soup_soap_parameter_get_first_child_by_name (email_rt_subparam, "delete");
+                                               if (rights_subparam)
                                                        rights = rights | 0x4;
 
                                                user->rights = rights;
@@ -375,7 +375,7 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
 
                                        container->priv->user_list = g_list_append (container->priv->user_list, user);
 
-                               } 
+                               }
 
                        }
 
@@ -388,7 +388,7 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
                        e_gw_container_set_owner (container, value);
                        g_free (value);
                }
-       }       
+       }
 
                /* shared folder*/
                /*Retrieve When Modified last*/
@@ -403,19 +403,19 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
                /*retrieve sequence*/
                subparam = soup_soap_parameter_get_first_child_by_name (param, "sequence");
 
-               if (subparam) { 
+               if (subparam) {
                        int_value = soup_soap_parameter_get_int_value (subparam);
-                       e_gw_container_set_sequence (container, int_value);             
+                       e_gw_container_set_sequence (container, int_value);
                }
 
                return TRUE;
 }
 
-void 
+void
 e_gw_container_get_user_list (EGwContainer *container, GList **user_list)
 {
        g_return_if_fail (E_GW_CONTAINER (container));
-       
+
        *user_list = container->priv->user_list;
 
 }
@@ -424,11 +424,11 @@ int
 e_gw_container_get_sequence (EGwContainer *container)
 {
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), 0);
-       
+
        return (int)container->priv->sequence;
 }
 
-static  void 
+static  void
 e_gw_container_set_sequence (EGwContainer *container, int sequence)
 {
        g_return_if_fail (E_IS_GW_CONTAINER (container));
@@ -458,14 +458,14 @@ e_gw_container_set_modified (EGwContainer *container, const char *modified)
        priv->modified = g_strdup (modified);
 }
 
-static void 
+static void
 e_gw_container_set_owner(EGwContainer *container, const char *owner)
 {
        EGwContainerPrivate *priv;
-       
+
        g_return_if_fail (E_IS_GW_CONTAINER(container));
        g_return_if_fail (owner!=NULL);
-       
+
        priv = container->priv;
        if (priv->owner)
                g_free (container->priv->owner);
@@ -476,7 +476,7 @@ const char *
 e_gw_container_get_owner (EGwContainer *container)
 {
        g_return_val_if_fail (E_GW_CONTAINER (container), NULL);
-       
+
        return (const char *) container->priv->owner;
 }
 
@@ -490,7 +490,7 @@ e_gw_container_get_rights (EGwContainer *container, gchar *email)
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), 0);
 
        user_list = container->priv->user_list;
-       
+
        for (node = user_list; node != NULL; node = node->next) {
                user = node->data;
                if( !strcmp (user->email, email))
@@ -504,7 +504,7 @@ gboolean
 e_gw_container_get_is_shared_by_me (EGwContainer *container)
 {
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE);
-       
+
        return (gboolean) container->priv->is_shared_by_me;
 }
 
@@ -512,7 +512,7 @@ static void
 e_gw_container_set_is_shared_by_me (EGwContainer *container, gboolean is_shared_by_me)
 {
        g_return_if_fail (E_IS_GW_CONTAINER (container));
-       
+
        container->priv->is_shared_by_me = is_shared_by_me;
 }
 
@@ -520,7 +520,7 @@ gboolean
 e_gw_container_get_is_shared_to_me (EGwContainer *container)
 {
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE);
-       
+
        return (gboolean) container->priv->is_shared_to_me;
 }
 
@@ -528,7 +528,7 @@ static void
 e_gw_container_set_is_shared_to_me (EGwContainer *container, gboolean is_shared_to_me)
 {
        g_return_if_fail (E_IS_GW_CONTAINER (container));
-       
+
        container->priv->is_shared_to_me = is_shared_to_me;
 }
 
@@ -536,7 +536,7 @@ gboolean
 e_gw_container_get_is_system_folder (EGwContainer *container)
 {
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE);
-       
+
        return container->priv->is_system_folder;
 }
 
@@ -544,7 +544,7 @@ void
 e_gw_container_set_is_system_folder (EGwContainer *container, gboolean is_system_folder)
 {
        g_return_if_fail (E_IS_GW_CONTAINER (container));
-       
+
        container->priv->is_system_folder = is_system_folder;
 }
 
@@ -595,7 +595,7 @@ e_gw_container_set_id (EGwContainer *container, const char *new_id)
 }
 
 const char *
-e_gw_container_get_parent_id (EGwContainer *container) 
+e_gw_container_get_parent_id (EGwContainer *container)
 {
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), NULL);
 
@@ -606,7 +606,7 @@ void
 e_gw_container_set_parent_id (EGwContainer *container, const char *parent_id)
 {
        EGwContainerPrivate *priv ;
-       
+
        g_return_if_fail (E_IS_GW_CONTAINER (container));
        g_return_if_fail (parent_id != NULL);
 
@@ -625,7 +625,7 @@ e_gw_container_get_total_count (EGwContainer *container)
 
        return container->priv->total ;
 }
-               
+
 guint32
 e_gw_container_get_unread_count (EGwContainer *container)
 {
@@ -636,28 +636,28 @@ e_gw_container_get_unread_count (EGwContainer *container)
 }
 
 
-gboolean 
+gboolean
 e_gw_container_get_is_writable (EGwContainer *container)
 {
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE);
-       
+
        return container->priv->is_writable;
 
 }
 
-void 
+void
 e_gw_container_set_is_writable (EGwContainer *container, gboolean is_writable)
 {
        g_return_if_fail (E_IS_GW_CONTAINER (container));
-       
+
        container->priv->is_writable = is_writable;
 }
 
-gboolean 
+gboolean
 e_gw_container_get_is_frequent_contacts (EGwContainer *container)
 {
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE);
-                                                                                                                             
+
         return container->priv->is_frequent_contacts;
 
 }
@@ -666,7 +666,7 @@ void
 e_gw_container_set_is_frequent_contacts (EGwContainer *container, gboolean is_frequent_contacts)
 {
         g_return_if_fail (E_IS_GW_CONTAINER (container));
-                                                                                                                             
+
         container->priv->is_frequent_contacts = is_frequent_contacts;
 }
 
@@ -674,7 +674,7 @@ gboolean
 e_gw_container_is_root (EGwContainer *container)
 {
        g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE) ;
-       
+
        return container->priv->is_root ;
 }
 
@@ -690,7 +690,7 @@ e_gw_container_get_container_type (EGwContainer *container)
  * flag = 2 :update entry
  * flag = 0 :add to acl
  */
-void   
+void
 e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, const char *sub, const char *mesg, int flag)
 {
        gboolean add, edit, del;
@@ -705,7 +705,7 @@ e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, c
        soup_soap_message_end_element (msg);
        soup_soap_message_start_element (msg, "updates", NULL, NULL);
 
-       if (flag == 0) {        
+       if (flag == 0) {
                soup_soap_message_start_element (msg, "add", NULL, NULL);
                soup_soap_message_start_element (msg, "acl", NULL, NULL);
 
@@ -714,7 +714,7 @@ e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, c
                        add=edit=del=FALSE;
                        soup_soap_message_start_element (msg, "entry", NULL, NULL);
                        e_gw_message_write_string_parameter (msg, "displayName", NULL,"");
-                       email = g_strdup (user->email); 
+                       email = g_strdup (user->email);
                        if (user->rights & 0x1)
                                add = TRUE;
                        if (user->rights & 0x2)
@@ -731,7 +731,7 @@ e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, c
 
                        soup_soap_message_end_element (msg);
                        soup_soap_message_end_element (msg);
-               } 
+               }
 
                soup_soap_message_end_element (msg);
                soup_soap_message_end_element (msg);
@@ -745,7 +745,7 @@ e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, c
                        add = edit = del = FALSE;
                        soup_soap_message_start_element (msg, "entry", NULL, NULL);
                        e_gw_message_write_string_parameter (msg, "displayName", NULL, "name");
-                       email = g_strdup (user->email); 
+                       email = g_strdup (user->email);
 
                        if(user->rights & 0x1)
                                add = TRUE;
@@ -768,7 +768,7 @@ e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, c
                soup_soap_message_end_element (msg);
                soup_soap_message_end_element (msg);
 
-       } else if (flag == 2) { 
+       } else if (flag == 2) {
                soup_soap_message_start_element (msg, "update", NULL, NULL);
                soup_soap_message_start_element (msg, "acl", NULL, NULL);
 
@@ -777,7 +777,7 @@ e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, c
                        add = edit = del = FALSE;
                        soup_soap_message_start_element (msg, "entry", NULL, NULL);
                        e_gw_message_write_string_parameter (msg, "displayName",NULL,"");
-                       email = g_strdup (user->email); 
+                       email = g_strdup (user->email);
                        if (user->rights & 0x1)
                                add = TRUE;
                        if (user->rights & 0x2)
@@ -801,5 +801,5 @@ e_gw_container_form_message (SoupSoapMessage *msg, gchar *id, GList *new_list, c
 
        }
 
-       soup_soap_message_end_element (msg);    
+       soup_soap_message_end_element (msg);
 }
index 5a8abf1..c9846e0 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -68,7 +68,7 @@ typedef enum {
        E_GW_CONTAINER_TYPE_TRASH,
        E_GW_CONTAINER_TYPE_JUNK,
        E_GW_CONTAINER_TYPE_FOLDER
-       
+
 } EGwContainerType ;
 
 GType         e_gw_container_get_type (void);
index 1896702..2c32948 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
- * Sivaiah Nallagatla <snallagatla@novell.com> 
- * 
+/*
+ * Authors :
+ * Sivaiah Nallagatla <snallagatla@novell.com>
+ *
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -42,7 +42,7 @@ typedef struct _FilterComponent  FilterComponent;
 struct _EGwFilterPrivate {
        GSList *component_list;
        int  filter_group_type; /* stores, whether all condtions are to be met or any one of them*/
-  
+
 };
 
 
@@ -51,11 +51,11 @@ void
 e_gw_filter_add_filter_component (EGwFilter *filter, EGwFilterOpType operation, const char *field_name, const char *field_value)
 {
        FilterComponent *component;
-  
+
        g_return_if_fail (E_IS_GW_FILTER (filter));
        g_return_if_fail (field_name != NULL);
        g_return_if_fail (field_value != NULL);
-  
+
        component = g_new0 (FilterComponent, 1);
        component->operation = operation;
        component->field_name = g_strdup (field_name);
@@ -64,11 +64,11 @@ e_gw_filter_add_filter_component (EGwFilter *filter, EGwFilterOpType operation,
 
 }
 
-void 
+void
 e_gw_filter_group_conditions (EGwFilter *filter, EGwFilterOpType operation, int num_of_condtions)
 {
        FilterComponent *component;
-  
+
        g_return_if_fail (E_IS_GW_FILTER (filter));
        g_return_if_fail ( operation == E_GW_FILTER_OP_AND || operation == E_GW_FILTER_OP_OR ||
                          operation == E_GW_FILTER_OP_NOT);
@@ -78,7 +78,7 @@ e_gw_filter_group_conditions (EGwFilter *filter, EGwFilterOpType operation, int
        filter->priv->component_list = g_slist_prepend (filter->priv->component_list, component);
 }
 
-static void 
+static void
 append_child_component (FilterComponent* filter_component, SoupSoapMessage *msg)
 {
 
@@ -87,9 +87,9 @@ append_child_component (FilterComponent* filter_component, SoupSoapMessage *msg)
        g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
        soup_soap_message_start_element (msg, "element", NULL, NULL);
        operation_name = NULL;
-  
+
        switch (filter_component->operation) {
-    
+
                case E_GW_FILTER_OP_EQUAL :
                        operation_name = "eq";
                        break;
@@ -123,12 +123,12 @@ append_child_component (FilterComponent* filter_component, SoupSoapMessage *msg)
                case E_GW_FILTER_OP_NOTEXISTS :
                        operation_name = "notExist";
                        break;
-                                
+
        }
-       
-               
+
+
        if (operation_name != NULL) {
-               
+
                        e_gw_message_write_string_parameter (msg, "op", NULL, operation_name);
                        e_gw_message_write_string_parameter (msg, "field", NULL, filter_component->field_name);
                        e_gw_message_write_string_parameter (msg, "value", NULL, filter_component->field_value);
@@ -139,7 +139,7 @@ append_child_component (FilterComponent* filter_component, SoupSoapMessage *msg)
 
 
 
-static GSList* 
+static GSList*
 append_complex_component (GSList *component_list, SoupSoapMessage *msg)
 {
        FilterComponent *filter_component;
@@ -149,11 +149,11 @@ append_complex_component (GSList *component_list, SoupSoapMessage *msg)
        filter_component = (FilterComponent* )component_list->data;
        if (filter_component->operation == E_GW_FILTER_OP_AND || filter_component->operation == E_GW_FILTER_OP_OR
            ||  filter_component->operation == E_GW_FILTER_OP_NOT ) {
-               
+
                soup_soap_message_start_element (msg, "group", NULL, NULL);
                if (filter_component->operation == E_GW_FILTER_OP_AND)
                        e_gw_message_write_string_parameter (msg, "op", NULL, "and");
-               else if (filter_component->operation == E_GW_FILTER_OP_OR) 
+               else if (filter_component->operation == E_GW_FILTER_OP_OR)
                        e_gw_message_write_string_parameter (msg, "op", NULL, "or");
                else
                        e_gw_message_write_string_parameter (msg, "op", NULL, "not");
@@ -166,9 +166,9 @@ append_complex_component (GSList *component_list, SoupSoapMessage *msg)
                    || filter_component->operation == E_GW_FILTER_OP_NOT ) {
                        component_list = append_complex_component (component_list, msg);
                }
-               else 
+               else
                        append_child_component (filter_component, msg);
-               
+
 
        }
        soup_soap_message_end_element (msg);
@@ -176,7 +176,7 @@ append_complex_component (GSList *component_list, SoupSoapMessage *msg)
        return component_list;
 }
 
-void 
+void
 e_gw_filter_append_to_soap_message (EGwFilter *filter, SoupSoapMessage *msg)
 {
        EGwFilterPrivate *priv;
@@ -185,7 +185,7 @@ e_gw_filter_append_to_soap_message (EGwFilter *filter, SoupSoapMessage *msg)
 
        g_return_if_fail (E_IS_GW_FILTER (filter));
        g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
+
        priv = filter->priv;
        component_list = priv->component_list;
 
@@ -196,10 +196,10 @@ e_gw_filter_append_to_soap_message (EGwFilter *filter, SoupSoapMessage *msg)
                    || filter_component->operation == E_GW_FILTER_OP_NOT) {
                        component_list = append_complex_component (component_list, msg);
                }
-               else 
+               else
                        append_child_component (filter_component, msg);
        soup_soap_message_end_element (msg); //end filter
-    
+
        }
 }
 
@@ -228,10 +228,10 @@ e_gw_filter_finalize (GObject *object)
                (* parent_class->finalize) (object);
 }
 
-static void 
+static void
 e_gw_filter_dispose (GObject *object)
 {
-  
+
        if (parent_class->dispose)
                (* parent_class->dispose) (object);
 
@@ -253,7 +253,7 @@ static void
 e_gw_filter_class_init (EGwFilterClass *klass)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  
+
        parent_class = g_type_class_peek_parent (klass);
        object_class->dispose = e_gw_filter_dispose;
        object_class->finalize = e_gw_filter_finalize;
@@ -263,7 +263,7 @@ GType
 e_gw_filter_get_type (void)
 {
        static GType type = 0;
-  
+
        if (!type) {
                static GTypeInfo info = {
                        sizeof (EGwFilterClass),
index 764110c..b86ebc1 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
- * Sivaiah Nallagatla <snallagatla@novell.com> 
- * 
+/*
+ * Authors :
+ * Sivaiah Nallagatla <snallagatla@novell.com>
+ *
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -56,7 +56,7 @@ typedef enum {
        E_GW_FILTER_OP_BEGINS,
        E_GW_FILTER_OP_EXISTS,
        E_GW_FILTER_OP_NOTEXISTS
-       
+
 } EGwFilterOpType;
 
 struct _EGwFilter {
index f12475d..292ebae 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *  Harish Krishnaswamy <kharish@novell.com>
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -63,7 +63,7 @@ struct _EGwItemPrivate {
        int recurrence_key;
        int trigger; /* alarm */
        /*message size*/
-       int size;    
+       int size;
        EGwItemOrganizer *organizer;
 
        /*properties for mail*/
@@ -74,13 +74,13 @@ struct _EGwItemPrivate {
        int item_status;
        /*Attachments*/
        gboolean has_attachment;
-       GSList *attach_list ; 
+       GSList *attach_list ;
        /*linkInfo for replies*/
-       EGwItemLinkInfo *link_info; 
+       EGwItemLinkInfo *link_info;
 
        /* properties for tasks/calendars */
        char *icalid;
-       /* if the self is not the organizer of the item, the 
+       /* if the self is not the organizer of the item, the
         * status is not reflected in the recipientStatus.
         * Hence it should be gleaned from the 'status' element
         * of the Mail, the parent item.*/
@@ -97,12 +97,12 @@ struct _EGwItemPrivate {
        GHashTable *addresses;
 
        /***** Send Options *****/
-       
+
        gboolean set_sendoptions;
        /* Reply Request */
        char *reply_within;
        gboolean reply_request_set;
-       
+
        /* Status Tracking through sent Item */
        EGwItemTrack track_info;
        gboolean autodelete;
@@ -123,7 +123,7 @@ struct _EGwItemPrivate {
        /* changes */
        GHashTable *additions;
        GHashTable *updates;
-       GHashTable *deletions;  
+       GHashTable *deletions;
        /*padding*/
        unsigned int padding[10];
 };
@@ -145,7 +145,7 @@ free_recipient (EGwItemRecipient *recipient, gpointer data)
        g_free (recipient);
 }
 
-static void 
+static void
 free_postal_address (gpointer  postal_address)
 {
        PostalAddress *address;
@@ -161,7 +161,7 @@ free_postal_address (gpointer  postal_address)
        }
 }
 
-static void 
+static void
 free_full_name (gpointer full_name)
 {
        FullName *name = (FullName *) full_name;
@@ -174,7 +174,7 @@ free_full_name (gpointer full_name)
 
 }
 
-static void 
+static void
 free_string (gpointer s, gpointer data)
 {
        if (s)
@@ -182,11 +182,11 @@ free_string (gpointer s, gpointer data)
 }
 
 static void
-free_attach (gpointer s, gpointer data) 
+free_attach (gpointer s, gpointer data)
 {
        EGwItemAttachment *attach = (EGwItemAttachment *) s ;
        if (attach) {
-               if (attach->id) 
+               if (attach->id)
                        g_free (attach->id), attach->id = NULL ;
                if (attach->name)
                        g_free (attach->name), attach->name = NULL ;
@@ -198,12 +198,12 @@ free_attach (gpointer s, gpointer data)
                        g_free (attach->date), attach->date = NULL ;
                if (attach->data)
                        g_free (attach->data), attach->data = NULL ;
-       
+
                g_free(attach) ;
        }
-       
+
 }
-static void 
+static void
 free_member (gpointer member, gpointer data)
 {
        EGroupMember *group_member = (EGroupMember *) member;
@@ -216,12 +216,12 @@ free_member (gpointer member, gpointer data)
        g_free (group_member);
 }
 
-static void 
+static void
 free_im_address ( gpointer address, gpointer data)
 {
        IMAddress *im_address;
        im_address = (IMAddress *) address;
-       
+
        if (im_address) {
                if (im_address->service)
                        g_free (im_address->service);
@@ -246,7 +246,7 @@ free_link_info (EGwItemLinkInfo *info)
        }
 }
 
-static void 
+static void
 free_changes ( GHashTable *changes)
 {
        gpointer value;
@@ -313,12 +313,12 @@ e_gw_item_dispose (GObject *object)
                        g_free (priv->priority);
                        priv->priority = NULL;
                }
-                       
+
                if (priv->task_priority) {
                        g_free (priv->task_priority);
                        priv->task_priority = NULL;
                }
-               
+
                if (priv->place) {
                        g_free (priv->place);
                        priv->place = NULL;
@@ -333,7 +333,7 @@ e_gw_item_dispose (GObject *object)
                        g_free (priv->to) ;
                        priv->to = NULL ;
                }
-               
+
                if (priv->content_type) {
                        g_free (priv->content_type) ;
                        priv->content_type = NULL ;
@@ -367,14 +367,14 @@ e_gw_item_dispose (GObject *object)
                        g_slist_foreach (priv->recipient_list, (GFunc) free_recipient, NULL);
                        g_slist_free (priv->recipient_list);
                        priv->recipient_list = NULL;
-               }       
-               
+               }
+
                if (priv->organizer) {
                        g_free (priv->organizer->display_name);
                        g_free (priv->organizer->email);
                        priv->organizer = NULL;
                }
-               
+
                if (priv->recurrence_dates) {
                        g_slist_foreach (priv->recurrence_dates, free_string, NULL);
                        g_slist_free (priv->recurrence_dates);
@@ -396,19 +396,19 @@ e_gw_item_dispose (GObject *object)
                        free_full_name (priv->full_name);
                        priv->full_name = NULL;
                        }
-               
+
                if (priv->simple_fields)
                        g_hash_table_destroy (priv->simple_fields);
-               
+
                if (priv->addresses)
                        g_hash_table_destroy (priv->addresses);
-               
+
                if (priv->email_list) {
                        g_list_foreach (priv->email_list,  free_string , NULL);
                        g_list_free (priv->email_list);
                        priv->email_list = NULL;
                }
-               
+
                if (priv->member_list) {
                        g_list_foreach (priv->member_list,  free_member, NULL);
                        g_list_free (priv->member_list);
@@ -420,29 +420,29 @@ e_gw_item_dispose (GObject *object)
                        g_list_free (priv->im_list);
                        priv->im_list = NULL;
                }
-               
+
                if (priv->category_list) {
                        g_list_foreach (priv->category_list,  free_string, NULL);
                        g_list_free (priv->category_list);
                        priv->category_list = NULL;
                }
-               
+
                if(priv->attach_list) {
-                       g_slist_foreach (priv->attach_list, free_attach, NULL); 
+                       g_slist_foreach (priv->attach_list, free_attach, NULL);
                        g_slist_free (priv->attach_list) ;
                        priv->attach_list = NULL ;
                }
-               
+
                if (priv->category_name) {
                        g_free (priv->category_name);
                        priv->category_name = NULL;
                }
-               
+
                if (priv->source) {
                        g_free (priv->source);
                        priv->source = NULL;
                }
-               
+
                if (priv->link_info) {
                        free_link_info (priv->link_info);
                        priv->link_info = NULL;
@@ -451,12 +451,12 @@ e_gw_item_dispose (GObject *object)
                if (priv->end_date) {
                        g_free (priv->end_date);
                        priv->end_date = NULL;
-               }       
-               
+               }
+
                free_changes (priv->additions);
                free_changes (priv->deletions);
                free_changes (priv->updates);
-               
+
        }
 
        if (parent_class->dispose)
@@ -503,8 +503,8 @@ e_gw_item_init (EGwItem *item, EGwItemClass *klass)
        priv->creation_date = NULL;
        priv->delivered_date = NULL;
        priv->start_date = NULL;
-       priv->end_date = NULL; 
-       priv->due_date = NULL; 
+       priv->end_date = NULL;
+       priv->due_date = NULL;
        priv->completed_date = NULL;
        priv->trigger = 0;
        priv->recipient_list = NULL;
@@ -534,8 +534,8 @@ e_gw_item_init (EGwItem *item, EGwItemClass *klass)
        priv->msg_body_id = NULL;
        priv->has_attachment = FALSE;
        item->priv = priv;
-       
-       
+
+
 }
 
 GType
@@ -560,19 +560,19 @@ e_gw_item_get_type (void)
        return type;
 }
 
-void 
+void
 e_gw_item_free_cal_id (EGwItemCalId *calid)
 {
        if (calid->item_id) {
                g_free (calid->item_id);
                calid->item_id = NULL;
        }
-       
+
        if (calid->ical_id) {
                g_free (calid->ical_id);
                calid->ical_id = NULL;
        }
-       
+
        if (calid->recur_key) {
                g_free (calid->recur_key);
                calid->recur_key = NULL;
@@ -587,7 +587,7 @@ e_gw_item_new_empty (void)
        return g_object_new (E_TYPE_GW_ITEM, NULL);
 }
 
-static void 
+static void
 set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
         SoupSoapParameter *param_recipient;
@@ -596,31 +596,31 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
        GList *email_list;
 
        email_list = e_gw_item_get_email_list (item);
-       
+
         for (param_recipient = soup_soap_parameter_get_first_child_by_name (param, "recipient");
             param_recipient != NULL;
             param_recipient = soup_soap_parameter_get_next_child_by_name (param_recipient, "recipient")) {
                 SoupSoapParameter *subparam;
 
-               recipient = g_new0 (EGwItemRecipient, 1);       
+               recipient = g_new0 (EGwItemRecipient, 1);
                 subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "email");
                 if (subparam) {
                         email = soup_soap_parameter_get_string_value (subparam);
                         if (email)
                                 recipient->email = email;
-                }        
+                }
                 subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "displayName");
                 if (subparam) {
                         cn = soup_soap_parameter_get_string_value (subparam);
                         if (cn)
                                 recipient->display_name = cn;
                 }
-                
+
                 subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "distType");
                 if (subparam) {
                         const char *dist_type;
                         dist_type = soup_soap_parameter_get_string_value (subparam);
-                        if (!strcmp (dist_type, "TO")) 
+                        if (!strcmp (dist_type, "TO"))
                                 recipient->type = E_GW_ITEM_RECIPIENT_TO;
                         else if (!strcmp (dist_type, "CC"))
                                 recipient->type = E_GW_ITEM_RECIPIENT_CC;
@@ -631,13 +631,13 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                 }
                /*FIXME  gw recipientTypes need to be added after the server is fixed. */
 
-               
+
                /* update Recipient Status
                 look for accepted/declined and update the item else set it
                 to none. */
                subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "recipientStatus");
                 if (subparam) {
-                               char *formatted_date, *value; 
+                               char *formatted_date, *value;
                        SoupSoapParameter *temp_param ;
 
                        recipient->status_enabled = TRUE;
@@ -648,7 +648,7 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                                recipient->deleted_date = g_strdup (formatted_date);
                                g_free (value), value = NULL;
                                g_free (formatted_date), formatted_date = NULL;
-                       } 
+                       }
                        if ( (temp_param = soup_soap_parameter_get_first_child_by_name (subparam, "declined")) ) {
                                recipient->status = E_GW_ITEM_STAT_DECLINED;
                                value = soup_soap_parameter_get_string_value (temp_param);
@@ -664,7 +664,7 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                                recipient->accepted_date = g_strdup (formatted_date);
                                g_free (value), value = NULL;
                                g_free (formatted_date), formatted_date = NULL;
-                       } else  
+                       } else
                                recipient->status = E_GW_ITEM_STAT_NONE;
                        temp_param = soup_soap_parameter_get_first_child_by_name (subparam, "completed");
                        if (temp_param) {
@@ -700,24 +700,24 @@ set_recipient_list_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                else {
                        /* if recipientStatus is not provided, use the
                         * self_status, obtained from the mail properties. */
-                       if (!strcmp ((const char *)email_list->data, recipient->email)) 
-                               recipient->status = item->priv->self_status & (E_GW_ITEM_STAT_DECLINED | 
+                       if (!strcmp ((const char *)email_list->data, recipient->email))
+                               recipient->status = item->priv->self_status & (E_GW_ITEM_STAT_DECLINED |
                                                                                E_GW_ITEM_STAT_ACCEPTED);
                        else
                                recipient->status = E_GW_ITEM_STAT_NONE;
                }
-               
+
                 item->priv->recipient_list = g_slist_append (item->priv->recipient_list, recipient);
-        }        
+        }
 }
 static EGwItemReturnNotify
 get_notification_value (SoupSoapParameter *param, const char *param_name)
 {
        SoupSoapParameter *subparam;
-       
+
        if ((subparam = soup_soap_parameter_get_first_child_by_name (param, param_name))) {
                char *value = NULL;
-               
+
                subparam = soup_soap_parameter_get_first_child_by_name (subparam, "mail");
                if (subparam)
                        value = soup_soap_parameter_get_string_value (subparam);
@@ -739,17 +739,17 @@ set_sendoptions_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 
        priv = item->priv;
 
-       if ( (subparam = soup_soap_parameter_get_first_child_by_name (param, "requestReply")) ) {               
+       if ( (subparam = soup_soap_parameter_get_first_child_by_name (param, "requestReply")) ) {
                child = soup_soap_parameter_get_first_child_by_name (subparam, "whenConvenient");
                if (child) {
                        value = soup_soap_parameter_get_string_value (child);
-                       if (value && !g_ascii_strcasecmp (value, "1")) 
+                       if (value && !g_ascii_strcasecmp (value, "1"))
                                priv->reply_request_set = TRUE;
-               }       
+               }
 
                if (!priv->reply_request_set) {
                        child = soup_soap_parameter_get_first_child_by_name (subparam, "byDate");
-                       
+
                        if (child)
                                value = soup_soap_parameter_get_string_value (child);
                        if (value) {
@@ -761,33 +761,33 @@ set_sendoptions_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 
                }
                g_free (value), value = NULL;
-       }       
+       }
 
        if ( (subparam = soup_soap_parameter_get_first_child_by_name (param, "statusTracking"))) {
                value = soup_soap_parameter_get_string_value (subparam);
               if (value) {
-                      if (!g_ascii_strcasecmp (value, "Delivered")) 
+                      if (!g_ascii_strcasecmp (value, "Delivered"))
                               priv->track_info = E_GW_ITEM_DELIVERED;
-                      else if (!g_ascii_strcasecmp (value, "DeliveredAndOpened")) 
+                      else if (!g_ascii_strcasecmp (value, "DeliveredAndOpened"))
                                priv->track_info = E_GW_ITEM_DELIVERED_OPENED;
-                      else if (!g_ascii_strcasecmp (value, "All")) 
+                      else if (!g_ascii_strcasecmp (value, "All"))
                                priv->track_info = E_GW_ITEM_ALL;
-                      
+
                       g_free (value), value = NULL;
 
                       value = soup_soap_parameter_get_property (subparam, "autoDelete");
                       if (value && !g_ascii_strcasecmp (value, "1"))
-                               priv->autodelete = TRUE; 
+                               priv->autodelete = TRUE;
                       g_free (value), value = NULL;
-              }               
+              }
        }
 
        if ( (subparam = soup_soap_parameter_get_first_child_by_name (param, "notification"))) {
-               priv->notify_opened = get_notification_value (subparam, "opened");      
-               priv->notify_deleted = get_notification_value (subparam, "deleted");    
-               priv->notify_accepted = get_notification_value (subparam, "accepted");  
-               priv->notify_declined = get_notification_value (subparam, "declined");  
-               priv->notify_completed = get_notification_value (subparam, "completed");        
+               priv->notify_opened = get_notification_value (subparam, "opened");
+               priv->notify_deleted = get_notification_value (subparam, "deleted");
+               priv->notify_accepted = get_notification_value (subparam, "accepted");
+               priv->notify_declined = get_notification_value (subparam, "declined");
+               priv->notify_completed = get_notification_value (subparam, "completed");
        }
 }
 
@@ -798,35 +798,35 @@ e_gw_item_get_field_value (EGwItem *item, char *field_name)
 
        g_return_val_if_fail (field_name != NULL, NULL);
        g_return_val_if_fail (E_IS_GW_ITEM(item), NULL);
-       
+
        if (item->priv->simple_fields == NULL)
                return NULL;
-       
+
        value =  (char *) g_hash_table_lookup (item->priv->simple_fields, field_name);
        if (value)
                return value;
-                       
+
        return NULL;
 }
 
-void 
+void
 e_gw_item_set_field_value (EGwItem *item, char *field_name, char* field_value)
 {
        g_return_if_fail (field_name != NULL);
        g_return_if_fail (field_name != NULL);
        g_return_if_fail (E_IS_GW_ITEM(item));
-       
+
        if (item->priv->simple_fields != NULL)
                g_hash_table_insert (item->priv->simple_fields, field_name, g_strdup (field_value));
 
 }
-guint32 
+guint32
 e_gw_item_get_item_status (EGwItem *item)
 {
 
        return item->priv->self_status;
 }
-GList * 
+GList *
 e_gw_item_get_email_list (EGwItem *item)
 {
        return item->priv->email_list;
@@ -834,20 +834,20 @@ e_gw_item_get_email_list (EGwItem *item)
 
 }
 
-void 
-e_gw_item_set_email_list (EGwItem *item, GList* email_list)     
+void
+e_gw_item_set_email_list (EGwItem *item, GList* email_list)
 {
        item->priv->email_list = email_list;
 }
 
-GList * 
+GList *
 e_gw_item_get_im_list (EGwItem *item)
 
 {
        return item->priv->im_list;
 }
 
-void 
+void
 e_gw_item_set_im_list (EGwItem *item, GList *im_list)
 {
        item->priv->im_list = im_list;
@@ -858,9 +858,9 @@ e_gw_item_get_full_name (EGwItem *item)
        return item->priv->full_name;
 }
 
-void 
+void
 e_gw_item_set_full_name (EGwItem *item, FullName *full_name)
-{      
+{
        item->priv->full_name = full_name;
 }
 
@@ -870,14 +870,14 @@ e_gw_item_get_member_list (EGwItem *item)
        return item->priv->member_list;
 }
 
-void 
+void
 e_gw_item_set_member_list (EGwItem *item, GList *list)
 {
        item->priv->member_list = list;
 
 }
 
-void 
+void
 e_gw_item_set_address (EGwItem *item, char *address_type, PostalAddress *address)
 {
        if (address_type && address)
@@ -890,7 +890,7 @@ PostalAddress *e_gw_item_get_address (EGwItem *item, char *address_type)
        return (PostalAddress *) g_hash_table_lookup (item->priv->addresses, address_type);
 }
 
-void 
+void
 e_gw_item_set_categories (EGwItem *item, GList *category_list)
 {
        item->priv->category_list = category_list;
@@ -903,7 +903,7 @@ e_gw_item_get_categories (EGwItem *item)
        return item->priv->category_list;
 }
 
-void 
+void
 e_gw_item_set_category_name (EGwItem *item, char *category_name)
 {
        item->priv->category_name = category_name;
@@ -935,15 +935,15 @@ void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, char *f
        case E_GW_ITEM_CHNAGE_TYPE_UNKNOWN :
                hash_table = NULL;
                break;
-       
+
        }
 
        if (hash_table)
                g_hash_table_insert (hash_table, field_name, field_value);
-       
+
 }
 
-static void 
+static void
 set_common_addressbook_item_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
        SoupSoapParameter *subparam, *category_param;
@@ -997,16 +997,16 @@ set_common_addressbook_item_fields_from_soap_parameter (EGwItem *item, SoupSoapP
                                value = components[0];
                                priv->category_list = g_list_append (priv->category_list, g_strdup (value));
                                g_strfreev(components);
-                               
+
                        }
-                               
+
                }
        }
 
 
 }
 
-static void 
+static void
 set_postal_address_from_soap_parameter (PostalAddress *address, SoupSoapParameter *param)
 {
        SoupSoapParameter *subparam;
@@ -1018,46 +1018,46 @@ set_postal_address_from_soap_parameter (PostalAddress *address, SoupSoapParamete
                if (value)
                        address->street_address = value;
        }
-       
+
        subparam = soup_soap_parameter_get_first_child_by_name (param, "location");
        if (subparam) {
                value = soup_soap_parameter_get_string_value (subparam);
-               
+
                if (value)
                        address->location = value;
        }
-       
+
        subparam = soup_soap_parameter_get_first_child_by_name (param, "city");
        if (subparam) {
                value = soup_soap_parameter_get_string_value (subparam);
                if (value)
                        address->city = value;
        }
-       
+
        subparam = soup_soap_parameter_get_first_child_by_name (param, "state");
        if (subparam) {
                value = soup_soap_parameter_get_string_value (subparam);
                if (value)
                        address->state = value;
        }
-       
+
        subparam = soup_soap_parameter_get_first_child_by_name (param, "postalCode");
        if (subparam) {
                value = soup_soap_parameter_get_string_value (subparam);
                if (value)
                        address->postal_code = value;
        }
-       
+
        subparam = soup_soap_parameter_get_first_child_by_name (param, "country");
        if (subparam) {
                value = soup_soap_parameter_get_string_value (subparam);
                if (value)
                        address->country = value;
        }
-       
+
 }
 
-static void 
+static void
 set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
        char *value;
@@ -1081,31 +1081,31 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
        if (full_name) {
                subparam = soup_soap_parameter_get_first_child_by_name (param, "fullName");
                if (subparam) {
-                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "namePrefix"); 
+                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "namePrefix");
                        if (temp) {
                                value = soup_soap_parameter_get_string_value (temp);
                                if (value)
                                        full_name->name_prefix = value;
                        }
-                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "firstName"); 
+                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "firstName");
                        if (temp) {
                                value = soup_soap_parameter_get_string_value (temp);
                                if (value)
                                        full_name->first_name = value;
                        }
-                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "middleName"); 
+                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "middleName");
                        if (temp) {
                                value = soup_soap_parameter_get_string_value (temp);
                                if (value)
                                        full_name->middle_name = value;
                        }
-                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "lastName"); 
+                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "lastName");
                        if (temp) {
                                value = soup_soap_parameter_get_string_value (temp);
                                if (value)
                                        full_name->last_name = value;
                        }
-                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "nameSuffix"); 
+                       temp = soup_soap_parameter_get_first_child_by_name(subparam, "nameSuffix");
                        if (temp) {
                                value = soup_soap_parameter_get_string_value (temp);
                                if (value)
@@ -1113,11 +1113,11 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                        }
                }
        }
-       subparam = soup_soap_parameter_get_first_child_by_name(param, "emailList"); 
+       subparam = soup_soap_parameter_get_first_child_by_name(param, "emailList");
        if (subparam) {
                primary_email = NULL;
                value = soup_soap_parameter_get_property(subparam, "primary");
-               if (value) {     
+               if (value) {
                        primary_email = value;
                        item->priv->email_list = g_list_append (item->priv->email_list, g_strdup (primary_email));
                }
@@ -1153,13 +1153,13 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                                }
                                if (im_address->service && im_address->address)
                                        item->priv->im_list = g_list_append (item->priv->im_list, im_address);
-                               else 
-                                       free_im_address (im_address, NULL);                                     
-                               
+                               else
+                                       free_im_address (im_address, NULL);
+
                        }
        }
-       
-       
+
+
        subparam =  soup_soap_parameter_get_first_child_by_name(param, "phoneList");
        if(subparam) {
                g_hash_table_insert (simple_fields, "default_phone", soup_soap_parameter_get_property(subparam, "default"));
@@ -1170,7 +1170,7 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                                type =  soup_soap_parameter_get_property (temp, "type");
                                value = soup_soap_parameter_get_string_value (temp);
                                switch (*type) {
-                                       case 'O' :      
+                                       case 'O' :
                                                key = "phone_Office";
                                                break;
                                        case 'H' :
@@ -1204,7 +1204,7 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                        value = soup_soap_parameter_get_string_value (temp);
                        if (value)
                                g_hash_table_insert (simple_fields, "birthday", value);
-                       
+
                }
                temp = soup_soap_parameter_get_first_child_by_name (subparam, "website");
                if(temp) {
@@ -1237,7 +1237,7 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                        if(value)
                                g_hash_table_insert (simple_fields, "title", value);
                }
-                       
+
        }
 
        subparam = soup_soap_parameter_get_first_child_by_name (param, "addressList");
@@ -1247,32 +1247,32 @@ set_contact_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                        address = g_new0 (PostalAddress, 1);
                        set_postal_address_from_soap_parameter (address, temp);
                        value = soup_soap_parameter_get_property(temp, "type");
-                       
+
                        if (value && value[0] == 'H')
                                add = "Home";
                        else if (value && value[0] == 'O')
                                add = "Office";
-                       else 
+                       else
                                add = "Other";
 
-                       if (value) 
+                       if (value)
                                g_hash_table_insert (item->priv->addresses, (char*)add, address);
                        else
                                free_postal_address (address);
                        g_free (value);
                }
-               
+
        }
-       
+
 }
-static void 
+static void
 set_group_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
 
        char *value;
        SoupSoapParameter *subparam, *temp, *second_level_child;
        GHashTable *simple_fields;
-       
+
        if (strcmp (soup_soap_parameter_get_name (param), "item") != 0) {
                g_warning (G_STRLOC ": Invalid SOAP parameter %s", soup_soap_parameter_get_name (param));
                return;
@@ -1283,7 +1283,7 @@ set_group_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 
        /* set name as the ful name also , as it is needed for searching*/
        value = g_hash_table_lookup (simple_fields, "name");
-       if (value) 
+       if (value)
                item->priv->full_name->first_name = g_strdup (value);
 
        subparam = soup_soap_parameter_get_first_child_by_name (param, "members");
@@ -1291,37 +1291,37 @@ set_group_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
                char *id, *email;
                for ( temp = soup_soap_parameter_get_first_child (subparam); temp != NULL; temp = soup_soap_parameter_get_next_child (temp)) {
                        id = email = NULL;
-                       second_level_child = soup_soap_parameter_get_first_child_by_name (temp, "email"); 
+                       second_level_child = soup_soap_parameter_get_first_child_by_name (temp, "email");
                        if (second_level_child)
                                email = soup_soap_parameter_get_string_value (second_level_child);
                        second_level_child = soup_soap_parameter_get_first_child_by_name (temp, "id");
                        if (second_level_child)
                                id = soup_soap_parameter_get_string_value (second_level_child);
-                       
+
                        if (id && email) {
                                EGroupMember *member = g_new0 (EGroupMember, 1);
                                member->id = id;
                                member->email = email;
                                second_level_child = soup_soap_parameter_get_first_child_by_name (temp, "name");
-                               member->name =  soup_soap_parameter_get_string_value (second_level_child); 
+                               member->name =  soup_soap_parameter_get_string_value (second_level_child);
                                item->priv->member_list = g_list_append (item->priv->member_list, member);
                        }
-                             
-                       
+
+
                }
        }
-       
-       
+
+
 }
 
-static void 
+static void
 set_resource_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
 
        char *value;
        SoupSoapParameter *subparam;
        GHashTable *simple_fields;
-       
+
        if (strcmp (soup_soap_parameter_get_name (param), "item") != 0) {
                g_warning (G_STRLOC ": Invalid SOAP parameter %s", soup_soap_parameter_get_name (param));
                return;
@@ -1332,9 +1332,9 @@ set_resource_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param
 
        /* set name as the ful name also , as it is needed for searching*/
        value = g_hash_table_lookup (simple_fields, "name");
-       if (value) 
+       if (value)
                item->priv->full_name->first_name = g_strdup (value);
-               
+
        subparam = soup_soap_parameter_get_first_child_by_name (param, "phone");
        if(subparam) {
                value = soup_soap_parameter_get_string_value (subparam);
@@ -1347,10 +1347,10 @@ set_resource_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param
                if(value)
                        item->priv->email_list = g_list_append (item->priv->email_list, value);
        }
-       
+
 }
 
-static void 
+static void
 set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 {
 
@@ -1358,7 +1358,7 @@ set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *p
        SoupSoapParameter *subparam;
        PostalAddress *address;
        GHashTable *simple_fields;
-       
+
        if (strcmp (soup_soap_parameter_get_name (param), "item") != 0) {
                g_warning (G_STRLOC ": Invalid SOAP parameter %s", soup_soap_parameter_get_name (param));
                return;
@@ -1368,7 +1368,7 @@ set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *p
 
        /* set name as the ful name also , as it is needed for searching*/
        value = g_hash_table_lookup (simple_fields, "name");
-       if (value) 
+       if (value)
                item->priv->full_name->first_name = g_strdup (value);
 
        subparam = soup_soap_parameter_get_first_child_by_name (param, "phone");
@@ -1390,7 +1390,7 @@ set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *p
                address = g_new0 (PostalAddress, 1);
                set_postal_address_from_soap_parameter (address, subparam);
                g_hash_table_insert (item->priv->addresses, "Office", address);
-               
+
        }
 
                subparam = soup_soap_parameter_get_first_child_by_name (param, "website");
@@ -1403,7 +1403,7 @@ set_organization_fields_from_soap_parameter (EGwItem *item, SoupSoapParameter *p
 
 }
 
-static void 
+static void
 append_postal_address_to_soap_message (SoupSoapMessage *msg, PostalAddress *address, char *address_type)
 {
        soup_soap_message_start_element (msg, "address", NULL, NULL);
@@ -1428,27 +1428,27 @@ static void
 append_common_addressbook_item_fields_to_soap_message (GHashTable *simple_fields, GList *category_list,  SoupSoapMessage *msg)
 {
        char * value;
-       
+
        value =  g_hash_table_lookup (simple_fields, "name");
        if (value)
                e_gw_message_write_string_parameter (msg, "name", NULL, value);
 
        soup_soap_message_start_element (msg, "categories", NULL, NULL);
-       if (category_list && category_list->data) 
+       if (category_list && category_list->data)
                soup_soap_message_add_attribute (msg, "types:primary", category_list->data, NULL, NULL);
-       for (; category_list != NULL; category_list = g_list_next (category_list)) 
+       for (; category_list != NULL; category_list = g_list_next (category_list))
                if (category_list->data) {
                        e_gw_message_write_string_parameter (msg, "category", NULL, category_list->data);
                }
        soup_soap_message_end_element (msg);
 
        value = g_hash_table_lookup (simple_fields, "comment");
-       if(value) 
+       if(value)
                e_gw_message_write_string_parameter (msg, "comment", NULL, value);
 
 }
 
-static void 
+static void
 append_full_name_to_soap_message (FullName *full_name, char *display_name, SoupSoapMessage *msg)
 {
        g_return_if_fail (full_name != NULL);
@@ -1469,21 +1469,21 @@ append_full_name_to_soap_message (FullName *full_name, char *display_name, SoupS
 
 }
 
-static void 
+static void
 append_email_list_soap_message (GList *email_list, SoupSoapMessage *msg)
 {
        g_return_if_fail (email_list != NULL);
 
        soup_soap_message_start_element (msg, "emailList", NULL, NULL);
        soup_soap_message_add_attribute (msg, "primary", email_list->data, NULL, NULL);
-       for (; email_list != NULL; email_list = g_list_next (email_list)) 
-               if(email_list->data) 
+       for (; email_list != NULL; email_list = g_list_next (email_list))
+               if(email_list->data)
                        e_gw_message_write_string_parameter (msg, "email", NULL, email_list->data);
        soup_soap_message_end_element (msg);
 
 }
 
-static void 
+static void
 append_im_list_to_soap_message (GList *ims, SoupSoapMessage *msg)
 {
        IMAddress *address;
@@ -1509,29 +1509,29 @@ append_phone_list_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *m
 
        soup_soap_message_start_element (msg, "phoneList", NULL, NULL);
        value = g_hash_table_lookup (simple_fields, "default_phone");
-       if (value) 
+       if (value)
                soup_soap_message_add_attribute (msg, "default", value, NULL, NULL);
        value = g_hash_table_lookup (simple_fields, "phone_Office");
-       if (value) 
+       if (value)
                e_gw_message_write_string_parameter_with_attribute (msg, "phone", NULL, value, "type", "Office");
        value = g_hash_table_lookup (simple_fields, "phone_Home");
-       if (value) 
+       if (value)
                e_gw_message_write_string_parameter_with_attribute (msg, "phone", NULL, value, "type", "Home");
        value = g_hash_table_lookup (simple_fields, "phone_Pager");
-       if (value) 
+       if (value)
                e_gw_message_write_string_parameter_with_attribute (msg, "phone", NULL, value, "type", "Pager");
        value = g_hash_table_lookup (simple_fields, "phone_Mobile");
-       if (value) 
+       if (value)
                e_gw_message_write_string_parameter_with_attribute (msg, "phone", NULL, value, "type", "Mobile");
        value = g_hash_table_lookup (simple_fields, "phone_Fax");
-       if (value) 
+       if (value)
                e_gw_message_write_string_parameter_with_attribute (msg, "phone", NULL, value, "type", "Fax");
 
        soup_soap_message_end_element (msg);
 
 }
 
-static void 
+static void
 append_office_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *msg)
 {
        char *value;
@@ -1541,14 +1541,14 @@ append_office_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *
        soup_soap_message_start_element (msg, "officeInfo", NULL, NULL);
        value = g_hash_table_lookup (simple_fields, "organization_id");
        org_name = g_hash_table_lookup (simple_fields, "organization");
-       if (value && org_name) 
+       if (value && org_name)
                e_gw_message_write_string_parameter_with_attribute (msg, "organization", NULL, org_name, "uid", value);
        else if(org_name)
                e_gw_message_write_string_parameter (msg, "organization", NULL, org_name);
        value = g_hash_table_lookup (simple_fields, "department");
        if (value)
                e_gw_message_write_string_parameter (msg, "department", NULL, value);
-       
+
                value = g_hash_table_lookup (simple_fields, "title");
        if (value)
                e_gw_message_write_string_parameter (msg, "title", NULL, value);
@@ -1560,13 +1560,13 @@ append_office_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *
 
 }
 
-static void 
+static void
 append_personal_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage *msg)
 {
        char *value;
 
        g_return_if_fail (simple_fields != NULL);
-       
+
        soup_soap_message_start_element (msg, "personalInfo", NULL, NULL);
        value =  g_hash_table_lookup (simple_fields, "birthday");
        if(value)
@@ -1574,7 +1574,7 @@ append_personal_info_to_soap_message (GHashTable *simple_fields, SoupSoapMessage
        value =  g_hash_table_lookup (simple_fields, "website");
        if(value)
                e_gw_message_write_string_parameter (msg, "website",NULL,  value);
-       
+
        soup_soap_message_end_element (msg);
 
 }
@@ -1586,32 +1586,32 @@ append_contact_fields_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
        GHashTable *simple_fields;
        FullName *full_name;
        PostalAddress *postal_address;
-       
+
        simple_fields = item->priv->simple_fields;
        value = g_hash_table_lookup (simple_fields, "id");
        if (value)
                e_gw_message_write_string_parameter (msg, "id", NULL, value);
-       
+
        if (item->priv->container)
                e_gw_message_write_string_parameter (msg, "container", NULL, item->priv->container);
 
        append_common_addressbook_item_fields_to_soap_message (simple_fields, item->priv->category_list, msg);
        value =  g_hash_table_lookup (simple_fields, "name");
-       
+
        full_name = item->priv->full_name;
-       
+
        if (full_name)
-               append_full_name_to_soap_message (full_name, value, msg); 
-       
+               append_full_name_to_soap_message (full_name, value, msg);
+
        if (item->priv->email_list)
                append_email_list_soap_message (item->priv->email_list, msg);
-       
+
        if (item->priv->im_list)
                append_im_list_to_soap_message (item->priv->im_list, msg);
-       
+
        if (simple_fields)
                append_phone_list_to_soap_message (simple_fields, msg);
-               
+
        soup_soap_message_start_element (msg, "addressList", NULL, NULL);
        postal_address = g_hash_table_lookup (item->priv->addresses, "Home");
        if (postal_address)
@@ -1625,7 +1625,7 @@ append_contact_fields_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 
 }
 
-static void 
+static void
 append_group_fields_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 {
        GHashTable *simple_fields;
@@ -1647,7 +1647,7 @@ append_group_fields_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 
        }
        soup_soap_message_end_element (msg);
-       
+
 }
 
 EGwItem *
@@ -1658,7 +1658,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
        SoupSoapParameter *subparameter, *child, *category_param, *attachment_param;
        gboolean is_group_item = TRUE;
        GList *user_email = NULL;
-       
+
        g_return_val_if_fail (param != NULL, NULL);
 
        if (strcmp (soup_soap_parameter_get_name (param), "item") != 0) {
@@ -1681,7 +1681,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                set_contact_fields_from_soap_parameter (item, param);
                g_free (item_type);
                return item;
-       } 
+       }
        else if (!g_ascii_strcasecmp (item_type,"SharedNotification"))
                item->priv->item_type = E_GW_ITEM_TYPE_NOTIFICATION ;
 
@@ -1692,22 +1692,22 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                g_free (item_type);
                return item;
        }
-               
+
        else if (!g_ascii_strcasecmp (item_type, "Resource")) {
-               
+
                item->priv->item_type = E_GW_ITEM_TYPE_CONTACT;
                set_resource_fields_from_soap_parameter (item, param);
                g_free (item_type);
                return item;
        }
-                
+
        else if (!g_ascii_strcasecmp (item_type, "Group")) {
                item->priv->item_type = E_GW_ITEM_TYPE_GROUP;
                set_group_fields_from_soap_parameter (item, param);
                g_free (item_type);
                return item;
        }
-       
+
        else {
                g_free (item_type);
                g_object_unref (item);
@@ -1732,7 +1732,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                        subparameter = soup_soap_parameter_get_first_child_by_name (changes, "update");
        }
        else subparameter = param; /* The item is a complete one, not a delta  */
-       
+
        /* now add all properties to the private structure */
        for (child = soup_soap_parameter_get_first_child (subparameter);
                        child != NULL;
@@ -1767,7 +1767,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                                item->priv->is_allday_event = TRUE;
                        else
                                item->priv->is_allday_event = FALSE;
-                       g_free (value); 
+                       g_free (value);
 
                } else if (!g_ascii_strcasecmp (name, "status")) {
                        SoupSoapParameter *status_param;
@@ -1783,7 +1783,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                                        item->priv->self_status |= E_GW_ITEM_STAT_DECLINED;
                                else if (!strcmp (status_name, "deleted"))
                                        item->priv->self_status |= E_GW_ITEM_STAT_DELETED;
-                               else if (!strcmp (status_name, "read")) 
+                               else if (!strcmp (status_name, "read"))
                                        item->priv->self_status |= E_GW_ITEM_STAT_READ;
                                else if (!strcmp (status_name, "opened"))
                                        item->priv->self_status |= E_GW_ITEM_STAT_OPENED;
@@ -1824,8 +1824,8 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                        }
 
                        tp = soup_soap_parameter_get_first_child_by_name (child, "sendoptions");
-                       if (tp) 
-                               set_sendoptions_from_soap_parameter (item, tp);         
+                       if (tp)
+                               set_sendoptions_from_soap_parameter (item, tp);
 
                        tp = soup_soap_parameter_get_first_child_by_name (child, "from");
                        if (tp && is_group_item) {
@@ -1833,10 +1833,10 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                                EGwItemOrganizer *organizer = g_new0 (EGwItemOrganizer, 1);
 
                                subparam = soup_soap_parameter_get_first_child_by_name (tp, "displayName");
-                               if (subparam) 
+                               if (subparam)
                                        organizer->display_name = soup_soap_parameter_get_string_value (subparam);
                                subparam = soup_soap_parameter_get_first_child_by_name (tp, "email");
-                               if (subparam) 
+                               if (subparam)
                                        organizer->email = soup_soap_parameter_get_string_value (subparam);
                                e_gw_item_set_organizer (item, organizer);
                        }
@@ -1858,7 +1858,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                        if (subparam)
                                value = soup_soap_parameter_get_string_value (subparam);
                        if (value)
-                               item->priv->expires = g_strdup (value); 
+                               item->priv->expires = g_strdup (value);
                        g_free (value), value = NULL;
 
                        subparam = soup_soap_parameter_get_first_child_by_name (child, "delayDeliveryUntil");
@@ -1869,7 +1869,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                        g_free (value), value = NULL;
 
                } else if (!g_ascii_strcasecmp (name, "dueDate")) {
-                       char *formatted_date; 
+                       char *formatted_date;
                        value = soup_soap_parameter_get_string_value (child);
                        formatted_date = e_gw_connection_format_date_string (value);
                        e_gw_item_set_due_date (item, formatted_date);
@@ -1877,12 +1877,12 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                        g_free (formatted_date);
 
                } else if (!g_ascii_strcasecmp (name, "endDate") || !g_ascii_strcasecmp (name, "endDay")) {
-                       char *formatted_date; 
+                       char *formatted_date;
                        value = soup_soap_parameter_get_string_value (child);
                        formatted_date = e_gw_connection_format_date_string (value);
                        e_gw_item_set_end_date (item, formatted_date);
                        g_free (value);
-                       g_free (formatted_date); 
+                       g_free (formatted_date);
 
                } else if (!g_ascii_strcasecmp (name, "to")) {
                        char *to ;
@@ -1892,7 +1892,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                } else if (!g_ascii_strcasecmp (name, "iCalId"))
                        item->priv->icalid = soup_soap_parameter_get_string_value (child);
 
-               else if (!g_ascii_strcasecmp (name, "categories")) { 
+               else if (!g_ascii_strcasecmp (name, "categories")) {
                        for (category_param = soup_soap_parameter_get_first_child_by_name (child, "category");
                                        category_param != NULL;
                                        category_param = soup_soap_parameter_get_next_child_by_name (category_param, "category")) {
@@ -1907,7 +1907,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                                }
                        }
 
-               } else if (!g_ascii_strcasecmp (name, "id")) 
+               } else if (!g_ascii_strcasecmp (name, "id"))
                        item->priv->id = soup_soap_parameter_get_string_value (child);
                else if (!g_ascii_strcasecmp (name, "recurrenceKey"))
                        item->priv->recurrence_key = soup_soap_parameter_get_int_value (child);
@@ -1919,16 +1919,16 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 
                        part = soup_soap_parameter_get_first_child_by_name (child, "part");
                        msg = soup_soap_parameter_get_string_value (part);
-                       length = soup_soap_parameter_get_property (part, "length"); 
+                       length = soup_soap_parameter_get_property (part, "length");
 
                        if (msg && length) {
                                len = atoi (length);
                                item->priv->message = g_base64_decode  (msg, &len);
                                if (!(item->priv->message)) {
                                        item->priv->msg_body_id = soup_soap_parameter_get_property (part, "id") ;
-                               } 
+                               }
                                item->priv->content_type = soup_soap_parameter_get_property (part, "contentType") ;
-                       } 
+                       }
 
                        g_free (length);
                        g_free (msg);
@@ -1995,7 +1995,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
                else if (!g_ascii_strcasecmp (name, "source")) {
                        value = soup_soap_parameter_get_string_value (child);
                        if (!strcmp (value, "personal")) {
-                               if (item->priv->item_type == E_GW_ITEM_TYPE_TASK || 
+                               if (item->priv->item_type == E_GW_ITEM_TYPE_TASK ||
                                                item->priv->item_type == E_GW_ITEM_TYPE_APPOINTMENT)
                                        is_group_item = FALSE;
                        }
@@ -2219,7 +2219,7 @@ e_gw_item_get_completed_date (EGwItem *item)
        return item->priv->completed_date;
 }
 
-void 
+void
 e_gw_item_set_completed_date (EGwItem *item, const char *new_date)
 {
        g_return_if_fail (E_IS_GW_ITEM (item));
@@ -2327,7 +2327,7 @@ e_gw_item_set_completed (EGwItem *item, gboolean new_completed)
        item->priv->completed = new_completed;
 }
 
-gboolean 
+gboolean
 e_gw_item_get_is_allday_event (EGwItem *item)
 {
        g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
@@ -2335,7 +2335,7 @@ e_gw_item_get_is_allday_event (EGwItem *item)
        return item->priv->is_allday_event;
 }
 
-void 
+void
 e_gw_item_set_is_allday_event (EGwItem *item, gboolean allday_event)
 {
        g_return_if_fail (E_IS_GW_ITEM (item));
@@ -2439,7 +2439,7 @@ e_gw_item_get_attach_id_list (EGwItem *item)
 void
 e_gw_item_set_organizer (EGwItem  *item, EGwItemOrganizer *organizer)
 {
-       /* free organizer */ 
+       /* free organizer */
        g_free (item->priv->organizer);
        item->priv->organizer = organizer;
 }
@@ -2524,11 +2524,11 @@ e_gw_item_set_trigger (EGwItem *item, int trigger)
 }
 
 
-void 
+void
 e_gw_item_set_to (EGwItem *item, const char *to)
 {
        g_return_if_fail (E_IS_GW_ITEM (item));
-       item->priv->to = g_strdup (to) ; 
+       item->priv->to = g_strdup (to) ;
 }
 
 const char *
@@ -2626,7 +2626,7 @@ e_gw_item_get_autodelete (EGwItem *item)
        return item->priv->autodelete;
 }
 
-void 
+void
 e_gw_item_set_notify_completed (EGwItem *item, EGwItemReturnNotify notify)
 {
        g_return_if_fail (E_IS_GW_ITEM (item));
@@ -2634,7 +2634,7 @@ e_gw_item_set_notify_completed (EGwItem *item, EGwItemReturnNotify notify)
        item->priv->notify_completed = notify;
 }
 
-EGwItemReturnNotify 
+EGwItemReturnNotify
 e_gw_item_get_notify_completed (EGwItem *item)
 {
        g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
@@ -2642,7 +2642,7 @@ e_gw_item_get_notify_completed (EGwItem *item)
        return item->priv->notify_completed;
 }
 
-void 
+void
 e_gw_item_set_notify_accepted (EGwItem *item, EGwItemReturnNotify notify)
 {
        g_return_if_fail (E_IS_GW_ITEM (item));
@@ -2650,7 +2650,7 @@ e_gw_item_set_notify_accepted (EGwItem *item, EGwItemReturnNotify notify)
        item->priv->notify_accepted = notify;
 }
 
-EGwItemReturnNotify 
+EGwItemReturnNotify
 e_gw_item_get_notify_accepted (EGwItem *item)
 {
        g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
@@ -2658,7 +2658,7 @@ e_gw_item_get_notify_accepted (EGwItem *item)
        return item->priv->notify_accepted;
 }
 
-void 
+void
 e_gw_item_set_notify_declined (EGwItem *item, EGwItemReturnNotify notify)
 {
        g_return_if_fail (E_IS_GW_ITEM (item));
@@ -2666,7 +2666,7 @@ e_gw_item_set_notify_declined (EGwItem *item, EGwItemReturnNotify notify)
        item->priv->notify_declined = notify;
 }
 
-EGwItemReturnNotify 
+EGwItemReturnNotify
 e_gw_item_get_notify_declined (EGwItem *item)
 {
        g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
@@ -2674,7 +2674,7 @@ e_gw_item_get_notify_declined (EGwItem *item)
        return item->priv->notify_declined;
 }
 
-void 
+void
 e_gw_item_set_notify_opened (EGwItem *item, EGwItemReturnNotify notify)
 {
        g_return_if_fail (E_IS_GW_ITEM (item));
@@ -2682,7 +2682,7 @@ e_gw_item_set_notify_opened (EGwItem *item, EGwItemReturnNotify notify)
        item->priv->notify_opened = notify;
 }
 
-EGwItemReturnNotify 
+EGwItemReturnNotify
 e_gw_item_get_notify_opened (EGwItem *item)
 {
        g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
@@ -2690,7 +2690,7 @@ e_gw_item_get_notify_opened (EGwItem *item)
        return item->priv->notify_opened;
 }
 
-void 
+void
 e_gw_item_set_notify_deleted (EGwItem *item, EGwItemReturnNotify notify)
 {
        g_return_if_fail (E_IS_GW_ITEM (item));
@@ -2698,7 +2698,7 @@ e_gw_item_set_notify_deleted (EGwItem *item, EGwItemReturnNotify notify)
        item->priv->notify_deleted = notify;
 }
 
-EGwItemReturnNotify 
+EGwItemReturnNotify
 e_gw_item_get_notify_deleted (EGwItem *item)
 {
        g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
@@ -2789,25 +2789,25 @@ add_return_notification (SoupSoapMessage *msg, char *option, EGwItemReturnNotify
                case E_GW_ITEM_NOTIFY_NONE:
                        e_gw_message_write_string_parameter (msg, "mail", NULL, "0");
        }
-       
-       soup_soap_message_end_element (msg);    
+
+       soup_soap_message_end_element (msg);
 }
 
-static void 
-append_gw_item_options (SoupSoapMessage *msg, EGwItem *item) 
+static void
+append_gw_item_options (SoupSoapMessage *msg, EGwItem *item)
 {
        EGwItemPrivate *priv;
 
        priv = item->priv;
-       
+
        soup_soap_message_start_element (msg, "options", NULL, NULL);
-       
+
        /* Priority */
        e_gw_message_write_string_parameter (msg, "priority", NULL, priv->priority ? priv->priority : "0");
 
        /* Expiration date */
        e_gw_message_write_string_parameter (msg, "expires", NULL, priv->expires ? priv->expires : "0");
-       
+
        /* Delay delivery */
        e_gw_message_write_string_parameter (msg, "delayDeliveryUntil", NULL, priv->delay_until ? priv->delay_until : "0");
 
@@ -2825,16 +2825,16 @@ e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
        priv = item->priv;
        organizer = priv->organizer;
        recipient_list = priv->recipient_list;
-       
+
        /* start distribution element */
        soup_soap_message_start_element (msg, "distribution", NULL, NULL);
        if (organizer) {
                soup_soap_message_start_element (msg, "from", NULL, NULL);
                e_gw_message_write_string_parameter (msg, "displayName", NULL,
                                organizer->display_name ? organizer->display_name : "");
-               e_gw_message_write_string_parameter (msg, "email", NULL, 
+               e_gw_message_write_string_parameter (msg, "email", NULL,
                                organizer->email ? organizer->email : "");
-               
+
                soup_soap_message_end_element (msg);
        }
        /* start recipients */
@@ -2845,7 +2845,7 @@ e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                char *status = NULL;
 
                EGwItemRecipient *recipient = (EGwItemRecipient *) rl->data;
-               
+
                soup_soap_message_start_element (msg, "recipient", NULL, NULL);
                e_gw_message_write_string_parameter (msg, "displayName", NULL, recipient->display_name ? recipient->display_name : "");
                e_gw_message_write_string_parameter (msg, "email", NULL, recipient->email ? recipient->email : "");
@@ -2855,7 +2855,7 @@ e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                        dist_type = "CC";
                else if (recipient->type == E_GW_ITEM_RECIPIENT_BC)
                        dist_type = "BC";
-               else 
+               else
                        dist_type ="";
                e_gw_message_write_string_parameter (msg, "distType", NULL, dist_type);
                /* add recip_status */
@@ -2867,31 +2867,31 @@ e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                        status = "";
                if (status && *status)
                        e_gw_message_write_string_parameter (msg, "recipientStatus", NULL, status);
-               
-               soup_soap_message_end_element (msg);            
+
+               soup_soap_message_end_element (msg);
        }
-       
+
        soup_soap_message_end_element (msg);
-       
-       if (priv->set_sendoptions) {    
+
+       if (priv->set_sendoptions) {
                soup_soap_message_start_element (msg, "sendoptions", NULL, NULL);
-                       
+
                soup_soap_message_start_element (msg, "requestReply", NULL, NULL);
                if (priv->reply_request_set) {
-                       
-                       if (priv->reply_within)  
+
+                       if (priv->reply_within)
                                e_gw_message_write_string_parameter (msg, "byDate", NULL, priv->reply_within);
-                       else 
+                       else
                                e_gw_message_write_string_parameter (msg, "whenConvenient", NULL, "1");
-                       
+
                } else
                        soup_soap_message_write_string (msg, "0");
                soup_soap_message_end_element (msg);
 
                soup_soap_message_start_element (msg, "statusTracking", NULL, NULL);
-               
+
                soup_soap_message_add_attribute (msg, "autoDelete", priv->autodelete ? "1" : "0", NULL, NULL);
-       
+
                switch (priv->track_info) {
                        case E_GW_ITEM_DELIVERED : soup_soap_message_write_string (msg, "Delivered");
                                 break;
@@ -2901,21 +2901,21 @@ e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                                 break;
                        default: soup_soap_message_write_string (msg, "None");
                }
-               
+
                soup_soap_message_end_element (msg);
-       
+
                soup_soap_message_start_element (msg, "notification", NULL, NULL);
                switch (priv->item_type) {
-               
+
                case E_GW_ITEM_TYPE_TASK :
                        add_return_notification (msg, "completed", priv->notify_completed);
-                       
+
                case E_GW_ITEM_TYPE_APPOINTMENT:
                        add_return_notification (msg, "accepted", priv->notify_accepted);
                        add_return_notification (msg, "declined", priv->notify_declined);
                        add_return_notification (msg, "opened", priv->notify_opened);
                        break;
-               
+
                default:
                        add_return_notification (msg, "opened", priv->notify_opened);
                        add_return_notification (msg, "deleted", priv->notify_deleted);
@@ -2952,10 +2952,10 @@ add_attachment_to_soap_message(EGwItemAttachment *attachment, SoupSoapMessage *m
        if (attachment->size > 0) {
                size = g_strdup_printf ("%d", attachment->size) ;
                e_gw_message_write_string_parameter (msg, "size", NULL, size) ;
-       } 
+       }
        /*date*/
-       if (attachment->date) 
-               e_gw_message_write_string_parameter (msg, "date", NULL, attachment->date) ;     
+       if (attachment->date)
+               e_gw_message_write_string_parameter (msg, "date", NULL, attachment->date) ;
 
        /*data*/
        if (attachment->size > 0) {
@@ -2966,12 +2966,12 @@ add_attachment_to_soap_message(EGwItemAttachment *attachment, SoupSoapMessage *m
                soup_soap_message_write_string (msg, attachment->data) ;
                soup_soap_message_end_element (msg) ;
        }
-       
+
        soup_soap_message_end_element (msg) ;
        g_free (size) ;
 }
 
-static void 
+static void
 e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
 {
        EGwItemPrivate *priv = item->priv;
@@ -3004,7 +3004,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
        soup_soap_message_start_element (msg, "message", NULL, NULL);
        if (priv->message) {
                char *str;
-               
+
                str = g_base64_encode (priv->message, strlen (priv->message));
                dtstring = g_strdup_printf ("%d", (int)strlen (str));
                soup_soap_message_add_attribute (msg, "length", dtstring, NULL, NULL);
@@ -3019,31 +3019,31 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
        soup_soap_message_end_element (msg);
 
        if (priv->start_date) {
-               e_gw_message_write_string_parameter (msg, "startDate", NULL, 
+               e_gw_message_write_string_parameter (msg, "startDate", NULL,
                                priv->start_date);
        }
 
        if (priv->category_list) {
                        soup_soap_message_start_element (msg, "categories", NULL, NULL);
-                       
-                       if (priv->category_list && priv->category_list->data) 
+
+                       if (priv->category_list && priv->category_list->data)
                                soup_soap_message_add_attribute (msg, "types:primary", priv->category_list->data, NULL, NULL);
-                       
-                       for (; priv->category_list != NULL; priv->category_list = g_list_next (priv->category_list)) 
+
+                       for (; priv->category_list != NULL; priv->category_list = g_list_next (priv->category_list))
                                if (priv->category_list->data) {
                                        e_gw_message_write_string_parameter (msg, "category", NULL, priv->category_list->data);
                                }
                        soup_soap_message_end_element (msg);
                }
-       
+
        /* handle recurrences */
         if (item->priv->rrule) {
                EGwItemRecurrenceRule *rrule = item->priv->rrule;
 
                soup_soap_message_start_element (msg, "rrule", NULL, NULL);
-               
-               e_gw_message_write_string_parameter (msg, "frequency", NULL, rrule->frequency); 
-               e_gw_message_write_int_parameter (msg, "interval", NULL, rrule->interval); 
+
+               e_gw_message_write_string_parameter (msg, "frequency", NULL, rrule->frequency);
+               e_gw_message_write_int_parameter (msg, "interval", NULL, rrule->interval);
 
                if (rrule->until)
                        e_gw_message_write_string_parameter (msg, "until", NULL, rrule->until);
@@ -3058,7 +3058,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                        /* expand into  a sequence of 'day' here  */
                        for (i = 0; i < max_elements && rrule->by_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
                                /*TODO occurence attribute */
-                               e_gw_message_write_string_parameter (msg, "day", NULL, 
+                               e_gw_message_write_string_parameter (msg, "day", NULL,
                                                e_gw_recur_get_day_of_week (rrule->by_day [i]));
                        }
                        soup_soap_message_end_element (msg);
@@ -3067,7 +3067,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                if (rrule->by_month_day) {
                        int i, max_elements;
                        char month_day[3];
-                       
+
                        soup_soap_message_start_element (msg, "byMonthDay", NULL, NULL);
                        max_elements = sizeof (rrule->by_month_day)  / sizeof (rrule->by_month_day [i]);
                        /* expand into  a sequence of 'day' here  */
@@ -3075,7 +3075,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                                /*TODO occurence attribute */
                                g_sprintf (month_day, "%d", rrule->by_month_day [i]);
                                e_gw_message_write_string_parameter (msg, "day", NULL, month_day);
-                                                                               
+
                        }
                        soup_soap_message_end_element (msg);
                }
@@ -3090,7 +3090,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                                /*TODO occurence attribute */
                                g_sprintf (year_day, "%d", rrule->by_year_day [i]);
                                e_gw_message_write_string_parameter (msg, "day", NULL, year_day);
-                                                                               
+
                        }
                soup_soap_message_end_element (msg);
                }
@@ -3105,12 +3105,12 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                                /*TODO occurence attribute */
                                g_sprintf (month, "%d", rrule->by_month [i]);
                                e_gw_message_write_string_parameter (msg, "month", NULL, month);
-                                                                               
+
                        }
                        soup_soap_message_end_element (msg);
                }
                soup_soap_message_end_element (msg);
-               
+
        } else if (item->priv->recurrence_dates) {
                GSList *date;
                soup_soap_message_start_element (msg, "rdate", NULL, NULL);
@@ -3119,7 +3119,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                }
                soup_soap_message_end_element (msg);
        }
-       
+
        if (item->priv->exdate_list) {
                GSList *date;
                soup_soap_message_start_element (msg, "exdate", NULL, NULL);
@@ -3128,7 +3128,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                }
                soup_soap_message_end_element (msg);
        }
-       /*xxx - byday, bymonthday and byyearday not handled - FIXME */  
+       /*xxx - byday, bymonthday and byyearday not handled - FIXME */
 
        /*attachments*/
        if (priv->attach_list) {
@@ -3137,7 +3137,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                for (al = priv->attach_list ; al != NULL ;  al = al->next) {
                        EGwItemAttachment *attachment = (EGwItemAttachment *)al->data ;
                        add_attachment_to_soap_message (attachment, msg) ;
-               
+
                }
                soup_soap_message_end_element (msg) ;
        }
@@ -3162,13 +3162,13 @@ e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 
                if (priv->security)
                        e_gw_message_write_string_parameter (msg, "security", NULL, priv->security);
-               
+
                /*The subject*/
                if (priv->subject)
                        e_gw_message_write_string_parameter (msg, "subject", NULL, priv->subject) ;
                /*distribution*/
                e_gw_item_add_distribution_to_soap_message(item, msg) ;
-               
+
                if (priv->set_sendoptions) {
                        /* item options */
                        append_gw_item_options (msg, item);
@@ -3178,7 +3178,7 @@ e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                        e_gw_message_write_string_parameter (msg, "container", NULL, item->priv->container);
                if (item->priv->source)
                        e_gw_message_write_string_parameter (msg, "source", NULL, item->priv->source);
-               
+
                /*message*/
                soup_soap_message_start_element (msg, "message", NULL, NULL);
                if (priv->message) {
@@ -3249,7 +3249,7 @@ e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                        g_free (alarm);
                }
                e_gw_message_write_string_parameter (msg, "place", NULL, priv->place ? priv->place : "");
-               
+
                break;
 
        case E_GW_ITEM_TYPE_TASK :
@@ -3273,7 +3273,7 @@ e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                break;
        case E_GW_ITEM_TYPE_NOTE:
                soup_soap_message_add_attribute (msg, "type", "Note", "xsi", NULL);
-               
+
                e_gw_item_set_calendar_item_elements (item, msg);
                break;
        case E_GW_ITEM_TYPE_CONTACT :
@@ -3284,17 +3284,17 @@ e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
         case E_GW_ITEM_TYPE_GROUP :
                soup_soap_message_add_attribute (msg, "type", "Group", "xsi", NULL);
                append_group_fields_to_soap_message (item, msg);
-               soup_soap_message_end_element(msg); 
+               soup_soap_message_end_element(msg);
                return TRUE;
        case E_GW_ITEM_TYPE_ORGANISATION :
-               soup_soap_message_add_attribute (msg, "type", "Organization", "xsi", NULL); 
+               soup_soap_message_add_attribute (msg, "type", "Organization", "xsi", NULL);
                append_contact_fields_to_soap_message (item, msg);
-               soup_soap_message_end_element(msg); 
+               soup_soap_message_end_element(msg);
                return TRUE;
        case E_GW_ITEM_TYPE_CATEGORY :
                soup_soap_message_add_attribute (msg, "type", "Category", "xsi", NULL);
                e_gw_message_write_string_parameter (msg, "name", NULL, item->priv->category_name);
-               soup_soap_message_end_element(msg); 
+               soup_soap_message_end_element(msg);
                return TRUE;
        default :
                g_warning (G_STRLOC ": Unknown type for item");
@@ -3332,7 +3332,7 @@ append_contact_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int
                soup_soap_message_start_element (msg, "delete", NULL, NULL);
                changes = priv->deletions;
                break;
-       
+
        }
        if (!changes)
                return;
@@ -3340,7 +3340,7 @@ append_contact_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int
        append_common_addressbook_item_fields_to_soap_message (changes, list, msg);
        full_name = g_hash_table_lookup (changes, "full_name");
        value = g_hash_table_lookup (changes, "name");
-       if (full_name) 
+       if (full_name)
                append_full_name_to_soap_message (full_name, value, msg);
        list = g_hash_table_lookup (changes, "email");
        if (list)
@@ -3358,7 +3358,7 @@ append_contact_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int
        if (postal_address)
                append_postal_address_to_soap_message (msg, postal_address, "Office");
        soup_soap_message_end_element (msg);
-       
+
        append_office_info_to_soap_message (changes, msg);
        append_personal_info_to_soap_message (changes, msg);
 
@@ -3395,13 +3395,13 @@ append_event_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int c
                break;
        }
        if (g_hash_table_lookup (changes, "categories")){
-               GList *list;    
+               GList *list;
                list = g_hash_table_lookup (changes, "categories");
 
                soup_soap_message_start_element (msg, "categories", NULL, NULL);
-               if (list != NULL && list->data) 
+               if (list != NULL && list->data)
                        soup_soap_message_add_attribute (msg, "types:primary",list->data, NULL, NULL);
-                       for (; list != NULL; list = g_list_next (list)) 
+                       for (; list != NULL; list = g_list_next (list))
                                if (list->data) {
                                        e_gw_message_write_string_parameter (msg, "category", NULL, list->data);
                        }
@@ -3412,7 +3412,7 @@ append_event_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int c
                e_gw_message_write_string_parameter (msg, "subject", NULL, priv->subject ? priv->subject : "");
        if (g_hash_table_lookup (changes, "start_date")) {
                if (priv->start_date) {
-                       e_gw_message_write_string_parameter (msg, "startDate", NULL, priv->start_date); 
+                       e_gw_message_write_string_parameter (msg, "startDate", NULL, priv->start_date);
                }
        }
        if (g_hash_table_lookup (changes, "end_date")) {
@@ -3466,7 +3466,7 @@ append_event_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg, int c
 
 }
 
-gboolean 
+gboolean
 e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
 {
        EGwItemPrivate *priv;
@@ -3484,7 +3484,7 @@ e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                append_contact_changes_to_soap_message (item, msg, E_GW_ITEM_CHANGE_TYPE_ADD);
                append_contact_changes_to_soap_message (item, msg, E_GW_ITEM_CHANGE_TYPE_UPDATE);
                append_contact_changes_to_soap_message (item, msg, E_GW_ITEM_CHANGE_TYPE_DELETE);
-               soup_soap_message_end_element(msg); 
+               soup_soap_message_end_element(msg);
                return TRUE;
         case E_GW_ITEM_TYPE_GROUP :
                soup_soap_message_start_element (msg, "update", NULL, NULL);
@@ -3492,7 +3492,7 @@ e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                if (value)
                        e_gw_message_write_string_parameter (msg, "name", NULL, value);
                soup_soap_message_end_element (msg);
-               soup_soap_message_end_element(msg); 
+               soup_soap_message_end_element(msg);
                return TRUE;
        case E_GW_ITEM_TYPE_APPOINTMENT:
        case E_GW_ITEM_TYPE_TASK :
@@ -3500,7 +3500,7 @@ e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
                append_event_changes_to_soap_message (item, msg, E_GW_ITEM_CHANGE_TYPE_ADD);
                append_event_changes_to_soap_message (item, msg, E_GW_ITEM_CHANGE_TYPE_UPDATE);
                append_event_changes_to_soap_message (item, msg, E_GW_ITEM_CHANGE_TYPE_DELETE);
-               soup_soap_message_end_element(msg); 
+               soup_soap_message_end_element(msg);
                return TRUE;
        default :
                g_warning (G_STRLOC ": Unknown type for item");
index a72cd1d..995df3b 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -49,7 +49,7 @@ typedef enum {
        E_GW_ITEM_TYPE_ORGANISATION,
        E_GW_ITEM_TYPE_RESOURCE,
        E_GW_ITEM_TYPE_CATEGORY,
-       E_GW_ITEM_TYPE_NOTIFICATION, 
+       E_GW_ITEM_TYPE_NOTIFICATION,
        E_GW_ITEM_TYPE_NOTE,
        E_GW_ITEM_TYPE_UNKNOWN
 
@@ -190,7 +190,7 @@ void        e_gw_item_set_security (EGwItem *item, const char *new_class);
 gboolean    e_gw_item_get_completed (EGwItem *item);
 void        e_gw_item_set_completed (EGwItem *item, gboolean new_completed);
 gboolean    e_gw_item_get_is_allday_event (EGwItem *item);
-void       e_gw_item_set_is_allday_event (EGwItem *item, gboolean is_allday);  
+void       e_gw_item_set_is_allday_event (EGwItem *item, gboolean is_allday);
 char*       e_gw_item_get_field_value (EGwItem *item, char *field_name);
 void        e_gw_item_set_field_value (EGwItem *item, char *field_name, char* field_value);
 GList*      e_gw_item_get_email_list (EGwItem *item);
@@ -254,7 +254,7 @@ void        e_gw_item_set_classification (EGwItem *item, const char *new_class);
 
 #define E_GW_ITEM_ACCEPT_LEVEL_BUSY          "Busy"
 #define E_GW_ITEM_ACCEPT_LEVEL_OUT_OF_OFFICE "OutOfOffice"
-#define E_GW_ITEM_ACCEPT_LEVEL_FREE         "Free"     
+#define E_GW_ITEM_ACCEPT_LEVEL_FREE         "Free"
 
 const char *e_gw_item_get_accept_level (EGwItem *item);
 void        e_gw_item_set_accept_level (EGwItem *item, const char *new_level);
@@ -287,7 +287,7 @@ void e_gw_item_set_exdate_list (EGwItem  *item, GSList *new_exdate_list);
 
 void e_gw_item_set_rrule (EGwItem *item, EGwItemRecurrenceRule *rrule);
 EGwItemRecurrenceRule *e_gw_item_get_rrule (EGwItem *item);
-               
+
 int e_gw_item_get_recurrence_key (EGwItem *item);
 void e_gw_item_set_recurrence_key (EGwItem *item, int recurrence_key);
 
index 538db0f..066db81 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -118,11 +118,11 @@ e_gw_message_write_string_parameter (SoupSoapMessage *msg, const char *name, con
        soup_soap_message_end_element (msg);
 }
 
-void 
+void
 e_gw_message_write_string_parameter_with_attribute (SoupSoapMessage *msg,
                                                    const char *name,
                                                    const char *prefix,
-                                                   const char *value, 
+                                                   const char *value,
                                                    const char *attribute_name,
                                                    const char *attribute_value)
 {
@@ -163,25 +163,25 @@ e_gw_message_write_footer (SoupSoapMessage *msg)
                        gchar *body;
                        gchar *begin = NULL;
                        gchar *end = NULL;
-                       
+
                        body = g_strndup (SOUP_MESSAGE (msg)->request.body, SOUP_MESSAGE (msg)->request.length);
                        begin = g_strrstr (body, "<types:password>");
-                       if (begin) 
+                       if (begin)
                                begin = begin + strlen ("<types:password>");
                        end = g_strrstr (body , "</types:password>");
                        if (begin && end) {
                                gchar *tmp;
                                for (tmp = begin; tmp < end; tmp++)
                                        *tmp='X';
-                               
+
                        }
                        fputc ('\n', stdout);
                        fwrite (body, 1, SOUP_MESSAGE (msg)->request.length, stdout);
-                       fputc ('\n', stdout);   
+                       fputc ('\n', stdout);
                        g_free (body);
                }
-               else {          
-       
+               else {
+
                        /* print request's body */
                        fputc ('\n', stdout);
                        fwrite (SOUP_MESSAGE (msg)->request.body, 1, SOUP_MESSAGE (msg)->request.length, stdout);
index 2474cd3..91726bc 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -34,7 +34,7 @@ void             e_gw_message_write_string_parameter (SoupSoapMessage *msg, cons
 void             e_gw_message_write_string_parameter_with_attribute (SoupSoapMessage *msg,
                                                                     const char *name,
                                                                     const char *prefix,
-                                                                    const char *value, 
+                                                                    const char *value,
                                                                     const char *attrubute_name,
                                                                     const char *attribute_value);
 void             e_gw_message_write_base64_parameter (SoupSoapMessage *msg,
index 8977fdc..29f0c74 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Sankar P <psankar@novell.com>
  *  Shreyas Srinivasan <sshreyas@novell.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -28,7 +28,7 @@
 #include "e-gw-proxy.h"
 #include "e-gw-message.h"
 
-void 
+void
 e_gw_proxy_construct_proxy_access_list (SoupSoapParameter *param, GList **proxy_list)
 {
        /* parse the response and create the individual proxy accounts */
@@ -64,18 +64,18 @@ e_gw_proxy_construct_proxy_access_list (SoupSoapParameter *param, GList **proxy_
                if (type_param) {
                        value = soup_soap_parameter_get_string_value (type_param);
                        aclInstance->uniqueid = g_strdup_printf ("%s", value);
-               } else 
+               } else
                        aclInstance->uniqueid = NULL;
 
                type_param = soup_soap_parameter_get_first_child_by_name (subparam, "mail");
                value = NULL;
                if (type_param) {
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"read");                              
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"read");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_MAIL_READ;
                        }
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"write");                             
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"write");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_MAIL_WRITE;
@@ -88,12 +88,12 @@ e_gw_proxy_construct_proxy_access_list (SoupSoapParameter *param, GList **proxy_
                value = NULL;
                type_param = soup_soap_parameter_get_first_child_by_name (subparam, "appointment");
                if (type_param) {
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"read");                              
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"read");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_APPOINTMENT_READ;
                        }
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"write");                             
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"write");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_APPOINTMENT_WRITE;
@@ -105,12 +105,12 @@ e_gw_proxy_construct_proxy_access_list (SoupSoapParameter *param, GList **proxy_
                value = NULL;
                type_param = soup_soap_parameter_get_first_child_by_name (subparam, "task");
                if (type_param) {
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"read");                              
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"read");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_TASK_READ;
                        }
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"write");                             
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"write");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_TASK_WRITE;
@@ -122,12 +122,12 @@ e_gw_proxy_construct_proxy_access_list (SoupSoapParameter *param, GList **proxy_
                value = NULL;
                type_param = soup_soap_parameter_get_first_child_by_name (subparam, "note");
                if (type_param) {
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"read");                              
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"read");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_NOTES_READ;
                        }
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"write");                             
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"write");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_NOTES_WRITE;
@@ -150,12 +150,12 @@ e_gw_proxy_construct_proxy_access_list (SoupSoapParameter *param, GList **proxy_
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_GET_NOTIFICATIONS;
                        }
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"setup"); 
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"setup");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_MODIFY_FOLDERS;
                        }
-                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"readHidden"); 
+                       individual_rights= soup_soap_parameter_get_first_child_by_name (type_param,"readHidden");
                        if (individual_rights) {
                                value = soup_soap_parameter_get_string_value (individual_rights);
                                aclInstance->permissions |= E_GW_PROXY_READ_PRIVATE;
@@ -168,16 +168,16 @@ e_gw_proxy_construct_proxy_access_list (SoupSoapParameter *param, GList **proxy_
        }
 }
 
-void 
+void
 e_gw_proxy_construct_proxy_list (SoupSoapParameter *param, GList **proxy_info)
 {
-       SoupSoapParameter *subparam; 
+       SoupSoapParameter *subparam;
        SoupSoapParameter *type_param;
        char *value;
 
        for (subparam = soup_soap_parameter_get_first_child_by_name (param, "proxy");
                        subparam != NULL;
-                       subparam = soup_soap_parameter_get_next_child_by_name (subparam, "proxy")) 
+                       subparam = soup_soap_parameter_get_next_child_by_name (subparam, "proxy"))
        {
 
                type_param = soup_soap_parameter_get_first_child_by_name (subparam, "displayName");
@@ -200,7 +200,7 @@ e_gw_proxy_form_soap_request_from_proxyHandler (SoupSoapMessage *msg, proxyHandl
 {
        gboolean added = FALSE;
        e_gw_message_write_string_parameter (msg, "email", NULL, new_proxy->proxy_email);
-       e_gw_message_write_string_parameter (msg, "displayName", NULL, new_proxy->proxy_name);  
+       e_gw_message_write_string_parameter (msg, "displayName", NULL, new_proxy->proxy_name);
 
        if (new_proxy->permissions & E_GW_PROXY_MAIL_READ){
                added = TRUE;
@@ -300,36 +300,36 @@ e_gw_proxy_form_soap_request_from_proxyHandler (SoupSoapMessage *msg, proxyHandl
                e_gw_message_write_int_parameter (msg, "readHidden", NULL, 1);
        }
        if (added==TRUE)
-               soup_soap_message_end_element(msg);     
+               soup_soap_message_end_element(msg);
 
 }
 
-void 
+void
 e_gw_proxy_form_proxy_add_msg (SoupSoapMessage *msg, proxyHandler *new_proxy)
 {
        soup_soap_message_start_element (msg, "entry", NULL, NULL);
-       
+
        e_gw_proxy_form_soap_request_from_proxyHandler (msg, new_proxy);
 }
-       
-void 
+
+void
 e_gw_proxy_form_proxy_remove_msg (SoupSoapMessage *msg, proxyHandler *removeProxy)
 {
        e_gw_message_write_string_parameter (msg, "id", NULL, removeProxy->uniqueid);
 }
 
-void 
+void
 e_gw_proxy_form_modify_proxy_msg (SoupSoapMessage *msg, proxyHandler *new_proxy)
 {
        soup_soap_message_start_element (msg, "updates", NULL, NULL);
-       
+
        soup_soap_message_start_element (msg, "delete", NULL, NULL);
        soup_soap_message_end_element (msg);
-       
+
        soup_soap_message_start_element (msg, "add", NULL, NULL);
        e_gw_proxy_form_soap_request_from_proxyHandler (msg, new_proxy);
        soup_soap_message_end_element (msg);
-       
+
        soup_soap_message_end_element (msg);
 }
 
@@ -344,12 +344,12 @@ e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, int *permission
        subparam = soup_soap_parameter_get_first_child_by_name (param, "mail");
        value = NULL;
        if (subparam) {
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"read");                                
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"read");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_MAIL_READ;
                }
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"write");                               
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"write");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_MAIL_WRITE;
@@ -362,12 +362,12 @@ e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, int *permission
        value = NULL;
        subparam = soup_soap_parameter_get_first_child_by_name (param, "appointment");
        if (subparam) {
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"read");                                
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"read");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_APPOINTMENT_READ;
                }
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"write");                               
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"write");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_APPOINTMENT_WRITE;
@@ -379,12 +379,12 @@ e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, int *permission
        value = NULL;
        subparam = soup_soap_parameter_get_first_child_by_name (param, "task");
        if (subparam)   {
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"read");                                
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"read");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_TASK_READ;
                }
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"write");                               
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"write");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_TASK_WRITE;
@@ -396,12 +396,12 @@ e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, int *permission
        value = NULL;
        subparam = soup_soap_parameter_get_first_child_by_name (param, "note");
        if (subparam)   {
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"read");                                
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"read");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_NOTES_READ;
                }
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"write");                               
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"write");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_NOTES_WRITE;
@@ -424,12 +424,12 @@ e_gw_proxy_parse_proxy_login_response (SoupSoapParameter *param, int *permission
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_GET_NOTIFICATIONS;
                }
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"setup"); 
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"setup");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_MODIFY_FOLDERS;
                }
-               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"readHidden"); 
+               individual_rights= soup_soap_parameter_get_first_child_by_name (subparam,"readHidden");
                if (individual_rights) {
                        value = soup_soap_parameter_get_string_value (individual_rights);
                        *permissions |= E_GW_PROXY_READ_PRIVATE;
index 94f9805..61178c9 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  Shreyas Srinivasan <sshreyas@novell.com>
  *  Sankar P <psankar@novell.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
 
 /*State of each proxy grant*/
 
-#define E_GW_PROXY_NEW           (1 << 0)           
+#define E_GW_PROXY_NEW           (1 << 0)
 #define E_GW_PROXY_DELETED       (1 << 1)
 #define E_GW_PROXY_EDITED          (1 << 2)
 
 /*Permissions associated with a proxy grant*/
-#define E_GW_PROXY_MAIL_READ                (1 << 0)           
+#define E_GW_PROXY_MAIL_READ                (1 << 0)
 #define E_GW_PROXY_MAIL_WRITE               (1 << 1)
-#define E_GW_PROXY_APPOINTMENT_READ         (1 << 2)           
+#define E_GW_PROXY_APPOINTMENT_READ         (1 << 2)
 #define E_GW_PROXY_APPOINTMENT_WRITE        (1 << 3)
 #define E_GW_PROXY_NOTES_READ               (1 << 4)
 #define E_GW_PROXY_NOTES_WRITE              (1 << 5)
@@ -51,7 +51,7 @@
 struct _proxyHandler {
     char *uniqueid;
     char *proxy_name;
-    char *proxy_email;   
+    char *proxy_email;
     guint32 flags;
     guint32 permissions;
 };
index dc9991b..68575c3 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *    Harish Krishnaswamy <kharish@novell.com>
- *  
+ *
  * Copyright 2005, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -28,7 +28,7 @@
 static const char *days_of_week[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
 
 const char *
-e_gw_recur_get_day_of_week (short day) 
+e_gw_recur_get_day_of_week (short day)
 {
 
        if (day < 1 || day > 7)
index 0a1b11f..c06e4ae 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
+/*
  * Authors :
  *     Harish Krishnaswamy <kharish@novell.com>
- *   
+ *
  * Copyright 2005, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
 #define E_GW_ITEM_RECURRENCE_FREQUENCY_YEARLY "Yearly"
 
 
-#define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_FIRST  "First" 
-#define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_SECOND "Second" 
-#define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_THIRD  "Third" 
-#define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_FOURTH "Fourth" 
+#define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_FIRST  "First"
+#define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_SECOND "Second"
+#define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_THIRD  "Third"
+#define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_FOURTH "Fourth"
 #define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_FIFTH  "Fifth"
 #define E_GW_ITEM_RECUR_OCCURRENCE_TYPE_LAST   "Last"
 
@@ -68,5 +68,5 @@ typedef struct {
 
 
 const char *e_gw_recur_get_day_of_week (short day);
+
 #endif
index f1f88ab..9a9ca54 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
@@ -45,7 +45,7 @@ static void e_gw_sendoptions_dispose (GObject *object);
 static void e_gw_sendoptions_finalize (GObject *object);
 
 EGwSendOptionsGeneral*
-e_gw_sendoptions_get_general_options (EGwSendOptions *opts) 
+e_gw_sendoptions_get_general_options (EGwSendOptions *opts)
 {
        g_return_val_if_fail (opts != NULL || E_IS_GW_SENDOPTIONS (opts), NULL);
 
@@ -80,7 +80,7 @@ e_gw_sendoptions_dispose (GObject *object)
 }
 
 static void
-e_gw_sendoptions_finalize (GObject *object) 
+e_gw_sendoptions_finalize (GObject *object)
 {
        EGwSendOptions *opts = (EGwSendOptions *) object;
        EGwSendOptionsPrivate *priv;
@@ -88,7 +88,7 @@ e_gw_sendoptions_finalize (GObject *object)
        g_return_if_fail (E_IS_GW_SENDOPTIONS (opts));
 
        priv = opts->priv;
-       
+
        if (priv->gopts) {
                g_free (priv->gopts);
                priv->gopts = NULL;
@@ -131,7 +131,7 @@ e_gw_sendoptions_class_init (GObjectClass *klass)
 
 static void
 e_gw_sendoptions_init (GObject *object)
-{              
+{
        EGwSendOptions *opts;
        EGwSendOptionsPrivate *priv;
 
@@ -181,7 +181,7 @@ parse_status_tracking_options (SoupSoapParameter *group_param, guint i, EGwSendO
                char *field = NULL, *val = NULL;
                field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
                val_param = soup_soap_parameter_get_first_child_by_name (subparam, "value");
-               
+
                if (field_param) {
                        field = soup_soap_parameter_get_string_value (field_param);
                        if (!field)
@@ -228,12 +228,12 @@ parse_status_tracking_options (SoupSoapParameter *group_param, guint i, EGwSendO
                                sopts->opened = E_GW_RETURN_NOTIFY_MAIL;
                        } else
                                sopts->opened = E_GW_RETURN_NOTIFY_NONE;
-                       
+
 
                } else if (!g_ascii_strcasecmp (field + i, "ReturnDelete")) {
                        if (val_param)
                                val_param = soup_soap_parameter_get_first_child_by_name (val_param, "mail");
-                       
+
                        if (val_param)
                                val = soup_soap_parameter_get_string_value (val_param);
 
@@ -245,7 +245,7 @@ parse_status_tracking_options (SoupSoapParameter *group_param, guint i, EGwSendO
                } else if (!g_ascii_strcasecmp (field + i, "ReturnAccept")) {
                        if (val_param)
                                val_param = soup_soap_parameter_get_first_child_by_name (val_param, "mail");
-                       
+
                        if (val_param)
                                val = soup_soap_parameter_get_string_value (val_param);
 
@@ -258,7 +258,7 @@ parse_status_tracking_options (SoupSoapParameter *group_param, guint i, EGwSendO
                } else if (!g_ascii_strcasecmp (field + i, "ReturnCompleted")) {
                        if (val_param)
                                val_param = soup_soap_parameter_get_first_child_by_name (val_param, "mail");
-                       
+
                        if (val_param)
                                val = soup_soap_parameter_get_string_value (val_param);
 
@@ -267,18 +267,18 @@ parse_status_tracking_options (SoupSoapParameter *group_param, guint i, EGwSendO
                        } else
                                sopts->completed = E_GW_RETURN_NOTIFY_NONE;
 
-               }                       
+               }
                g_free (field);
-               g_free (val);           
-       }       
+               g_free (val);
+       }
 }
 
 /* These are not actually general Options. These can be configured seperatly for
-   each component. Since win32 shows them as general options, we too do the same 
+   each component. Since win32 shows them as general options, we too do the same
    way. So the Options are take from the mail setttings */
-       
-static void 
-parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *gopts) 
+
+static void
+parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *gopts)
 {
        SoupSoapParameter *subparam, *field_param, *val_param;
 
@@ -288,7 +288,7 @@ parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *go
                char *field = NULL, *val = NULL;
                field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
                val_param = soup_soap_parameter_get_first_child_by_name (subparam, "value");
-               
+
                if (field_param) {
                        field = soup_soap_parameter_get_string_value (field_param);
                        if (!field)
@@ -309,7 +309,7 @@ parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *go
                                        gopts->priority = E_GW_PRIORITY_LOW;
                                else
                                        gopts->priority = E_GW_PRIORITY_UNDEFINED;
-                                       
+
                        } else
                                gopts->priority = E_GW_PRIORITY_UNDEFINED;
                } else if (!g_ascii_strcasecmp (field, "mailReplyRequested")) {
@@ -325,15 +325,15 @@ parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *go
                                } else {
                                        char *temp;
                                        int i = 0;
-                                       
+
                                        val_param = soup_soap_parameter_get_first_child_by_name (val_param, "WithinNDays");
-                                       temp = soup_soap_parameter_get_string_value (val_param); 
-                               
-                                       if (temp)       
-                                               i = atoi (temp);                                                        
+                                       temp = soup_soap_parameter_get_string_value (val_param);
+
+                                       if (temp)
+                                               i = atoi (temp);
 
                                        gopts->reply_within = i;
-                                       gopts->reply_enabled = TRUE;            
+                                       gopts->reply_enabled = TRUE;
                                        g_free (temp);
                                }
                        }
@@ -345,7 +345,7 @@ parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *go
                                int i = atoi (val);
                                if (i != 0)
                                        gopts->expiration_enabled = TRUE;
-                               else 
+                               else
                                        gopts->expiration_enabled = FALSE;
 
                                gopts->expire_after = i;
@@ -360,7 +360,7 @@ parse_general_options (SoupSoapParameter *group_param, EGwSendOptionsGeneral *go
 /* These settings are common to all components */
 
 static void
-parse_advanced_settings (SoupSoapParameter *group_param, EGwSendOptionsGeneral *gopts) 
+parse_advanced_settings (SoupSoapParameter *group_param, EGwSendOptionsGeneral *gopts)
 {
        SoupSoapParameter *subparam, *field_param, *val_param;
 
@@ -370,7 +370,7 @@ parse_advanced_settings (SoupSoapParameter *group_param, EGwSendOptionsGeneral *
                char *field = NULL, *val = NULL;
                field_param = soup_soap_parameter_get_first_child_by_name (subparam, "field");
                val_param = soup_soap_parameter_get_first_child_by_name (subparam, "value");
-               
+
                if (field_param) {
                        field = soup_soap_parameter_get_string_value (field_param);
                        if (!field)
@@ -386,7 +386,7 @@ parse_advanced_settings (SoupSoapParameter *group_param, EGwSendOptionsGeneral *
                                if (i > 0 ) {
                                        gopts->delay_enabled = TRUE;
                                        gopts->delay_until = i;
-                               } else 
+                               } else
                                        gopts->delay_enabled = FALSE;
                        } else
                                gopts->delay_enabled = FALSE;
@@ -402,34 +402,34 @@ e_gw_sendoptions_store_settings (SoupSoapParameter *param, EGwSendOptions *opts)
        EGwSendOptionsPrivate *priv;
 
        priv = opts->priv;
-       
+
        for (group_param = soup_soap_parameter_get_first_child_by_name(param, "group") ;
                             group_param != NULL ;
                             group_param = soup_soap_parameter_get_next_child_by_name (group_param, "group")) {
                char *temp = NULL;
 
                temp = soup_soap_parameter_get_property (group_param, "type");
-               
-               if (!temp) 
+
+               if (!temp)
                        continue;
 
                if (!g_ascii_strcasecmp (temp, "MailMessageSettings")) {
                        parse_status_tracking_options (group_param, 4, priv->mopts);
                        parse_general_options (group_param, priv->gopts);
-               }       
-               
-               if (!g_ascii_strcasecmp (temp, "AppointmentMessageSettings")) { 
+               }
+
+               if (!g_ascii_strcasecmp (temp, "AppointmentMessageSettings")) {
                        parse_status_tracking_options (group_param, 11, priv->copts);
                }
-               if (!g_ascii_strcasecmp (temp, "TaskMessageSettings")) 
+               if (!g_ascii_strcasecmp (temp, "TaskMessageSettings"))
                        parse_status_tracking_options (group_param, 4, priv->topts);
 
-               if (!g_ascii_strcasecmp (temp, "AdvancedSettings")) 
+               if (!g_ascii_strcasecmp (temp, "AdvancedSettings"))
                        parse_advanced_settings (group_param, priv->gopts);
 
                g_free (temp);
        }
-       
+
        return TRUE;
 }
 
@@ -437,22 +437,22 @@ static void
 e_gw_sendoptions_write_settings (SoupSoapMessage *msg, char *field_name, char *value, char *value_name, gboolean value_direct)
 {
        soup_soap_message_start_element (msg, "setting", NULL, NULL);
-       
+
        soup_soap_message_start_element (msg, "field", NULL, NULL);
        soup_soap_message_write_string (msg, field_name);
        soup_soap_message_end_element (msg);
 
        soup_soap_message_start_element (msg, "value", NULL, NULL);
-       
+
        if (!value_direct)
                e_gw_message_write_string_parameter (msg, value_name, NULL, value);
        else
                soup_soap_message_write_string (msg, value);
 
        soup_soap_message_end_element (msg);
-       
-       soup_soap_message_end_element (msg);    
-}      
+
+       soup_soap_message_end_element (msg);
+}
 
 static void
 set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking *n_sopts, EGwSendOptionsStatusTracking *o_sopts, char *comp)
@@ -474,7 +474,7 @@ set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking
                g_free (comp_name), comp_name = NULL;
                g_free (value), value = NULL;
        }
-               
+
        if (!strcmp (comp, "mail")) {
                if (n_sopts->autodelete != o_sopts->autodelete) {
                        if (n_sopts->autodelete)
@@ -501,7 +501,7 @@ set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking
                g_free (comp_name), comp_name = NULL;
                g_free (value), value = NULL;
        }
-       
+
        if (n_sopts->declined != o_sopts->declined) {
                comp_name = g_strconcat (comp, "ReturnDelete", NULL);
                if (n_sopts->declined == E_GW_RETURN_NOTIFY_MAIL) {
@@ -515,7 +515,7 @@ set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking
                g_free (comp_name), comp_name = NULL;
                g_free (value), value = NULL;
        }
-       
+
        if (!strcmp (comp, "appointment") || !strcmp (comp, "task")) {
                if (n_sopts->accepted != o_sopts->accepted) {
                        comp_name = g_strconcat (comp, "ReturnAccept", NULL);
@@ -526,12 +526,12 @@ set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking
                                value = g_strdup ("None");
                                e_gw_sendoptions_write_settings (msg, comp_name, value, NULL, TRUE);
                        }
-       
+
                        g_free (comp_name), comp_name = NULL;
                        g_free (value), value = NULL;
                }
        }
-       
+
        if (!strcmp (comp, "task")) {
                if (n_sopts->completed != o_sopts->completed) {
                        comp_name = g_strconcat (comp, "ReturnCompleted", NULL);
@@ -542,7 +542,7 @@ set_status_tracking_changes (SoupSoapMessage *msg, EGwSendOptionsStatusTracking
                                value = g_strdup ("None");
                                e_gw_sendoptions_write_settings (msg, comp_name, value, NULL, TRUE);
                        }
-       
+
                        g_free (comp_name), comp_name = NULL;
                        g_free (value), value = NULL;
                }
@@ -562,7 +562,7 @@ set_general_options_changes (SoupSoapMessage *msg, EGwSendOptionsGeneral *n_gopt
                        value = g_strdup ("Standard");
                else if (n_gopts->priority == E_GW_PRIORITY_LOW)
                        value = g_strdup ("Low");
-               else 
+               else
                        value = NULL;
                e_gw_sendoptions_write_settings (msg, "mailPriority", value, NULL, TRUE);
                e_gw_sendoptions_write_settings (msg, "appointmentPriority", value, NULL, TRUE);
@@ -572,15 +572,15 @@ set_general_options_changes (SoupSoapMessage *msg, EGwSendOptionsGeneral *n_gopt
 
        if (n_gopts->reply_enabled != o_gopts->reply_enabled || n_gopts->reply_convenient != o_gopts->reply_convenient ||
                        n_gopts->reply_within != o_gopts->reply_within) {
-               
+
                if (n_gopts->reply_enabled) {
                        if (n_gopts->reply_convenient)
                                value = g_strdup ("WhenConvenient");
-                       else 
-                               value = g_strdup_printf ("%d", n_gopts->reply_within);  
-               } else 
+                       else
+                               value = g_strdup_printf ("%d", n_gopts->reply_within);
+               } else
                        value = g_strdup ("None");
-               
+
                if (n_gopts->reply_enabled && !n_gopts->reply_convenient)
                        e_gw_sendoptions_write_settings (msg, "mailReplyRequested", value, "WithinNDays" , FALSE);
                else
@@ -594,7 +594,7 @@ set_general_options_changes (SoupSoapMessage *msg, EGwSendOptionsGeneral *n_gopt
                        value = g_strdup_printf ("%d", n_gopts->expire_after);
                } else
                        value = g_strdup ("0");
-               
+
                e_gw_sendoptions_write_settings (msg, "mailExpireDays", value, NULL, TRUE);
                g_free (value), value = NULL;
        }
@@ -604,14 +604,14 @@ set_general_options_changes (SoupSoapMessage *msg, EGwSendOptionsGeneral *n_gopt
                        value = g_strdup_printf ("%d", n_gopts->delay_until);
                } else
                        value = g_strdup ("-1");
-               
+
                e_gw_sendoptions_write_settings (msg, "delayDelivery", value, NULL, TRUE);
                g_free (value), value = NULL;
        }
 }
 
 /* n_opts has the new options, o_opts has the old options settings */
-gboolean 
+gboolean
 e_gw_sendoptions_form_message_to_modify (SoupSoapMessage *msg, EGwSendOptions *n_opts, EGwSendOptions *o_opts)
 {
        g_return_val_if_fail (n_opts != NULL || o_opts != NULL, FALSE);
@@ -623,7 +623,7 @@ e_gw_sendoptions_form_message_to_modify (SoupSoapMessage *msg, EGwSendOptions *n
        set_status_tracking_changes (msg, n_opts->priv->mopts, o_opts->priv->mopts, "mail");
        set_status_tracking_changes (msg, n_opts->priv->copts, o_opts->priv->copts, "appointment");
        set_status_tracking_changes (msg, n_opts->priv->topts, o_opts->priv->topts, "task");
-       
+
        soup_soap_message_end_element (msg);
 
        return TRUE;
@@ -640,10 +640,10 @@ e_gw_sendoptions_new (void)
 }
 
 EGwSendOptions *
-e_gw_sendoptions_new_from_soap_parameter (SoupSoapParameter *param) 
+e_gw_sendoptions_new_from_soap_parameter (SoupSoapParameter *param)
 {
        EGwSendOptions *opts;
-       
+
        g_return_val_if_fail (param != NULL, NULL);
 
        opts = g_object_new (E_TYPE_GW_SENDOPTIONS, NULL);
@@ -652,7 +652,7 @@ e_gw_sendoptions_new_from_soap_parameter (SoupSoapParameter *param)
                g_object_unref (opts);
                return NULL;
        }
-       
+
        return opts;
 }
 
index 186f495..b881a71 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* 
- * Authors : 
+/*
+ * Authors :
  *  JP Rosevear <jpr@ximian.com>
  *  Rodrigo Moya <rodrigo@ximian.com>
  *
  * Copyright 2003, Novell, Inc.
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of version 2 of the GNU Lesser General Public 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
  * License as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
index 7556d1b..91092ec 100644 (file)
@@ -39,7 +39,7 @@ enum {
 
 static GObjectClass *parent_class = NULL;
 
-struct _OfflineListenerPrivate 
+struct _OfflineListenerPrivate
 {
        GConfClient *default_client;
 
@@ -51,11 +51,11 @@ struct _OfflineListenerPrivate
 };
 
 
-static void 
+static void
 set_online_status (OfflineListener *offline_listener, gboolean is_offline)
 {
        OfflineListenerPrivate *priv;
-       
+
        priv = offline_listener->priv;
 
 #if ENABLE_CALENDAR
@@ -66,7 +66,7 @@ set_online_status (OfflineListener *offline_listener, gboolean is_offline)
                (priv->book_factory, is_offline ? OFFLINE_MODE : ONLINE_MODE);
 }
 
-static void 
+static void
 online_status_changed (GConfClient *client, int cnxn_id, GConfEntry *entry, gpointer data)
 {
        GConfValue *value;
@@ -84,20 +84,20 @@ online_status_changed (GConfClient *client, int cnxn_id, GConfEntry *entry, gpoi
                priv->is_offline_now = offline;
                set_online_status (offline_listener ,offline);
        }
-       
+
 }
 
 
-static void 
+static void
 setup_offline_listener (OfflineListener *offline_listener)
 {
        OfflineListenerPrivate *priv = offline_listener->priv;
-       
+
        priv->default_client = gconf_client_get_default ();
        gconf_client_add_dir (priv->default_client, "/apps/evolution/shell", GCONF_CLIENT_PRELOAD_RECURSIVE,NULL);
        gconf_client_notify_add (priv->default_client, "/apps/evolution/shell/start_offline", (GConfClientNotifyFunc)online_status_changed, offline_listener, NULL, NULL);
        priv->is_offline_now = gconf_client_get_bool (priv->default_client, "/apps/evolution/shell/start_offline", NULL);
-       set_online_status (offline_listener, priv->is_offline_now); 
+       set_online_status (offline_listener, priv->is_offline_now);
 }
 
 #if ENABLE_CALENDAR
@@ -110,7 +110,7 @@ offline_listener_new (EDataBookFactory *book_factory)
 {
        OfflineListener *offline_listener = g_object_new (OFFLINE_TYPE_LISTENER, NULL);
        OfflineListenerPrivate *priv = offline_listener->priv;
-       
+
        priv->book_factory = book_factory;
 #if ENABLE_CALENDAR
        priv->cal_factory = cal_factory;
@@ -140,10 +140,10 @@ offline_listener_finalize (GObject *object)
 
        offline_listener = OFFLINE_LISTENER (object);
        priv = offline_listener->priv;
-       
+
        g_free (priv);
        offline_listener->priv = NULL;
-       
+
        parent_class->finalize (object);
 }
 
@@ -151,10 +151,10 @@ static void
 offline_listener_init (OfflineListener *listener)
 {
        OfflineListenerPrivate *priv;
-       
+
        priv =g_new0 (OfflineListenerPrivate, 1);
        listener->priv = priv;
-       
+
 }
 
 
@@ -169,8 +169,8 @@ offline_listener_class_init (OfflineListener *klass)
        object_class = G_OBJECT_CLASS (klass);
        object_class->dispose = offline_listener_dispose;
        object_class->finalize = offline_listener_finalize;
-       
-       
+
+
 
 }
 
index 2aa42a2..0e5150c 100644 (file)
@@ -49,7 +49,7 @@ typedef struct _OfflineListenerClass   OfflineListenerClass;
 struct _OfflineListener {
        GObject parent;
        OfflineListenerPrivate *priv;
-  
+
 };
 
 struct _OfflineListenerClass {
index c000a10..9d75ea2 100644 (file)
@@ -46,12 +46,12 @@ server_logging_dispose (GObject *object)
        ServerLogging *logging = SERVER_LOGGING (object);
        ServerLoggingPrivate *priv;
        GSList *l;
-       
+
        priv = logging->priv;
-       
+
        for (l = priv->handlers; l; l = l->next) {
                ServerLoggingHandler *handler = l->data;
-               
+
                g_log_remove_handler (handler->domain, handler->id);
                g_free (handler->domain);
                g_free (handler);
@@ -88,7 +88,7 @@ static void
 server_logging_init (ServerLogging *logging)
 {
        ServerLoggingPrivate *priv;
-       
+
        priv = g_new0 (ServerLoggingPrivate, 1);
 
        logging->priv = priv;
@@ -143,7 +143,7 @@ server_log_handler(const gchar *domain,
 
        if (bonobo_event_source_has_listener (es, "log_event")) {
                CORBA_exception_init (&ev);
-               bonobo_event_source_notify_listeners (es, "log_event", &value, &ev); 
+               bonobo_event_source_notify_listeners (es, "log_event", &value, &ev);
                CORBA_exception_free (&ev);
        }
 
@@ -158,7 +158,7 @@ server_logging_register_domain (ServerLogging *logging,
        guint handler_id;
 
        priv = logging->priv;
-       
+
        handler_id = g_log_set_handler(domain, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
                                       server_log_handler, logging);
 
@@ -168,7 +168,7 @@ server_logging_register_domain (ServerLogging *logging,
                handler = g_new0 (ServerLoggingHandler, 1);
                handler->domain = g_strdup (domain);
                handler->id = handler_id;
-               
+
                priv->handlers = g_slist_prepend (priv->handlers, handler);
        }
 }
index 1e2a5af..47bb98f 100644 (file)
@@ -110,9 +110,9 @@ gnome_segv_handler (int signo)
                 fprintf (stderr, _("Multiple segmentation faults occurred; cannot display error dialog\n"));
                 _exit (1);
         }
-       
+
        gnome_segv_path = GNOMEUI_SERVERDIR "/gnome_segv2";
-       
+
        exec = g_strdup_printf ("%s \"" PACKAGE "-" BASE_VERSION "\" %d \"" VERSION "\"",
                                gnome_segv_path, signo);
        system (exec);
@@ -125,7 +125,7 @@ static void
 setup_segv_handler (void)
 {
        struct sigaction sa;
-       
+
        sa.sa_flags = 0;
        sigemptyset (&sa.sa_mask);
        sa.sa_handler = gnome_segv_handler;
@@ -353,7 +353,7 @@ main (int argc, char **argv)
 {
        gboolean did_books=FALSE, did_cals=FALSE;
        OfflineListener *offline_listener = NULL;
-       
+
        bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
        textdomain (GETTEXT_PACKAGE);
@@ -410,11 +410,11 @@ main (int argc, char **argv)
 #else
        offline_listener = offline_listener_new (e_data_book_factory);
 #endif
-       
+
        if ( setup_logging ()) {
                        if ( setup_interface_check ()) {
                                g_message ("Server up and running");
-                               
+
                                bonobo_main ();
                        } else
                                g_error (G_STRLOC "Cannot register DataServer::InterfaceCheck object");
@@ -436,7 +436,7 @@ main (int argc, char **argv)
 
        bonobo_object_unref (BONOBO_OBJECT (interface_check_iface));
        interface_check_iface = NULL;
-       
+
        gnome_vfs_shutdown ();
 
        return 0;